kokopu-react 3.0.1 → 3.1.0

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 (250) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/lib/chessboard/BoardProperties.d.ts +91 -0
  3. package/dist/lib/chessboard/BoardProperties.js +43 -0
  4. package/dist/lib/chessboard/BoardProperties.js.map +1 -0
  5. package/dist/lib/chessboard/Chessboard.css +7 -5
  6. package/dist/lib/chessboard/Chessboard.d.ts +36 -58
  7. package/dist/lib/chessboard/Chessboard.js +33 -97
  8. package/dist/lib/chessboard/Chessboard.js.map +1 -1
  9. package/dist/lib/chessboard/ChessboardImpl.d.ts +22 -0
  10. package/dist/lib/chessboard/ChessboardImpl.js +8 -6
  11. package/dist/lib/chessboard/ChessboardImpl.js.map +1 -1
  12. package/dist/lib/chessboard/Draggable.d.ts +22 -0
  13. package/dist/lib/chessboard/Draggable.js +7 -5
  14. package/dist/lib/chessboard/Draggable.js.map +1 -1
  15. package/dist/lib/chessboard/Motion.d.ts +22 -0
  16. package/dist/lib/chessboard/Motion.js +7 -5
  17. package/dist/lib/chessboard/Motion.js.map +1 -1
  18. package/dist/lib/chessboard/colorsets.d.ts +22 -0
  19. package/dist/lib/chessboard/colorsets.js +7 -5
  20. package/dist/lib/chessboard/colorsets.js.map +1 -1
  21. package/dist/lib/chessboard/piecesets.d.ts +22 -0
  22. package/dist/lib/chessboard/piecesets.js +7 -5
  23. package/dist/lib/chessboard/piecesets.js.map +1 -1
  24. package/dist/lib/errorbox/ErrorBox.css +7 -5
  25. package/dist/lib/errorbox/ErrorBox.d.ts +22 -0
  26. package/dist/lib/errorbox/ErrorBox.js +7 -5
  27. package/dist/lib/errorbox/ErrorBox.js.map +1 -1
  28. package/dist/lib/errorbox/parsing.d.ts +57 -0
  29. package/dist/lib/errorbox/parsing.js +140 -0
  30. package/dist/lib/errorbox/parsing.js.map +1 -0
  31. package/dist/lib/exception.d.ts +22 -0
  32. package/dist/lib/exception.js +7 -5
  33. package/dist/lib/exception.js.map +1 -1
  34. package/dist/lib/i18n.d.ts +27 -0
  35. package/dist/lib/i18n.js +13 -5
  36. package/dist/lib/i18n.js.map +1 -1
  37. package/dist/lib/icons/AnnotationSymbolShape.css +7 -5
  38. package/dist/lib/icons/AnnotationSymbolShape.d.ts +22 -0
  39. package/dist/lib/icons/AnnotationSymbolShape.js +7 -5
  40. package/dist/lib/icons/AnnotationSymbolShape.js.map +1 -1
  41. package/dist/lib/icons/ArrowMarkerIcon.d.ts +22 -0
  42. package/dist/lib/icons/ArrowMarkerIcon.js +7 -5
  43. package/dist/lib/icons/ArrowMarkerIcon.js.map +1 -1
  44. package/dist/lib/icons/ArrowTip.d.ts +22 -0
  45. package/dist/lib/icons/ArrowTip.js +7 -5
  46. package/dist/lib/icons/ArrowTip.js.map +1 -1
  47. package/dist/lib/icons/ChessPieceIcon.d.ts +22 -0
  48. package/dist/lib/icons/ChessPieceIcon.js +7 -5
  49. package/dist/lib/icons/ChessPieceIcon.js.map +1 -1
  50. package/dist/lib/icons/SquareMarkerIcon.d.ts +22 -0
  51. package/dist/lib/icons/SquareMarkerIcon.js +7 -5
  52. package/dist/lib/icons/SquareMarkerIcon.js.map +1 -1
  53. package/dist/lib/icons/TextMarkerIcon.d.ts +22 -0
  54. package/dist/lib/icons/TextMarkerIcon.js +7 -5
  55. package/dist/lib/icons/TextMarkerIcon.js.map +1 -1
  56. package/dist/lib/icons/arrow.css +7 -5
  57. package/dist/lib/index.d.ts +26 -1
  58. package/dist/lib/index.js +9 -5
  59. package/dist/lib/index.js.map +1 -1
  60. package/dist/lib/movetext/Movetext.css +7 -18
  61. package/dist/lib/movetext/Movetext.d.ts +31 -43
  62. package/dist/lib/movetext/Movetext.js +22 -72
  63. package/dist/lib/movetext/Movetext.js.map +1 -1
  64. package/dist/lib/movetext/MovetextImpl.d.ts +29 -28
  65. package/dist/lib/movetext/MovetextImpl.js +22 -99
  66. package/dist/lib/movetext/MovetextImpl.js.map +1 -1
  67. package/dist/lib/movetext/fonts.css +7 -5
  68. package/dist/lib/movetext/htmlFilter.d.ts +22 -0
  69. package/dist/lib/movetext/htmlFilter.js +21 -19
  70. package/dist/lib/movetext/htmlFilter.js.map +1 -1
  71. package/dist/lib/movetext/moveFormatter.d.ts +22 -0
  72. package/dist/lib/movetext/moveFormatter.js +7 -5
  73. package/dist/lib/movetext/moveFormatter.js.map +1 -1
  74. package/dist/lib/navigationboard/NavigationBoard.d.ts +118 -0
  75. package/dist/lib/navigationboard/NavigationBoard.js +112 -0
  76. package/dist/lib/navigationboard/NavigationBoard.js.map +1 -0
  77. package/dist/lib/navigationboard/NavigationField.css +36 -0
  78. package/dist/lib/navigationboard/NavigationField.d.ts +81 -0
  79. package/dist/lib/navigationboard/NavigationField.js +154 -0
  80. package/dist/lib/navigationboard/NavigationField.js.map +1 -0
  81. package/dist/lib/navigationboard/NavigationToolbar.css +51 -0
  82. package/dist/lib/navigationboard/NavigationToolbar.d.ts +41 -0
  83. package/dist/lib/navigationboard/NavigationToolbar.js +124 -0
  84. package/dist/lib/navigationboard/NavigationToolbar.js.map +1 -0
  85. package/dist/lib/sanitization.d.ts +22 -0
  86. package/dist/lib/sanitization.js +7 -5
  87. package/dist/lib/sanitization.js.map +1 -1
  88. package/dist/lib/types.d.ts +22 -0
  89. package/dist/lib/types.js +7 -5
  90. package/dist/lib/types.js.map +1 -1
  91. package/dist/lib/util.d.ts +22 -0
  92. package/dist/lib/util.js +7 -5
  93. package/dist/lib/util.js.map +1 -1
  94. package/doc_src/demo/PageChessboardBase.tsx +7 -5
  95. package/doc_src/demo/PageChessboardInteraction.tsx +32 -22
  96. package/doc_src/demo/PageChessboardMove.tsx +24 -5
  97. package/doc_src/demo/PageChessboardSmallScreens.tsx +7 -5
  98. package/doc_src/demo/PageMovetextBase.tsx +7 -5
  99. package/doc_src/demo/PageMovetextInteraction.tsx +7 -5
  100. package/doc_src/demo/PageNavigationBoardBase.tsx +194 -0
  101. package/doc_src/demo/PageNavigationBoardUncontrolledVsControlled.tsx +114 -0
  102. package/doc_src/demo/decs.d.ts +7 -5
  103. package/doc_src/demo/demo.css +7 -5
  104. package/doc_src/demo/game-3.pgn +10 -0
  105. package/doc_src/demo/util.ts +7 -5
  106. package/doc_src/examples/Movetext.md +1 -1
  107. package/doc_src/examples/NavigationBoard.md +15 -0
  108. package/doc_src/theming/LogoRenderer.js +7 -5
  109. package/doc_src/theming/theming.css +7 -5
  110. package/package.json +27 -26
  111. package/scripts/doc.styleguide.config.js +19 -7
  112. package/scripts/docker-compose.yml +3 -3
  113. package/scripts/test-graphic.webpack.config.js +7 -5
  114. package/scripts/test-headless.webpack.config.js +7 -5
  115. package/src/chessboard/BoardProperties.ts +131 -0
  116. package/src/chessboard/Chessboard.css +7 -5
  117. package/src/chessboard/Chessboard.tsx +48 -175
  118. package/src/chessboard/ChessboardImpl.tsx +7 -5
  119. package/src/chessboard/Draggable.tsx +7 -5
  120. package/src/chessboard/Motion.tsx +7 -5
  121. package/src/chessboard/colorsets.ts +7 -5
  122. package/src/chessboard/piecesets.ts +7 -5
  123. package/src/decs.d.ts +7 -5
  124. package/src/errorbox/ErrorBox.css +7 -5
  125. package/src/errorbox/ErrorBox.tsx +7 -5
  126. package/src/errorbox/parsing.tsx +158 -0
  127. package/src/exception.ts +7 -5
  128. package/src/i18n.ts +14 -5
  129. package/src/icons/AnnotationSymbolShape.css +7 -5
  130. package/src/icons/AnnotationSymbolShape.tsx +7 -5
  131. package/src/icons/ArrowMarkerIcon.tsx +7 -5
  132. package/src/icons/ArrowTip.tsx +7 -5
  133. package/src/icons/ChessPieceIcon.tsx +7 -5
  134. package/src/icons/SquareMarkerIcon.tsx +7 -5
  135. package/src/icons/TextMarkerIcon.tsx +7 -5
  136. package/src/icons/arrow.css +7 -5
  137. package/src/index.ts +12 -6
  138. package/src/movetext/Movetext.css +7 -18
  139. package/src/movetext/Movetext.tsx +27 -90
  140. package/src/movetext/MovetextImpl.tsx +35 -120
  141. package/src/movetext/fonts.css +7 -5
  142. package/src/movetext/htmlFilter.tsx +7 -5
  143. package/src/movetext/moveFormatter.tsx +7 -5
  144. package/src/navigationboard/NavigationBoard.tsx +231 -0
  145. package/src/navigationboard/NavigationField.css +36 -0
  146. package/src/navigationboard/NavigationField.tsx +185 -0
  147. package/src/navigationboard/NavigationToolbar.css +51 -0
  148. package/src/navigationboard/NavigationToolbar.tsx +174 -0
  149. package/src/sanitization.ts +7 -5
  150. package/src/types.ts +7 -5
  151. package/src/util.ts +7 -5
  152. package/test/01_types.js +7 -5
  153. package/test/02_chessboard_util.js +7 -5
  154. package/test/03_error_box_graphic.js +7 -5
  155. package/test/04_icons_graphic.js +7 -5
  156. package/test/05_chessboard_graphic.js +9 -5
  157. package/test/06_chessboard_animation.js +7 -5
  158. package/test/07_chessboard_interaction.js +7 -5
  159. package/test/08_chessboard_play_moves.js +7 -5
  160. package/test/09_chessboard_small_screens.js +28 -5
  161. package/test/10_movetext_graphic.js +12 -5
  162. package/test/11_movetext_interaction.js +19 -13
  163. package/test/12_navigation_board.js +168 -0
  164. package/test/common/graphic.js +7 -5
  165. package/test/graphic_references/05_chessboard_graphic/move/illegal_null-move.png +0 -0
  166. package/test/graphic_references/05_chessboard_graphic/move/null-move.png +0 -0
  167. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_bottom_component.png +0 -0
  168. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_top_component.png +0 -0
  169. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_bottom_component.png +0 -0
  170. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_top_component.png +0 -0
  171. package/test/graphic_references/10_movetext_graphic/format_move/format_text.png +0 -0
  172. package/test/graphic_references/10_movetext_graphic/options/wrong_piece_symbol_value.png +0 -0
  173. package/test/graphic_references/11_movetext_interaction/select_moves/click_on_unselected_without_callback.png +0 -0
  174. package/test/graphic_references/12_navigation_board/controlled/default.png +0 -0
  175. package/test/graphic_references/12_navigation_board/controlled/forbidden_navigation_0.png +0 -0
  176. package/test/graphic_references/12_navigation_board/controlled/forbidden_navigation_1.png +0 -0
  177. package/test/graphic_references/12_navigation_board/controlled/invalid_node_id.png +0 -0
  178. package/test/graphic_references/12_navigation_board/controlled/no_callback_defined_0.png +0 -0
  179. package/test/graphic_references/12_navigation_board/controlled/no_callback_defined_1.png +0 -0
  180. package/test/graphic_references/12_navigation_board/controlled/overriding_initial_node_id.png +0 -0
  181. package/test/graphic_references/12_navigation_board/controlled/regular_navigation_0.png +0 -0
  182. package/test/graphic_references/12_navigation_board/controlled/regular_navigation_1.png +0 -0
  183. package/test/graphic_references/12_navigation_board/controlled/regular_navigation_2.png +0 -0
  184. package/test/graphic_references/12_navigation_board/controlled/regular_navigation_3.png +0 -0
  185. package/test/graphic_references/12_navigation_board/error/pgn_parsing_error.png +0 -0
  186. package/test/graphic_references/12_navigation_board/error/wrong_game_type.png +0 -0
  187. package/test/graphic_references/12_navigation_board/theme/custom_1.png +0 -0
  188. package/test/graphic_references/12_navigation_board/theme/custom_2.png +0 -0
  189. package/test/graphic_references/12_navigation_board/theme/large.png +0 -0
  190. package/test/graphic_references/12_navigation_board/theme/small.png +0 -0
  191. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_beginning_0.png +0 -0
  192. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_beginning_1.png +0 -0
  193. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_beginning_2.png +0 -0
  194. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_end_0.png +0 -0
  195. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_end_1.png +0 -0
  196. package/test/graphic_references/12_navigation_board/uncontrolled/forbidden_navigation_at_end_2.png +0 -0
  197. package/test/graphic_references/12_navigation_board/uncontrolled/initial_state_at_end.png +0 -0
  198. package/test/graphic_references/12_navigation_board/uncontrolled/initial_state_at_specific_id.png +0 -0
  199. package/test/graphic_references/12_navigation_board/uncontrolled/initial_state_default.png +0 -0
  200. package/test/graphic_references/12_navigation_board/uncontrolled/initial_state_default_with_game_index.png +0 -0
  201. package/test/graphic_references/12_navigation_board/uncontrolled/initial_state_on_null-move.png +0 -0
  202. package/test/graphic_references/12_navigation_board/uncontrolled/navigation_with_keys_0.png +0 -0
  203. package/test/graphic_references/12_navigation_board/uncontrolled/navigation_with_keys_1.png +0 -0
  204. package/test/graphic_references/12_navigation_board/uncontrolled/navigation_with_keys_2.png +0 -0
  205. package/test/graphic_references/12_navigation_board/uncontrolled/navigation_with_keys_3.png +0 -0
  206. package/test/graphic_references/12_navigation_board/uncontrolled/navigation_with_keys_4.png +0 -0
  207. package/test/graphic_references/12_navigation_board/uncontrolled/regular_flipping_0.png +0 -0
  208. package/test/graphic_references/12_navigation_board/uncontrolled/regular_flipping_1.png +0 -0
  209. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_0.png +0 -0
  210. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_1.png +0 -0
  211. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_2.png +0 -0
  212. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_3.png +0 -0
  213. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_4.png +0 -0
  214. package/test/graphic_references/12_navigation_board/uncontrolled/regular_navigation_5.png +0 -0
  215. package/test/graphic_test_app/03_error_box_graphic/base.tsx +7 -5
  216. package/test/graphic_test_app/03_error_box_graphic/localization.tsx +7 -5
  217. package/test/graphic_test_app/04_icons_graphic/chess_piece.tsx +7 -5
  218. package/test/graphic_test_app/04_icons_graphic/marker.tsx +7 -5
  219. package/test/graphic_test_app/05_chessboard_graphic/annotations.tsx +7 -5
  220. package/test/graphic_test_app/05_chessboard_graphic/base.tsx +7 -5
  221. package/test/graphic_test_app/05_chessboard_graphic/chess_variants.tsx +7 -5
  222. package/test/graphic_test_app/05_chessboard_graphic/flipped.tsx +7 -5
  223. package/test/graphic_test_app/05_chessboard_graphic/move.tsx +9 -5
  224. package/test/graphic_test_app/05_chessboard_graphic/theme.tsx +7 -5
  225. package/test/graphic_test_app/06_chessboard_animation/base_1.tsx +7 -5
  226. package/test/graphic_test_app/06_chessboard_animation/base_2.tsx +7 -5
  227. package/test/graphic_test_app/06_chessboard_animation/base_3.tsx +7 -5
  228. package/test/graphic_test_app/06_chessboard_animation/on_redraw.tsx +7 -5
  229. package/test/graphic_test_app/07_chessboard_interaction/click_squares.tsx +7 -5
  230. package/test/graphic_test_app/07_chessboard_interaction/edit_arrows.tsx +7 -5
  231. package/test/graphic_test_app/07_chessboard_interaction/error.tsx +7 -5
  232. package/test/graphic_test_app/07_chessboard_interaction/move_pieces.tsx +7 -5
  233. package/test/graphic_test_app/08_chessboard_play_moves/base.tsx +7 -5
  234. package/test/graphic_test_app/08_chessboard_play_moves/promotions.tsx +7 -5
  235. package/test/graphic_test_app/09_chessboard_small_screens/base.tsx +7 -5
  236. package/test/graphic_test_app/09_chessboard_small_screens/top_bottom_components.tsx +48 -0
  237. package/test/graphic_test_app/10_movetext_graphic/base.tsx +7 -5
  238. package/test/graphic_test_app/10_movetext_graphic/error.tsx +7 -5
  239. package/test/graphic_test_app/10_movetext_graphic/format_move.tsx +31 -0
  240. package/test/graphic_test_app/10_movetext_graphic/html.tsx +7 -5
  241. package/test/graphic_test_app/10_movetext_graphic/options.tsx +8 -5
  242. package/test/graphic_test_app/11_movetext_interaction/error.tsx +7 -5
  243. package/test/graphic_test_app/11_movetext_interaction/select_moves.tsx +8 -5
  244. package/test/graphic_test_app/12_navigation_board/controlled.tsx +43 -0
  245. package/test/graphic_test_app/12_navigation_board/error.tsx +34 -0
  246. package/test/graphic_test_app/12_navigation_board/theme.tsx +38 -0
  247. package/test/graphic_test_app/12_navigation_board/uncontrolled.tsx +56 -0
  248. package/test/graphic_test_app/common/decs.d.ts +7 -5
  249. package/test/graphic_test_app/common/test_app.css +7 -5
  250. package/test/graphic_test_app/common/test_app.tsx +7 -5
@@ -0,0 +1,112 @@
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-2024 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
+ import * as React from 'react';
24
+ import { Game, Node as GameNode } from 'kokopu';
25
+ import { sanitizeBoolean, sanitizeOptional, sanitizeString } from '../sanitization';
26
+ import { defaultDynamicBoardProps } from '../chessboard/BoardProperties';
27
+ import { Chessboard } from '../chessboard/Chessboard';
28
+ import { parseGame } from '../errorbox/parsing';
29
+ import { NavigationField, firstNodeId, previousNodeId, nextNodeId, lastNodeId } from '../navigationboard/NavigationField';
30
+ import { NavigationToolbar } from './NavigationToolbar';
31
+ /**
32
+ * Component displaying the positions occurring in a chess game, with navigation buttons to browse these positions.
33
+ */
34
+ export class NavigationBoard extends React.Component {
35
+ constructor(props) {
36
+ super(props);
37
+ this.navigationFieldRef = React.createRef();
38
+ this.state = {
39
+ nodeIdAsUncontrolled: sanitizeString(props.initialNodeId),
40
+ flippedAsUncontrolled: sanitizeBoolean(props.initialFlipped),
41
+ };
42
+ }
43
+ render() {
44
+ // Validate the game and game-index attributes.
45
+ const info = parseGame(this.props.game, this.props.gameIndex, 'NavigationBoard');
46
+ if (info.error) {
47
+ return info.errorBox;
48
+ }
49
+ // Fetch the current node/variation.
50
+ const currentNodeId = sanitizeOptional(this.props.nodeId, sanitizeString) ?? this.state.nodeIdAsUncontrolled;
51
+ const currentNode = info.game.findById(currentNodeId) ?? info.game.mainVariation();
52
+ // Flip state.
53
+ const flipped = sanitizeOptional(this.props.flipped, sanitizeBoolean) ?? this.state.flippedAsUncontrolled;
54
+ return (React.createElement("div", { className: "kokopu-navigationBoard" },
55
+ this.renderBoard(info.game, currentNode, flipped),
56
+ this.renderNavigationField(info.game, currentNode.id())));
57
+ }
58
+ renderBoard(game, node, flipped) {
59
+ const position = node instanceof GameNode ? node.positionBefore() : node.initialPosition();
60
+ const move = node instanceof GameNode ? node.notation() : undefined;
61
+ return React.createElement(Chessboard, { position: position, move: move, flipped: flipped, squareMarkers: node.tag('csl'), arrowMarkers: node.tag('cal'), textMarkers: node.tag('ctl'), squareSize: this.props.squareSize, coordinateVisible: this.props.coordinateVisible, turnVisible: this.props.turnVisible, colorset: this.props.colorset, pieceset: this.props.pieceset, smallScreenLimits: this.props.smallScreenLimits, moveArrowVisible: this.props.moveArrowVisible, moveArrowColor: this.props.moveArrowColor, animated: this.props.animated, bottomComponent: ({ squareSize }) => this.renderToolbar(game, node.id(), squareSize) });
62
+ }
63
+ renderNavigationField(game, currentNodeId) {
64
+ return React.createElement(NavigationField, { ref: this.navigationFieldRef, onFirstPressed: () => this.handleNavigationButtonClicked(firstNodeId(game, currentNodeId)), onPreviousPressed: () => this.handleNavigationButtonClicked(previousNodeId(game, currentNodeId)), onNextPressed: () => this.handleNavigationButtonClicked(nextNodeId(game, currentNodeId)), onLastPressed: () => this.handleNavigationButtonClicked(lastNodeId(game, currentNodeId)) });
65
+ }
66
+ renderToolbar(game, currentNodeId, squareSize) {
67
+ const flipButtonVisible = sanitizeBoolean(this.props.flipButtonVisible);
68
+ return React.createElement(NavigationToolbar, { flipButtonVisible: flipButtonVisible, squareSize: squareSize, onFirstClicked: () => this.handleNavigationButtonClicked(firstNodeId(game, currentNodeId)), onPreviousClicked: () => this.handleNavigationButtonClicked(previousNodeId(game, currentNodeId)), onNextClicked: () => this.handleNavigationButtonClicked(nextNodeId(game, currentNodeId)), onLastClicked: () => this.handleNavigationButtonClicked(lastNodeId(game, currentNodeId)), onFlipClicked: () => this.handleFlipButtonClicked() });
69
+ }
70
+ handleNavigationButtonClicked(targetNodeId) {
71
+ this.focus();
72
+ if (targetNodeId === undefined) {
73
+ return;
74
+ }
75
+ if (this.props.nodeId === undefined) { // uncontrolled-component behavior
76
+ this.setState({ nodeIdAsUncontrolled: targetNodeId });
77
+ }
78
+ else if (this.props.onNodeIdChanged) { // controlled-component behavior
79
+ this.props.onNodeIdChanged(targetNodeId);
80
+ }
81
+ }
82
+ handleFlipButtonClicked() {
83
+ this.focus();
84
+ if (this.props.flipped === undefined) { // uncontrolled flip state
85
+ this.setState({ flippedAsUncontrolled: !this.state.flippedAsUncontrolled });
86
+ }
87
+ else if (this.props.onFlippedChanged) { // controlled flip state
88
+ this.props.onFlippedChanged(!this.props.flipped);
89
+ }
90
+ }
91
+ /**
92
+ * Set the focus to the current component.
93
+ *
94
+ * @public
95
+ */
96
+ focus() {
97
+ const target = this.navigationFieldRef.current;
98
+ // istanbul ignore else
99
+ if (target) {
100
+ target.focus();
101
+ }
102
+ }
103
+ }
104
+ NavigationBoard.defaultProps = {
105
+ ...defaultDynamicBoardProps(),
106
+ game: new Game(),
107
+ gameIndex: 0,
108
+ initialNodeId: 'start',
109
+ initialFlipped: false,
110
+ flipButtonVisible: true,
111
+ };
112
+ //# sourceMappingURL=NavigationBoard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationBoard.js","sourceRoot":"","sources":["../../../src/navigationboard/NavigationBoard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;gFAqBgF;AAGhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,IAAI,EAAE,I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CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;IACF,CAAC;IAED;;;;OAIG;IACH,KAAK;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;QAC/C,uBAAuB;QACvB,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;;AApHM,4BAAY,GAAG;IACrB,GAAG,wBAAwB,EAAE;IAC7B,IAAI,EAAE,IAAI,IAAI,EAAE;IAChB,SAAS,EAAE,CAAC;IACZ,aAAa,EAAE,OAAO;IACtB,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,IAAI;CACvB,AAPkB,CAOjB"}
@@ -0,0 +1,36 @@
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-2024 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
+ .kokopu-focusFieldContainer {
26
+ position: fixed;
27
+ bottom: 0px;
28
+ right: 0px;
29
+ width: 0px;
30
+ height: 0px;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .kokopu-focusField {
35
+ position: absolute; /* see #1 */
36
+ }
@@ -0,0 +1,81 @@
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-2024 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
+ import * as React from 'react';
24
+ import { Game } from 'kokopu';
25
+ import './NavigationField.css';
26
+ interface NavigationFieldProps {
27
+ onFirstPressed?: () => void;
28
+ onPreviousPressed?: () => void;
29
+ onNextPressed?: () => void;
30
+ onLastPressed?: () => void;
31
+ onExitPressed?: () => void;
32
+ }
33
+ /**
34
+ * Invisible field, to capture keyboard events.
35
+ */
36
+ export declare class NavigationField extends React.Component<NavigationFieldProps> {
37
+ private focusFieldRef;
38
+ render(): React.JSX.Element;
39
+ private handleKeyDown;
40
+ /**
41
+ * Set the focus to the component.
42
+ */
43
+ focus(): void;
44
+ }
45
+ /**
46
+ * Return the ID of the main variation in the given chess game.
47
+ * If the given selection corresponds already at the main variation, `undefined` is returned.
48
+ *
49
+ * @param game - Considered chess game.
50
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
51
+ * @public
52
+ */
53
+ export declare function firstNodeId(game: Game, selection: string): string | undefined;
54
+ /**
55
+ * Return the ID of the node immediately preceding the given selection in the given chess game.
56
+ * If no such node exists, `undefined` is returned.
57
+ *
58
+ * @param game - Considered chess game.
59
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
60
+ * @public
61
+ */
62
+ export declare function previousNodeId(game: Game, selection: string): string | undefined;
63
+ /**
64
+ * Return the ID of the node immediately following the given selection in the given chess game.
65
+ * If no such node exists, `undefined` is returned.
66
+ *
67
+ * @param game - Considered chess game.
68
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
69
+ * @public
70
+ */
71
+ export declare function nextNodeId(game: Game, selection: string): string | undefined;
72
+ /**
73
+ * Return the ID of the node at then end of the variation in which lies the given selection in the given chess game.
74
+ * If the selection is already at the end its variation, `undefined` is returned.
75
+ *
76
+ * @param game - Considered chess game.
77
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
78
+ * @public
79
+ */
80
+ export declare function lastNodeId(game: Game, selection: string): string | undefined;
81
+ export {};
@@ -0,0 +1,154 @@
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-2024 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
+ import * as React from 'react';
24
+ import { Variation } from 'kokopu';
25
+ import './NavigationField.css';
26
+ /**
27
+ * Invisible field, to capture keyboard events.
28
+ */
29
+ export class NavigationField extends React.Component {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.focusFieldRef = React.createRef();
33
+ }
34
+ render() {
35
+ return (React.createElement("div", { className: "kokopu-focusFieldContainer" },
36
+ React.createElement("a", { className: "kokopu-focusField", href: "#", ref: this.focusFieldRef, onKeyDown: evt => this.handleKeyDown(evt) })));
37
+ }
38
+ handleKeyDown(evt) {
39
+ /* eslint-disable no-unused-expressions */
40
+ doHandleKeyDown(evt, 'Home', this.props.onFirstPressed) ||
41
+ doHandleKeyDown(evt, 'ArrowLeft', this.props.onPreviousPressed) ||
42
+ doHandleKeyDown(evt, 'ArrowRight', this.props.onNextPressed) ||
43
+ doHandleKeyDown(evt, 'End', this.props.onLastPressed) ||
44
+ doHandleKeyDown(evt, 'Escape', this.props.onExitPressed);
45
+ /* eslint-enable */
46
+ }
47
+ /**
48
+ * Set the focus to the component.
49
+ */
50
+ focus() {
51
+ const target = this.focusFieldRef.current;
52
+ // istanbul ignore else
53
+ if (target) {
54
+ target.focus();
55
+ }
56
+ }
57
+ }
58
+ function doHandleKeyDown(evt, targetKey, targetCallback) {
59
+ // Skip if the pressed key does not match the target key.
60
+ if (evt.key !== targetKey) {
61
+ return false;
62
+ }
63
+ // Otherwise, invoke the callback.
64
+ if (targetCallback) {
65
+ evt.preventDefault();
66
+ targetCallback();
67
+ }
68
+ return true;
69
+ }
70
+ /**
71
+ * Return the ID of the main variation in the given chess game.
72
+ * If the given selection corresponds already at the main variation, `undefined` is returned.
73
+ *
74
+ * @param game - Considered chess game.
75
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
76
+ * @public
77
+ */
78
+ export function firstNodeId(game, selection) {
79
+ if (!game.findById(selection)) {
80
+ return undefined;
81
+ }
82
+ return selection === 'start' ? undefined : 'start';
83
+ }
84
+ /**
85
+ * Return the ID of the node immediately preceding the given selection in the given chess game.
86
+ * If no such node exists, `undefined` is returned.
87
+ *
88
+ * @param game - Considered chess game.
89
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
90
+ * @public
91
+ */
92
+ export function previousNodeId(game, selection) {
93
+ let currentNode = game.findById(selection);
94
+ if (!currentNode) {
95
+ return undefined;
96
+ }
97
+ if (currentNode instanceof Variation) {
98
+ currentNode = currentNode.parentNode();
99
+ if (!currentNode) {
100
+ return undefined; // This case corresponds to the first variation being selected initially.
101
+ }
102
+ }
103
+ while (currentNode) {
104
+ const previousNode = currentNode.previous();
105
+ if (previousNode) {
106
+ return previousNode.id();
107
+ }
108
+ currentNode = currentNode.parentVariation().parentNode();
109
+ }
110
+ return 'start';
111
+ }
112
+ /**
113
+ * Return the ID of the node immediately following the given selection in the given chess game.
114
+ * If no such node exists, `undefined` is returned.
115
+ *
116
+ * @param game - Considered chess game.
117
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
118
+ * @public
119
+ */
120
+ export function nextNodeId(game, selection) {
121
+ const currentNode = game.findById(selection);
122
+ if (!currentNode) {
123
+ return undefined;
124
+ }
125
+ const nextNode = currentNode instanceof Variation ? currentNode.first() : currentNode.next();
126
+ return nextNode ? nextNode.id() : undefined;
127
+ }
128
+ /**
129
+ * Return the ID of the node at then end of the variation in which lies the given selection in the given chess game.
130
+ * If the selection is already at the end its variation, `undefined` is returned.
131
+ *
132
+ * @param game - Considered chess game.
133
+ * @param selection - ID of the selected move (or `'start'` for the beginning of the main variation).
134
+ * @public
135
+ */
136
+ export function lastNodeId(game, selection) {
137
+ let currentNode = game.findById(selection);
138
+ if (!currentNode) {
139
+ return undefined;
140
+ }
141
+ currentNode = currentNode instanceof Variation ? currentNode.first() : currentNode.next();
142
+ if (!currentNode) { // Ensure that the input node is not already the last one.
143
+ return undefined;
144
+ }
145
+ let currentNodeNotNull = currentNode;
146
+ while (true) {
147
+ const nextNode = currentNodeNotNull.next();
148
+ if (!nextNode) {
149
+ return currentNodeNotNull.id();
150
+ }
151
+ currentNodeNotNull = nextNode;
152
+ }
153
+ }
154
+ //# sourceMappingURL=NavigationField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationField.js","sourceRoot":"","sources":["../../../src/navigationboard/NavigationField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;gFAqBgF;AAGhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,uBAAuB,CAAC;AAY/B;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAA+B;IAA1E;;QAES,kBAAa,GAAuC,KAAK,CAAC,SAAS,EAAE,CAAC;IA+B/E,CAAC;IA7BA,MAAM;QACL,OAAO,CACN,6BAAK,SAAS,EAAC,4BAA4B;YAC1C,2BAAG,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,GAAG,EAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAM,CAC7G,CACN,CAAC;IACH,CAAC;IAEO,aAAa,CAAC,GAA2C;QAChE,0CAA0C;QAC1C,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YACvD,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;YAC/D,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAC5D,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YACrD,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACzD,mBAAmB;IACpB,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,MAAM,MAAM,GAAG,IAA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E,EAAE,CAAC;QAChC,CAAC;QACD,kBAAkB,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACF,CAAC"}
@@ -0,0 +1,51 @@
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-2024 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
+ .kokopu-navigationBoard {
26
+ display: flex;
27
+ flex-direction: column;
28
+ align-items: center;
29
+ }
30
+
31
+ .kokopu-navigationToolbar {
32
+ line-height: 0px;
33
+ }
34
+
35
+ .kokopu-navigationButton {
36
+ display: inline-block;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .kokopu-navigationButton:hover {
41
+ opacity: 0.6;
42
+ }
43
+
44
+ * + .kokopu-navigationButton {
45
+ margin-left: 2px;
46
+ }
47
+
48
+ .kokopu-navigationSpacer {
49
+ display: inline-block;
50
+ width: 10px;
51
+ }
@@ -0,0 +1,41 @@
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-2024 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
+ import * as React from 'react';
24
+ import './NavigationToolbar.css';
25
+ interface NavigationToolbarProps {
26
+ flipButtonVisible: boolean;
27
+ squareSize: number;
28
+ onFirstClicked?: () => void;
29
+ onPreviousClicked?: () => void;
30
+ onNextClicked?: () => void;
31
+ onLastClicked?: () => void;
32
+ onFlipClicked?: () => void;
33
+ }
34
+ /**
35
+ * Toolbar below the navigation board.
36
+ */
37
+ export declare class NavigationToolbar extends React.Component<NavigationToolbarProps> {
38
+ render(): React.JSX.Element;
39
+ private renderFlipButton;
40
+ }
41
+ export {};
@@ -0,0 +1,124 @@
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-2024 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
+ import * as React from 'react';
24
+ import { i18n } from '../i18n';
25
+ import './NavigationToolbar.css';
26
+ const THICKNESS = 2;
27
+ const CHEVRON_SIZE = 7;
28
+ const ARROW_SIZE = 5;
29
+ const ARROW_LENGTH = 16;
30
+ /**
31
+ * Toolbar below the navigation board.
32
+ */
33
+ export class NavigationToolbar extends React.Component {
34
+ render() {
35
+ const buttonSize = computeButtonSize(this.props.squareSize);
36
+ const marginTop = Math.round(buttonSize / 4);
37
+ return (React.createElement("div", { className: "kokopu-navigationToolbar", style: { marginTop: marginTop } },
38
+ React.createElement(NavigationButton, { size: buttonSize, tooltip: i18n.TOOLTIP_GO_FIRST, path: chevronPath(14, 16, -1) + ' ' + chevronPath(10, 16, -1), onClick: this.props.onFirstClicked }),
39
+ React.createElement(NavigationButton, { size: buttonSize, tooltip: i18n.TOOLTIP_GO_PREVIOUS, path: chevronPath(12, 16, -1), onClick: this.props.onPreviousClicked }),
40
+ React.createElement(NavigationButton, { size: buttonSize, tooltip: i18n.TOOLTIP_GO_NEXT, path: chevronPath(20, 16, 1), onClick: this.props.onNextClicked }),
41
+ React.createElement(NavigationButton, { size: buttonSize, tooltip: i18n.TOOLTIP_GO_LAST, path: chevronPath(18, 16, 1) + ' ' + chevronPath(22, 16, 1), onClick: this.props.onLastClicked }),
42
+ this.renderFlipButton(buttonSize)));
43
+ }
44
+ renderFlipButton(buttonSize) {
45
+ if (!this.props.flipButtonVisible) {
46
+ return undefined;
47
+ }
48
+ return (React.createElement(React.Fragment, null,
49
+ React.createElement("div", { className: "kokopu-navigationSpacer" }),
50
+ React.createElement(NavigationButton, { size: buttonSize, tooltip: i18n.TOOLTIP_FLIP, path: arrowPath(11, 25, 1) + ' ' + arrowPath(21, 7, -1), onClick: this.props.onFlipClicked })));
51
+ }
52
+ }
53
+ /**
54
+ * Button for the navigation toolbar.
55
+ */
56
+ function NavigationButton({ size, tooltip, path, onClick }) {
57
+ return (React.createElement("div", { className: "kokopu-navigationButton", title: tooltip, onClick: onClick },
58
+ React.createElement("svg", { viewBox: "0 0 32 32", width: size, height: size },
59
+ React.createElement("path", { d: `M 16 0 A 16 16 0 0 0 16 32 A 16 16 0 0 0 16 0 Z ${path}`, fill: "currentcolor" }))));
60
+ }
61
+ /**
62
+ * * C
63
+ * / \
64
+ * B * \
65
+ * \ \
66
+ * \ \
67
+ * A * * D
68
+ * / /
69
+ * / /
70
+ * F * /
71
+ * \ /
72
+ * * E
73
+ *
74
+ * (x,y) = middle of [AD]
75
+ */
76
+ function chevronPath(x, y, direction) {
77
+ const xA = x - direction * THICKNESS * Math.sqrt(2) / 2;
78
+ const xB = x - direction * (CHEVRON_SIZE + THICKNESS / Math.sqrt(2) / 2);
79
+ const xC = x - direction * (CHEVRON_SIZE - THICKNESS / Math.sqrt(2) / 2);
80
+ const xD = x + direction * THICKNESS * Math.sqrt(2) / 2;
81
+ const yB = y - direction * (CHEVRON_SIZE - THICKNESS / Math.sqrt(2) / 2);
82
+ const yC = y - direction * (CHEVRON_SIZE + THICKNESS / Math.sqrt(2) / 2);
83
+ const yE = y + direction * (CHEVRON_SIZE + THICKNESS / Math.sqrt(2) / 2);
84
+ const yF = y + direction * (CHEVRON_SIZE - THICKNESS / Math.sqrt(2) / 2);
85
+ return `M ${xA} ${y} L ${xB} ${yB} L ${xC} ${yC} L ${xD} ${y} L ${xC} ${yE} L ${xB} ${yF} Z`;
86
+ }
87
+ /**
88
+ * D +---+ E
89
+ * | |
90
+ * | |
91
+ * | |
92
+ * B * | | * G
93
+ * / \ | | / \
94
+ * A * \| |/ * H
95
+ * \ * * /
96
+ * \ C F /
97
+ * \ O /
98
+ * \ * /
99
+ * \ /
100
+ * \ /
101
+ * *
102
+ * (x,y)
103
+ */
104
+ function arrowPath(x, y, direction) {
105
+ const xA = x - direction * (ARROW_SIZE + THICKNESS / Math.sqrt(2) / 2);
106
+ const xB = x - direction * (ARROW_SIZE - THICKNESS / Math.sqrt(2) / 2);
107
+ const xC = x - direction * THICKNESS / 2;
108
+ const xF = x + direction * THICKNESS / 2;
109
+ const xG = x + direction * (ARROW_SIZE - THICKNESS / Math.sqrt(2) / 2);
110
+ const xH = x + direction * (ARROW_SIZE + THICKNESS / Math.sqrt(2) / 2);
111
+ const y0 = y - direction * THICKNESS * Math.sqrt(2) / 2;
112
+ const yA = y0 - direction * (ARROW_SIZE - THICKNESS / Math.sqrt(2) / 2);
113
+ const yB = y0 - direction * (ARROW_SIZE + THICKNESS / Math.sqrt(2) / 2);
114
+ const yC = yB + (xC - xB);
115
+ const yD = y - direction * ARROW_LENGTH;
116
+ return `M ${x} ${y} L ${xA} ${yA} L ${xB} ${yB} L ${xC} ${yC} V ${yD} H ${xF} V ${yC} L ${xG} ${yB} L ${xH} ${yA} Z`;
117
+ }
118
+ /**
119
+ * Return the height/width of the buttons assuming the given square size.
120
+ */
121
+ function computeButtonSize(squareSize) {
122
+ return Math.round((squareSize * 2 + 116) / 7);
123
+ }
124
+ //# sourceMappingURL=NavigationToolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationToolbar.js","sourceRoot":"","sources":["../../../src/navigationboard/NavigationToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;gFAqBgF;AAIhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,yBAAyB,CAAC;AAEjC,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,YAAY,GAAG,EAAE,CAAC;AAcxB;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAiC;IAE7E,MAAM;QACL,MAAM,UAAU,GAAG,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