scrabble-solver 2.18.0 → 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 (353) hide show
  1. package/.nx/workspace-data/d/server-process.json +2 -2
  2. package/.nx/workspace-data/file-map.json +1652 -1412
  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 +669 -670
  9. package/.nx/workspace-data/source-maps.json +236 -0
  10. package/CLAUDE.md +13 -11
  11. package/README.md +2 -2
  12. package/bun.lock +115 -130
  13. package/e2e/app.spec.ts +1 -1
  14. package/e2e/bugs/398-digraphs-in-created-words.spec.ts +2 -2
  15. package/e2e/bugs/445-tile-text-selection.spec.ts +38 -0
  16. package/e2e/bugs/451-results-list-gap-hover.spec.ts +35 -0
  17. package/e2e/bugs/452-stale-translations-cache.spec.ts +32 -0
  18. package/e2e/features/427-highlight-created-words.spec.ts +86 -0
  19. package/e2e/features/430-highlight-unreachable-cells-results.spec.ts +75 -0
  20. package/e2e/features/91-hover-remaining-tile-highlights.spec.ts +22 -0
  21. package/e2e/features/result-candidate-picker.spec.ts +21 -0
  22. package/e2e/features/results-interactions.spec.ts +170 -0
  23. package/e2e/features/solver-paths.spec.ts +2 -2
  24. package/e2e/features/words-dictionary-search.spec.ts +36 -0
  25. package/e2e/features/words-empty-state.spec.ts +42 -0
  26. package/e2e/features/words-interactions.spec.ts +179 -0
  27. package/e2e/features/words-preview.spec.ts +140 -0
  28. package/e2e/features/words-table-filtering.spec.ts +22 -0
  29. package/e2e/features/words-table-sorting.spec.ts +33 -0
  30. package/e2e/lib/actions.ts +76 -6
  31. package/e2e/lib/selectors.ts +40 -3
  32. package/lerna.json +1 -1
  33. package/package.json +24 -44
  34. package/packages/configs/package.json +13 -4
  35. package/packages/constants/package.json +6 -2
  36. package/packages/dictionaries/package.json +12 -5
  37. package/packages/logger/package.json +7 -2
  38. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  39. package/packages/scrabble-solver/.next/build-manifest.json +15 -15
  40. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -1
  41. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  42. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  43. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  44. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  45. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  46. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  47. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  48. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  49. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  50. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  51. package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
  52. package/packages/scrabble-solver/.next/dynamic-css-manifest.json +2 -2
  53. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  54. package/packages/scrabble-solver/.next/react-loadable-manifest.json +37 -37
  55. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  56. package/packages/scrabble-solver/.next/server/chunks/309.js +1 -1
  57. package/packages/scrabble-solver/.next/server/chunks/344.js +1 -1
  58. package/packages/scrabble-solver/.next/server/chunks/371.js +1 -1
  59. package/packages/scrabble-solver/.next/server/chunks/392.js +1 -1
  60. package/packages/scrabble-solver/.next/server/chunks/465.js +1 -1
  61. package/packages/scrabble-solver/.next/server/chunks/546.js +1 -1
  62. package/packages/scrabble-solver/.next/server/chunks/641.js +1 -1
  63. package/packages/scrabble-solver/.next/server/chunks/67.js +1 -0
  64. package/packages/scrabble-solver/.next/server/chunks/712.js +1 -1
  65. package/packages/scrabble-solver/.next/server/chunks/846.js +1 -1
  66. package/packages/scrabble-solver/.next/server/chunks/886.js +1 -1
  67. package/packages/scrabble-solver/.next/server/chunks/942.js +1 -0
  68. package/packages/scrabble-solver/.next/server/chunks/953.js +1 -1
  69. package/packages/scrabble-solver/.next/server/chunks/961.js +1 -1
  70. package/packages/scrabble-solver/.next/server/dynamic-css-manifest.js +1 -1
  71. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  72. package/packages/scrabble-solver/.next/server/middleware-react-loadable-manifest.js +1 -1
  73. package/packages/scrabble-solver/.next/server/pages/404.html +3 -2
  74. package/packages/scrabble-solver/.next/server/pages/500.html +3 -2
  75. package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
  76. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  77. package/packages/scrabble-solver/.next/server/pages/_document.js +2 -2
  78. package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
  79. package/packages/scrabble-solver/.next/server/pages/_error.js +2 -2
  80. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  81. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +1 -1
  82. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  83. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
  84. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  85. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  86. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  87. package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
  88. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  89. package/packages/scrabble-solver/.next/server/pages/index.html +3 -2
  90. package/packages/scrabble-solver/.next/server/pages/index.js +4 -4
  91. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  92. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  93. package/packages/scrabble-solver/.next/server/pages/not-found.html +3 -2
  94. package/packages/scrabble-solver/.next/server/pages/not-found.js.nft.json +1 -1
  95. package/packages/scrabble-solver/.next/static/chunks/100.305bdf9c75b1758f.js +1 -0
  96. package/packages/scrabble-solver/.next/static/chunks/256.66ff9fb6d7db9ec7.js +1 -0
  97. package/packages/scrabble-solver/.next/static/chunks/{307.67f52f13e3d60d4e.js → 307.89e6100f58443679.js} +1 -1
  98. package/packages/scrabble-solver/.next/static/chunks/{363.01eed3233f92b6a4.js → 363.cec65b1f9668a75e.js} +1 -1
  99. package/packages/scrabble-solver/.next/static/chunks/{422.1559ae6756912ca5.js → 422.3e55b4c94e328701.js} +1 -1
  100. package/packages/scrabble-solver/.next/static/chunks/{663.d2c9ca36b26695b8.js → 663.bd2c45413fbca518.js} +1 -1
  101. package/packages/scrabble-solver/.next/static/chunks/693.677c88e0eb1340b5.js +1 -0
  102. package/packages/scrabble-solver/.next/static/chunks/{820.97b82f751ca49579.js → 820.823e9e885ebb66af.js} +1 -1
  103. package/packages/scrabble-solver/.next/static/chunks/827.c81b92b383a748c9.js +1 -0
  104. package/packages/scrabble-solver/.next/static/chunks/{865.a9b563a45848a83c.js → 865.59baba8296c9b116.js} +1 -1
  105. package/packages/scrabble-solver/.next/static/chunks/912.077603e4f0bc6cca.js +1 -0
  106. package/packages/scrabble-solver/.next/static/chunks/{939.19b33a3d3c351d73.js → 939.2ad86b50405c7897.js} +1 -1
  107. package/packages/scrabble-solver/.next/static/chunks/980.7ce17464fc56648a.js +1 -0
  108. package/packages/scrabble-solver/.next/static/chunks/{main-b92e08f3fc96dd8d.js → main-7e52da35a4beea0b.js} +1 -1
  109. package/packages/scrabble-solver/.next/static/chunks/pages/_app-f9ec81278ffa7b1a.js +1 -0
  110. package/packages/scrabble-solver/.next/static/chunks/pages/index-b5bf018100015277.js +1 -0
  111. package/packages/scrabble-solver/.next/static/chunks/pages/not-found-a59f9deeeff63d17.js +1 -0
  112. package/packages/scrabble-solver/.next/static/chunks/webpack-9f5c9d275348829b.js +1 -0
  113. package/packages/scrabble-solver/.next/static/css/65bcc9440e067113.css +1 -0
  114. package/packages/scrabble-solver/.next/static/css/{abc2425d3ba607bc.css → 92f85ce358a0a468.css} +2 -1
  115. package/packages/scrabble-solver/.next/static/css/a691348b788f8bc0.css +1 -0
  116. package/packages/scrabble-solver/.next/static/css/cd4d7f2458487399.css +1 -0
  117. package/packages/scrabble-solver/.next/static/{FL82obwzFHRzvV6z76I-U → nvGZh1gPuX98L07YmxlYD}/_buildManifest.js +1 -1
  118. package/packages/scrabble-solver/.next/trace +21 -21
  119. package/packages/scrabble-solver/.next/trace-build +1 -1
  120. package/packages/scrabble-solver/AGENTS.md +9 -0
  121. package/packages/scrabble-solver/CLAUDE.md +1 -0
  122. package/packages/scrabble-solver/package.json +22 -13
  123. package/packages/scrabble-solver/public/robots.txt +1 -0
  124. package/packages/scrabble-solver/public/service-worker.js +1 -1
  125. package/packages/scrabble-solver/public/site.webmanifest +14 -0
  126. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -1
  127. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +26 -20
  128. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +4 -4
  129. package/packages/scrabble-solver/src/components/Board/lib.test.ts +106 -0
  130. package/packages/scrabble-solver/src/components/Board/lib.ts +34 -3
  131. package/packages/scrabble-solver/src/components/Board/selectors.ts +17 -5
  132. package/packages/scrabble-solver/src/components/Button/Button.module.scss +1 -1
  133. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +0 -4
  134. package/packages/scrabble-solver/src/components/Results/Header.tsx +30 -5
  135. package/packages/scrabble-solver/src/components/Results/Result.tsx +45 -55
  136. package/packages/scrabble-solver/src/components/Results/Results.module.scss +0 -126
  137. package/packages/scrabble-solver/src/components/Results/Results.module.scss.d.ts +0 -10
  138. package/packages/scrabble-solver/src/components/Results/Results.tsx +25 -5
  139. package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +4 -4
  140. package/packages/scrabble-solver/src/components/Solver/Solver.tsx +5 -3
  141. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +5 -1
  142. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss.d.ts +1 -0
  143. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -2
  144. package/packages/scrabble-solver/src/components/Table/Cell.tsx +42 -0
  145. package/packages/scrabble-solver/src/components/Table/Header.tsx +11 -0
  146. package/packages/scrabble-solver/src/components/{Results → Table}/HeaderButton.tsx +22 -14
  147. package/packages/scrabble-solver/src/components/Table/Row.tsx +59 -0
  148. package/packages/scrabble-solver/src/components/{ResultsInput/ResultsInput.tsx → Table/Search.tsx} +9 -11
  149. package/packages/scrabble-solver/src/components/Table/Table.module.scss +147 -0
  150. package/packages/scrabble-solver/src/components/Table/Table.module.scss.d.ts +19 -0
  151. package/packages/scrabble-solver/src/components/Table/index.ts +5 -0
  152. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +2 -1
  153. package/packages/scrabble-solver/src/hooks/useColumns.ts +7 -5
  154. package/packages/scrabble-solver/src/hooks/useIsCompactLayout.ts +14 -0
  155. package/packages/scrabble-solver/src/i18n/languages/english.json +6 -1
  156. package/packages/scrabble-solver/src/i18n/languages/french.json +6 -1
  157. package/packages/scrabble-solver/src/i18n/languages/german.json +6 -1
  158. package/packages/scrabble-solver/src/i18n/languages/persian.json +6 -1
  159. package/packages/scrabble-solver/src/i18n/languages/polish.json +6 -1
  160. package/packages/scrabble-solver/src/i18n/languages/romanian.json +6 -1
  161. package/packages/scrabble-solver/src/i18n/languages/spanish.json +6 -1
  162. package/packages/scrabble-solver/src/i18n/languages/turkish.json +6 -1
  163. package/packages/scrabble-solver/src/icons/QuestionSquare.svg +5 -0
  164. package/packages/scrabble-solver/src/lib/createCoordinatesComparator.ts +23 -0
  165. package/packages/scrabble-solver/src/lib/createKeyComparator.ts +1 -4
  166. package/packages/scrabble-solver/src/lib/createSortComparator.ts +22 -0
  167. package/packages/scrabble-solver/src/lib/getCoordinates.test.ts +21 -0
  168. package/packages/scrabble-solver/src/lib/getCoordinates.ts +16 -0
  169. package/packages/scrabble-solver/src/lib/getNextSort.ts +12 -0
  170. package/packages/scrabble-solver/src/lib/waitForIdleOrFirstIntent.ts +19 -8
  171. package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +3 -1
  172. package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +8 -9
  173. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +14 -10
  174. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +16 -27
  175. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss.d.ts +3 -6
  176. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +56 -42
  177. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordRow.tsx +92 -0
  178. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss +69 -0
  179. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss.d.ts +16 -0
  180. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.tsx +137 -0
  181. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/index.ts +1 -0
  182. package/packages/scrabble-solver/src/modals/WordsModal/components/index.ts +1 -0
  183. package/packages/scrabble-solver/src/pages/_app.tsx +40 -76
  184. package/packages/scrabble-solver/src/pages/_document.tsx +21 -19
  185. package/packages/scrabble-solver/src/pages/api/verify.ts +7 -6
  186. package/packages/scrabble-solver/src/pages/index.tsx +58 -6
  187. package/packages/scrabble-solver/src/pages/not-found.tsx +13 -2
  188. package/packages/scrabble-solver/src/parameters/index.ts +9 -0
  189. package/packages/scrabble-solver/src/sdk/verify.ts +3 -2
  190. package/packages/scrabble-solver/src/solver-worker/client.test.ts +10 -3
  191. package/packages/scrabble-solver/src/solver-worker/index.worker.ts +7 -7
  192. package/packages/scrabble-solver/src/solver-worker/messages.ts +3 -3
  193. package/packages/scrabble-solver/src/state/hoveredWord/index.ts +4 -0
  194. package/packages/scrabble-solver/src/state/hoveredWord/initialState.ts +5 -0
  195. package/packages/scrabble-solver/src/state/hoveredWord/selectors.ts +5 -0
  196. package/packages/scrabble-solver/src/state/hoveredWord/slice.ts +18 -0
  197. package/packages/scrabble-solver/src/state/hoveredWord/types.ts +5 -0
  198. package/packages/scrabble-solver/src/state/index.ts +1 -0
  199. package/packages/scrabble-solver/src/state/localStorage.ts +13 -2
  200. package/packages/scrabble-solver/src/state/results/lib.ts +9 -26
  201. package/packages/scrabble-solver/src/state/results/selectors.ts +9 -1
  202. package/packages/scrabble-solver/src/state/results/slice.ts +4 -16
  203. package/packages/scrabble-solver/src/state/sagas.ts +30 -5
  204. package/packages/scrabble-solver/src/state/selectors.ts +18 -1
  205. package/packages/scrabble-solver/src/state/store.ts +2 -0
  206. package/packages/scrabble-solver/src/state/types.ts +2 -0
  207. package/packages/scrabble-solver/src/state/verify/initialState.ts +7 -0
  208. package/packages/scrabble-solver/src/state/verify/lib.test.ts +55 -0
  209. package/packages/scrabble-solver/src/state/verify/lib.ts +49 -0
  210. package/packages/scrabble-solver/src/state/verify/selectors.ts +37 -0
  211. package/packages/scrabble-solver/src/state/verify/slice.ts +13 -2
  212. package/packages/scrabble-solver/src/state/verify/types.ts +6 -2
  213. package/packages/scrabble-solver/src/styles/_tokens.scss +2 -0
  214. package/packages/scrabble-solver/src/styles/mixins.scss +5 -0
  215. package/packages/scrabble-solver/src/styles/variables.module.scss +1 -0
  216. package/packages/scrabble-solver/src/styles/variables.module.scss.d.ts +1 -0
  217. package/packages/scrabble-solver/src/styles/variables.scss +1 -1
  218. package/packages/scrabble-solver/src/types/index.ts +24 -11
  219. package/packages/scrabble-solver/tsconfig.tsbuildinfo +1 -1
  220. package/packages/solver/package.json +14 -6
  221. package/packages/types/build/Bingo.d.ts +0 -3
  222. package/packages/types/build/Bingo.js +0 -14
  223. package/packages/types/build/Board.d.ts +3 -1
  224. package/packages/types/build/Board.js +5 -40
  225. package/packages/types/build/BoardJson.d.ts +0 -1
  226. package/packages/types/build/BoardJson.js +0 -19
  227. package/packages/types/build/BoardWord.d.ts +7 -0
  228. package/packages/types/build/BoardWord.js +2 -0
  229. package/packages/types/build/CellJson.d.ts +0 -1
  230. package/packages/types/build/CellJson.js +0 -11
  231. package/packages/types/build/Game.d.ts +0 -1
  232. package/packages/types/build/Game.js +1 -4
  233. package/packages/types/build/Locale.d.ts +0 -1
  234. package/packages/types/build/Locale.js +1 -4
  235. package/packages/types/build/Result.js +3 -3
  236. package/packages/types/build/TileJson.d.ts +0 -1
  237. package/packages/types/build/TileJson.js +0 -6
  238. package/packages/types/build/index.d.ts +9 -8
  239. package/packages/types/build/index.js +14 -17
  240. package/packages/types/build/lib/getBoardWords.d.ts +3 -0
  241. package/packages/types/build/lib/getBoardWords.js +10 -0
  242. package/packages/types/build/lib/getCells.d.ts +4 -0
  243. package/packages/types/build/lib/getCells.js +27 -0
  244. package/packages/types/build/lib/getCollidingWords.d.ts +3 -0
  245. package/packages/types/build/lib/getCollidingWords.js +19 -0
  246. package/packages/types/build/lib/getCollision.d.ts +3 -0
  247. package/packages/types/build/lib/getCollision.js +31 -0
  248. package/packages/types/build/lib/getCollisions.d.ts +3 -0
  249. package/packages/types/build/lib/getCollisions.js +17 -0
  250. package/packages/types/build/lib/getPlacedCell.d.ts +3 -0
  251. package/packages/types/build/lib/getPlacedCell.js +10 -0
  252. package/packages/types/build/lib/getWordThrough.d.ts +4 -0
  253. package/packages/types/build/lib/getWordThrough.js +23 -0
  254. package/packages/types/build/lib/getWordsInRows.d.ts +8 -0
  255. package/packages/types/build/lib/getWordsInRows.js +29 -0
  256. package/packages/types/build/lib/index.d.ts +5 -0
  257. package/packages/types/build/lib/index.js +21 -0
  258. package/packages/types/build/lib/isSameBoardWord.d.ts +2 -0
  259. package/packages/types/build/lib/isSameBoardWord.js +6 -0
  260. package/packages/types/build/lib/toBoardWord.d.ts +4 -0
  261. package/packages/types/build/lib/toBoardWord.js +11 -0
  262. package/packages/types/build/lib/transpose.d.ts +1 -0
  263. package/packages/types/build/lib/transpose.js +16 -0
  264. package/packages/types/build/type-guards/index.d.ts +10 -0
  265. package/packages/types/build/type-guards/index.js +23 -0
  266. package/packages/types/build/type-guards/isBingo.d.ts +2 -0
  267. package/packages/types/build/type-guards/isBingo.js +9 -0
  268. package/packages/types/build/type-guards/isBoardJson.d.ts +2 -0
  269. package/packages/types/build/type-guards/isBoardJson.js +21 -0
  270. package/packages/types/build/type-guards/isCellJson.d.ts +2 -0
  271. package/packages/types/build/type-guards/isCellJson.js +13 -0
  272. package/packages/types/build/type-guards/isGame.d.ts +2 -0
  273. package/packages/types/build/type-guards/isGame.js +7 -0
  274. package/packages/types/build/type-guards/isLocale.d.ts +2 -0
  275. package/packages/types/build/type-guards/isLocale.js +7 -0
  276. package/packages/types/build/type-guards/isMultiplierBingo.d.ts +2 -0
  277. package/packages/types/build/type-guards/isMultiplierBingo.js +8 -0
  278. package/packages/types/build/type-guards/isScoreBingo.d.ts +2 -0
  279. package/packages/types/build/type-guards/isScoreBingo.js +8 -0
  280. package/packages/types/build/type-guards/isTileJson.d.ts +2 -0
  281. package/packages/types/build/type-guards/isTileJson.js +8 -0
  282. package/packages/types/package.json +10 -3
  283. package/packages/types/src/Bingo.ts +0 -14
  284. package/packages/types/src/Board.test.ts +85 -0
  285. package/packages/types/src/Board.ts +8 -49
  286. package/packages/types/src/BoardJson.ts +1 -21
  287. package/packages/types/src/BoardWord.ts +8 -0
  288. package/packages/types/src/CellJson.ts +1 -12
  289. package/packages/types/src/Game.ts +0 -4
  290. package/packages/types/src/Locale.ts +0 -4
  291. package/packages/types/src/Result.ts +3 -3
  292. package/packages/types/src/TileJson.ts +0 -6
  293. package/packages/types/src/index.ts +20 -8
  294. package/packages/types/src/lib/getBoardWords.ts +11 -0
  295. package/packages/types/src/lib/getCells.test.ts +127 -0
  296. package/packages/types/src/lib/getCells.ts +31 -0
  297. package/packages/types/src/lib/getCollidingWords.ts +25 -0
  298. package/packages/types/src/lib/getCollision.ts +38 -0
  299. package/packages/types/src/lib/getCollisions.test.ts +82 -0
  300. package/packages/types/src/lib/getCollisions.ts +22 -0
  301. package/packages/types/src/lib/getPlacedCell.ts +9 -0
  302. package/packages/types/src/lib/getWordThrough.ts +30 -0
  303. package/packages/types/src/lib/getWordsInRows.ts +34 -0
  304. package/packages/types/src/lib/index.ts +5 -0
  305. package/packages/types/src/lib/isSameBoardWord.ts +5 -0
  306. package/packages/types/src/lib/toBoardWord.ts +12 -0
  307. package/packages/types/src/lib/transpose.ts +15 -0
  308. package/packages/types/src/type-guards/index.ts +10 -0
  309. package/packages/types/src/type-guards/isBingo.ts +8 -0
  310. package/packages/types/src/type-guards/isBoardJson.test.ts +33 -0
  311. package/packages/types/src/type-guards/isBoardJson.ts +23 -0
  312. package/packages/types/src/type-guards/isCellJson.ts +14 -0
  313. package/packages/types/src/type-guards/isGame.ts +5 -0
  314. package/packages/types/src/type-guards/isLocale.ts +5 -0
  315. package/packages/types/src/type-guards/isMultiplierBingo.ts +7 -0
  316. package/packages/types/src/type-guards/isScoreBingo.ts +7 -0
  317. package/packages/types/src/type-guards/isTileJson.ts +7 -0
  318. package/packages/word-definitions/package.json +9 -3
  319. package/packages/word-lists/package.json +11 -3
  320. package/playwright-report/index.html +1 -1
  321. package/screencast.gif +0 -0
  322. package/packages/scrabble-solver/.next/server/chunks/316.js +0 -1
  323. package/packages/scrabble-solver/.next/server/chunks/916.js +0 -1
  324. package/packages/scrabble-solver/.next/static/chunks/106.e414e88694add27f.js +0 -1
  325. package/packages/scrabble-solver/.next/static/chunks/127.125d896a19061d71.js +0 -1
  326. package/packages/scrabble-solver/.next/static/chunks/18.8b91e137d239e15c.js +0 -1
  327. package/packages/scrabble-solver/.next/static/chunks/583.7a46807be14c377e.js +0 -1
  328. package/packages/scrabble-solver/.next/static/chunks/711.ba7b8f900dfd40d0.js +0 -1
  329. package/packages/scrabble-solver/.next/static/chunks/912.ff8037ba9d4db5c8.js +0 -1
  330. package/packages/scrabble-solver/.next/static/chunks/pages/_app-ba5d628e81a15461.js +0 -1
  331. package/packages/scrabble-solver/.next/static/chunks/pages/index-5f9fa6ac3cd3d97b.js +0 -1
  332. package/packages/scrabble-solver/.next/static/chunks/pages/not-found-23d61fd3ed791cad.js +0 -1
  333. package/packages/scrabble-solver/.next/static/chunks/webpack-e34c3ae12275e978.js +0 -1
  334. package/packages/scrabble-solver/.next/static/css/b74cd7de82dabcdd.css +0 -1
  335. package/packages/scrabble-solver/.next/static/css/c403ce739a9c0d83.css +0 -1
  336. package/packages/scrabble-solver/.next/static/css/fbfdce70731d0d2b.css +0 -1
  337. package/packages/scrabble-solver/src/components/Results/Cell.tsx +0 -32
  338. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss +0 -12
  339. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss.d.ts +0 -7
  340. package/packages/scrabble-solver/src/components/ResultsInput/index.ts +0 -1
  341. package/packages/scrabble-solver/src/components/SeoMessage/SeoMessage.tsx +0 -18
  342. package/packages/scrabble-solver/src/components/SeoMessage/index.ts +0 -1
  343. package/packages/types/build/readResultCells.d.ts +0 -5
  344. package/packages/types/build/readResultCells.js +0 -75
  345. package/packages/types/src/readResultCells.test.ts +0 -140
  346. package/packages/types/src/readResultCells.ts +0 -90
  347. /package/packages/scrabble-solver/.next/static/{FL82obwzFHRzvV6z76I-U → nvGZh1gPuX98L07YmxlYD}/_ssgManifest.js +0 -0
  348. /package/packages/types/build/{isError.d.ts → type-guards/isError.d.ts} +0 -0
  349. /package/packages/types/build/{isError.js → type-guards/isError.js} +0 -0
  350. /package/packages/types/build/{isObject.d.ts → type-guards/isObject.d.ts} +0 -0
  351. /package/packages/types/build/{isObject.js → type-guards/isObject.js} +0 -0
  352. /package/packages/types/src/{isError.ts → type-guards/isError.ts} +0 -0
  353. /package/packages/types/src/{isObject.ts → type-guards/isObject.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ import classNames from 'classnames';
2
+ import { type FunctionComponent, type ReactNode } from 'react';
3
+
4
+ import { selectLocale, useTranslate, useTypedSelector } from '@/state';
5
+ import { type TranslationKey } from '@/types';
6
+
7
+ import { Tooltip } from '../Tooltip';
8
+
9
+ import styles from './Table.module.scss';
10
+
11
+ interface Props {
12
+ children?: ReactNode;
13
+ className?: string;
14
+ 'data-testid'?: string;
15
+ primary?: boolean;
16
+ translationKey?: TranslationKey;
17
+ tooltip?: string | number;
18
+ value: string | number;
19
+ }
20
+
21
+ export const Cell: FunctionComponent<Props> = ({
22
+ children,
23
+ className,
24
+ 'data-testid': dataTestId,
25
+ primary,
26
+ translationKey,
27
+ tooltip,
28
+ value,
29
+ }) => {
30
+ const translate = useTranslate();
31
+ const locale = useTypedSelector(selectLocale);
32
+ const formattedValue = value.toLocaleString(locale);
33
+ const label = translationKey ? `${translate(translationKey)}: ` : '';
34
+
35
+ return (
36
+ <Tooltip tooltip={`${label}${tooltip || formattedValue}`}>
37
+ <div className={classNames(styles.cell, className, { [styles.primary]: primary })} data-testid={dataTestId}>
38
+ <span className={styles.cellValue}>{children || formattedValue}</span>
39
+ </div>
40
+ </Tooltip>
41
+ );
42
+ };
@@ -0,0 +1,11 @@
1
+ import { type FunctionComponent, type ReactNode } from 'react';
2
+
3
+ import styles from './Table.module.scss';
4
+
5
+ interface Props {
6
+ children: ReactNode;
7
+ }
8
+
9
+ export const Header: FunctionComponent<Props> = ({ children }) => {
10
+ return <div className={styles.header}>{children}</div>;
11
+ };
@@ -1,41 +1,49 @@
1
1
  import classNames from 'classnames';
2
2
  import { type FunctionComponent, type ReactElement, type SVGAttributes, useCallback } from 'react';
3
- import { useDispatch } from 'react-redux';
4
3
 
5
4
  import SortDown from '@/icons/SortDown.svg';
6
5
  import SortUp from '@/icons/SortUp.svg';
7
- import { resultsSlice, selectResultsSort, useTranslate, useTypedSelector } from '@/state';
8
- import { type ResultColumnId, SortDirection, type TranslationKey } from '@/types';
6
+ import { useTranslate } from '@/state';
7
+ import { type Sort, SortDirection, type TranslationKey } from '@/types';
9
8
 
10
9
  import { Tooltip } from '../Tooltip';
11
10
 
12
- import styles from './Results.module.scss';
11
+ import styles from './Table.module.scss';
13
12
 
14
- interface Props {
15
- className: string;
13
+ interface Props<Id extends string> {
14
+ className?: string;
16
15
  Icon?: FunctionComponent<SVGAttributes<SVGElement>>;
17
- id: ResultColumnId;
16
+ id: Id;
17
+ primary?: boolean;
18
+ sort: Sort<Id>;
18
19
  translationKey: TranslationKey;
20
+ onSort: (id: Id) => void;
19
21
  }
20
22
 
21
- export const HeaderButton = ({ className, Icon, id, translationKey }: Props): ReactElement => {
22
- const dispatch = useDispatch();
23
+ export const HeaderButton = <Id extends string>({
24
+ className,
25
+ Icon,
26
+ id,
27
+ primary,
28
+ sort,
29
+ translationKey,
30
+ onSort,
31
+ }: Props<Id>): ReactElement => {
23
32
  const translate = useTranslate();
24
- const sort = useTypedSelector(selectResultsSort);
25
33
 
26
34
  const handleClick = useCallback(() => {
27
- dispatch(resultsSlice.actions.sort(id));
28
- }, [dispatch, id]);
35
+ onSort(id);
36
+ }, [id, onSort]);
29
37
 
30
38
  return (
31
39
  <Tooltip tooltip={translate(translationKey)}>
32
40
  <button
33
41
  aria-label={translate(translationKey)}
34
- className={classNames(styles.headerButton, className)}
42
+ className={classNames(styles.headerButton, className, { [styles.primary]: primary })}
35
43
  type="button"
36
44
  onClick={handleClick}
37
45
  >
38
- <span className={styles.cell}>
46
+ <span className={classNames(styles.cell, { [styles.primary]: primary })}>
39
47
  {Icon && <Icon aria-hidden="true" className={styles.headerButtonIcon} role="img" />}
40
48
 
41
49
  {!Icon && <span className={styles.headerButtonLabel}>{translate(translationKey)}</span>}
@@ -0,0 +1,59 @@
1
+ import classNames from 'classnames';
2
+ import {
3
+ type CSSProperties,
4
+ type FocusEventHandler,
5
+ type FunctionComponent,
6
+ type MouseEventHandler,
7
+ type ReactNode,
8
+ } from 'react';
9
+
10
+ import styles from './Table.module.scss';
11
+
12
+ interface Props {
13
+ 'aria-label': string;
14
+ children: ReactNode;
15
+ className?: string;
16
+ 'data-testid'?: string;
17
+ highlighted: boolean;
18
+ inactive: boolean;
19
+ style?: CSSProperties;
20
+ onBlur?: FocusEventHandler;
21
+ onClick?: MouseEventHandler;
22
+ onFocus?: FocusEventHandler;
23
+ onMouseEnter?: MouseEventHandler;
24
+ }
25
+
26
+ export const Row: FunctionComponent<Props> = ({
27
+ 'aria-label': ariaLabel,
28
+ children,
29
+ className,
30
+ 'data-testid': dataTestId,
31
+ highlighted,
32
+ inactive,
33
+ style,
34
+ onBlur,
35
+ onClick,
36
+ onFocus,
37
+ onMouseEnter,
38
+ }) => {
39
+ return (
40
+ <button
41
+ aria-current={highlighted ? 'true' : undefined}
42
+ aria-hidden={inactive ? 'true' : undefined}
43
+ aria-label={ariaLabel}
44
+ className={classNames(styles.row, className, {
45
+ [styles.clickable]: Boolean(onClick),
46
+ [styles.highlighted]: highlighted,
47
+ })}
48
+ data-testid={dataTestId}
49
+ style={style}
50
+ type="button"
51
+ onBlur={onBlur}
52
+ onClick={onClick}
53
+ onFocus={onFocus}
54
+ onMouseEnter={onMouseEnter}
55
+ >
56
+ <span className={styles.rowContent}>{children}</span>
57
+ </button>
58
+ );
59
+ };
@@ -1,20 +1,18 @@
1
1
  import classNames from 'classnames';
2
2
  import { type ChangeEvent, type FunctionComponent, type SubmitEventHandler, useState } from 'react';
3
- import { useDispatch } from 'react-redux';
4
3
 
5
4
  import { isRegExp } from '@/lib/isRegExp';
6
- import { resultsSlice, selectResultsQuery, useTranslate, useTypedSelector } from '@/state';
7
5
 
8
- import styles from './ResultsInput.module.scss';
6
+ import styles from './Table.module.scss';
9
7
 
10
8
  interface Props {
11
9
  className?: string;
10
+ placeholder: string;
11
+ value: string;
12
+ onChange: (value: string) => void;
12
13
  }
13
14
 
14
- export const ResultsInput: FunctionComponent<Props> = ({ className }) => {
15
- const dispatch = useDispatch();
16
- const translate = useTranslate();
17
- const value = useTypedSelector(selectResultsQuery);
15
+ export const Search: FunctionComponent<Props> = ({ className, placeholder, value, onChange }) => {
18
16
  const [localValue, setLocalValue] = useState(value);
19
17
 
20
18
  const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
@@ -23,7 +21,7 @@ export const ResultsInput: FunctionComponent<Props> = ({ className }) => {
23
21
  setLocalValue(newValue);
24
22
 
25
23
  if (isRegExp(newValue)) {
26
- dispatch(resultsSlice.actions.changeQuery(newValue));
24
+ onChange(newValue);
27
25
  }
28
26
  };
29
27
 
@@ -32,10 +30,10 @@ export const ResultsInput: FunctionComponent<Props> = ({ className }) => {
32
30
  };
33
31
 
34
32
  return (
35
- <form className={classNames(styles.resultsInput, className)} onSubmit={handleSubmit}>
33
+ <form className={classNames(styles.search, className)} onSubmit={handleSubmit}>
36
34
  <input
37
- className={styles.input}
38
- placeholder={translate('results.input.placeholder')}
35
+ className={styles.searchField}
36
+ placeholder={placeholder}
39
37
  type="text"
40
38
  value={localValue}
41
39
  onChange={handleChange}
@@ -0,0 +1,147 @@
1
+ @use 'styles/mixins' as *;
2
+
3
+ $row-padding-horizontal: calc(var(--spacing--m) + var(--spacing--s));
4
+
5
+ .header {
6
+ position: relative;
7
+ z-index: 1;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ border-bottom: var(--border);
12
+ border-top-left-radius: inherit;
13
+ border-top-right-radius: inherit;
14
+ }
15
+
16
+ .headerButton {
17
+ @include button-reset;
18
+ @include focus-effect;
19
+
20
+ cursor: pointer;
21
+
22
+ text-transform: uppercase;
23
+ transition:
24
+ background-color var(--transition--duration) var(--transition--easing),
25
+ color var(--transition--duration) var(--transition--easing);
26
+ background-color: var(--color--background);
27
+ height: 100%;
28
+
29
+ &:first-child {
30
+ border-start-start-radius: inherit;
31
+ }
32
+
33
+ &:last-child {
34
+ border-start-end-radius: inherit;
35
+ }
36
+
37
+ &:focus,
38
+ &:hover {
39
+ background-color: var(--color--primary);
40
+ color: var(--color--primary--opposite);
41
+ }
42
+
43
+ &.primary {
44
+ flex: 1 1 0;
45
+ min-width: 0;
46
+ text-transform: uppercase;
47
+ }
48
+ }
49
+
50
+ .headerButtonLabel {
51
+ @include ellipsis;
52
+
53
+ flex: 0 1 auto;
54
+ text-align: start;
55
+ }
56
+
57
+ .headerButtonIcon {
58
+ flex: 0 0 auto;
59
+ width: var(--results--icon--size);
60
+ height: var(--results--icon--size);
61
+ }
62
+
63
+ .row {
64
+ @include button-reset;
65
+
66
+ user-select: none;
67
+ font-weight: 400;
68
+
69
+ /**
70
+ * :focus-visible rather than :focus - a row left focused by click/hover on another row
71
+ * must not keep looking highlighted.
72
+ */
73
+ &:focus-visible,
74
+ &:hover,
75
+ &.highlighted {
76
+ &:not(:disabled) {
77
+ background-color: var(--color--primary);
78
+ color: var(--color--primary--opposite);
79
+ }
80
+ }
81
+
82
+ &[aria-hidden='true'] {
83
+ color: var(--color--inactive);
84
+
85
+ &:focus-visible,
86
+ &:hover,
87
+ &.highlighted {
88
+ &:not(:disabled) {
89
+ background-color: var(--color--primary--light);
90
+ color: var(--color--primary--opposite);
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ .clickable {
97
+ cursor: pointer;
98
+ }
99
+
100
+ .rowContent {
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: space-between;
104
+ height: 100%;
105
+ }
106
+
107
+ .cell {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ height: 100%;
112
+ gap: var(--spacing--s);
113
+ line-height: var(--results--item--height);
114
+
115
+ &.primary {
116
+ flex: 1 1 0;
117
+ min-width: 0;
118
+ text-transform: uppercase;
119
+ justify-content: flex-start;
120
+ padding-inline-start: $row-padding-horizontal;
121
+ }
122
+ }
123
+
124
+ .cellValue {
125
+ @include ellipsis;
126
+
127
+ min-width: 0;
128
+ }
129
+
130
+ .search {
131
+ @include focus-effect;
132
+ }
133
+
134
+ .searchField {
135
+ @include text-input;
136
+
137
+ border: none;
138
+ border-radius: inherit;
139
+ }
140
+
141
+ .sortIcon {
142
+ $size: 19px;
143
+
144
+ flex: 0 0 auto;
145
+ width: $size;
146
+ height: $size;
147
+ }
@@ -0,0 +1,19 @@
1
+ // Generated by scripts/generate-scss-types.ts - do not edit.
2
+ declare const styles: {
3
+ readonly cell: string;
4
+ readonly cellValue: string;
5
+ readonly clickable: string;
6
+ readonly header: string;
7
+ readonly headerButton: string;
8
+ readonly headerButtonIcon: string;
9
+ readonly headerButtonLabel: string;
10
+ readonly highlighted: string;
11
+ readonly primary: string;
12
+ readonly row: string;
13
+ readonly rowContent: string;
14
+ readonly search: string;
15
+ readonly searchField: string;
16
+ readonly sortIcon: string;
17
+ };
18
+
19
+ export default styles;
@@ -0,0 +1,5 @@
1
+ export { Cell } from './Cell';
2
+ export { Header } from './Header';
3
+ export { HeaderButton } from './HeaderButton';
4
+ export { Row } from './Row';
5
+ export { Search } from './Search';
@@ -85,9 +85,10 @@
85
85
  caret-color: transparent;
86
86
  font-size: 16px; // prevent iOS from automatically zooming in on focus
87
87
  outline: none;
88
+ user-select: none;
88
89
 
89
90
  &::selection {
90
- --background--color: transparent;
91
+ background-color: transparent;
91
92
  }
92
93
  }
93
94
 
@@ -5,6 +5,7 @@ import { LOCALE_FEATURES } from '@/i18n/constants';
5
5
  import { selectLocale, useTypedSelector } from '@/state';
6
6
  import { ResultColumnId } from '@/types';
7
7
 
8
+ import { useIsCompactLayout } from './useIsCompactLayout';
8
9
  import { useMediaQueries } from './useMediaQueries';
9
10
 
10
11
  const COLUMNS_XS = [ResultColumnId.Coordinates, ResultColumnId.Word, ResultColumnId.Points];
@@ -13,7 +14,7 @@ const COLUMNS_S = [...COLUMNS_XS, ResultColumnId.BlanksCount, ResultColumnId.Wor
13
14
 
14
15
  const COLUMNS_M = [...COLUMNS_XS];
15
16
 
16
- const COLUMNS_L = [...COLUMNS_XS];
17
+ const COLUMNS_COMPACT = [...COLUMNS_XS];
17
18
 
18
19
  const selectColumns = createSelector([selectLocale], (locale) => {
19
20
  const { consonants, vowels } = LOCALE_FEATURES[locale];
@@ -39,7 +40,8 @@ const selectColumns = createSelector([selectLocale], (locale) => {
39
40
 
40
41
  export const useColumns = (): Partial<Record<ResultColumnId, boolean>> => {
41
42
  const columns = useTypedSelector(selectColumns);
42
- const { isLessThanXs, isLessThanS, isLessThanM, isLessThanL } = useMediaQueries();
43
+ const { isLessThanXs, isLessThanS, isLessThanM } = useMediaQueries();
44
+ const isCompactLayout = useIsCompactLayout();
43
45
 
44
46
  const filteredColumns = useMemo(() => {
45
47
  if (isLessThanXs) {
@@ -54,12 +56,12 @@ export const useColumns = (): Partial<Record<ResultColumnId, boolean>> => {
54
56
  return columns.filter((columnId) => COLUMNS_M.includes(columnId));
55
57
  }
56
58
 
57
- if (isLessThanL) {
58
- return columns.filter((columnId) => COLUMNS_L.includes(columnId));
59
+ if (isCompactLayout) {
60
+ return columns.filter((columnId) => COLUMNS_COMPACT.includes(columnId));
59
61
  }
60
62
 
61
63
  return columns;
62
- }, [columns, isLessThanXs, isLessThanS, isLessThanM, isLessThanL]);
64
+ }, [columns, isLessThanXs, isLessThanS, isLessThanM, isCompactLayout]);
63
65
 
64
66
  const columnsMap = useMemo(() => {
65
67
  return Object.fromEntries(filteredColumns.map((column) => [column, true]));
@@ -0,0 +1,14 @@
1
+ import { BREAKPOINT_HEIGHT_L } from '@/parameters';
2
+
3
+ import { useMedia } from './useMedia';
4
+ import { useMediaQuery } from './useMediaQuery';
5
+
6
+ const SHORT_VIEWPORT = `(max-height: ${BREAKPOINT_HEIGHT_L - 1}px)`;
7
+
8
+ // Keep in sync with the `compact` media expression in styles/mixins.scss
9
+ export function useIsCompactLayout(): boolean {
10
+ const isNarrowViewport = useMediaQuery('<l');
11
+ const isShortViewport = useMedia(SHORT_VIEWPORT);
12
+
13
+ return isNarrowViewport || isShortViewport;
14
+ }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Search results... (RegExp)",
60
60
  "results.insert": "Insert",
61
61
  "results.preview": "Preview",
62
+ "results.select": "Select...",
62
63
  "results.solve": "Solve",
63
64
  "settings": "Settings",
64
65
  "settings.autoGroupTiles": "Group remaining tiles",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternative",
79
80
  "settings.showCoordinates.original": "Original",
80
81
  "words": "Created words",
82
+ "words.empty-state.no-words": "No created words - the board is empty.",
83
+ "words.input.placeholder": "Search words... (RegExp)",
81
84
  "words.invalid": "Invalid",
82
- "words.valid": "Valid"
85
+ "words.preview": "Preview",
86
+ "words.valid": "Valid",
87
+ "words.validity": "Validity"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Rechercher les résultats... (RegExp)",
60
60
  "results.insert": "Inserer",
61
61
  "results.preview": "Prévisualisation",
62
+ "results.select": "Sélectionner...",
62
63
  "results.solve": "Résoudre",
63
64
  "settings": "Options",
64
65
  "settings.autoGroupTiles": "Grouper les cases restantes",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternative",
79
80
  "settings.showCoordinates.original": "Original",
80
81
  "words": "Mots créés",
82
+ "words.empty-state.no-words": "Pas de mots créés - le plateau est vide.",
83
+ "words.input.placeholder": "Rechercher les mots... (RegExp)",
81
84
  "words.invalid": "Incorrect",
82
- "words.valid": "Corriger"
85
+ "words.preview": "Prévisualisation",
86
+ "words.valid": "Corriger",
87
+ "words.validity": "Validité"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Suchergebnisse... (RegExp)",
60
60
  "results.insert": "Hinzufügen",
61
61
  "results.preview": "Vorschau",
62
+ "results.select": "Auswählen...",
62
63
  "results.solve": "Lösen",
63
64
  "settings": "Einstellungen",
64
65
  "settings.autoGroupTiles": "Restliche Steine gruppieren",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternative",
79
80
  "settings.showCoordinates.original": "Original",
80
81
  "words": "Gebildete Wörter",
82
+ "words.empty-state.no-words": "Keine gebildeten Wörter - das Brett ist leer.",
83
+ "words.input.placeholder": "Wörter suchen... (RegExp)",
81
84
  "words.invalid": "Falsch",
82
- "words.valid": "Korrekt"
85
+ "words.preview": "Vorschau",
86
+ "words.valid": "Korrekt",
87
+ "words.validity": "Gültigkeit"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "جستجو در نتایج (RegExp)",
60
60
  "results.insert": "وارد کردن",
61
61
  "results.preview": "پیش نمایش",
62
+ "results.select": "انتخاب کنید...",
62
63
  "results.solve": "حل کن",
63
64
  "settings": "تنظیمات",
64
65
  "settings.autoGroupTiles": "کاشی های باقی مانده ی طاقچه را کنار هم قرار بده",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "بديل",
79
80
  "settings.showCoordinates.original": "إبداعي",
80
81
  "words": "کلمات ساخته شده",
82
+ "words.empty-state.no-words": "کلمه‌ای ساخته نشده - صفحه خالی است.",
83
+ "words.input.placeholder": "جستجو در کلمات (RegExp)",
81
84
  "words.invalid": "نا معتبر",
82
- "words.valid": "معتبر"
85
+ "words.preview": "پیش نمایش",
86
+ "words.valid": "معتبر",
87
+ "words.validity": "اعتبار"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Szukaj rozwiązania... (RegExp)",
60
60
  "results.insert": "Wstaw",
61
61
  "results.preview": "Podgląd",
62
+ "results.select": "Wybierz...",
62
63
  "results.solve": "Rozwiąż",
63
64
  "settings": "Opcje",
64
65
  "settings.autoGroupTiles": "Grupuj pozostałe płytki",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternatywne",
79
80
  "settings.showCoordinates.original": "Oryginalne",
80
81
  "words": "Utworzone słowa",
82
+ "words.empty-state.no-words": "Brak utworzonych słów - plansza jest pusta.",
83
+ "words.input.placeholder": "Szukaj słów... (RegExp)",
81
84
  "words.invalid": "Niepoprawne",
82
- "words.valid": "Poprawne"
85
+ "words.preview": "Podgląd",
86
+ "words.valid": "Poprawne",
87
+ "words.validity": "Poprawność"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Cautare solutii... (RegExp)",
60
60
  "results.insert": "Introducere",
61
61
  "results.preview": "Previzualizare",
62
+ "results.select": "Selectati...",
62
63
  "results.solve": "Gasire solutii",
63
64
  "settings": "Setari",
64
65
  "settings.autoGroupTiles": "Litere ramase",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternativă",
79
80
  "settings.showCoordinates.original": "Original",
80
81
  "words": "Cuvinte create",
82
+ "words.empty-state.no-words": "Niciun cuvânt creat - tabla este goală.",
83
+ "words.input.placeholder": "Cautare cuvinte... (RegExp)",
81
84
  "words.invalid": "Invalid",
82
- "words.valid": "Valid"
85
+ "words.preview": "Previzualizare",
86
+ "words.valid": "Valid",
87
+ "words.validity": "Validitate"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Busque una solución... (RegExp)",
60
60
  "results.insert": "Insertar",
61
61
  "results.preview": "Vista previa",
62
+ "results.select": "Seleccionar...",
62
63
  "results.solve": "Resolver",
63
64
  "settings": "Configuración",
64
65
  "settings.autoGroupTiles": "Agrupar casillas restantes",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternativa",
79
80
  "settings.showCoordinates.original": "Original",
80
81
  "words": "Palabras creadas",
82
+ "words.empty-state.no-words": "No hay palabras creadas; el tablero está vacío.",
83
+ "words.input.placeholder": "Busque una palabra... (RegExp)",
81
84
  "words.invalid": "Incorrecto",
82
- "words.valid": "Correcto"
85
+ "words.preview": "Vista previa",
86
+ "words.valid": "Correcto",
87
+ "words.validity": "Validez"
83
88
  }
@@ -59,6 +59,7 @@
59
59
  "results.input.placeholder": "Sonuçları Ara... (RegExp)",
60
60
  "results.insert": "Sokmak",
61
61
  "results.preview": "Önizleme",
62
+ "results.select": "Seç...",
62
63
  "results.solve": "Çöz",
63
64
  "settings": "Ayarlar",
64
65
  "settings.autoGroupTiles": "Kalan taşları grupla",
@@ -78,6 +79,10 @@
78
79
  "settings.showCoordinates.alternative": "Alternatif",
79
80
  "settings.showCoordinates.original": "Orijinal",
80
81
  "words": "Oluşturulan kelimeler",
82
+ "words.empty-state.no-words": "Oluşturulan kelime yok - tahta boş.",
83
+ "words.input.placeholder": "Kelimeleri Ara... (RegExp)",
81
84
  "words.invalid": "Geçersiz",
82
- "words.valid": "Geçerli"
85
+ "words.preview": "Önizleme",
86
+ "words.valid": "Geçerli",
87
+ "words.validity": "Geçerlilik"
83
88
  }
@@ -0,0 +1,5 @@
1
+ <!-- https://icons.getbootstrap.com/icons/question-square/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" fill="currentColor" />
4
+ <path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94" fill="currentColor" />
5
+ </svg>
@@ -0,0 +1,23 @@
1
+ import { type ShowCoordinates } from '@scrabble-solver/types';
2
+
3
+ import { type Comparator } from '@/types';
4
+
5
+ import { createStringComparator } from './createStringComparator';
6
+
7
+ interface Parameters<Item> {
8
+ getItemCoordinates: (item: Item, showCoordinates: ShowCoordinates) => string;
9
+ locale: string;
10
+ showCoordinates: ShowCoordinates;
11
+ }
12
+
13
+ export function createCoordinatesComparator<Item>({
14
+ getItemCoordinates,
15
+ locale,
16
+ showCoordinates,
17
+ }: Parameters<Item>): Comparator<Item> {
18
+ const stringComparator = createStringComparator(locale);
19
+
20
+ return (a, b) => {
21
+ return stringComparator(getItemCoordinates(a, showCoordinates), getItemCoordinates(b, showCoordinates));
22
+ };
23
+ }