kokopu-react 3.0.0 → 3.0.2

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 (167) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/lib/chessboard/Chessboard.css +7 -5
  3. package/dist/lib/chessboard/Chessboard.d.ts +22 -0
  4. package/dist/lib/chessboard/Chessboard.js +8 -7
  5. package/dist/lib/chessboard/Chessboard.js.map +1 -1
  6. package/dist/lib/chessboard/ChessboardImpl.d.ts +22 -0
  7. package/dist/lib/chessboard/ChessboardImpl.js +8 -6
  8. package/dist/lib/chessboard/ChessboardImpl.js.map +1 -1
  9. package/dist/lib/chessboard/Draggable.d.ts +22 -0
  10. package/dist/lib/chessboard/Draggable.js +7 -5
  11. package/dist/lib/chessboard/Draggable.js.map +1 -1
  12. package/dist/lib/chessboard/Motion.d.ts +22 -0
  13. package/dist/lib/chessboard/Motion.js +7 -5
  14. package/dist/lib/chessboard/Motion.js.map +1 -1
  15. package/dist/lib/chessboard/colorsets.d.ts +22 -0
  16. package/dist/lib/chessboard/colorsets.js +7 -5
  17. package/dist/lib/chessboard/colorsets.js.map +1 -1
  18. package/dist/lib/chessboard/piecesets.d.ts +22 -0
  19. package/dist/lib/chessboard/piecesets.js +7 -5
  20. package/dist/lib/chessboard/piecesets.js.map +1 -1
  21. package/dist/lib/errorbox/ErrorBox.css +7 -5
  22. package/dist/lib/errorbox/ErrorBox.d.ts +22 -0
  23. package/dist/lib/errorbox/ErrorBox.js +7 -5
  24. package/dist/lib/errorbox/ErrorBox.js.map +1 -1
  25. package/dist/lib/exception.d.ts +22 -0
  26. package/dist/lib/exception.js +7 -5
  27. package/dist/lib/exception.js.map +1 -1
  28. package/dist/lib/i18n.d.ts +22 -0
  29. package/dist/lib/i18n.js +7 -5
  30. package/dist/lib/i18n.js.map +1 -1
  31. package/dist/lib/icons/AnnotationSymbolShape.css +7 -5
  32. package/dist/lib/icons/AnnotationSymbolShape.d.ts +22 -0
  33. package/dist/lib/icons/AnnotationSymbolShape.js +7 -5
  34. package/dist/lib/icons/AnnotationSymbolShape.js.map +1 -1
  35. package/dist/lib/icons/ArrowMarkerIcon.d.ts +22 -0
  36. package/dist/lib/icons/ArrowMarkerIcon.js +8 -7
  37. package/dist/lib/icons/ArrowMarkerIcon.js.map +1 -1
  38. package/dist/lib/icons/ArrowTip.d.ts +22 -0
  39. package/dist/lib/icons/ArrowTip.js +7 -5
  40. package/dist/lib/icons/ArrowTip.js.map +1 -1
  41. package/dist/lib/icons/ChessPieceIcon.d.ts +22 -0
  42. package/dist/lib/icons/ChessPieceIcon.js +7 -5
  43. package/dist/lib/icons/ChessPieceIcon.js.map +1 -1
  44. package/dist/lib/icons/SquareMarkerIcon.d.ts +22 -0
  45. package/dist/lib/icons/SquareMarkerIcon.js +7 -5
  46. package/dist/lib/icons/SquareMarkerIcon.js.map +1 -1
  47. package/dist/lib/icons/TextMarkerIcon.d.ts +22 -0
  48. package/dist/lib/icons/TextMarkerIcon.js +7 -5
  49. package/dist/lib/icons/TextMarkerIcon.js.map +1 -1
  50. package/dist/lib/icons/arrow.css +7 -5
  51. package/dist/lib/index.d.ts +22 -0
  52. package/dist/lib/index.js +7 -5
  53. package/dist/lib/index.js.map +1 -1
  54. package/dist/lib/movetext/Movetext.css +7 -5
  55. package/dist/lib/movetext/Movetext.d.ts +22 -0
  56. package/dist/lib/movetext/Movetext.js +8 -7
  57. package/dist/lib/movetext/Movetext.js.map +1 -1
  58. package/dist/lib/movetext/MovetextImpl.d.ts +22 -0
  59. package/dist/lib/movetext/MovetextImpl.js +7 -5
  60. package/dist/lib/movetext/MovetextImpl.js.map +1 -1
  61. package/dist/lib/movetext/fonts.css +7 -5
  62. package/dist/lib/movetext/htmlFilter.d.ts +22 -0
  63. package/dist/lib/movetext/htmlFilter.js +21 -19
  64. package/dist/lib/movetext/htmlFilter.js.map +1 -1
  65. package/dist/lib/movetext/moveFormatter.d.ts +22 -0
  66. package/dist/lib/movetext/moveFormatter.js +7 -5
  67. package/dist/lib/movetext/moveFormatter.js.map +1 -1
  68. package/dist/lib/sanitization.d.ts +22 -0
  69. package/dist/lib/sanitization.js +7 -5
  70. package/dist/lib/sanitization.js.map +1 -1
  71. package/dist/lib/types.d.ts +22 -0
  72. package/dist/lib/types.js +7 -5
  73. package/dist/lib/types.js.map +1 -1
  74. package/dist/lib/util.d.ts +22 -0
  75. package/dist/lib/util.js +7 -5
  76. package/dist/lib/util.js.map +1 -1
  77. package/doc_src/demo/PageChessboardBase.tsx +7 -5
  78. package/doc_src/demo/PageChessboardInteraction.tsx +32 -22
  79. package/doc_src/demo/PageChessboardMove.tsx +7 -5
  80. package/doc_src/demo/PageChessboardSmallScreens.tsx +8 -6
  81. package/doc_src/demo/PageMovetextBase.tsx +7 -5
  82. package/doc_src/demo/PageMovetextInteraction.tsx +7 -5
  83. package/doc_src/demo/decs.d.ts +7 -5
  84. package/doc_src/demo/demo.css +7 -5
  85. package/doc_src/demo/util.ts +7 -5
  86. package/doc_src/home.md +3 -0
  87. package/doc_src/migrate_to_3.md +5 -5
  88. package/doc_src/theming/LogoRenderer.js +7 -5
  89. package/doc_src/theming/theming.css +7 -5
  90. package/doc_src/webpack_configuration.md +27 -0
  91. package/package.json +26 -25
  92. package/scripts/doc.styleguide.config.js +15 -11
  93. package/scripts/docker-compose.yml +3 -3
  94. package/scripts/test-graphic.webpack.config.js +7 -5
  95. package/scripts/test-headless.webpack.config.js +7 -5
  96. package/src/chessboard/Chessboard.css +7 -5
  97. package/src/chessboard/Chessboard.tsx +7 -5
  98. package/src/chessboard/ChessboardImpl.tsx +7 -5
  99. package/src/chessboard/Draggable.tsx +7 -5
  100. package/src/chessboard/Motion.tsx +7 -5
  101. package/src/chessboard/colorsets.ts +7 -5
  102. package/src/chessboard/piecesets.ts +7 -5
  103. package/src/decs.d.ts +7 -5
  104. package/src/errorbox/ErrorBox.css +7 -5
  105. package/src/errorbox/ErrorBox.tsx +7 -5
  106. package/src/exception.ts +7 -5
  107. package/src/i18n.ts +7 -5
  108. package/src/icons/AnnotationSymbolShape.css +7 -5
  109. package/src/icons/AnnotationSymbolShape.tsx +7 -5
  110. package/src/icons/ArrowMarkerIcon.tsx +7 -5
  111. package/src/icons/ArrowTip.tsx +7 -5
  112. package/src/icons/ChessPieceIcon.tsx +7 -5
  113. package/src/icons/SquareMarkerIcon.tsx +7 -5
  114. package/src/icons/TextMarkerIcon.tsx +7 -5
  115. package/src/icons/arrow.css +7 -5
  116. package/src/index.ts +7 -5
  117. package/src/movetext/Movetext.css +7 -5
  118. package/src/movetext/Movetext.tsx +7 -5
  119. package/src/movetext/MovetextImpl.tsx +7 -5
  120. package/src/movetext/fonts.css +7 -5
  121. package/src/movetext/htmlFilter.tsx +7 -5
  122. package/src/movetext/moveFormatter.tsx +7 -5
  123. package/src/sanitization.ts +7 -5
  124. package/src/types.ts +7 -5
  125. package/src/util.ts +7 -5
  126. package/test/01_types.js +7 -5
  127. package/test/02_chessboard_util.js +7 -5
  128. package/test/03_error_box_graphic.js +7 -5
  129. package/test/04_icons_graphic.js +7 -5
  130. package/test/05_chessboard_graphic.js +7 -5
  131. package/test/06_chessboard_animation.js +7 -5
  132. package/test/07_chessboard_interaction.js +7 -5
  133. package/test/08_chessboard_play_moves.js +7 -5
  134. package/test/09_chessboard_small_screens.js +7 -5
  135. package/test/10_movetext_graphic.js +7 -5
  136. package/test/11_movetext_interaction.js +7 -5
  137. package/test/common/graphic.js +7 -5
  138. package/test/graphic_test_app/03_error_box_graphic/base.tsx +7 -5
  139. package/test/graphic_test_app/03_error_box_graphic/localization.tsx +7 -5
  140. package/test/graphic_test_app/04_icons_graphic/chess_piece.tsx +7 -5
  141. package/test/graphic_test_app/04_icons_graphic/marker.tsx +7 -5
  142. package/test/graphic_test_app/05_chessboard_graphic/annotations.tsx +7 -5
  143. package/test/graphic_test_app/05_chessboard_graphic/base.tsx +7 -5
  144. package/test/graphic_test_app/05_chessboard_graphic/chess_variants.tsx +7 -5
  145. package/test/graphic_test_app/05_chessboard_graphic/flipped.tsx +7 -5
  146. package/test/graphic_test_app/05_chessboard_graphic/move.tsx +7 -5
  147. package/test/graphic_test_app/05_chessboard_graphic/theme.tsx +7 -5
  148. package/test/graphic_test_app/06_chessboard_animation/base_1.tsx +7 -5
  149. package/test/graphic_test_app/06_chessboard_animation/base_2.tsx +7 -5
  150. package/test/graphic_test_app/06_chessboard_animation/base_3.tsx +7 -5
  151. package/test/graphic_test_app/06_chessboard_animation/on_redraw.tsx +7 -5
  152. package/test/graphic_test_app/07_chessboard_interaction/click_squares.tsx +7 -5
  153. package/test/graphic_test_app/07_chessboard_interaction/edit_arrows.tsx +7 -5
  154. package/test/graphic_test_app/07_chessboard_interaction/error.tsx +7 -5
  155. package/test/graphic_test_app/07_chessboard_interaction/move_pieces.tsx +7 -5
  156. package/test/graphic_test_app/08_chessboard_play_moves/base.tsx +7 -5
  157. package/test/graphic_test_app/08_chessboard_play_moves/promotions.tsx +7 -5
  158. package/test/graphic_test_app/09_chessboard_small_screens/base.tsx +7 -5
  159. package/test/graphic_test_app/10_movetext_graphic/base.tsx +7 -5
  160. package/test/graphic_test_app/10_movetext_graphic/error.tsx +7 -5
  161. package/test/graphic_test_app/10_movetext_graphic/html.tsx +7 -5
  162. package/test/graphic_test_app/10_movetext_graphic/options.tsx +7 -5
  163. package/test/graphic_test_app/11_movetext_interaction/error.tsx +7 -5
  164. package/test/graphic_test_app/11_movetext_interaction/select_moves.tsx +7 -5
  165. package/test/graphic_test_app/common/decs.d.ts +7 -5
  166. package/test/graphic_test_app/common/test_app.css +7 -5
  167. package/test/graphic_test_app/common/test_app.tsx +7 -5
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1 +1 @@
1
- {"version":3,"file":"sanitization.js","sourceRoot":"","sources":["../../src/sanitization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;gFAmBgF;AAMhF,MAAM,UAAU,cAAc,CAAC,KAAa;IAC3C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,KAAc;IAC7C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAGD,MAAM,UAAU,qBAAqB,CAAI,KAA6B,EAAE,gBAAuC;IAC9G,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;QAC1C,OAAO,EAAE,CAAC;KACV;SACI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACnC,MAAM,gBAAgB,EAAE,CAAC;KACzB;SACI;QACJ,OAAO,KAAK,CAAC;KACb;AACF,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,gBAAuC;IACrF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACzD,MAAM,gBAAgB,EAAE,CAAC;KACzB;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,KA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AE,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAGD,MAAM,UAAU,sBAAsB,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,gBAAuC;IACtH,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/E,CAAC;AAGD,MAAM,UAAU,gBAAgB,CAAI,KAAoB,EAAE,oBAAmC;IAC5F,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;AACxF,CAAC"}
@@ -1,3 +1,25 @@
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
+ * -------------------------------------------------------------------------- */
1
23
  import { ColoredPiece, Square, SquareCouple } from 'kokopu';
2
24
  /**
3
25
  * Minimum square size in a {@link Chessboard} component.
package/dist/lib/types.js CHANGED
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;gFAmBgF;AAGhF,OAAO,EAAsC,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEtG,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAWlC;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAiB;IACrD,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,CAAC;AAC3E,CAAC;AA8FD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACpD,IAAI,OAAO,OAAO,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;YACvF,SAAS,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC;AAGD,SAAS,YAAY,CAAsB,OAAe,EAAE,WAAgE;IAC3H,MAAM,MAAM,GAA0B,EAAE,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC3E,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;QACnC,CAAC;IACF,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -1,2 +1,24 @@
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
+ * -------------------------------------------------------------------------- */
1
23
  export declare function generateRandomId(): string;
2
24
  export declare function fillPlaceholder(message: string, ...placeholderValues: unknown[]): string;
package/dist/lib/util.js CHANGED
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;gFAmBgF;AAGhF,MAAM,UAAU,gBAAgB;IAC/B,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACvC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACjC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,GAAG,iBAA4B;IAC/E,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QACzD,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7C,OAAO,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1G,CAAC,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;gFAqBgF;AAGhF,MAAM,UAAU,gBAAgB;IAC/B,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,GAAG,iBAA4B;IAC/E,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QACzD,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7C,OAAO,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1G,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -111,25 +113,33 @@ export default class Page extends React.Component<object, PageState> {
111
113
  <Typography gutterBottom>Interaction mode</Typography>
112
114
  <RadioGroup value={this.state.interactionMode} onChange={evt => this.setState({ interactionMode: evt.target.value as PageState['interactionMode'] })}>
113
115
  <FormControlLabel value="none" control={<Radio color="primary" />} label="None" />
114
- <Stack direction="row" spacing={2} alignItems="center">
115
- <FormControlLabel value="addRemovePieces" control={<Radio color="primary" />} label="Add/remove pieces" />
116
- {this.renderPieceSelector()}
117
- </Stack>
116
+ <FormControlLabel value="addRemovePieces" control={<Radio color="primary" />} label={
117
+ <Stack direction="row" spacing={2} alignItems="center">
118
+ <span>Add/remove pieces</span>
119
+ {this.renderPieceSelector()}
120
+ </Stack>
121
+ } />
118
122
  <FormControlLabel value="movePieces" control={<Radio color="primary" />} label="Move pieces" />
119
123
  <FormControlLabel value="playMoves" control={<Radio color="primary" />} label="Move pieces (obeying chess rules)" />
120
- <Stack direction="row" spacing={2} alignItems="center">
121
- <FormControlLabel value="editSquareMarkers" control={<Radio color="primary" />} label="Edit square annotations" />
122
- {this.renderMarkerColorSelector('editSquareMarkers', this.state.squareMarkerColor, newColor => this.handleSquareMarkerColorChanged(newColor))}
123
- </Stack>
124
- <Stack direction="row" spacing={2} alignItems="center">
125
- <FormControlLabel value="editTextMarkers" control={<Radio color="primary" />} label="Edit text annotations" />
126
- {this.renderMarkerColorSelector('editTextMarkers', this.state.textMarkerColor, newColor => this.handleTextMarkerColorChanged(newColor))}
127
- {this.renderTextMarkerSymbolSelector()}
128
- </Stack>
129
- <Stack direction="row" spacing={2} alignItems="center">
130
- <FormControlLabel value="editArrowMarkers" control={<Radio color="primary" />} label="Edit arrow annotations" />
131
- {this.renderMarkerColorSelector('editArrowMarkers', this.state.arrowMarkerColor, newColor => this.handleArrowMarkerColorChanged(newColor))}
132
- </Stack>
124
+ <FormControlLabel value="editSquareMarkers" control={<Radio color="primary" />} label={
125
+ <Stack direction="row" spacing={2} alignItems="center">
126
+ <span>Edit square annotations</span>
127
+ {this.renderMarkerColorSelector('editSquareMarkers', this.state.squareMarkerColor, newColor => this.handleSquareMarkerColorChanged(newColor))}
128
+ </Stack>
129
+ } />
130
+ <FormControlLabel value="editTextMarkers" control={<Radio color="primary" />} label={
131
+ <Stack direction="row" spacing={2} alignItems="center">
132
+ <span>Edit text annotations</span>
133
+ {this.renderMarkerColorSelector('editTextMarkers', this.state.textMarkerColor, newColor => this.handleTextMarkerColorChanged(newColor))}
134
+ {this.renderTextMarkerSymbolSelector()}
135
+ </Stack>
136
+ } />
137
+ <FormControlLabel value="editArrowMarkers" control={<Radio color="primary" />} label={
138
+ <Stack direction="row" spacing={2} alignItems="center">
139
+ <span>Edit arrow annotations</span>
140
+ {this.renderMarkerColorSelector('editArrowMarkers', this.state.arrowMarkerColor, newColor => this.handleArrowMarkerColorChanged(newColor))}
141
+ </Stack>
142
+ } />
133
143
  </RadioGroup>
134
144
  </Box>
135
145
  </>);
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -120,7 +122,7 @@ export default class Page extends React.Component<object, PageState> {
120
122
  return (
121
123
  <pre className="kokopu-demoCode">
122
124
  {
123
- 'let limits = [\n' +
125
+ 'const limits = [\n' +
124
126
  limits.join('') +
125
127
  '];\n' +
126
128
  buildComponentDemoCode('Chessboard', attributes)
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
package/doc_src/home.md CHANGED
@@ -14,6 +14,9 @@ Installation
14
14
  npm install kokopu-react
15
15
  ```
16
16
 
17
+ If you use [Webpack](https://webpack.js.org/), please look at [webpack configuration](#/Webpack%20configuration)
18
+ to get more information on how to configure it to handle Kokopu-React propertly.
19
+
17
20
 
18
21
 
19
22
  Main components
@@ -18,9 +18,9 @@ const coordinateVisible = true;
18
18
  const smallScreenLimits = [ /* whatever */ ];
19
19
 
20
20
  const { width, height } = Chessboard.size({
21
- squareSize: squareSize,
22
- coordinateVisible: coordinateVisible,
23
- smallScreenLimits: smallScreenLimits,
21
+ squareSize: squareSize,
22
+ coordinateVisible: coordinateVisible,
23
+ smallScreenLimits: smallScreenLimits,
24
24
  });
25
25
 
26
26
  // Used to be, before 3.0.0:
@@ -42,8 +42,8 @@ const coordinateVisible = true;
42
42
  const smallScreenLimits = [ /* whatever */ ];
43
43
 
44
44
  const squareSize = Chessboard.adaptSquareSize(width, height, {
45
- coordinateVisible: coordinateVisible,
46
- smallScreenLimits: smallScreenLimits,
45
+ coordinateVisible: coordinateVisible,
46
+ smallScreenLimits: smallScreenLimits,
47
47
  });
48
48
 
49
49
  // Used to be, before 3.0.0:
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -1,14 +1,16 @@
1
- /* -------------------------------------------------------------------------- *
1
+ /*!
2
+ * -------------------------------------------------------------------------- *
2
3
  * *
3
- * This file is part of Kokopu-React, a JavaScript chess library. *
4
- * Copyright (C) 2021-2023 Yoann Le Montagner <yo35 -at- melix.net> *
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> *
5
7
  * *
6
- * This program is free software: you can redistribute it and/or *
8
+ * Kokopu-React is free software: you can redistribute it and/or *
7
9
  * modify it under the terms of the GNU Lesser General Public License *
8
10
  * as published by the Free Software Foundation, either version 3 of *
9
11
  * the License, or (at your option) any later version. *
10
12
  * *
11
- * This program is distributed in the hope that it will be useful, *
13
+ * Kokopu-React is distributed in the hope that it will be useful, *
12
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
16
  * GNU Lesser General Public License for more details. *
@@ -0,0 +1,27 @@
1
+ Kokopu-React is not a "pure" JavaScript/TypeScript library, in that it is shipped with other type of files:
2
+ - `*.css` files (stylesheets),
3
+ - `*.png` files (images),
4
+ - `*.woff` and `*.woff2` files (fonts).
5
+
6
+ If you are using a bundler such as [Webpack](https://webpack.js.org/) to package an application that depends on Kokopu-React,
7
+ it must be configured so that these files are handled properly. An example of Webpack loading rules suitable for Kokopu-React is provided below:
8
+
9
+ ```plain
10
+ module.exports = {
11
+ // ...
12
+ module: {
13
+ rules: [
14
+ {
15
+ test: /\.css$/i,
16
+ use: [ 'style-loader', 'css-loader' ],
17
+ // ... or any other configuration that loads the matching files as global CSS.
18
+ },
19
+ {
20
+ test: /\.(png|woff|woff2)$/i,
21
+ type: 'asset/resource',
22
+ // ... or any other configuration that loads the matching files as resources.
23
+ },
24
+ ],
25
+ },
26
+ };
27
+ ```