kokopu-react 3.3.1 → 3.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.
- package/CHANGELOG.md +8 -0
- package/dist/lib/chessboard/BoardProperties.d.ts +1 -1
- package/dist/lib/chessboard/BoardProperties.js +1 -1
- package/dist/lib/chessboard/Chessboard.css +1 -1
- package/dist/lib/chessboard/Chessboard.d.ts +3 -3
- package/dist/lib/chessboard/Chessboard.js +1 -1
- package/dist/lib/chessboard/ChessboardImpl.d.ts +1 -1
- package/dist/lib/chessboard/ChessboardImpl.js +1 -1
- package/dist/lib/chessboard/Draggable.d.ts +1 -1
- package/dist/lib/chessboard/Draggable.js +1 -1
- package/dist/lib/chessboard/Draggable.js.map +1 -1
- package/dist/lib/chessboard/Motion.d.ts +1 -1
- package/dist/lib/chessboard/Motion.js +1 -1
- package/dist/lib/chessboard/colorsets.d.ts +1 -1
- package/dist/lib/chessboard/colorsets.js +1 -1
- package/dist/lib/chessboard/piecesets.d.ts +1 -1
- package/dist/lib/chessboard/piecesets.js +1 -1
- package/dist/lib/errorbox/ErrorBox.css +1 -1
- package/dist/lib/errorbox/ErrorBox.d.ts +1 -1
- package/dist/lib/errorbox/ErrorBox.js +1 -1
- package/dist/lib/errorbox/parsing.d.ts +5 -4
- package/dist/lib/errorbox/parsing.js +1 -1
- package/dist/lib/exception.d.ts +1 -1
- package/dist/lib/exception.js +1 -1
- package/dist/lib/i18n.d.ts +1 -1
- package/dist/lib/i18n.js +1 -1
- package/dist/lib/icons/AnnotationSymbolShape.css +1 -1
- package/dist/lib/icons/AnnotationSymbolShape.d.ts +1 -1
- package/dist/lib/icons/AnnotationSymbolShape.js +1 -1
- package/dist/lib/icons/ArrowMarkerIcon.d.ts +1 -1
- package/dist/lib/icons/ArrowMarkerIcon.js +1 -1
- package/dist/lib/icons/ArrowTip.d.ts +1 -1
- package/dist/lib/icons/ArrowTip.js +1 -1
- package/dist/lib/icons/ChessPieceIcon.d.ts +1 -1
- package/dist/lib/icons/ChessPieceIcon.js +1 -1
- package/dist/lib/icons/SquareMarkerIcon.d.ts +1 -1
- package/dist/lib/icons/SquareMarkerIcon.js +1 -1
- package/dist/lib/icons/TextMarkerIcon.d.ts +1 -1
- package/dist/lib/icons/TextMarkerIcon.js +1 -1
- package/dist/lib/icons/arrow.css +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/movetext/Movetext.css +1 -1
- package/dist/lib/movetext/Movetext.d.ts +1 -1
- package/dist/lib/movetext/Movetext.js +1 -1
- package/dist/lib/movetext/Movetext.js.map +1 -1
- package/dist/lib/movetext/MovetextImpl.d.ts +1 -1
- package/dist/lib/movetext/MovetextImpl.js +1 -1
- package/dist/lib/movetext/MovetextImpl.js.map +1 -1
- package/dist/lib/movetext/fonts.css +1 -1
- package/dist/lib/movetext/htmlFilter.d.ts +1 -1
- package/dist/lib/movetext/htmlFilter.js +1 -1
- package/dist/lib/movetext/moveFormatter.d.ts +1 -1
- package/dist/lib/movetext/moveFormatter.js +1 -1
- package/dist/lib/navigationboard/NavigationBoard.d.ts +1 -1
- package/dist/lib/navigationboard/NavigationBoard.js +1 -1
- package/dist/lib/navigationboard/NavigationBoard.js.map +1 -1
- package/dist/lib/navigationboard/NavigationButton.d.ts +1 -1
- package/dist/lib/navigationboard/NavigationButton.js +1 -1
- package/dist/lib/navigationboard/NavigationField.css +1 -1
- package/dist/lib/navigationboard/NavigationField.d.ts +1 -1
- package/dist/lib/navigationboard/NavigationField.js +1 -1
- package/dist/lib/navigationboard/NavigationField.js.map +1 -1
- package/dist/lib/navigationboard/NavigationToolbar.css +1 -1
- package/dist/lib/navigationboard/NavigationToolbar.d.ts +1 -1
- package/dist/lib/navigationboard/NavigationToolbar.js +1 -1
- package/dist/lib/navigationboard/iconPaths.d.ts +1 -1
- package/dist/lib/navigationboard/iconPaths.js +1 -1
- package/dist/lib/sanitization.d.ts +1 -1
- package/dist/lib/sanitization.js +1 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/util.d.ts +1 -1
- package/dist/lib/util.js +1 -1
- package/doc_src/demo/NavigationBoardWithMoveText.txt +19 -0
- package/doc_src/demo/PageChessboardBase.tsx +1 -1
- package/doc_src/demo/PageChessboardInteraction.tsx +1 -1
- package/doc_src/demo/PageChessboardMove.tsx +1 -1
- package/doc_src/demo/PageChessboardSmallScreens.tsx +1 -1
- package/doc_src/demo/PageMovetextBase.tsx +1 -1
- package/doc_src/demo/PageMovetextInteraction.tsx +7 -9
- package/doc_src/demo/PageNavigationBoardBase.tsx +2 -2
- package/doc_src/demo/PageNavigationBoardUncontrolledVsControlled.tsx +3 -3
- package/doc_src/demo/PageSynchroNavigationBoardMovetext.tsx +115 -0
- package/doc_src/demo/decs.d.ts +6 -1
- package/doc_src/demo/demo.css +1 -1
- package/doc_src/demo/util.ts +1 -1
- package/doc_src/theming/LogoRenderer.js +1 -1
- package/doc_src/theming/theming.css +1 -1
- package/package.json +29 -29
- package/scripts/doc.styleguide.config.js +3 -2
- package/scripts/docker-compose.yml +1 -1
- package/scripts/test-graphic.webpack.config.js +1 -1
- package/scripts/test-headless.webpack.config.js +1 -1
- package/src/chessboard/BoardProperties.ts +1 -1
- package/src/chessboard/Chessboard.css +1 -1
- package/src/chessboard/Chessboard.tsx +3 -3
- package/src/chessboard/ChessboardImpl.tsx +1 -1
- package/src/chessboard/Draggable.tsx +2 -2
- package/src/chessboard/Motion.tsx +1 -1
- package/src/chessboard/colorsets.ts +1 -1
- package/src/chessboard/piecesets.ts +1 -1
- package/src/decs.d.ts +1 -1
- package/src/errorbox/ErrorBox.css +1 -1
- package/src/errorbox/ErrorBox.tsx +1 -1
- package/src/errorbox/parsing.tsx +4 -4
- package/src/exception.ts +1 -1
- package/src/i18n.ts +1 -1
- package/src/icons/AnnotationSymbolShape.css +1 -1
- package/src/icons/AnnotationSymbolShape.tsx +1 -1
- package/src/icons/ArrowMarkerIcon.tsx +1 -1
- package/src/icons/ArrowTip.tsx +1 -1
- package/src/icons/ChessPieceIcon.tsx +1 -1
- package/src/icons/SquareMarkerIcon.tsx +1 -1
- package/src/icons/TextMarkerIcon.tsx +1 -1
- package/src/icons/arrow.css +1 -1
- package/src/index.ts +1 -1
- package/src/movetext/Movetext.css +1 -1
- package/src/movetext/Movetext.tsx +2 -2
- package/src/movetext/MovetextImpl.tsx +2 -2
- package/src/movetext/fonts.css +1 -1
- package/src/movetext/htmlFilter.tsx +1 -1
- package/src/movetext/moveFormatter.tsx +1 -1
- package/src/navigationboard/NavigationBoard.tsx +2 -2
- package/src/navigationboard/NavigationButton.ts +1 -1
- package/src/navigationboard/NavigationField.css +1 -1
- package/src/navigationboard/NavigationField.tsx +2 -2
- package/src/navigationboard/NavigationToolbar.css +1 -1
- package/src/navigationboard/NavigationToolbar.tsx +1 -1
- package/src/navigationboard/iconPaths.ts +1 -1
- package/src/sanitization.ts +1 -1
- package/src/types.ts +1 -1
- package/src/util.ts +1 -1
- package/test/01_types.js +1 -1
- package/test/02_chessboard_util.js +1 -1
- package/test/03_error_box_graphic.js +1 -1
- package/test/04_icons_graphic.js +1 -1
- package/test/05_chessboard_graphic.js +1 -1
- package/test/06_chessboard_animation.js +1 -1
- package/test/07_chessboard_interaction.js +1 -1
- package/test/08_chessboard_play_moves.js +1 -1
- package/test/09_chessboard_small_screens.js +1 -1
- package/test/10_movetext_graphic.js +1 -1
- package/test/11_movetext_interaction.js +1 -1
- package/test/12_navigation_board_base.js +1 -1
- package/test/13_navigation_board_graphic.js +1 -1
- package/test/14_navigation_board_autoplay.js +1 -1
- package/test/common/graphic.js +13 -3
- package/test/graphic_references/03_error_box_graphic/base/cut_beginning_of_text.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/cut_end_of_text.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/cut_on_line_breaks.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/error_index_not_integer.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/full.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/minimal.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/missing_error_index.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/missing_error_text.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/negative_error_index.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/single_character_text.png +0 -0
- package/test/graphic_references/03_error_box_graphic/base/too_large_error_index.png +0 -0
- package/test/graphic_references/03_error_box_graphic/localization/default.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/customized_pieceset.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/invalid_multiple_pieces.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/invalid_pieceset.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/invalid_single_piece.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/invalid_size.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/multiple_pieces.png +0 -0
- package/test/graphic_references/04_icons_graphic/chess_piece/single_piece.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/colorized_arrow.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/colorized_square.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/colorized_symbol.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/colorized_text.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/default_arrow.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/default_square.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/default_text.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/invalid_arrow_size.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/invalid_square_size.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/invalid_symbol.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/invalid_text_size.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/wrapped_arrow.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/wrapped_square.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/wrapped_symbol.png +0 -0
- package/test/graphic_references/04_icons_graphic/marker/wrapped_text.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/overlap.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/overlap_and_flip.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/with_coordinates.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/with_coordinates_and_flip.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/without_coordinates.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/annotations/without_coordinates_and_flip.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/default.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/empty.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/from_fen.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/from_kokopu_object.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/parsing_error.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/base/wrong_position_type.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/chess960.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/chess960_with_move.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/invalid_variant.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/invalid_variant_with_fen.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/special_code.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/variant_with_std_initial_position.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/chess_variants/variant_without_std_initial_position.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/flipped/default.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/flipped/empty.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/flipped/from_fen.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/flipped/from_kokopu_object.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/flipped/parsing_error.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/capture.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/castling_move.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/default.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/en-passant.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/illegal_null-move.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/no_move_arrow.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/null-move.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/parsing_error.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/promotion.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/with_forced_move_arrow_and_flip.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/wrong_move_arrow_color_type.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/move/wrong_move_type.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_1.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_2.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_3.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_4.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_5.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/custom_6.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/default.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/large.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/small.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/wrong_colorset.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/wrong_pieceset.png +0 -0
- package/test/graphic_references/05_chessboard_graphic/theme/wrong_square_size_type.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/capture.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/castling_move.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/en-passant.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/move_1.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/move_2.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_1/promotion.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/capture.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/castling_move.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/en-passant.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/move_1.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/move_2.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_2/promotion.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/capture.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/castling_move.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/en-passant.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/move_1.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/move_2.png +0 -0
- package/test/graphic_references/06_chessboard_animation/base_3/promotion.png +0 -0
- package/test/graphic_references/06_chessboard_animation/on_redraw/final_state.png +0 -0
- package/test/graphic_references/06_chessboard_animation/on_redraw/initial_state.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/base_1.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/base_2.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/from_==_to.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/out_of_board.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/over_arrow_marker.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/edit_arrows/over_square_marker.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/error/edit_color_not_set.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/error/wrong_interaction_mode.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/after_move.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/from_==_to.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/move_empty_square.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/out_of_board.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_arrow_marker.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_empty.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_non-empty_1.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_non-empty_2.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_square_marker.png +0 -0
- package/test/graphic_references/07_chessboard_interaction/move_pieces/over_text_marker.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/castling_move.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/chess960_ambiguous_king_move.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/chess960_castling_move_1.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/chess960_castling_move_2.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/chess960_non-kxr_castling.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/from_==_to.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/illegal_move.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/illegal_position.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/out_of_board.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/regular_move_1.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/regular_move_2.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/base/wrong_color_moved.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/promotions/antichess_promotion.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/promotions/cancel_promotion.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/promotions/regular_promotion_1.png +0 -0
- package/test/graphic_references/08_chessboard_play_moves/promotions/regular_promotion_2.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/default.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/invalid_limits.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_690.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_700.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_710.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_720.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_730.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_740.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/base/width_750.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_bottom_component.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_top_component.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_bottom_component.png +0 -0
- package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_top_component.png +0 -0
- package/test/graphic_references/10_movetext_graphic/base/game_1.png +0 -0
- package/test/graphic_references/10_movetext_graphic/base/game_2.png +0 -0
- package/test/graphic_references/10_movetext_graphic/base/game_3.png +0 -0
- package/test/graphic_references/10_movetext_graphic/base/game_4.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/pgn_parsing_error_1.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/pgn_parsing_error_2.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_1.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_2.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_type.png +0 -0
- package/test/graphic_references/10_movetext_graphic/error/wrong_game_type.png +0 -0
- package/test/graphic_references/10_movetext_graphic/format_move/format_text.png +0 -0
- package/test/graphic_references/10_movetext_graphic/html/filtered_tags_and_attributes.png +0 -0
- package/test/graphic_references/10_movetext_graphic/html/html_in_comments.png +0 -0
- package/test/graphic_references/10_movetext_graphic/html/html_in_headers.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/custom_piece_symbols.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/figurine_piece_symbols_and_diagram_options.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/hidden_diagrams.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/localized_piece_symbols.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/other_diagram_options.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/wrong_diagram_options_1.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/wrong_diagram_options_2.png +0 -0
- package/test/graphic_references/10_movetext_graphic/options/wrong_piece_symbol_value.png +0 -0
- package/test/graphic_references/11_movetext_interaction/error/wrong_interaction_mode.png +0 -0
- package/test/graphic_references/11_movetext_interaction/select_moves/click_on_disabled.png +0 -0
- package/test/graphic_references/11_movetext_interaction/select_moves/click_on_unselected.png +0 -0
- package/test/graphic_references/11_movetext_interaction/select_moves/click_on_unselected_without_callback.png +0 -0
- package/test/graphic_references/11_movetext_interaction/select_moves/click_on_with_variations.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/default.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/forbidden_navigation_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/forbidden_navigation_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/invalid_node_id.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/no_callback_defined_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/no_callback_defined_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/overriding_initial_node_id.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_2.png +0 -0
- package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_3.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_2.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_2.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_at_end.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_at_specific_id.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_default.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_default_with_game_index.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_on_null-move.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_2.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_3.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_4.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_flipping_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_flipping_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_0.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_1.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_2.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_3.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_4.png +0 -0
- package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_5.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/additional_buttons/error_1.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/additional_buttons/error_2.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/additional_buttons/multiple_buttons.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/additional_buttons/single_button.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/error/pgn_parsing_error.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/error/wrong_game_type.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/theme/custom_1.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/theme/custom_2.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/theme/large.png +0 -0
- package/test/graphic_references/13_navigation_board_graphic/theme/small.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/after_1_move_acknowledging_is-playing_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/after_1_move_not_acknowledging_is-playing_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/after_2_moves_acknowledging_node_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/after_2_moves_not_acknowledging_node_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/after_reaching_the_end.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/already_at_the_end.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_acknowledging_is-playing_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_acknowledging_node_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_at_the_end.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_close_to_end.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_not_acknowledging_is-playing_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_not_acknowledging_node_changes.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_2_moves_from_beginning_after_stop.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_2_moves_from_beginning_before_stop.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_reaching_the_end_after_stop.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_reaching_the_end_before_stop.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/initial_state_close_to_end.png +0 -0
- package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/initial_state_default.png +0 -0
- package/test/graphic_test_app/03_error_box_graphic/base.tsx +1 -1
- package/test/graphic_test_app/03_error_box_graphic/localization.tsx +1 -1
- package/test/graphic_test_app/04_icons_graphic/chess_piece.tsx +1 -1
- package/test/graphic_test_app/04_icons_graphic/marker.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/annotations.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/base.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/chess_variants.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/flipped.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/move.tsx +1 -1
- package/test/graphic_test_app/05_chessboard_graphic/theme.tsx +1 -1
- package/test/graphic_test_app/06_chessboard_animation/base_1.tsx +1 -1
- package/test/graphic_test_app/06_chessboard_animation/base_2.tsx +1 -1
- package/test/graphic_test_app/06_chessboard_animation/base_3.tsx +1 -1
- package/test/graphic_test_app/06_chessboard_animation/on_redraw.tsx +1 -1
- package/test/graphic_test_app/07_chessboard_interaction/click_squares.tsx +1 -1
- package/test/graphic_test_app/07_chessboard_interaction/edit_arrows.tsx +1 -1
- package/test/graphic_test_app/07_chessboard_interaction/error.tsx +1 -1
- package/test/graphic_test_app/07_chessboard_interaction/move_pieces.tsx +1 -1
- package/test/graphic_test_app/08_chessboard_play_moves/base.tsx +1 -1
- package/test/graphic_test_app/08_chessboard_play_moves/promotions.tsx +1 -1
- package/test/graphic_test_app/09_chessboard_small_screens/base.tsx +1 -1
- package/test/graphic_test_app/09_chessboard_small_screens/top_bottom_components.tsx +1 -1
- package/test/graphic_test_app/10_movetext_graphic/base.tsx +1 -1
- package/test/graphic_test_app/10_movetext_graphic/error.tsx +1 -1
- package/test/graphic_test_app/10_movetext_graphic/format_move.tsx +1 -1
- package/test/graphic_test_app/10_movetext_graphic/html.tsx +1 -1
- package/test/graphic_test_app/10_movetext_graphic/options.tsx +1 -1
- package/test/graphic_test_app/11_movetext_interaction/error.tsx +1 -1
- package/test/graphic_test_app/11_movetext_interaction/select_moves.tsx +1 -1
- package/test/graphic_test_app/12_navigation_board_base/controlled.tsx +1 -1
- package/test/graphic_test_app/12_navigation_board_base/uncontrolled.tsx +1 -1
- package/test/graphic_test_app/13_navigation_board_graphic/additional_buttons.tsx +1 -1
- package/test/graphic_test_app/13_navigation_board_graphic/error.tsx +1 -1
- package/test/graphic_test_app/13_navigation_board_graphic/theme.tsx +1 -1
- package/test/graphic_test_app/14_navigation_board_autoplay/controlled.tsx +1 -1
- package/test/graphic_test_app/14_navigation_board_autoplay/uncontrolled.tsx +1 -1
- package/test/graphic_test_app/common/decs.d.ts +1 -1
- package/test/graphic_test_app/common/test_app.css +1 -1
- package/test/graphic_test_app/common/test_app.tsx +1 -1
- /package/doc_src/demo/{game-3.pgn → game-short.pgn} +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* -------------------------------------------------------------------------- *
|
|
3
|
+
* *
|
|
4
|
+
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
|
+
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
|
+
* *
|
|
8
|
+
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public License *
|
|
10
|
+
* as published by the Free Software Foundation, either version 3 of *
|
|
11
|
+
* the License, or (at your option) any later version. *
|
|
12
|
+
* *
|
|
13
|
+
* Kokopu-React is distributed in the hope that it will be useful, *
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
16
|
+
* GNU Lesser General Public License for more details. *
|
|
17
|
+
* *
|
|
18
|
+
* You should have received a copy of the GNU Lesser General *
|
|
19
|
+
* Public License along with this program. If not, see *
|
|
20
|
+
* <http://www.gnu.org/licenses/>. *
|
|
21
|
+
* *
|
|
22
|
+
* -------------------------------------------------------------------------- */
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
import * as React from 'react';
|
|
26
|
+
import { pgnRead, Game } from 'kokopu';
|
|
27
|
+
|
|
28
|
+
import { Movetext, NavigationBoard } from '../../src/index';
|
|
29
|
+
|
|
30
|
+
import Button from '@mui/material/Button';
|
|
31
|
+
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
32
|
+
import Stack from '@mui/material/Stack';
|
|
33
|
+
import Typography from '@mui/material/Typography';
|
|
34
|
+
|
|
35
|
+
import './demo.css';
|
|
36
|
+
import game1 from './game-1.pgn';
|
|
37
|
+
import game2 from './game-2.pgn';
|
|
38
|
+
import NavigationBoardWithMoveTextSourceCode from './NavigationBoardWithMoveText.txt';
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
interface PageState {
|
|
42
|
+
componentKey: string,
|
|
43
|
+
pgn: string,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
function NavigationBoardWithMoveText({ game }: { game: Game }) {
|
|
48
|
+
const [ nodeId, setNodeId ] = React.useState('start');
|
|
49
|
+
return (
|
|
50
|
+
<Stack direction="row" spacing={2}>
|
|
51
|
+
<NavigationBoard animated game={game} nodeId={nodeId} onNodeIdChanged={setNodeId} />
|
|
52
|
+
<Movetext
|
|
53
|
+
game={game} diagramOptions={{ squareSize: 28 }} interactionMode="selectMove" selection={nodeId}
|
|
54
|
+
onMoveSelected={n => {
|
|
55
|
+
if (n !== undefined) {
|
|
56
|
+
setNodeId(n);
|
|
57
|
+
}
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
</Stack>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export default class Page extends React.Component<object, PageState> {
|
|
66
|
+
|
|
67
|
+
constructor(props: object) {
|
|
68
|
+
super(props);
|
|
69
|
+
this.state = {
|
|
70
|
+
componentKey: 'game1',
|
|
71
|
+
pgn: game1,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
render() {
|
|
76
|
+
return (
|
|
77
|
+
<Stack spacing={2} mt={2}>
|
|
78
|
+
{this.renderControls()}
|
|
79
|
+
{this.renderNavigationBoardWithMovetext()}
|
|
80
|
+
{this.renderCode()}
|
|
81
|
+
</Stack>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private renderControls() {
|
|
86
|
+
return (
|
|
87
|
+
<Stack direction="row" spacing={2} alignItems="center">
|
|
88
|
+
<ButtonGroup color="primary" size="small">
|
|
89
|
+
<Button onClick={() => this.setState({ componentKey: 'game1', pgn: game1 })}>Game 1</Button>
|
|
90
|
+
<Button onClick={() => this.setState({ componentKey: 'game2', pgn: game2 })}>Game 2</Button>
|
|
91
|
+
</ButtonGroup>
|
|
92
|
+
</Stack>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private renderNavigationBoardWithMovetext() {
|
|
97
|
+
const game = pgnRead(this.state.pgn, 0);
|
|
98
|
+
return <NavigationBoardWithMoveText key={this.state.componentKey} game={game} />;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private renderCode() {
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
<Typography>
|
|
105
|
+
This example shows how to synchronize a <code>NavigationBoard</code> component with a <code>Movetext</code> component.
|
|
106
|
+
Both components are layout next to each other here, but real-world applications may use more complex layouts,
|
|
107
|
+
e.g. render them in distant places.
|
|
108
|
+
The key point to synchronize the components is to have them controlled by the same <code>nodeId</code> state variable.
|
|
109
|
+
</Typography>
|
|
110
|
+
<pre className="kokopu-demoCode">{NavigationBoardWithMoveTextSourceCode}</pre>
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
}
|
package/doc_src/demo/decs.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -27,6 +27,11 @@ declare module '*.pgn' {
|
|
|
27
27
|
export default pgnText;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
declare module '*.txt' {
|
|
31
|
+
const text: string;
|
|
32
|
+
export default text;
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
declare module '*.png' {
|
|
31
36
|
const path: string;
|
|
32
37
|
export default path;
|
package/doc_src/demo/demo.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/doc_src/demo/util.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kokopu-react",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "A React-based library to create and display chessboard and chess-related components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chess",
|
|
@@ -37,49 +37,49 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"kokopu": "^4.9.1",
|
|
40
|
-
"react": "17.x.x || 18.x.x"
|
|
40
|
+
"react": "17.x.x || 18.x.x || 19.x.x"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"htmlparser2": "^9.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@babel/preset-env": "^7.
|
|
47
|
-
"@babel/preset-react": "^7.
|
|
48
|
-
"@emotion/react": "^11.
|
|
49
|
-
"@emotion/styled": "^11.
|
|
50
|
-
"@eslint/js": "^9.
|
|
51
|
-
"@mui/material": "^
|
|
52
|
-
"@stylistic/eslint-plugin": "^
|
|
53
|
-
"@types/react": "^
|
|
54
|
-
"@types/react-dom": "^
|
|
55
|
-
"babel-loader": "^
|
|
56
|
-
"copy-webpack-plugin": "^
|
|
46
|
+
"@babel/preset-env": "^7.27.2",
|
|
47
|
+
"@babel/preset-react": "^7.27.1",
|
|
48
|
+
"@emotion/react": "^11.14.0",
|
|
49
|
+
"@emotion/styled": "^11.14.0",
|
|
50
|
+
"@eslint/js": "^9.29.0",
|
|
51
|
+
"@mui/material": "^7.1.2",
|
|
52
|
+
"@stylistic/eslint-plugin": "^4.4.1",
|
|
53
|
+
"@types/react": "^19.1.8",
|
|
54
|
+
"@types/react-dom": "^19.1.6",
|
|
55
|
+
"babel-loader": "^10.0.0",
|
|
56
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
57
57
|
"copyfiles": "^2.4.1",
|
|
58
58
|
"coverage-istanbul-loader": "^3.0.5",
|
|
59
59
|
"css-loader": "^7.1.2",
|
|
60
|
-
"eslint": "^9.
|
|
61
|
-
"eslint-plugin-react": "^7.37.
|
|
62
|
-
"globals": "^
|
|
60
|
+
"eslint": "^9.29.0",
|
|
61
|
+
"eslint-plugin-react": "^7.37.5",
|
|
62
|
+
"globals": "^16.2.0",
|
|
63
63
|
"html-webpack-plugin": "^5.6.3",
|
|
64
64
|
"img-diff-js": "^0.5.4",
|
|
65
|
-
"kokopu": "^4.
|
|
66
|
-
"mocha": "^
|
|
65
|
+
"kokopu": "^4.12.1",
|
|
66
|
+
"mocha": "^11.7.0",
|
|
67
67
|
"null-loader": "^4.0.1",
|
|
68
68
|
"nyc": "^17.1.0",
|
|
69
|
-
"react": "^
|
|
70
|
-
"react-docgen-typescript": "
|
|
71
|
-
"react-dom": "^
|
|
72
|
-
"react-styleguidist": "^13.1.
|
|
69
|
+
"react": "^19.1.0",
|
|
70
|
+
"react-docgen-typescript": "~2.2.2",
|
|
71
|
+
"react-dom": "^19.1.0",
|
|
72
|
+
"react-styleguidist": "^13.1.4",
|
|
73
73
|
"rimraf": "^6.0.1",
|
|
74
|
-
"selenium-webdriver": "^4.
|
|
75
|
-
"ssh2-sftp-client": "^
|
|
74
|
+
"selenium-webdriver": "^4.33.0",
|
|
75
|
+
"ssh2-sftp-client": "^12.0.0",
|
|
76
76
|
"style-loader": "^4.0.0",
|
|
77
|
-
"ts-loader": "^9.5.
|
|
78
|
-
"typescript": "^5.
|
|
79
|
-
"typescript-eslint": "^8.
|
|
77
|
+
"ts-loader": "^9.5.2",
|
|
78
|
+
"typescript": "^5.8.3",
|
|
79
|
+
"typescript-eslint": "^8.34.1",
|
|
80
80
|
"unit.js": "^2.1.1",
|
|
81
|
-
"webpack": "^5.
|
|
82
|
-
"webpack-cli": "^
|
|
81
|
+
"webpack": "^5.99.9",
|
|
82
|
+
"webpack-cli": "^6.0.1"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"lint": "eslint doc_src src test",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -64,6 +64,7 @@ const demoPages = [
|
|
|
64
64
|
{ id: 'NavigationBoardUncontrolledVsControlled', title: 'NavigationBoard - Uncontrolled vs. controlled' },
|
|
65
65
|
{ id: 'MovetextBase', title: 'Movetext - Basic features' },
|
|
66
66
|
{ id: 'MovetextInteraction', title: 'Movetext - Interactions' },
|
|
67
|
+
{ id: 'SynchroNavigationBoardMovetext', title: 'Synchronize NavigationBoard and Movetext components' },
|
|
67
68
|
];
|
|
68
69
|
|
|
69
70
|
|
|
@@ -137,7 +138,7 @@ module.exports = {
|
|
|
137
138
|
type: 'asset/resource',
|
|
138
139
|
},
|
|
139
140
|
{
|
|
140
|
-
test: /\.pgn$/i,
|
|
141
|
+
test: /\.(pgn|txt)$/i,
|
|
141
142
|
type: 'asset/source',
|
|
142
143
|
},
|
|
143
144
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
web-client:
|
|
3
|
-
image: selenium/standalone-firefox:4.
|
|
3
|
+
image: selenium/standalone-firefox:4.33.0-20250606 # https://github.com/SeleniumHQ/docker-selenium to get the latest version
|
|
4
4
|
shm_size: '2gb'
|
|
5
5
|
ports:
|
|
6
6
|
- 4444:4444 # http://localhost:4444/ (driver)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -119,13 +119,13 @@ export interface ChessboardProps extends DynamicBoardGraphicProps {
|
|
|
119
119
|
* Optional component, to be rendered above the chessboard, and customized with the same square-size / coordinate-visible / turn-visible
|
|
120
120
|
* parameter values as actually used for the chessboard (which may be different from what is defined in props because of small-screen limits).
|
|
121
121
|
*/
|
|
122
|
-
topComponent?: (attr: Pick<StaticBoardGraphicProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) => JSX.Element,
|
|
122
|
+
topComponent?: (attr: Pick<StaticBoardGraphicProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) => React.JSX.Element,
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Optional component, to be rendered below the chessboard, and customized with the same square-size / coordinate-visible / turn-visible
|
|
126
126
|
* parameter values as actually used for the chessboard (which may be different from what is defined in props because of small-screen limits).
|
|
127
127
|
*/
|
|
128
|
-
bottomComponent?: (attr: Pick<StaticBoardGraphicProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) => JSX.Element,
|
|
128
|
+
bottomComponent?: (attr: Pick<StaticBoardGraphicProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) => React.JSX.Element,
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -97,7 +97,7 @@ interface ClientCoordinates {
|
|
|
97
97
|
*/
|
|
98
98
|
export class Draggable extends React.Component<DraggableProps> {
|
|
99
99
|
|
|
100
|
-
private innerRef
|
|
100
|
+
private innerRef = React.createRef<SVGRectElement>();
|
|
101
101
|
private dragData?: DragData;
|
|
102
102
|
|
|
103
103
|
private mouseDownListener = (evt: MouseEvent) => this.handleMouseDown(evt);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/decs.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/errorbox/parsing.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -36,7 +36,7 @@ import { ErrorBox } from './ErrorBox';
|
|
|
36
36
|
* Try to interpret the given object as a chess position.
|
|
37
37
|
*/
|
|
38
38
|
export function parsePosition(position: Position | string, componentName: string):
|
|
39
|
-
{ error: true, errorBox: JSX.Element } | { error: false, position: Position } {
|
|
39
|
+
{ error: true, errorBox: React.JSX.Element } | { error: false, position: Position } {
|
|
40
40
|
|
|
41
41
|
if (position instanceof Position) {
|
|
42
42
|
return { error: false, position: position };
|
|
@@ -84,7 +84,7 @@ function splitGameVariantAndFEN(position: string): { variant: GameVariant, fen:
|
|
|
84
84
|
* Try to interpret the given object `move` as a move descriptor based on the given position.
|
|
85
85
|
*/
|
|
86
86
|
export function parseMove(position: Position, move: MoveDescriptor | string | undefined, componentName: string):
|
|
87
|
-
{ error: true, errorBox: JSX.Element } | { error: false, type: 'none' | 'null-move' } | { error: false, type: 'regular', move: MoveDescriptor } {
|
|
87
|
+
{ error: true, errorBox: React.JSX.Element } | { error: false, type: 'none' | 'null-move' } | { error: false, type: 'regular', move: MoveDescriptor } {
|
|
88
88
|
|
|
89
89
|
if (move === undefined || move === null) {
|
|
90
90
|
return { error: false, type: 'none' };
|
|
@@ -126,7 +126,7 @@ export function parseMove(position: Position, move: MoveDescriptor | string | un
|
|
|
126
126
|
* Try to interpret the given object as a chess game.
|
|
127
127
|
*/
|
|
128
128
|
export function parseGame(game: Game | Database | string, gameIndex: number, componentName: string):
|
|
129
|
-
{ error: true, errorBox: JSX.Element } | { error: false, game: Game } {
|
|
129
|
+
{ error: true, errorBox: React.JSX.Element } | { error: false, game: Game } {
|
|
130
130
|
|
|
131
131
|
if (game instanceof Game) {
|
|
132
132
|
return { error: false, game: game };
|
package/src/exception.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/i18n.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/icons/ArrowTip.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/icons/arrow.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* *
|
|
4
4
|
* Kokopu-React - A React-based library of chess-related components. *
|
|
5
5
|
* <https://www.npmjs.com/package/kokopu-react> *
|
|
6
|
-
* Copyright (C) 2021-
|
|
6
|
+
* Copyright (C) 2021-2025 Yoann Le Montagner <yo35 -at- melix.net> *
|
|
7
7
|
* *
|
|
8
8
|
* Kokopu-React is free software: you can redistribute it and/or *
|
|
9
9
|
* modify it under the terms of the GNU Lesser General Public License *
|