scrabble-solver 2.18.1 → 2.18.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 (342) hide show
  1. package/.nx/workspace-data/d/server-process.json +2 -2
  2. package/.nx/workspace-data/file-map.json +1717 -1473
  3. package/.nx/workspace-data/lockfile-dependencies.hash +1 -1
  4. package/.nx/workspace-data/lockfile-nodes.hash +1 -1
  5. package/.nx/workspace-data/nx_files.nxt +0 -0
  6. package/.nx/workspace-data/parsed-lock-file.dependencies.json +184 -209
  7. package/.nx/workspace-data/parsed-lock-file.nodes.json +374 -419
  8. package/.nx/workspace-data/project-graph.json +608 -652
  9. package/.nx/workspace-data/source-maps.json +64 -0
  10. package/CLAUDE.md +12 -10
  11. package/README.md +2 -2
  12. package/bun.lock +115 -130
  13. package/e2e/bugs/398-digraphs-in-created-words.spec.ts +2 -2
  14. package/e2e/bugs/445-tile-text-selection.spec.ts +38 -0
  15. package/e2e/bugs/451-results-list-gap-hover.spec.ts +35 -0
  16. package/e2e/bugs/452-stale-translations-cache.spec.ts +32 -0
  17. package/e2e/features/427-highlight-created-words.spec.ts +86 -0
  18. package/e2e/features/430-highlight-unreachable-cells-results.spec.ts +75 -0
  19. package/e2e/features/91-hover-remaining-tile-highlights.spec.ts +22 -0
  20. package/e2e/features/result-candidate-picker.spec.ts +21 -0
  21. package/e2e/features/results-interactions.spec.ts +170 -0
  22. package/e2e/features/words-dictionary-search.spec.ts +36 -0
  23. package/e2e/features/words-empty-state.spec.ts +42 -0
  24. package/e2e/features/words-interactions.spec.ts +179 -0
  25. package/e2e/features/words-preview.spec.ts +140 -0
  26. package/e2e/features/words-table-filtering.spec.ts +22 -0
  27. package/e2e/features/words-table-sorting.spec.ts +33 -0
  28. package/e2e/lib/actions.ts +76 -6
  29. package/e2e/lib/selectors.ts +40 -3
  30. package/lerna.json +1 -1
  31. package/package.json +8 -9
  32. package/packages/configs/package.json +3 -3
  33. package/packages/constants/package.json +1 -1
  34. package/packages/dictionaries/package.json +4 -4
  35. package/packages/logger/package.json +1 -1
  36. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  37. package/packages/scrabble-solver/.next/build-manifest.json +14 -14
  38. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -1
  39. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  40. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  41. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  42. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  43. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  44. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  45. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  46. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  47. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  48. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  49. package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
  50. package/packages/scrabble-solver/.next/dynamic-css-manifest.json +2 -2
  51. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  52. package/packages/scrabble-solver/.next/react-loadable-manifest.json +37 -37
  53. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  54. package/packages/scrabble-solver/.next/server/chunks/309.js +1 -1
  55. package/packages/scrabble-solver/.next/server/chunks/344.js +1 -1
  56. package/packages/scrabble-solver/.next/server/chunks/371.js +1 -1
  57. package/packages/scrabble-solver/.next/server/chunks/392.js +1 -1
  58. package/packages/scrabble-solver/.next/server/chunks/465.js +1 -1
  59. package/packages/scrabble-solver/.next/server/chunks/546.js +1 -1
  60. package/packages/scrabble-solver/.next/server/chunks/641.js +1 -1
  61. package/packages/scrabble-solver/.next/server/chunks/67.js +1 -0
  62. package/packages/scrabble-solver/.next/server/chunks/712.js +1 -1
  63. package/packages/scrabble-solver/.next/server/chunks/846.js +1 -1
  64. package/packages/scrabble-solver/.next/server/chunks/886.js +1 -1
  65. package/packages/scrabble-solver/.next/server/chunks/942.js +1 -0
  66. package/packages/scrabble-solver/.next/server/chunks/953.js +1 -1
  67. package/packages/scrabble-solver/.next/server/chunks/961.js +1 -1
  68. package/packages/scrabble-solver/.next/server/dynamic-css-manifest.js +1 -1
  69. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  70. package/packages/scrabble-solver/.next/server/middleware-react-loadable-manifest.js +1 -1
  71. package/packages/scrabble-solver/.next/server/pages/404.html +2 -2
  72. package/packages/scrabble-solver/.next/server/pages/500.html +2 -2
  73. package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
  74. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  75. package/packages/scrabble-solver/.next/server/pages/_document.js +2 -2
  76. package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
  77. package/packages/scrabble-solver/.next/server/pages/_error.js +1 -1
  78. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  79. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +1 -1
  80. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  81. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
  82. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  83. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  84. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  85. package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
  86. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  87. package/packages/scrabble-solver/.next/server/pages/index.html +2 -2
  88. package/packages/scrabble-solver/.next/server/pages/index.js +4 -4
  89. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  90. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  91. package/packages/scrabble-solver/.next/server/pages/not-found.html +2 -2
  92. package/packages/scrabble-solver/.next/server/pages/not-found.js.nft.json +1 -1
  93. package/packages/scrabble-solver/.next/server/pages-manifest.json +1 -1
  94. package/packages/scrabble-solver/.next/static/chunks/100.305bdf9c75b1758f.js +1 -0
  95. package/packages/scrabble-solver/.next/static/chunks/256.66ff9fb6d7db9ec7.js +1 -0
  96. package/packages/scrabble-solver/.next/static/chunks/{307.67f52f13e3d60d4e.js → 307.89e6100f58443679.js} +1 -1
  97. package/packages/scrabble-solver/.next/static/chunks/{363.01eed3233f92b6a4.js → 363.cec65b1f9668a75e.js} +1 -1
  98. package/packages/scrabble-solver/.next/static/chunks/{422.1559ae6756912ca5.js → 422.3e55b4c94e328701.js} +1 -1
  99. package/packages/scrabble-solver/.next/static/chunks/{663.d2c9ca36b26695b8.js → 663.bd2c45413fbca518.js} +1 -1
  100. package/packages/scrabble-solver/.next/static/chunks/693.677c88e0eb1340b5.js +1 -0
  101. package/packages/scrabble-solver/.next/static/chunks/{820.97b82f751ca49579.js → 820.823e9e885ebb66af.js} +1 -1
  102. package/packages/scrabble-solver/.next/static/chunks/827.c81b92b383a748c9.js +1 -0
  103. package/packages/scrabble-solver/.next/static/chunks/{865.a9b563a45848a83c.js → 865.59baba8296c9b116.js} +1 -1
  104. package/packages/scrabble-solver/.next/static/chunks/912.077603e4f0bc6cca.js +1 -0
  105. package/packages/scrabble-solver/.next/static/chunks/{939.19b33a3d3c351d73.js → 939.2ad86b50405c7897.js} +1 -1
  106. package/packages/scrabble-solver/.next/static/chunks/980.7ce17464fc56648a.js +1 -0
  107. package/packages/scrabble-solver/.next/static/chunks/{main-b92e08f3fc96dd8d.js → main-7e52da35a4beea0b.js} +1 -1
  108. package/packages/scrabble-solver/.next/static/chunks/pages/_app-f9ec81278ffa7b1a.js +1 -0
  109. package/packages/scrabble-solver/.next/static/chunks/pages/index-b5bf018100015277.js +1 -0
  110. package/packages/scrabble-solver/.next/static/chunks/webpack-9f5c9d275348829b.js +1 -0
  111. package/packages/scrabble-solver/.next/static/css/65bcc9440e067113.css +1 -0
  112. package/packages/scrabble-solver/.next/static/css/{4dbcacc1122ac6b9.css → 92f85ce358a0a468.css} +1 -1
  113. package/packages/scrabble-solver/.next/static/css/a691348b788f8bc0.css +1 -0
  114. package/packages/scrabble-solver/.next/static/css/cd4d7f2458487399.css +1 -0
  115. package/packages/scrabble-solver/.next/static/{5KOWzYqfY1Z2rjrzptr8D → nvGZh1gPuX98L07YmxlYD}/_buildManifest.js +1 -1
  116. package/packages/scrabble-solver/.next/trace +21 -21
  117. package/packages/scrabble-solver/.next/trace-build +1 -1
  118. package/packages/scrabble-solver/AGENTS.md +9 -0
  119. package/packages/scrabble-solver/CLAUDE.md +1 -0
  120. package/packages/scrabble-solver/package.json +13 -11
  121. package/packages/scrabble-solver/public/service-worker.js +1 -1
  122. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -1
  123. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +26 -20
  124. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +4 -4
  125. package/packages/scrabble-solver/src/components/Board/lib.test.ts +106 -0
  126. package/packages/scrabble-solver/src/components/Board/lib.ts +34 -3
  127. package/packages/scrabble-solver/src/components/Board/selectors.ts +17 -5
  128. package/packages/scrabble-solver/src/components/Button/Button.module.scss +1 -1
  129. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +0 -4
  130. package/packages/scrabble-solver/src/components/Results/Header.tsx +30 -5
  131. package/packages/scrabble-solver/src/components/Results/Result.tsx +45 -55
  132. package/packages/scrabble-solver/src/components/Results/Results.module.scss +0 -126
  133. package/packages/scrabble-solver/src/components/Results/Results.module.scss.d.ts +0 -10
  134. package/packages/scrabble-solver/src/components/Results/Results.tsx +25 -5
  135. package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +4 -4
  136. package/packages/scrabble-solver/src/components/Solver/Solver.tsx +5 -3
  137. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +5 -1
  138. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss.d.ts +1 -0
  139. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -2
  140. package/packages/scrabble-solver/src/components/Table/Cell.tsx +42 -0
  141. package/packages/scrabble-solver/src/components/Table/Header.tsx +11 -0
  142. package/packages/scrabble-solver/src/components/{Results → Table}/HeaderButton.tsx +22 -14
  143. package/packages/scrabble-solver/src/components/Table/Row.tsx +59 -0
  144. package/packages/scrabble-solver/src/components/{ResultsInput/ResultsInput.tsx → Table/Search.tsx} +9 -11
  145. package/packages/scrabble-solver/src/components/Table/Table.module.scss +147 -0
  146. package/packages/scrabble-solver/src/components/Table/Table.module.scss.d.ts +19 -0
  147. package/packages/scrabble-solver/src/components/Table/index.ts +5 -0
  148. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +2 -1
  149. package/packages/scrabble-solver/src/hooks/useColumns.ts +7 -5
  150. package/packages/scrabble-solver/src/hooks/useIsCompactLayout.ts +14 -0
  151. package/packages/scrabble-solver/src/i18n/languages/english.json +6 -1
  152. package/packages/scrabble-solver/src/i18n/languages/french.json +6 -1
  153. package/packages/scrabble-solver/src/i18n/languages/german.json +6 -1
  154. package/packages/scrabble-solver/src/i18n/languages/persian.json +6 -1
  155. package/packages/scrabble-solver/src/i18n/languages/polish.json +6 -1
  156. package/packages/scrabble-solver/src/i18n/languages/romanian.json +6 -1
  157. package/packages/scrabble-solver/src/i18n/languages/spanish.json +6 -1
  158. package/packages/scrabble-solver/src/i18n/languages/turkish.json +6 -1
  159. package/packages/scrabble-solver/src/icons/QuestionSquare.svg +5 -0
  160. package/packages/scrabble-solver/src/lib/createCoordinatesComparator.ts +23 -0
  161. package/packages/scrabble-solver/src/lib/createKeyComparator.ts +1 -4
  162. package/packages/scrabble-solver/src/lib/createSortComparator.ts +22 -0
  163. package/packages/scrabble-solver/src/lib/getCoordinates.test.ts +21 -0
  164. package/packages/scrabble-solver/src/lib/getCoordinates.ts +16 -0
  165. package/packages/scrabble-solver/src/lib/getNextSort.ts +12 -0
  166. package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +3 -1
  167. package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +8 -9
  168. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +14 -10
  169. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +16 -27
  170. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss.d.ts +3 -6
  171. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +56 -42
  172. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordRow.tsx +92 -0
  173. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss +69 -0
  174. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss.d.ts +16 -0
  175. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.tsx +137 -0
  176. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/index.ts +1 -0
  177. package/packages/scrabble-solver/src/modals/WordsModal/components/index.ts +1 -0
  178. package/packages/scrabble-solver/src/pages/api/verify.ts +7 -6
  179. package/packages/scrabble-solver/src/pages/index.tsx +28 -3
  180. package/packages/scrabble-solver/src/parameters/index.ts +2 -0
  181. package/packages/scrabble-solver/src/sdk/verify.ts +3 -2
  182. package/packages/scrabble-solver/src/solver-worker/client.test.ts +10 -3
  183. package/packages/scrabble-solver/src/solver-worker/index.worker.ts +7 -7
  184. package/packages/scrabble-solver/src/solver-worker/messages.ts +3 -3
  185. package/packages/scrabble-solver/src/state/hoveredWord/index.ts +4 -0
  186. package/packages/scrabble-solver/src/state/hoveredWord/initialState.ts +5 -0
  187. package/packages/scrabble-solver/src/state/hoveredWord/selectors.ts +5 -0
  188. package/packages/scrabble-solver/src/state/hoveredWord/slice.ts +18 -0
  189. package/packages/scrabble-solver/src/state/hoveredWord/types.ts +5 -0
  190. package/packages/scrabble-solver/src/state/index.ts +1 -0
  191. package/packages/scrabble-solver/src/state/localStorage.ts +13 -2
  192. package/packages/scrabble-solver/src/state/results/lib.ts +9 -26
  193. package/packages/scrabble-solver/src/state/results/selectors.ts +9 -1
  194. package/packages/scrabble-solver/src/state/results/slice.ts +4 -16
  195. package/packages/scrabble-solver/src/state/sagas.ts +26 -1
  196. package/packages/scrabble-solver/src/state/selectors.ts +18 -1
  197. package/packages/scrabble-solver/src/state/store.ts +2 -0
  198. package/packages/scrabble-solver/src/state/types.ts +2 -0
  199. package/packages/scrabble-solver/src/state/verify/initialState.ts +7 -0
  200. package/packages/scrabble-solver/src/state/verify/lib.test.ts +55 -0
  201. package/packages/scrabble-solver/src/state/verify/lib.ts +49 -0
  202. package/packages/scrabble-solver/src/state/verify/selectors.ts +37 -0
  203. package/packages/scrabble-solver/src/state/verify/slice.ts +13 -2
  204. package/packages/scrabble-solver/src/state/verify/types.ts +6 -2
  205. package/packages/scrabble-solver/src/styles/_tokens.scss +2 -0
  206. package/packages/scrabble-solver/src/styles/mixins.scss +5 -0
  207. package/packages/scrabble-solver/src/styles/variables.module.scss +1 -0
  208. package/packages/scrabble-solver/src/styles/variables.module.scss.d.ts +1 -0
  209. package/packages/scrabble-solver/src/styles/variables.scss +1 -1
  210. package/packages/scrabble-solver/src/types/index.ts +24 -11
  211. package/packages/scrabble-solver/tsconfig.tsbuildinfo +1 -1
  212. package/packages/solver/package.json +5 -5
  213. package/packages/types/build/Bingo.d.ts +0 -3
  214. package/packages/types/build/Bingo.js +0 -14
  215. package/packages/types/build/Board.d.ts +3 -1
  216. package/packages/types/build/Board.js +5 -40
  217. package/packages/types/build/BoardJson.d.ts +0 -1
  218. package/packages/types/build/BoardJson.js +0 -19
  219. package/packages/types/build/BoardWord.d.ts +7 -0
  220. package/packages/types/build/BoardWord.js +2 -0
  221. package/packages/types/build/CellJson.d.ts +0 -1
  222. package/packages/types/build/CellJson.js +0 -11
  223. package/packages/types/build/Game.d.ts +0 -1
  224. package/packages/types/build/Game.js +1 -4
  225. package/packages/types/build/Locale.d.ts +0 -1
  226. package/packages/types/build/Locale.js +1 -4
  227. package/packages/types/build/Result.js +3 -3
  228. package/packages/types/build/TileJson.d.ts +0 -1
  229. package/packages/types/build/TileJson.js +0 -6
  230. package/packages/types/build/index.d.ts +9 -8
  231. package/packages/types/build/index.js +14 -17
  232. package/packages/types/build/lib/getBoardWords.d.ts +3 -0
  233. package/packages/types/build/lib/getBoardWords.js +10 -0
  234. package/packages/types/build/lib/getCells.d.ts +4 -0
  235. package/packages/types/build/lib/getCells.js +27 -0
  236. package/packages/types/build/lib/getCollidingWords.d.ts +3 -0
  237. package/packages/types/build/lib/getCollidingWords.js +19 -0
  238. package/packages/types/build/lib/getCollision.d.ts +3 -0
  239. package/packages/types/build/lib/getCollision.js +31 -0
  240. package/packages/types/build/lib/getCollisions.d.ts +3 -0
  241. package/packages/types/build/lib/getCollisions.js +17 -0
  242. package/packages/types/build/lib/getPlacedCell.d.ts +3 -0
  243. package/packages/types/build/lib/getPlacedCell.js +10 -0
  244. package/packages/types/build/lib/getWordThrough.d.ts +4 -0
  245. package/packages/types/build/lib/getWordThrough.js +23 -0
  246. package/packages/types/build/lib/getWordsInRows.d.ts +8 -0
  247. package/packages/types/build/lib/getWordsInRows.js +29 -0
  248. package/packages/types/build/lib/index.d.ts +5 -0
  249. package/packages/types/build/lib/index.js +21 -0
  250. package/packages/types/build/lib/isSameBoardWord.d.ts +2 -0
  251. package/packages/types/build/lib/isSameBoardWord.js +6 -0
  252. package/packages/types/build/lib/toBoardWord.d.ts +4 -0
  253. package/packages/types/build/lib/toBoardWord.js +11 -0
  254. package/packages/types/build/lib/transpose.d.ts +1 -0
  255. package/packages/types/build/lib/transpose.js +16 -0
  256. package/packages/types/build/type-guards/index.d.ts +10 -0
  257. package/packages/types/build/type-guards/index.js +23 -0
  258. package/packages/types/build/type-guards/isBingo.d.ts +2 -0
  259. package/packages/types/build/type-guards/isBingo.js +9 -0
  260. package/packages/types/build/type-guards/isBoardJson.d.ts +2 -0
  261. package/packages/types/build/type-guards/isBoardJson.js +21 -0
  262. package/packages/types/build/type-guards/isCellJson.d.ts +2 -0
  263. package/packages/types/build/type-guards/isCellJson.js +13 -0
  264. package/packages/types/build/type-guards/isGame.d.ts +2 -0
  265. package/packages/types/build/type-guards/isGame.js +7 -0
  266. package/packages/types/build/type-guards/isLocale.d.ts +2 -0
  267. package/packages/types/build/type-guards/isLocale.js +7 -0
  268. package/packages/types/build/type-guards/isMultiplierBingo.d.ts +2 -0
  269. package/packages/types/build/type-guards/isMultiplierBingo.js +8 -0
  270. package/packages/types/build/type-guards/isScoreBingo.d.ts +2 -0
  271. package/packages/types/build/type-guards/isScoreBingo.js +8 -0
  272. package/packages/types/build/type-guards/isTileJson.d.ts +2 -0
  273. package/packages/types/build/type-guards/isTileJson.js +8 -0
  274. package/packages/types/package.json +2 -2
  275. package/packages/types/src/Bingo.ts +0 -14
  276. package/packages/types/src/Board.test.ts +85 -0
  277. package/packages/types/src/Board.ts +8 -49
  278. package/packages/types/src/BoardJson.ts +1 -21
  279. package/packages/types/src/BoardWord.ts +8 -0
  280. package/packages/types/src/CellJson.ts +1 -12
  281. package/packages/types/src/Game.ts +0 -4
  282. package/packages/types/src/Locale.ts +0 -4
  283. package/packages/types/src/Result.ts +3 -3
  284. package/packages/types/src/TileJson.ts +0 -6
  285. package/packages/types/src/index.ts +20 -8
  286. package/packages/types/src/lib/getBoardWords.ts +11 -0
  287. package/packages/types/src/lib/getCells.test.ts +127 -0
  288. package/packages/types/src/lib/getCells.ts +31 -0
  289. package/packages/types/src/lib/getCollidingWords.ts +25 -0
  290. package/packages/types/src/lib/getCollision.ts +38 -0
  291. package/packages/types/src/lib/getCollisions.test.ts +82 -0
  292. package/packages/types/src/lib/getCollisions.ts +22 -0
  293. package/packages/types/src/lib/getPlacedCell.ts +9 -0
  294. package/packages/types/src/lib/getWordThrough.ts +30 -0
  295. package/packages/types/src/lib/getWordsInRows.ts +34 -0
  296. package/packages/types/src/lib/index.ts +5 -0
  297. package/packages/types/src/lib/isSameBoardWord.ts +5 -0
  298. package/packages/types/src/lib/toBoardWord.ts +12 -0
  299. package/packages/types/src/lib/transpose.ts +15 -0
  300. package/packages/types/src/type-guards/index.ts +10 -0
  301. package/packages/types/src/type-guards/isBingo.ts +8 -0
  302. package/packages/types/src/type-guards/isBoardJson.test.ts +33 -0
  303. package/packages/types/src/type-guards/isBoardJson.ts +23 -0
  304. package/packages/types/src/type-guards/isCellJson.ts +14 -0
  305. package/packages/types/src/type-guards/isGame.ts +5 -0
  306. package/packages/types/src/type-guards/isLocale.ts +5 -0
  307. package/packages/types/src/type-guards/isMultiplierBingo.ts +7 -0
  308. package/packages/types/src/type-guards/isScoreBingo.ts +7 -0
  309. package/packages/types/src/type-guards/isTileJson.ts +7 -0
  310. package/packages/word-definitions/package.json +2 -2
  311. package/packages/word-lists/package.json +2 -2
  312. package/playwright-report/index.html +1 -1
  313. package/screencast.gif +0 -0
  314. package/packages/scrabble-solver/.next/server/chunks/316.js +0 -1
  315. package/packages/scrabble-solver/.next/server/chunks/916.js +0 -1
  316. package/packages/scrabble-solver/.next/static/chunks/106.e414e88694add27f.js +0 -1
  317. package/packages/scrabble-solver/.next/static/chunks/127.125d896a19061d71.js +0 -1
  318. package/packages/scrabble-solver/.next/static/chunks/18.8b91e137d239e15c.js +0 -1
  319. package/packages/scrabble-solver/.next/static/chunks/583.7a46807be14c377e.js +0 -1
  320. package/packages/scrabble-solver/.next/static/chunks/711.ba7b8f900dfd40d0.js +0 -1
  321. package/packages/scrabble-solver/.next/static/chunks/912.ff8037ba9d4db5c8.js +0 -1
  322. package/packages/scrabble-solver/.next/static/chunks/pages/_app-2e607dcd4135f340.js +0 -1
  323. package/packages/scrabble-solver/.next/static/chunks/pages/index-e0087247c995328d.js +0 -1
  324. package/packages/scrabble-solver/.next/static/chunks/webpack-cfb34d175e081981.js +0 -1
  325. package/packages/scrabble-solver/.next/static/css/b74cd7de82dabcdd.css +0 -1
  326. package/packages/scrabble-solver/.next/static/css/c403ce739a9c0d83.css +0 -1
  327. package/packages/scrabble-solver/.next/static/css/fbfdce70731d0d2b.css +0 -1
  328. package/packages/scrabble-solver/src/components/Results/Cell.tsx +0 -32
  329. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss +0 -12
  330. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss.d.ts +0 -7
  331. package/packages/scrabble-solver/src/components/ResultsInput/index.ts +0 -1
  332. package/packages/types/build/readResultCells.d.ts +0 -5
  333. package/packages/types/build/readResultCells.js +0 -75
  334. package/packages/types/src/readResultCells.test.ts +0 -140
  335. package/packages/types/src/readResultCells.ts +0 -90
  336. /package/packages/scrabble-solver/.next/static/{5KOWzYqfY1Z2rjrzptr8D → nvGZh1gPuX98L07YmxlYD}/_ssgManifest.js +0 -0
  337. /package/packages/types/build/{isError.d.ts → type-guards/isError.d.ts} +0 -0
  338. /package/packages/types/build/{isError.js → type-guards/isError.js} +0 -0
  339. /package/packages/types/build/{isObject.d.ts → type-guards/isObject.d.ts} +0 -0
  340. /package/packages/types/build/{isObject.js → type-guards/isObject.js} +0 -0
  341. /package/packages/types/src/{isError.ts → type-guards/isError.ts} +0 -0
  342. /package/packages/types/src/{isObject.ts → type-guards/isObject.ts} +0 -0
@@ -0,0 +1,49 @@
1
+ import { type BoardWord, type ShowCoordinates } from '@scrabble-solver/types';
2
+
3
+ import { createCoordinatesComparator } from '@/lib/createCoordinatesComparator';
4
+ import { createKeyComparator } from '@/lib/createKeyComparator';
5
+ import { createRegExp } from '@/lib/createRegExp';
6
+ import { createSortComparator } from '@/lib/createSortComparator';
7
+ import { getCoordinates } from '@/lib/getCoordinates';
8
+ import { numberComparator } from '@/lib/numberComparator';
9
+ import { type ComparatorFactory, type GroupedWords, type Sort, type VerifiedWord, WordColumnId } from '@/types';
10
+
11
+ export const getWordCoordinates = (word: BoardWord, showCoordinates: ShowCoordinates): string => {
12
+ return getCoordinates({ isHorizontal: word.direction === 'horizontal', x: word.x, y: word.y }, showCoordinates);
13
+ };
14
+
15
+ export const groupWords = (words: VerifiedWord[], query: string): GroupedWords => {
16
+ const regExp = createRegExp(query);
17
+
18
+ return words.reduce<GroupedWords>(
19
+ (groupedWords, word) => {
20
+ if (word.word.match(regExp)) {
21
+ groupedWords.matching.push(word);
22
+ } else {
23
+ groupedWords.other.push(word);
24
+ }
25
+
26
+ return groupedWords;
27
+ },
28
+ { matching: [], other: [] },
29
+ );
30
+ };
31
+
32
+ const comparators: Record<WordColumnId, ComparatorFactory<VerifiedWord>> = {
33
+ [WordColumnId.Coordinates]: (locale: string, showCoordinates: ShowCoordinates) => {
34
+ return createCoordinatesComparator({ getItemCoordinates: getWordCoordinates, locale, showCoordinates });
35
+ },
36
+ [WordColumnId.Validity]: () => (a, b) => {
37
+ return numberComparator(Number(a.isValid), Number(b.isValid));
38
+ },
39
+ [WordColumnId.Word]: (locale: string) => createKeyComparator('word', locale),
40
+ };
41
+
42
+ export const sortWords = (
43
+ words: VerifiedWord[],
44
+ sort: Sort<WordColumnId>,
45
+ locale: string,
46
+ showCoordinates: ShowCoordinates,
47
+ ): VerifiedWord[] => {
48
+ return [...words].sort(createSortComparator({ comparators, locale, showCoordinates, sort }));
49
+ };
@@ -1,9 +1,46 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
 
3
+ import { createRegExp } from '@/lib/createRegExp';
4
+
5
+ import { selectLocale, selectShowCoordinates } from '../settings';
3
6
  import type { RootState } from '../types';
4
7
 
8
+ import { getWordCoordinates, groupWords, sortWords } from './lib';
9
+
10
+ const selectWordIndex = (_: unknown, index: number): number => index;
11
+
5
12
  export const selectVerify = (state: RootState) => state.verify;
6
13
 
14
+ export const selectLastVerifiedBoard = createSelector([selectVerify], (verify) => verify.lastSolvedParameters.board);
15
+
7
16
  export const selectInvalidWords = createSelector([selectVerify], (verify) => verify.invalidWords);
8
17
 
9
18
  export const selectValidWords = createSelector([selectVerify], (verify) => verify.validWords);
19
+
20
+ export const selectWordsQuery = createSelector([selectVerify], (verify) => verify.query);
21
+
22
+ export const selectWordsSort = createSelector([selectVerify], (verify) => verify.sort);
23
+
24
+ export const selectCreatedWords = createSelector([selectInvalidWords, selectValidWords], (invalidWords, validWords) => {
25
+ return [...invalidWords, ...validWords];
26
+ });
27
+
28
+ const selectSortedWords = createSelector(
29
+ [selectCreatedWords, selectWordsSort, selectLocale, selectShowCoordinates],
30
+ sortWords,
31
+ );
32
+
33
+ export const selectProcessedWords = createSelector([selectSortedWords, selectWordsQuery], (words, query) => {
34
+ const { matching, other } = groupWords(words, query);
35
+ return [...matching, ...other];
36
+ });
37
+
38
+ export const selectIsWordMatching = createSelector(
39
+ [selectProcessedWords, selectWordsQuery, selectWordIndex],
40
+ (words, query, index) => createRegExp(query).test(words[index].word),
41
+ );
42
+
43
+ export const selectWordCoordinates = createSelector(
44
+ [selectProcessedWords, selectShowCoordinates, selectWordIndex],
45
+ (words, showCoordinates, index) => getWordCoordinates(words[index], showCoordinates),
46
+ );
@@ -1,12 +1,15 @@
1
1
  import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
2
2
  import { type Board } from '@scrabble-solver/types';
3
3
 
4
+ import { getNextSort } from '@/lib/getNextSort';
5
+ import { type VerifiedWord, type WordColumnId } from '@/types';
6
+
4
7
  import { verifyInitialState } from './initialState';
5
8
 
6
9
  interface VerifyParameters {
7
10
  board: Board;
8
- invalidWords: string[];
9
- validWords: string[];
11
+ invalidWords: VerifiedWord[];
12
+ validWords: VerifiedWord[];
10
13
  }
11
14
 
12
15
  export const verifySlice = createSlice({
@@ -17,10 +20,18 @@ export const verifySlice = createSlice({
17
20
  return { ...state, isLoading: true };
18
21
  },
19
22
 
23
+ changeQuery: (state, action: PayloadAction<string>) => {
24
+ return { ...state, query: action.payload };
25
+ },
26
+
20
27
  submitFailure: (state) => {
21
28
  return { ...state, isLoading: false };
22
29
  },
23
30
 
31
+ sort: (state, action: PayloadAction<WordColumnId>) => {
32
+ return { ...state, sort: getNextSort(state.sort, action.payload) };
33
+ },
34
+
24
35
  submitSuccess: (state, action: PayloadAction<VerifyParameters>) => {
25
36
  const { board, invalidWords, validWords } = action.payload;
26
37
  return { ...state, isLoading: false, lastSolvedParameters: { board }, invalidWords, validWords };
@@ -1,3 +1,5 @@
1
+ import type { Sort, VerifiedWord, WordColumnId } from '@/types';
2
+
1
3
  import type { BoardState } from '../board';
2
4
 
3
5
  export interface VerifyState {
@@ -5,6 +7,8 @@ export interface VerifyState {
5
7
  lastSolvedParameters: {
6
8
  board: BoardState;
7
9
  };
8
- invalidWords: string[];
9
- validWords: string[];
10
+ invalidWords: VerifiedWord[];
11
+ query: string;
12
+ sort: Sort<WordColumnId>;
13
+ validWords: VerifiedWord[];
10
14
  }
@@ -10,6 +10,8 @@ $breakpoint-m: 992px;
10
10
  $breakpoint-l: 1200px;
11
11
  $breakpoint-xl: 1400px;
12
12
 
13
+ $breakpoint-height-l: 860px;
14
+
13
15
  $border-color: #cdcdcd;
14
16
  $border-color-light: #d9d9d9;
15
17
  $border-radius: 5px;
@@ -10,6 +10,11 @@
10
10
  ),
11
11
  $media-expressions: (
12
12
  touch: '(hover: none)',
13
+ /**
14
+ * Keep in sync with useIsCompactLayout
15
+ */
16
+ compact: '(max-width: #{$breakpoint-l - 1px}), (max-height: #{$breakpoint-height-l - 1px})',
17
+ desktop: '(min-width: #{$breakpoint-l}) and (min-height: #{$breakpoint-height-l})',
13
18
  )
14
19
  );
15
20
 
@@ -6,6 +6,7 @@
6
6
  breakpointM: strip-unit($breakpoint-m);
7
7
  breakpointL: strip-unit($breakpoint-l);
8
8
  breakpointXl: strip-unit($breakpoint-xl);
9
+ breakpointHeightL: strip-unit($breakpoint-height-l);
9
10
 
10
11
  borderColorLight: $border-color-light;
11
12
  borderWidth: strip-unit($border-width);
@@ -2,6 +2,7 @@
2
2
  declare const styles: {
3
3
  readonly borderColorLight: string;
4
4
  readonly borderWidth: string;
5
+ readonly breakpointHeightL: string;
5
6
  readonly breakpointL: string;
6
7
  readonly breakpointM: string;
7
8
  readonly breakpointS: string;
@@ -153,7 +153,7 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
153
153
  --components-spacing: var(--spacing--l);
154
154
  }
155
155
 
156
- @include media('<l') {
156
+ @include media('compact') {
157
157
  --dictionary--height: var(--dictionary--height--mobile);
158
158
  --logo--height: #{$logo-height-small};
159
159
  --solver-column-total: 0px;
@@ -1,8 +1,9 @@
1
- import { type Result } from '@scrabble-solver/types';
2
- import { type FunctionComponent, type SVGAttributes } from 'react';
1
+ import { type BoardWord, type Result, type ShowCoordinates } from '@scrabble-solver/types';
3
2
 
4
3
  export type Comparator<T> = (a: T, B: T) => number;
5
4
 
5
+ export type ComparatorFactory<T> = (locale: string, showCoordinates: ShowCoordinates) => Comparator<T>;
6
+
6
7
  export type AutoGroupTiles = 'left' | 'right' | null;
7
8
 
8
9
  export type CellFilterType = 'include' | 'exclude';
@@ -26,8 +27,8 @@ export interface Point {
26
27
 
27
28
  export type Rack = (string | null)[];
28
29
 
29
- export interface Sort {
30
- column: ResultColumnId;
30
+ export interface Sort<Id extends string = ResultColumnId> {
31
+ column: Id;
31
32
  direction: SortDirection;
32
33
  }
33
34
 
@@ -61,12 +62,10 @@ export enum ResultColumnId {
61
62
  WordsCount = 'words-count',
62
63
  }
63
64
 
64
- export interface ResultColumn {
65
- className: string;
66
- Icon?: FunctionComponent<SVGAttributes<SVGElement>>;
67
- id: ResultColumnId;
68
- translationKey: TranslationKey;
69
- width?: number;
65
+ export enum WordColumnId {
66
+ Coordinates = 'coordinates',
67
+ Validity = 'validity',
68
+ Word = 'word',
70
69
  }
71
70
 
72
71
  export interface GroupedResults {
@@ -74,6 +73,15 @@ export interface GroupedResults {
74
73
  other: Result[];
75
74
  }
76
75
 
76
+ export interface GroupedWords {
77
+ matching: VerifiedWord[];
78
+ other: VerifiedWord[];
79
+ }
80
+
81
+ export interface VerifiedWord extends BoardWord {
82
+ isValid: boolean;
83
+ }
84
+
77
85
  export type TranslationKey =
78
86
  | 'cell.enter-word'
79
87
  | 'cell.filter-cell.exclude'
@@ -135,6 +143,7 @@ export type TranslationKey =
135
143
  | 'results.input.placeholder'
136
144
  | 'results.insert'
137
145
  | 'results.preview'
146
+ | 'results.select'
138
147
  | 'results.solve'
139
148
  | 'settings'
140
149
  | 'settings.autoGroupTiles'
@@ -154,8 +163,12 @@ export type TranslationKey =
154
163
  | 'settings.showCoordinates.alternative'
155
164
  | 'settings.showCoordinates.original'
156
165
  | 'words'
166
+ | 'words.empty-state.no-words'
167
+ | 'words.input.placeholder'
157
168
  | 'words.invalid'
158
- | 'words.valid';
169
+ | 'words.preview'
170
+ | 'words.valid'
171
+ | 'words.validity';
159
172
 
160
173
  export type Translate = (key: TranslationKey, replacements?: Record<string, string>) => string;
161
174