@scrabble-solver/scrabble-solver 2.11.2 → 2.11.4

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 (88) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +6 -6
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_8dgz12 +1 -1
  5. package/.next/cache/next-server.js.nft.json +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  9. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/.next/next-server.js.nft.json +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/routes-manifest.json +1 -1
  15. package/.next/server/chunks/210.js +109 -0
  16. package/.next/server/chunks/277.js +189 -125
  17. package/.next/server/chunks/44.js +19 -0
  18. package/.next/server/chunks/987.js +91 -0
  19. package/.next/server/middleware-build-manifest.js +1 -1
  20. package/.next/server/pages/404.html +2 -2
  21. package/.next/server/pages/404.js.nft.json +1 -1
  22. package/.next/server/pages/500.html +1 -1
  23. package/.next/server/pages/_app.js +1 -73
  24. package/.next/server/pages/_app.js.nft.json +1 -1
  25. package/.next/server/pages/_document.js.nft.json +1 -1
  26. package/.next/server/pages/_error.js.nft.json +1 -1
  27. package/.next/server/pages/api/dictionary/[locale]/[word].js +3 -3
  28. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  29. package/.next/server/pages/api/dictionary/[locale].js +3 -3
  30. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  31. package/.next/server/pages/api/solve.js +10 -6
  32. package/.next/server/pages/api/solve.js.nft.json +1 -1
  33. package/.next/server/pages/api/verify.js +5 -4
  34. package/.next/server/pages/api/verify.js.nft.json +1 -1
  35. package/.next/server/pages/api/visit.js +3 -3
  36. package/.next/server/pages/api/visit.js.nft.json +1 -1
  37. package/.next/server/pages/index.html +1 -1
  38. package/.next/server/pages/index.js +104 -207
  39. package/.next/server/pages/index.js.nft.json +1 -1
  40. package/.next/server/pages/index.json +1 -1
  41. package/.next/static/{Mdvi3FY0PqkILKLbPlVBU → MvHZRF4XuJ7g8LLLRkf8U}/_buildManifest.js +1 -1
  42. package/.next/static/chunks/pages/_app-66d80a5594aab8dc.js +28 -0
  43. package/.next/static/chunks/pages/index-0858deea02b2a417.js +1 -0
  44. package/.next/static/css/885da289cec275b3.css +1 -0
  45. package/.next/static/css/ea1c8134fe9a143e.css +2 -0
  46. package/.next/trace +53 -54
  47. package/package.json +9 -9
  48. package/src/api/index.ts +1 -0
  49. package/src/api/isCellValid.ts +3 -2
  50. package/src/api/isCharacterValid.ts +13 -0
  51. package/src/components/Button/Button.module.scss +14 -1
  52. package/src/components/Modal/Modal.module.scss +11 -3
  53. package/src/components/NotFound/NotFound.module.scss +13 -4
  54. package/src/components/NotFound/NotFound.tsx +4 -7
  55. package/src/components/Rack/Rack.tsx +3 -1
  56. package/src/components/Tile/Tile.module.scss +23 -18
  57. package/src/components/Tile/Tile.tsx +2 -5
  58. package/src/components/Tile/TilePure.tsx +1 -2
  59. package/src/i18n/constants.ts +65 -0
  60. package/src/i18n/de.json +3 -2
  61. package/src/i18n/en.json +3 -2
  62. package/src/i18n/es.json +3 -2
  63. package/src/i18n/fa.json +2 -1
  64. package/src/i18n/fr.json +3 -2
  65. package/src/i18n/i18n.module.scss +27 -0
  66. package/src/i18n/pl.json +3 -2
  67. package/src/icons/DashCircleFill.svg +1 -0
  68. package/src/icons/EyeFill.svg +5 -0
  69. package/src/icons/index.ts +3 -2
  70. package/src/modals/MenuModal/MenuModal.module.scss +17 -1
  71. package/src/modals/MenuModal/MenuModal.tsx +8 -2
  72. package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +4 -1
  73. package/src/modals/RemainingTilesModal/components/Character/Character.module.scss +8 -0
  74. package/src/modals/ResultsModal/ResultsModal.tsx +35 -11
  75. package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +3 -44
  76. package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +4 -2
  77. package/src/pages/api/solve.ts +3 -2
  78. package/src/styles/mixins.scss +2 -0
  79. package/src/styles/variables.scss +12 -0
  80. package/src/types/index.ts +1 -0
  81. package/.next/server/chunks/417.js +0 -221
  82. package/.next/server/chunks/664.js +0 -621
  83. package/.next/static/chunks/pages/_app-495e6f4ccc278bb2.js +0 -28
  84. package/.next/static/chunks/pages/index-5ecc51900ca29685.js +0 -1
  85. package/.next/static/css/17b0a2db8742105f.css +0 -1
  86. package/.next/static/css/e1ffeb2558330c55.css +0 -2
  87. package/src/modals/SettingsModal/components/LocaleSetting/options.ts +0 -68
  88. /package/.next/static/{Mdvi3FY0PqkILKLbPlVBU → MvHZRF4XuJ7g8LLLRkf8U}/_ssgManifest.js +0 -0
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ exports.id = 210;
3
+ exports.ids = [210];
4
+ exports.modules = {
5
+
6
+ /***/ 31210:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ "Z": () => (/* binding */ api_isBoardValid)
13
+ });
14
+
15
+ // EXTERNAL MODULE: ./src/api/isCharacterValid.ts
16
+ var isCharacterValid = __webpack_require__(38246);
17
+ ;// CONCATENATED MODULE: ./src/api/isCellValid.ts
18
+
19
+ const isCellValid = (cell, config)=>{
20
+ const { isEmpty , tile , x , y } = cell;
21
+ if (x < 0 || x >= config.boardWidth) {
22
+ return false;
23
+ }
24
+ if (y < 0 || y >= config.boardHeight) {
25
+ return false;
26
+ }
27
+ if (isEmpty && tile !== null) {
28
+ return false;
29
+ }
30
+ if (tile !== null && !(0,isCharacterValid/* default */.Z)(tile.character)) {
31
+ return false;
32
+ }
33
+ return true;
34
+ };
35
+ /* harmony default export */ const api_isCellValid = (isCellValid);
36
+
37
+ ;// CONCATENATED MODULE: ./src/api/isRowValid.ts
38
+
39
+ const isRowValid = (row, config)=>{
40
+ if (row.length !== config.boardWidth) {
41
+ return false;
42
+ }
43
+ for (const cell of row){
44
+ if (!api_isCellValid(cell, config)) {
45
+ return false;
46
+ }
47
+ }
48
+ return true;
49
+ };
50
+ /* harmony default export */ const api_isRowValid = (isRowValid);
51
+
52
+ ;// CONCATENATED MODULE: ./src/api/isBoardValid.ts
53
+
54
+ const isBoardValid = (board, config)=>{
55
+ if (board.length !== config.boardHeight) {
56
+ return false;
57
+ }
58
+ for (const row of board){
59
+ if (!api_isRowValid(row, config)) {
60
+ return false;
61
+ }
62
+ }
63
+ return areTwoCharacterTilesValid(board, config);
64
+ };
65
+ const areTwoCharacterTilesValid = (board, config)=>{
66
+ const cells = board.flat().filter((cell)=>cell && cell.tile && config.isTwoCharacterTilePrefix(cell.tile.character));
67
+ for (const cell of cells){
68
+ for (const characters of config.twoCharacterTiles){
69
+ const canCheckDown = cell.y + 1 < board.length;
70
+ const canCheckRight = cell.x + 1 < board[0].length;
71
+ const cellDown = board[cell.y + 1][cell.x];
72
+ const cellRight = board[cell.y][cell.x + 1];
73
+ const collidesDown = canCheckDown && cellDown.tile && cellDown.tile.character === characters[1];
74
+ const collidesRight = canCheckRight && cellRight.tile && cellRight.tile.character === characters[1];
75
+ const collides = collidesDown || collidesRight;
76
+ if (cell.tile && characters.startsWith(cell.tile.character) && collides) {
77
+ return false;
78
+ }
79
+ }
80
+ }
81
+ return true;
82
+ };
83
+ /* harmony default export */ const api_isBoardValid = (isBoardValid);
84
+
85
+
86
+ /***/ }),
87
+
88
+ /***/ 38246:
89
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
90
+
91
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
93
+ /* harmony export */ });
94
+ const TWO_TILE_CHARACTER_LENGTH = 2;
95
+ const MAX_CHARACTER_LENGTH = TWO_TILE_CHARACTER_LENGTH;
96
+ const isCharacterValid = (character)=>{
97
+ /*
98
+ * We could be strict here and check whether config.hasCharacter(character) || character === BLANK
99
+ * but since this case won't really affect/break solving, we don't need to worry about it.
100
+ * It's better to display an empty state than error state in UI, so this is a sanity check only.
101
+ */ return character.length !== 0 && character.length <= MAX_CHARACTER_LENGTH;
102
+ };
103
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isCharacterValid);
104
+
105
+
106
+ /***/ })
107
+
108
+ };
109
+ ;