@scrabble-solver/scrabble-solver 2.15.11 → 2.15.13

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 (309) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +16 -16
  3. package/.next/cache/.previewinfo +1 -0
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +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/client-production/index.pack.old +0 -0
  9. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  10. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  11. package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/server-production/0.pack +0 -0
  13. package/.next/cache/webpack/server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  15. package/.next/diagnostics/framework.json +1 -1
  16. package/.next/next-minimal-server.js.nft.json +1 -1
  17. package/.next/next-server.js.nft.json +1 -1
  18. package/.next/prerender-manifest.json +4 -4
  19. package/.next/required-server-files.json +23 -12
  20. package/.next/routes-manifest.json +7 -3
  21. package/.next/server/chunks/106.js +1 -0
  22. package/.next/server/chunks/30.js +4 -4
  23. package/.next/server/chunks/318.js +1 -0
  24. package/.next/server/chunks/50.js +19 -0
  25. package/.next/server/chunks/812.js +1 -1
  26. package/.next/server/chunks/929.js +1 -0
  27. package/.next/server/chunks/974.js +1 -1
  28. package/.next/server/middleware-build-manifest.js +1 -1
  29. package/.next/server/pages/404.html +1 -1
  30. package/.next/server/pages/404.js.nft.json +1 -1
  31. package/.next/server/pages/500.html +1 -1
  32. package/.next/server/pages/_app.js +1 -1
  33. package/.next/server/pages/_app.js.nft.json +1 -1
  34. package/.next/server/pages/_document.js +1 -1
  35. package/.next/server/pages/_document.js.nft.json +1 -1
  36. package/.next/server/pages/_error.js +1 -1
  37. package/.next/server/pages/_error.js.nft.json +1 -1
  38. package/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
  39. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  40. package/.next/server/pages/api/dictionary/[locale].js +1 -1
  41. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  42. package/.next/server/pages/api/solve.js +1 -1
  43. package/.next/server/pages/api/solve.js.nft.json +1 -1
  44. package/.next/server/pages/api/verify.js +1 -1
  45. package/.next/server/pages/api/verify.js.nft.json +1 -1
  46. package/.next/server/pages/api/visit.js +1 -1
  47. package/.next/server/pages/api/visit.js.nft.json +1 -1
  48. package/.next/server/pages/index.html +1 -1
  49. package/.next/server/pages/index.js +1 -1
  50. package/.next/server/pages/index.js.nft.json +1 -1
  51. package/.next/server/pages/index.json +1 -1
  52. package/.next/server/pages-manifest.json +1 -1
  53. package/.next/server/webpack-api-runtime.js +1 -1
  54. package/.next/server/webpack-runtime.js +1 -1
  55. package/.next/static/{47JHul8F9NSWCNSEuahuL → MhrqAqLI9_L8obb7tgjvi}/_buildManifest.js +1 -1
  56. package/.next/static/chunks/framework-aad31c68dd0bb0ea.js +1 -0
  57. package/.next/static/chunks/main-eab5847b41f0af4a.js +1 -0
  58. package/.next/static/chunks/pages/{404-590e2a3839c1d9e0.js → 404-04457ede98c6b53e.js} +1 -1
  59. package/.next/static/chunks/pages/_app-bf81f201c021fdc1.js +1 -0
  60. package/.next/static/chunks/pages/{_error-7ea2d37f66343175.js → _error-a9800cedd835bcad.js} +1 -1
  61. package/.next/static/chunks/pages/index-79a390f3c2a2499f.js +1 -0
  62. package/.next/static/css/{6682db14f926d4c7.css → 04a3767982ec10e8.css} +1 -1
  63. package/.next/static/css/{d875648f38121a28.css → 1fae874a25934f54.css} +1 -1
  64. package/.next/trace +24 -23
  65. package/coverage/clover.xml +6 -0
  66. package/coverage/coverage-final.json +1 -0
  67. package/coverage/lcov-report/base.css +224 -0
  68. package/coverage/lcov-report/block-navigation.js +87 -0
  69. package/coverage/lcov-report/favicon.png +0 -0
  70. package/coverage/lcov-report/index.html +101 -0
  71. package/coverage/lcov-report/prettify.css +1 -0
  72. package/coverage/lcov-report/prettify.js +2 -0
  73. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  74. package/coverage/lcov-report/sorter.js +196 -0
  75. package/coverage/lcov.info +0 -0
  76. package/package.json +18 -18
  77. package/src/api/getServerLoggingData.ts +1 -1
  78. package/src/api/isBoardValid.ts +1 -1
  79. package/src/api/isCellValid.ts +1 -1
  80. package/src/api/isRowValid.ts +1 -1
  81. package/src/components/Alert/Alert.tsx +1 -1
  82. package/src/components/Badge/Badge.tsx +1 -1
  83. package/src/components/Board/Board.tsx +8 -8
  84. package/src/components/Board/BoardPure.tsx +11 -11
  85. package/src/components/Board/components/Actions/Actions.tsx +3 -3
  86. package/src/components/Board/components/Actions/lib.ts +3 -3
  87. package/src/components/Board/components/Cell/Cell.tsx +7 -7
  88. package/src/components/Board/components/InputPrompt/InputPrompt.tsx +2 -2
  89. package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +2 -2
  90. package/src/components/Board/hooks/useBackgroundImage.tsx +1 -1
  91. package/src/components/Board/hooks/useBoardStyle.ts +1 -1
  92. package/src/components/Board/hooks/useGrid.ts +13 -13
  93. package/src/components/Board/lib.ts +37 -0
  94. package/src/components/Board/selectors.ts +8 -0
  95. package/src/components/Button/Button.tsx +1 -1
  96. package/src/components/Button/Link.tsx +1 -1
  97. package/src/components/Dictionary/Dictionary.tsx +10 -3
  98. package/src/components/DictionaryInput/DictionaryInput.tsx +1 -1
  99. package/src/components/EmptyState/EmptyState.tsx +3 -3
  100. package/src/components/IconButton/IconButton.tsx +1 -1
  101. package/src/components/IconButton/Link.tsx +1 -1
  102. package/src/components/Key/Key.tsx +1 -1
  103. package/src/components/Keys/Arrows/Arrows.tsx +1 -1
  104. package/src/components/Keys/index.tsx +1 -1
  105. package/src/components/Loading/Loading.tsx +6 -8
  106. package/src/components/Logo/LogoBlueprint.tsx +1 -1
  107. package/src/components/Modal/Modal.tsx +4 -2
  108. package/src/components/Modal/components/Section/Section.tsx +1 -1
  109. package/src/components/NavButtons/NavButtons.tsx +4 -3
  110. package/src/components/NavButtons/selectors.ts +11 -0
  111. package/src/components/NotFound/NotFound.tsx +1 -1
  112. package/src/components/PlainTiles/PlainTiles.tsx +1 -1
  113. package/src/components/PlainTiles/Tile.tsx +1 -1
  114. package/src/components/PlainTiles/lib.ts +90 -0
  115. package/src/components/Progress/Progress.tsx +1 -1
  116. package/src/components/Rack/Rack.tsx +10 -26
  117. package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +5 -8
  118. package/src/components/Rack/components/InputPrompt/lib.test.ts +27 -0
  119. package/src/components/Rack/components/InputPrompt/lib.ts +19 -0
  120. package/src/components/Rack/components/RackTile/RackTile.tsx +9 -9
  121. package/src/components/Rack/selectors.ts +9 -0
  122. package/src/components/Radio/Radio.tsx +1 -1
  123. package/src/components/Results/Cell.tsx +2 -2
  124. package/src/components/Results/Header.tsx +1 -1
  125. package/src/components/Results/HeaderButton.tsx +2 -2
  126. package/src/components/Results/Result.tsx +5 -6
  127. package/src/components/Results/Results.tsx +6 -6
  128. package/src/components/Results/SolveButton.tsx +3 -3
  129. package/src/components/Results/types.ts +2 -2
  130. package/src/components/ResultsInput/ResultsInput.tsx +1 -1
  131. package/src/components/SeoMessage/SeoMessage.tsx +1 -1
  132. package/src/components/Solver/Solver.tsx +4 -4
  133. package/src/components/Solver/components/InsertButton/InsertButton.tsx +1 -1
  134. package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -5
  135. package/src/components/Spinner/Spinner.tsx +1 -1
  136. package/src/components/Tile/Tile.tsx +7 -7
  137. package/src/components/Tile/TilePure.tsx +8 -8
  138. package/src/components/Tooltip/Tooltip.tsx +1 -1
  139. package/src/components/Tooltip/TooltipContent.tsx +1 -1
  140. package/src/components/Tooltip/TooltipTrigger.tsx +1 -1
  141. package/src/components/Tooltip/context.ts +1 -1
  142. package/src/components/Tooltip/useTooltip.ts +1 -1
  143. package/src/hooks/useAppLayout.ts +1 -1
  144. package/src/hooks/useColumns.ts +28 -1
  145. package/src/hooks/useEffectOnce.ts +1 -1
  146. package/src/hooks/useLocalStorage.ts +8 -0
  147. package/src/i18n/constants.ts +1 -1
  148. package/src/i18n/i18n.ts +1 -1
  149. package/src/i18n/languages/english.json +3 -0
  150. package/src/i18n/languages/french.json +3 -0
  151. package/src/i18n/languages/german.json +3 -0
  152. package/src/i18n/languages/persian.json +3 -0
  153. package/src/i18n/languages/polish.json +3 -0
  154. package/src/i18n/languages/romanian.json +3 -0
  155. package/src/i18n/languages/spanish.json +3 -0
  156. package/src/i18n/languages/turkish.json +3 -0
  157. package/src/lib/createComparator.ts +1 -1
  158. package/src/lib/createKeyComparator.ts +1 -1
  159. package/src/lib/createKeyboardNavigation.ts +1 -1
  160. package/src/lib/createStringComparator.ts +1 -1
  161. package/src/lib/extractCharacters.test.ts +42 -15
  162. package/src/lib/extractCharacters.ts +27 -25
  163. package/src/lib/findCell.ts +1 -1
  164. package/src/lib/index.ts +2 -17
  165. package/src/lib/isCtrl.ts +1 -1
  166. package/src/lib/localeTransliterate.test.ts +14 -0
  167. package/src/lib/localeTransliterate.ts +18 -0
  168. package/src/lib/numberComparator.ts +1 -1
  169. package/src/lib/reverseComparator.ts +1 -1
  170. package/src/lib/zipCharactersAndTiles.ts +2 -2
  171. package/src/modals/DictionaryModal/DictionaryModal.tsx +1 -1
  172. package/src/modals/KeyMapModal/KeyMapModal.tsx +1 -1
  173. package/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +1 -1
  174. package/src/modals/MenuModal/MenuModal.tsx +1 -1
  175. package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +3 -2
  176. package/src/modals/RemainingTilesModal/components/Character/Character.tsx +2 -2
  177. package/src/{lib/getRemainingTilesGroups.ts → modals/RemainingTilesModal/lib.ts} +26 -9
  178. package/src/modals/RemainingTilesModal/selectors.ts +7 -0
  179. package/src/modals/ResultsModal/ResultsModal.tsx +4 -4
  180. package/src/modals/SettingsModal/SettingsModal.tsx +6 -1
  181. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -1
  182. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/lib.ts +1 -1
  183. package/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +1 -1
  184. package/src/modals/SettingsModal/components/ConfigSetting/lib.ts +1 -1
  185. package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +1 -1
  186. package/src/modals/SettingsModal/components/InputModeSetting/lib.ts +1 -1
  187. package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +2 -2
  188. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.module.scss +12 -0
  189. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.tsx +53 -0
  190. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/index.ts +1 -0
  191. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/lib.ts +13 -0
  192. package/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +2 -2
  193. package/src/modals/SettingsModal/components/index.ts +1 -0
  194. package/src/modals/WordsModal/WordsModal.tsx +4 -3
  195. package/src/pages/_app.tsx +2 -2
  196. package/src/pages/_document.tsx +1 -1
  197. package/src/pages/api/dictionary/[locale]/[word].ts +2 -2
  198. package/src/pages/api/dictionary/[locale]/index.ts +2 -2
  199. package/src/pages/api/solve.ts +11 -2
  200. package/src/pages/api/verify.ts +2 -2
  201. package/src/pages/api/visit.ts +1 -1
  202. package/src/pages/index.tsx +34 -43
  203. package/src/parameters/index.ts +1 -0
  204. package/src/sdk/findWordDefinitions.ts +1 -1
  205. package/src/sdk/getDictionary.ts +1 -1
  206. package/src/sdk/solve.ts +1 -1
  207. package/src/sdk/verify.ts +1 -1
  208. package/src/service-worker/dictionaries/getDictionary.ts +1 -1
  209. package/src/service-worker/dictionaries/getDictionaryUrl.ts +1 -1
  210. package/src/service-worker/dictionaries/revalidateDictionary.ts +1 -1
  211. package/src/service-worker/getTrie.ts +1 -1
  212. package/src/service-worker/routeSolveRequests.ts +2 -2
  213. package/src/service-worker/routeVerifyRequests.ts +1 -1
  214. package/src/state/board/index.ts +4 -0
  215. package/src/state/{slices/boardInitialState.ts → board/initialState.ts} +3 -6
  216. package/src/state/board/selectors.ts +3 -0
  217. package/src/state/{slices/boardSlice.ts → board/slice.ts} +5 -4
  218. package/src/state/board/types.ts +3 -0
  219. package/src/state/cellFilters/index.ts +4 -0
  220. package/src/state/cellFilters/initialState.ts +3 -0
  221. package/src/state/cellFilters/lib.ts +8 -0
  222. package/src/state/cellFilters/selectors.ts +13 -0
  223. package/src/state/{slices/cellFilterSlice.ts → cellFilters/slice.ts} +15 -14
  224. package/src/state/cellFilters/types.ts +3 -0
  225. package/src/state/dictionary/index.ts +4 -0
  226. package/src/state/dictionary/initialState.ts +8 -0
  227. package/src/state/dictionary/selectors.ts +16 -0
  228. package/src/state/{slices/dictionarySlice.ts → dictionary/slice.ts} +3 -3
  229. package/src/state/dictionary/types.ts +8 -0
  230. package/src/state/index.ts +12 -5
  231. package/src/{lib/getRemainingTiles.ts → state/lib.ts} +3 -4
  232. package/src/state/localStorage.ts +11 -2
  233. package/src/state/rack/index.ts +4 -0
  234. package/src/state/rack/initialState.ts +12 -0
  235. package/src/state/rack/selectors.ts +7 -0
  236. package/src/state/{slices/rackSlice.ts → rack/slice.ts} +4 -4
  237. package/src/state/rack/types.ts +3 -0
  238. package/src/state/results/index.ts +4 -0
  239. package/src/state/results/initialState.ts +13 -0
  240. package/src/state/results/lib.ts +96 -0
  241. package/src/state/results/selectors.ts +75 -0
  242. package/src/state/{slices/resultsSlice.ts → results/slice.ts} +4 -4
  243. package/src/state/results/types.ts +10 -0
  244. package/src/state/sagas.ts +22 -23
  245. package/src/state/selectors.ts +15 -235
  246. package/src/state/settings/index.ts +4 -0
  247. package/src/state/{slices/settingsInitialState.ts → settings/initialState.ts} +4 -11
  248. package/src/state/settings/lib.ts +42 -0
  249. package/src/state/settings/selectors.ts +69 -0
  250. package/src/state/{slices/settingsSlice.ts → settings/slice.ts} +9 -4
  251. package/src/state/settings/types.ts +12 -0
  252. package/src/state/solve/index.ts +4 -0
  253. package/src/state/solve/initialState.ts +12 -0
  254. package/src/state/solve/selectors.ts +14 -0
  255. package/src/state/{slices/solveSlice.ts → solve/slice.ts} +3 -3
  256. package/src/state/solve/types.ts +10 -0
  257. package/src/state/store.ts +9 -11
  258. package/src/state/types.ts +16 -18
  259. package/src/state/useTranslate.ts +2 -2
  260. package/src/state/useTypedSelector.ts +2 -2
  261. package/src/state/verify/index.ts +4 -0
  262. package/src/state/verify/initialState.ts +12 -0
  263. package/src/state/verify/selectors.ts +9 -0
  264. package/src/state/{slices/verifySlice.ts → verify/slice.ts} +3 -3
  265. package/src/state/verify/types.ts +10 -0
  266. package/src/styles/global.scss +5 -0
  267. package/src/types/api.ts +1 -1
  268. package/src/types/index.ts +8 -3
  269. package/tsconfig.tsbuildinfo +1 -1
  270. package/.eslintrc.js +0 -10
  271. package/.next/server/chunks/60.js +0 -1
  272. package/.next/server/chunks/968.js +0 -1
  273. package/.next/static/chunks/framework-288d1abd95de88d9.js +0 -1
  274. package/.next/static/chunks/main-016492249b3393e2.js +0 -1
  275. package/.next/static/chunks/pages/_app-0e951de0aebb6505.js +0 -1
  276. package/.next/static/chunks/pages/index-c1d5a66d0f4794a6.js +0 -1
  277. package/src/components/Board/lib/getBonusColor.ts +0 -16
  278. package/src/components/Board/lib/getPositionInGrid.ts +0 -13
  279. package/src/components/Board/lib/index.ts +0 -2
  280. package/src/components/PlainTiles/lib/createPlainTile.ts +0 -41
  281. package/src/components/PlainTiles/lib/createPlainTiles.ts +0 -25
  282. package/src/components/PlainTiles/lib/getViewbox.ts +0 -17
  283. package/src/components/PlainTiles/lib/getX.ts +0 -5
  284. package/src/components/PlainTiles/lib/getY.ts +0 -5
  285. package/src/components/PlainTiles/lib/index.ts +0 -6
  286. package/src/components/PlainTiles/lib/randomize.ts +0 -1
  287. package/src/lib/createArray.ts +0 -1
  288. package/src/lib/createGridOf.ts +0 -9
  289. package/src/lib/detectLocale.ts +0 -27
  290. package/src/lib/extractCharactersByCase.test.ts +0 -29
  291. package/src/lib/extractCharactersByCase.ts +0 -29
  292. package/src/lib/getCellSize.ts +0 -10
  293. package/src/lib/getCoordinates.ts +0 -16
  294. package/src/lib/getRemainingTilesCount.ts +0 -11
  295. package/src/lib/getTotalRemainingTilesCount.ts +0 -11
  296. package/src/lib/groupResults.ts +0 -35
  297. package/src/lib/guessLocale.ts +0 -20
  298. package/src/lib/isUpperCase.ts +0 -5
  299. package/src/lib/resultMatchesCellFilter.ts +0 -21
  300. package/src/lib/sortGroupedResults.ts +0 -21
  301. package/src/lib/sortResults.ts +0 -41
  302. package/src/state/slices/cellFilterInitialState.ts +0 -5
  303. package/src/state/slices/dictionaryInitialState.ts +0 -15
  304. package/src/state/slices/index.ts +0 -16
  305. package/src/state/slices/rackInitialState.ts +0 -9
  306. package/src/state/slices/resultsInitialState.ts +0 -20
  307. package/src/state/slices/solveInitialState.ts +0 -21
  308. package/src/state/slices/verifyInitialState.ts +0 -19
  309. /package/.next/static/{47JHul8F9NSWCNSEuahuL → MhrqAqLI9_L8obb7tgjvi}/_ssgManifest.js +0 -0
@@ -1,9 +1,6 @@
1
1
  import { BLANK, CONSONANTS, VOWELS } from '@scrabble-solver/constants';
2
2
 
3
- import { RemainingTile, RemainingTilesGroup } from 'types';
4
-
5
- import { getRemainingTilesCount } from './getRemainingTilesCount';
6
- import { getTotalRemainingTilesCount } from './getTotalRemainingTilesCount';
3
+ import { type RemainingTile, type RemainingTilesGroup } from 'types';
7
4
 
8
5
  export const getRemainingTilesGroups = (remainingTiles: RemainingTile[]): RemainingTilesGroup[] => {
9
6
  const consonants = remainingTiles.filter(isConsonant);
@@ -15,21 +12,21 @@ export const getRemainingTilesGroups = (remainingTiles: RemainingTile[]): Remain
15
12
  remainingCount: getRemainingTilesCount(vowels),
16
13
  tiles: vowels,
17
14
  translationKey: 'common.vowels',
18
- totalCount: getTotalRemainingTilesCount(vowels),
15
+ totalCount: getTotalTilesCount(vowels),
19
16
  });
20
17
 
21
18
  groups.push({
22
19
  remainingCount: getRemainingTilesCount(consonants),
23
20
  tiles: consonants,
24
21
  translationKey: 'common.consonants',
25
- totalCount: getTotalRemainingTilesCount(consonants),
22
+ totalCount: getTotalTilesCount(consonants),
26
23
  });
27
24
 
28
25
  groups.push({
29
26
  remainingCount: getRemainingTilesCount(other),
30
27
  tiles: other,
31
28
  translationKey: 'common.tiles',
32
- totalCount: getTotalRemainingTilesCount(other),
29
+ totalCount: getTotalTilesCount(other),
33
30
  });
34
31
 
35
32
  const twoCharacterTiles = remainingTiles.filter(isTwoCharacter);
@@ -39,14 +36,14 @@ export const getRemainingTilesGroups = (remainingTiles: RemainingTile[]): Remain
39
36
  remainingCount: getRemainingTilesCount(twoCharacterTiles),
40
37
  tiles: twoCharacterTiles,
41
38
  translationKey: 'common.two-letter-tiles',
42
- totalCount: getTotalRemainingTilesCount(twoCharacterTiles),
39
+ totalCount: getTotalTilesCount(twoCharacterTiles),
43
40
  });
44
41
 
45
42
  groups.push({
46
43
  remainingCount: getRemainingTilesCount(blanks),
47
44
  tiles: blanks,
48
45
  translationKey: 'common.blanks',
49
- totalCount: getTotalRemainingTilesCount(blanks),
46
+ totalCount: getTotalTilesCount(blanks),
50
47
  });
51
48
 
52
49
  return groups.filter(({ totalCount }) => totalCount > 0);
@@ -62,3 +59,23 @@ const isBlank = (tile: RemainingTile): boolean => tile.character === BLANK;
62
59
 
63
60
  const isOther = (tile: RemainingTile) =>
64
61
  !isConsonant(tile) && !isVowel(tile) && !isBlank(tile) && !isTwoCharacter(tile);
62
+
63
+ const getRemainingTilesCount = (remainingTiles: RemainingTile[]): number => {
64
+ return remainingTiles.reduce((sum, { count, usedCount }) => {
65
+ if (typeof count === 'undefined') {
66
+ return sum;
67
+ }
68
+
69
+ return sum + count - usedCount;
70
+ }, 0);
71
+ };
72
+
73
+ const getTotalTilesCount = (remainingTiles: RemainingTile[]): number => {
74
+ return remainingTiles.reduce((sum, { count }) => {
75
+ if (typeof count === 'undefined') {
76
+ return sum;
77
+ }
78
+
79
+ return sum + count;
80
+ }, 0);
81
+ };
@@ -0,0 +1,7 @@
1
+ import { createSelector } from '@reduxjs/toolkit';
2
+
3
+ import { selectRemainingTiles } from 'state';
4
+
5
+ import { getRemainingTilesGroups } from './lib';
6
+
7
+ export const selectRemainingTilesGroups = createSelector([selectRemainingTiles], getRemainingTilesGroups);
@@ -1,11 +1,11 @@
1
- import { Result } from '@scrabble-solver/types';
2
- import { FunctionComponent, memo, useEffect, useMemo } from 'react';
1
+ import { type Result } from '@scrabble-solver/types';
2
+ import { type FunctionComponent, memo, useEffect, useMemo } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
5
  import { Button, Dictionary, Modal, Results } from 'components';
6
6
  import { useAppLayout } from 'hooks';
7
7
  import { Check, EyeFill } from 'icons';
8
- import { resultsSlice, selectResultCandidate, selectResults, useTranslate, useTypedSelector } from 'state';
8
+ import { resultsSlice, selectProcessedResults, selectResultCandidate, useTranslate, useTypedSelector } from 'state';
9
9
 
10
10
  import styles from './ResultsModal.module.scss';
11
11
 
@@ -19,7 +19,7 @@ const ResultsModalBase: FunctionComponent<Props> = ({ className, isOpen, onClose
19
19
  const dispatch = useDispatch();
20
20
  const translate = useTranslate();
21
21
  const { showResultsInModal } = useAppLayout();
22
- const results = useTypedSelector(selectResults);
22
+ const results = useTypedSelector(selectProcessedResults);
23
23
  const resultCandidate = useTypedSelector(selectResultCandidate);
24
24
  const index = results ? results.findIndex((result) => result.id === resultCandidate?.id) : -1;
25
25
  const highlightedIndex = index === -1 ? undefined : index;
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, memo } from 'react';
1
+ import { type FunctionComponent, memo } from 'react';
2
2
 
3
3
  import { Modal } from 'components';
4
4
  import { useIsTouchDevice } from 'hooks';
@@ -10,6 +10,7 @@ import {
10
10
  InputModeSetting,
11
11
  LocaleSetting,
12
12
  ShowCoordinatesSetting,
13
+ RemoveCellFiltersSetting,
13
14
  } from './components';
14
15
 
15
16
  interface Props {
@@ -45,6 +46,10 @@ const SettingsModalBase: FunctionComponent<Props> = ({ className, isOpen, onClos
45
46
  <Modal.Section label={translate('settings.autoGroupTiles')} title={translate('settings.autoGroupTiles')}>
46
47
  <AutoGroupTilesSetting disabled={!isOpen} />
47
48
  </Modal.Section>
49
+
50
+ <Modal.Section label={translate('settings.removeCellFilters')} title={translate('settings.removeCellFilters')}>
51
+ <RemoveCellFiltersSetting disabled={!isOpen} />
52
+ </Modal.Section>
48
53
  </Modal>
49
54
  );
50
55
  };
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, FunctionComponent } from 'react';
1
+ import { type ChangeEvent, type FunctionComponent } from 'react';
2
2
  import { useDispatch } from 'react-redux';
3
3
 
4
4
  import { Radio } from 'components';
@@ -1,4 +1,4 @@
1
- import { AutoGroupTiles } from 'types';
1
+ import { type AutoGroupTiles } from 'types';
2
2
 
3
3
  import { NULL_VALUE } from './constants';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { isGame } from '@scrabble-solver/types';
2
- import { ChangeEvent, FunctionComponent, useMemo } from 'react';
2
+ import { type ChangeEvent, type FunctionComponent, useMemo } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
5
  import { Radio } from 'components';
@@ -1,5 +1,5 @@
1
1
  import { games, hasConfig, languages } from '@scrabble-solver/configs';
2
- import { Locale } from '@scrabble-solver/types';
2
+ import { type Locale } from '@scrabble-solver/types';
3
3
 
4
4
  export const getOptions = (locale: Locale) => {
5
5
  const gameConfigs = Object.values(games);
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, FunctionComponent } from 'react';
1
+ import { type ChangeEvent, type FunctionComponent } from 'react';
2
2
  import { useDispatch } from 'react-redux';
3
3
 
4
4
  import { Radio } from 'components';
@@ -1,4 +1,4 @@
1
- import { InputMode } from 'types';
1
+ import { type InputMode } from 'types';
2
2
 
3
3
  export const parseValue = (value: string): InputMode => {
4
4
  if (value === 'keyboard') {
@@ -1,6 +1,6 @@
1
- import { Locale } from '@scrabble-solver/types';
1
+ import { type Locale } from '@scrabble-solver/types';
2
2
  import classNames from 'classnames';
3
- import { ChangeEvent, FunctionComponent } from 'react';
3
+ import { type ChangeEvent, type FunctionComponent } from 'react';
4
4
  import { useDispatch } from 'react-redux';
5
5
 
6
6
  import { Radio } from 'components';
@@ -0,0 +1,12 @@
1
+ .option {
2
+ margin-bottom: var(--spacing--m);
3
+
4
+ &:last-child {
5
+ margin-bottom: 0;
6
+ }
7
+ }
8
+
9
+ .label {
10
+ display: flex;
11
+ align-items: center;
12
+ }
@@ -0,0 +1,53 @@
1
+ import { type ChangeEvent, type FunctionComponent } from 'react';
2
+ import { useDispatch } from 'react-redux';
3
+
4
+ import { Radio } from 'components';
5
+ import { selectRemoveCellFilters, settingsSlice, useTranslate, useTypedSelector } from 'state';
6
+
7
+ import { parseValue } from './lib';
8
+ import styles from './RemoveCellFiltersSetting.module.scss';
9
+
10
+ interface Props {
11
+ className?: string;
12
+ disabled?: boolean;
13
+ }
14
+
15
+ export const RemoveCellFiltersSetting: FunctionComponent<Props> = ({ className, disabled }) => {
16
+ const dispatch = useDispatch();
17
+ const translate = useTranslate();
18
+ const value = useTypedSelector(selectRemoveCellFilters);
19
+
20
+ const options = [
21
+ {
22
+ label: translate('settings.removeCellFilters.always'),
23
+ value: 'always',
24
+ },
25
+ {
26
+ label: translate('settings.removeCellFilters.never'),
27
+ value: 'never',
28
+ },
29
+ ];
30
+
31
+ const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
32
+ const removeTileFilter = parseValue(event.target.value);
33
+ dispatch(settingsSlice.actions.changeRemoveCellFilters(removeTileFilter));
34
+ };
35
+
36
+ return (
37
+ <div className={className}>
38
+ {options.map((option) => (
39
+ <Radio
40
+ checked={value === option.value}
41
+ className={styles.option}
42
+ disabled={disabled}
43
+ key={option.value}
44
+ name="removeCellFilters"
45
+ value={option.value}
46
+ onChange={handleChange}
47
+ >
48
+ <div className={styles.label}>{option.label}</div>
49
+ </Radio>
50
+ ))}
51
+ </div>
52
+ );
53
+ };
@@ -0,0 +1 @@
1
+ export { RemoveCellFiltersSetting } from './RemoveCellFiltersSetting';
@@ -0,0 +1,13 @@
1
+ import { type RemoveCellFilters } from 'types';
2
+
3
+ export const parseValue = (value: string): RemoveCellFilters => {
4
+ if (value === 'always') {
5
+ return 'always';
6
+ }
7
+
8
+ if (value === 'never') {
9
+ return 'never';
10
+ }
11
+
12
+ throw new Error(`"${value}" is not valid. Should be "always" or "never"`);
13
+ };
@@ -1,5 +1,5 @@
1
- import { ShowCoordinates } from '@scrabble-solver/types';
2
- import { ChangeEvent, FunctionComponent } from 'react';
1
+ import { type ShowCoordinates } from '@scrabble-solver/types';
2
+ import { type ChangeEvent, type FunctionComponent } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
5
  import { Radio } from 'components';
@@ -3,3 +3,4 @@ export { ConfigSetting } from './ConfigSetting';
3
3
  export { InputModeSetting } from './InputModeSetting';
4
4
  export { LocaleSetting } from './LocaleSetting';
5
5
  export { ShowCoordinatesSetting } from './ShowCoordinatesSetting';
6
+ export { RemoveCellFiltersSetting } from './RemoveCellFiltersSetting';
@@ -1,9 +1,9 @@
1
1
  import classNames from 'classnames';
2
- import { FunctionComponent, memo } from 'react';
2
+ import { type FunctionComponent, memo } from 'react';
3
3
 
4
4
  import { Badge, Modal } from 'components';
5
5
  import { Check, Cross } from 'icons';
6
- import { selectLocale, selectVerify, useTranslate, useTypedSelector } from 'state';
6
+ import { selectInvalidWords, selectLocale, selectValidWords, useTranslate, useTypedSelector } from 'state';
7
7
 
8
8
  import styles from './WordsModal.module.scss';
9
9
 
@@ -16,7 +16,8 @@ interface Props {
16
16
  const WordsModalBase: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
17
17
  const translate = useTranslate();
18
18
  const locale = useTypedSelector(selectLocale);
19
- const { invalidWords, validWords } = useTypedSelector(selectVerify);
19
+ const invalidWords = useTypedSelector(selectInvalidWords);
20
+ const validWords = useTypedSelector(selectValidWords);
20
21
 
21
22
  return (
22
23
  <Modal className={className} isOpen={isOpen} title={translate('words')} onClose={onClose}>
@@ -1,7 +1,7 @@
1
1
  import { FloatingDelayGroup } from '@floating-ui/react';
2
- import { AppProps } from 'next/app';
2
+ import { type AppProps } from 'next/app';
3
3
  import Head from 'next/head';
4
- import { FunctionComponent } from 'react';
4
+ import { type FunctionComponent } from 'react';
5
5
  import { Provider } from 'react-redux';
6
6
 
7
7
  import { SeoMessage } from 'components';
@@ -1,5 +1,5 @@
1
1
  import Document, { Head, Html, Main, NextScript } from 'next/document';
2
- import { ReactElement } from 'react';
2
+ import { type ReactElement } from 'react';
3
3
 
4
4
  class MyDocument extends Document {
5
5
  render(): ReactElement {
@@ -2,9 +2,9 @@ import { games } from '@scrabble-solver/configs';
2
2
  import { COMMA_ARABIC, COMMA_LATIN } from '@scrabble-solver/constants';
3
3
  import { dictionaries } from '@scrabble-solver/dictionaries';
4
4
  import { logger } from '@scrabble-solver/logger';
5
- import { Locale, isLocale } from '@scrabble-solver/types';
5
+ import { type Locale, isLocale } from '@scrabble-solver/types';
6
6
  import { getWordDefinition } from '@scrabble-solver/word-definitions';
7
- import { NextApiRequest, NextApiResponse } from 'next';
7
+ import { type NextApiRequest, type NextApiResponse } from 'next';
8
8
 
9
9
  import { getServerLoggingData } from 'api';
10
10
 
@@ -1,7 +1,7 @@
1
1
  import { dictionaries } from '@scrabble-solver/dictionaries';
2
2
  import { logger } from '@scrabble-solver/logger';
3
- import { isLocale, Locale } from '@scrabble-solver/types';
4
- import { NextApiRequest, NextApiResponse } from 'next';
3
+ import { isLocale, type Locale } from '@scrabble-solver/types';
4
+ import { type NextApiRequest, type NextApiResponse } from 'next';
5
5
 
6
6
  import { getServerLoggingData } from 'api';
7
7
 
@@ -3,8 +3,17 @@ import { BLANK } from '@scrabble-solver/constants';
3
3
  import { dictionaries } from '@scrabble-solver/dictionaries';
4
4
  import { logger } from '@scrabble-solver/logger';
5
5
  import { solve as solveScrabble } from '@scrabble-solver/solver';
6
- import { Board, Config, Game, Locale, Tile, isBoardJson, isGame, isLocale } from '@scrabble-solver/types';
7
- import { NextApiRequest, NextApiResponse } from 'next';
6
+ import {
7
+ Board,
8
+ type Config,
9
+ type Game,
10
+ type Locale,
11
+ Tile,
12
+ isBoardJson,
13
+ isGame,
14
+ isLocale,
15
+ } from '@scrabble-solver/types';
16
+ import { type NextApiRequest, type NextApiResponse } from 'next';
8
17
 
9
18
  import { getServerLoggingData, isBoardValid, isCharacterValid } from 'api';
10
19
  import { isStringArray } from 'lib';
@@ -1,8 +1,8 @@
1
1
  import { getConfig, hasConfig } from '@scrabble-solver/configs';
2
2
  import { dictionaries } from '@scrabble-solver/dictionaries';
3
3
  import { logger } from '@scrabble-solver/logger';
4
- import { Board, Config, Game, Locale, isBoardJson, isGame, isLocale } from '@scrabble-solver/types';
5
- import { NextApiRequest, NextApiResponse } from 'next';
4
+ import { Board, type Config, type Game, type Locale, isBoardJson, isGame, isLocale } from '@scrabble-solver/types';
5
+ import { type NextApiRequest, type NextApiResponse } from 'next';
6
6
 
7
7
  import { getServerLoggingData, isBoardValid } from 'api';
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { logger } from '@scrabble-solver/logger';
2
- import { NextApiRequest, NextApiResponse } from 'next';
2
+ import { type NextApiRequest, type NextApiResponse } from 'next';
3
3
 
4
4
  import { getServerLoggingData } from 'api';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { isObject } from '@scrabble-solver/types';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- import { FunctionComponent, useCallback, useState } from 'react';
4
+ import { type FunctionComponent, useState } from 'react';
5
5
  import ReactModal from 'react-modal';
6
6
  import { useDispatch } from 'react-redux';
7
7
 
@@ -28,35 +28,26 @@ interface Props {
28
28
  version: string;
29
29
  }
30
30
 
31
- // eslint-disable-next-line max-statements
31
+ type Modal = 'dictionary' | 'keyMap' | 'menu' | 'remainingTiles' | 'results' | 'settings' | 'words';
32
+
32
33
  const Index: FunctionComponent<Props> = ({ version }) => {
33
34
  const dispatch = useDispatch();
34
35
  const config = useTypedSelector(selectConfig);
35
36
  const locale = useTypedSelector(selectLocale);
36
- const [showDictionary, setShowDictionary] = useState(false);
37
- const [showKeyMap, setShowKeyMap] = useState(false);
38
- const [showMenu, setShowMenu] = useState(false);
39
- const [showRemainingTiles, setShowRemainingTiles] = useState(false);
40
- const [showResults, setShowResults] = useState(false);
41
- const [showSettings, setShowSettings] = useState(false);
42
- const [showWords, setShowWords] = useState(false);
43
37
  const [isClient, setIsClient] = useState(false);
38
+ const [modals, setModals] = useState<Record<Modal, boolean>>({
39
+ dictionary: false,
40
+ keyMap: false,
41
+ menu: false,
42
+ remainingTiles: false,
43
+ results: false,
44
+ settings: false,
45
+ words: false,
46
+ });
44
47
 
45
- const handleShowResults = useCallback(() => setShowResults(true), []);
46
- const handleClear = useCallback(() => dispatch(reset()), [dispatch]);
47
- const handleHideDictionary = useCallback(() => setShowDictionary(false), []);
48
- const handleHideKeyMap = useCallback(() => setShowKeyMap(false), []);
49
- const handleHideMenu = useCallback(() => setShowMenu(false), []);
50
- const handleHideRemainingTiles = useCallback(() => setShowRemainingTiles(false), []);
51
- const handleHideResults = useCallback(() => setShowResults(false), []);
52
- const handleHideSettings = useCallback(() => setShowSettings(false), []);
53
- const handleHideWords = useCallback(() => setShowWords(false), []);
54
- const handleShowDictionary = useCallback(() => setShowDictionary(true), []);
55
- const handleShowKeyMap = useCallback(() => setShowKeyMap(true), []);
56
- const handleShowMenu = useCallback(() => setShowMenu(true), []);
57
- const handleShowRemainingTiles = useCallback(() => setShowRemainingTiles(true), []);
58
- const handleShowSettings = useCallback(() => setShowSettings(true), []);
59
- const handleShowWords = useCallback(() => setShowWords(true), []);
48
+ const patchModals = (patch: Partial<Record<Modal, boolean>>) => {
49
+ setModals((current) => ({ ...current, ...patch }));
50
+ };
60
51
 
61
52
  useDirection(LOCALE_FEATURES[locale].direction);
62
53
  useLanguage(locale);
@@ -87,40 +78,40 @@ const Index: FunctionComponent<Props> = ({ version }) => {
87
78
  </div>
88
79
 
89
80
  <NavButtons
90
- onClear={handleClear}
91
- onShowKeyMap={handleShowKeyMap}
92
- onShowMenu={handleShowMenu}
93
- onShowRemainingTiles={handleShowRemainingTiles}
94
- onShowSettings={handleShowSettings}
95
- onShowWords={handleShowWords}
81
+ onClear={() => dispatch(reset())}
82
+ onShowKeyMap={() => patchModals({ keyMap: true })}
83
+ onShowMenu={() => patchModals({ menu: true })}
84
+ onShowRemainingTiles={() => patchModals({ remainingTiles: true })}
85
+ onShowSettings={() => patchModals({ settings: true })}
86
+ onShowWords={() => patchModals({ words: true })}
96
87
  />
97
88
  </div>
98
89
  </nav>
99
90
 
100
- <Solver className={styles.solver} onShowResults={handleShowResults} />
91
+ <Solver className={styles.solver} onShowResults={() => patchModals({ results: true })} />
101
92
 
102
93
  <MenuModal
103
- isOpen={showMenu}
104
- onClose={handleHideMenu}
105
- onShowDictionary={handleShowDictionary}
106
- onShowRemainingTiles={handleShowRemainingTiles}
107
- onShowSettings={handleShowSettings}
108
- onShowWords={handleShowWords}
94
+ isOpen={modals.menu}
95
+ onClose={() => patchModals({ menu: false })}
96
+ onShowDictionary={() => patchModals({ dictionary: true })}
97
+ onShowRemainingTiles={() => patchModals({ remainingTiles: true })}
98
+ onShowSettings={() => patchModals({ settings: true })}
99
+ onShowWords={() => patchModals({ words: true })}
109
100
  />
110
101
 
111
- <SettingsModal isOpen={showSettings} onClose={handleHideSettings} />
102
+ <SettingsModal isOpen={modals.settings} onClose={() => patchModals({ settings: false })} />
112
103
 
113
- <KeyMapModal isOpen={showKeyMap} onClose={handleHideKeyMap} />
104
+ <KeyMapModal isOpen={modals.keyMap} onClose={() => patchModals({ keyMap: false })} />
114
105
 
115
- <WordsModal isOpen={showWords} onClose={handleHideWords} />
106
+ <WordsModal isOpen={modals.words} onClose={() => patchModals({ words: false })} />
116
107
 
117
108
  {config.supportsRemainingTiles && (
118
- <RemainingTilesModal isOpen={showRemainingTiles} onClose={handleHideRemainingTiles} />
109
+ <RemainingTilesModal isOpen={modals.remainingTiles} onClose={() => patchModals({ remainingTiles: false })} />
119
110
  )}
120
111
 
121
- <ResultsModal isOpen={showResults} onClose={handleHideResults} />
112
+ <ResultsModal isOpen={modals.results} onClose={() => patchModals({ results: false })} />
122
113
 
123
- <DictionaryModal isOpen={showDictionary} onClose={handleHideDictionary} />
114
+ <DictionaryModal isOpen={modals.dictionary} onClose={() => patchModals({ dictionary: false })} />
124
115
  </>
125
116
  );
126
117
  };
@@ -91,6 +91,7 @@ export const MODAL_HEADER_HEIGHT = 45;
91
91
  export const NAV_PADDING = SPACING_L;
92
92
 
93
93
  export const TILE_SIZE = 80;
94
+
94
95
  export const TOOLTIP_DURATION = TRANSITION_DURATION;
95
96
 
96
97
  export const PLAIN_TILES_COLOR_DEFAULT = COLOR_GREEN;
@@ -1,4 +1,4 @@
1
- import { Locale, WordDefinition, WordDefinitionJson } from '@scrabble-solver/types';
1
+ import { type Locale, WordDefinition, type WordDefinitionJson } from '@scrabble-solver/types';
2
2
 
3
3
  import { fetchJson } from './fetchJson';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { Trie } from '@kamilmielnik/trie';
2
- import { Locale } from '@scrabble-solver/types';
2
+ import { type Locale } from '@scrabble-solver/types';
3
3
 
4
4
  import { fetchJson } from './fetchJson';
5
5
 
package/src/sdk/solve.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BoardJson, Locale, Result, ResultJson } from '@scrabble-solver/types';
1
+ import { type BoardJson, type Locale, Result, type ResultJson } from '@scrabble-solver/types';
2
2
 
3
3
  import { fetchJson } from './fetchJson';
4
4
 
package/src/sdk/verify.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BoardJson, Locale } from '@scrabble-solver/types';
1
+ import { type BoardJson, type Locale } from '@scrabble-solver/types';
2
2
 
3
3
  import { fetchJson } from './fetchJson';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Locale } from '@scrabble-solver/types';
1
+ import { type Locale } from '@scrabble-solver/types';
2
2
 
3
3
  import { DICTIONARY_CACHE } from './constants';
4
4
  import { expirationManager } from './expirationManager';
@@ -1,4 +1,4 @@
1
- import { Locale } from '@scrabble-solver/types';
1
+ import { type Locale } from '@scrabble-solver/types';
2
2
 
3
3
  export const getDictionaryUrl = (locale: Locale): string => {
4
4
  return `/api/dictionary/${locale}`;
@@ -1,4 +1,4 @@
1
- import { Locale } from '@scrabble-solver/types';
1
+ import { type Locale } from '@scrabble-solver/types';
2
2
 
3
3
  import { DICTIONARY_CACHE } from './constants';
4
4
  import { expirationManager } from './expirationManager';
@@ -1,5 +1,5 @@
1
1
  import { Trie } from '@kamilmielnik/trie';
2
- import { Locale } from '@scrabble-solver/types';
2
+ import { type Locale } from '@scrabble-solver/types';
3
3
 
4
4
  import { getDictionary } from './dictionaries';
5
5
 
@@ -1,11 +1,11 @@
1
- import { Trie } from '@kamilmielnik/trie';
1
+ import { type Trie } from '@kamilmielnik/trie';
2
2
  import { getConfig } from '@scrabble-solver/configs';
3
3
  import { BLANK } from '@scrabble-solver/constants';
4
4
  import { solve } from '@scrabble-solver/solver';
5
5
  import { Board, Tile } from '@scrabble-solver/types';
6
6
  import { registerRoute } from 'workbox-routing';
7
7
 
8
- import { SolveRequestPayload } from 'types';
8
+ import { type SolveRequestPayload } from 'types';
9
9
 
10
10
  import { average } from './average';
11
11
  import { revalidateDictionary } from './dictionaries';
@@ -1,7 +1,7 @@
1
1
  import { Board } from '@scrabble-solver/types';
2
2
  import { registerRoute } from 'workbox-routing';
3
3
 
4
- import { VerifyRequestPayload } from 'types';
4
+ import { type VerifyRequestPayload } from 'types';
5
5
 
6
6
  import { revalidateDictionary } from './dictionaries';
7
7
  import { getTrie } from './getTrie';
@@ -0,0 +1,4 @@
1
+ export * from './initialState';
2
+ export * from './selectors';
3
+ export * from './slice';
4
+ export * from './types';
@@ -2,17 +2,14 @@ import { getConfig } from '@scrabble-solver/configs';
2
2
  import { Board } from '@scrabble-solver/types';
3
3
 
4
4
  import { localStorage } from '../localStorage';
5
+ import { settingsInitialState } from '../settings';
5
6
 
6
- import { settingsInitialState } from './settingsInitialState';
7
-
8
- export type BoardState = Board;
7
+ import type { BoardState } from './types';
9
8
 
10
9
  const { game, locale } = settingsInitialState;
11
10
  const { boardHeight, boardWidth } = getConfig(game, locale);
12
11
 
13
- export const boardDefaultState = Board.create(boardWidth, boardHeight);
14
-
15
- export const boardInitialState: BoardState = localStorage.getBoard() || boardDefaultState;
12
+ export const boardInitialState: BoardState = localStorage.getBoard() ?? Board.create(boardWidth, boardHeight);
16
13
 
17
14
  // const createOxyphenbutazone = () => {
18
15
  // // Tiles: oypbaze