@scrabble-solver/scrabble-solver 2.15.22 → 2.15.24

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 (154) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +12 -12
  3. package/.next/cache/.previewinfo +1 -1
  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/index.pack +0 -0
  10. package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  11. package/.next/cache/webpack/server-production/0.pack +0 -0
  12. package/.next/cache/webpack/server-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  14. package/.next/diagnostics/framework.json +1 -1
  15. package/.next/prerender-manifest.json +4 -4
  16. package/.next/routes-manifest.json +1 -1
  17. package/.next/server/chunks/712.js +1 -1
  18. package/.next/server/middleware-build-manifest.js +1 -1
  19. package/.next/server/pages/404.html +1 -1
  20. package/.next/server/pages/500.html +1 -1
  21. package/.next/server/pages/index.html +1 -1
  22. package/.next/server/pages/index.js +1 -1
  23. package/.next/server/pages/index.json +1 -1
  24. package/.next/server/pages/not-found.html +1 -1
  25. package/.next/static/chunks/{framework-906c47013125d174.js → framework-f7982db529c0590c.js} +1 -1
  26. package/.next/static/chunks/{main-f63f5bd5e9581250.js → main-ca07941c8a544c9a.js} +1 -1
  27. package/.next/static/chunks/pages/{_app-6a68c941d55599c8.js → _app-369e5cb907606ad4.js} +5 -5
  28. package/.next/static/chunks/pages/{index-6c5b582e7afc063c.js → index-08b3b0a754095919.js} +1 -1
  29. package/.next/static/{MxQ5rcf448WOpfCa2_VVz → f_g0t0jBAscXxDrNYOuV0}/_buildManifest.js +1 -1
  30. package/.next/trace +21 -21
  31. package/.next/trace-build +1 -1
  32. package/package.json +12 -12
  33. package/src/app-layout/useAppLayoutValue.ts +4 -4
  34. package/src/components/Alert/Alert.tsx +1 -1
  35. package/src/components/Board/Board.tsx +4 -4
  36. package/src/components/Board/BoardPure.tsx +4 -4
  37. package/src/components/Board/components/Actions/Actions.tsx +5 -5
  38. package/src/components/Board/components/Actions/lib.ts +2 -2
  39. package/src/components/Board/components/Cell/Cell.tsx +1 -1
  40. package/src/components/Board/components/InputPrompt/InputPrompt.tsx +3 -3
  41. package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +4 -4
  42. package/src/components/Board/hooks/useBackgroundImage.tsx +235 -172
  43. package/src/components/Board/hooks/useBoardStyle.ts +4 -4
  44. package/src/components/Board/hooks/useFloatingActions.ts +2 -2
  45. package/src/components/Board/hooks/useFloatingInputPrompt.ts +1 -1
  46. package/src/components/Board/hooks/useGrid.ts +5 -5
  47. package/src/components/Board/lib.ts +2 -2
  48. package/src/components/Board/selectors.ts +2 -2
  49. package/src/components/Dictionary/Dictionary.tsx +2 -2
  50. package/src/components/DictionaryInput/DictionaryInput.tsx +2 -2
  51. package/src/components/EmptyState/EmptyState.tsx +13 -5
  52. package/src/components/Keys/Arrows/Arrows.tsx +1 -1
  53. package/src/components/Keys/index.tsx +2 -2
  54. package/src/components/Loading/Loading.tsx +2 -2
  55. package/src/components/Logo/Logo.tsx +2 -2
  56. package/src/components/Modal/Modal.tsx +3 -3
  57. package/src/components/NavButtons/NavButtons.tsx +4 -4
  58. package/src/components/NavButtons/selectors.ts +1 -1
  59. package/src/components/NotFound/NotFound.tsx +1 -1
  60. package/src/components/PlainTiles/lib.ts +1 -1
  61. package/src/components/Progress/Progress.tsx +2 -2
  62. package/src/components/Rack/Rack.tsx +4 -4
  63. package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +2 -2
  64. package/src/components/Rack/components/InputPrompt/lib.ts +1 -3
  65. package/src/components/Rack/components/RackTile/RackTile.tsx +2 -2
  66. package/src/components/Rack/selectors.ts +2 -2
  67. package/src/components/Results/Cell.tsx +2 -2
  68. package/src/components/Results/Header.tsx +5 -5
  69. package/src/components/Results/HeaderButton.tsx +3 -3
  70. package/src/components/Results/Result.tsx +6 -6
  71. package/src/components/Results/Results.tsx +4 -4
  72. package/src/components/Results/SolveButton.tsx +2 -2
  73. package/src/components/ResultsInput/ResultsInput.tsx +2 -2
  74. package/src/components/Solver/Solver.tsx +3 -3
  75. package/src/components/Solver/components/InsertButton/InsertButton.tsx +2 -2
  76. package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +2 -2
  77. package/src/components/Spinner/Spinner.tsx +1 -1
  78. package/src/components/Tile/Tile.tsx +3 -3
  79. package/src/components/Tile/TilePure.tsx +1 -1
  80. package/src/components/Tooltip/TooltipContent.tsx +1 -1
  81. package/src/hooks/useColumns.ts +3 -3
  82. package/src/hooks/useDirection.ts +1 -1
  83. package/src/hooks/useLanguage.ts +1 -1
  84. package/src/hooks/useLocalStorage.ts +1 -1
  85. package/src/hooks/useMediaQuery.ts +1 -1
  86. package/src/i18n/constants.ts +1 -1
  87. package/src/i18n/i18n.ts +1 -1
  88. package/src/i18n/languages/english.json +1 -1
  89. package/src/i18n/languages/french.json +1 -1
  90. package/src/i18n/languages/german.json +1 -1
  91. package/src/i18n/languages/polish.json +1 -1
  92. package/src/i18n/languages/romanian.json +1 -1
  93. package/src/i18n/languages/spanish.json +1 -1
  94. package/src/i18n/languages/turkish.json +1 -1
  95. package/src/lib/createComparator.ts +1 -1
  96. package/src/lib/createKeyComparator.ts +1 -1
  97. package/src/lib/createStringComparator.ts +1 -1
  98. package/src/lib/getTileSizes.ts +1 -1
  99. package/src/lib/numberComparator.ts +1 -1
  100. package/src/lib/reverseComparator.ts +1 -1
  101. package/src/lib/zipCharactersAndTiles.ts +1 -1
  102. package/src/modals/DictionaryModal/DictionaryModal.tsx +2 -2
  103. package/src/modals/KeyMapModal/KeyMapModal.tsx +2 -2
  104. package/src/modals/MenuModal/MenuModal.tsx +5 -5
  105. package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +5 -5
  106. package/src/modals/RemainingTilesModal/components/Character/Character.tsx +5 -5
  107. package/src/modals/RemainingTilesModal/lib.ts +1 -1
  108. package/src/modals/RemainingTilesModal/selectors.ts +1 -1
  109. package/src/modals/ResultsModal/ResultsModal.tsx +4 -4
  110. package/src/modals/SettingsModal/SettingsModal.tsx +3 -3
  111. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +2 -2
  112. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/lib.ts +1 -1
  113. package/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +2 -2
  114. package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +2 -2
  115. package/src/modals/SettingsModal/components/InputModeSetting/lib.ts +1 -1
  116. package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +3 -3
  117. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.tsx +2 -2
  118. package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/lib.ts +1 -1
  119. package/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +2 -2
  120. package/src/modals/WordsModal/WordsModal.tsx +3 -3
  121. package/src/pages/_app.tsx +3 -3
  122. package/src/pages/api/dictionary/[locale]/[word].ts +1 -1
  123. package/src/pages/api/dictionary/[locale]/index.ts +1 -1
  124. package/src/pages/api/solve.ts +2 -2
  125. package/src/pages/api/verify.ts +1 -1
  126. package/src/pages/api/visit.ts +1 -1
  127. package/src/pages/index.tsx +6 -6
  128. package/src/pages/not-found.tsx +1 -1
  129. package/src/parameters/index.ts +1 -1
  130. package/src/service-worker/routeSolveRequests.ts +1 -1
  131. package/src/service-worker/routeVerifyRequests.ts +1 -1
  132. package/src/state/board/slice.ts +24 -1
  133. package/src/state/cellFilters/lib.ts +1 -1
  134. package/src/state/cellFilters/selectors.ts +1 -1
  135. package/src/state/cellFilters/slice.ts +1 -1
  136. package/src/state/cellFilters/types.ts +1 -1
  137. package/src/state/lib.ts +2 -2
  138. package/src/state/localStorage.ts +1 -1
  139. package/src/state/rack/slice.ts +2 -2
  140. package/src/state/rack/types.ts +1 -1
  141. package/src/state/results/initialState.ts +1 -1
  142. package/src/state/results/lib.ts +9 -2
  143. package/src/state/results/selectors.ts +1 -1
  144. package/src/state/results/slice.ts +1 -1
  145. package/src/state/results/types.ts +1 -1
  146. package/src/state/sagas.ts +3 -3
  147. package/src/state/selectors.ts +1 -1
  148. package/src/state/settings/selectors.ts +1 -1
  149. package/src/state/settings/slice.ts +1 -1
  150. package/src/state/settings/types.ts +1 -1
  151. package/src/state/useTranslate.ts +1 -1
  152. package/tsconfig.json +1 -15
  153. package/tsconfig.tsbuildinfo +1 -1
  154. /package/.next/static/{MxQ5rcf448WOpfCa2_VVz → f_g0t0jBAscXxDrNYOuV0}/_ssgManifest.js +0 -0
@@ -42,7 +42,7 @@
42
42
  "keyMap.board-and-rack.insert-two-letter-tile": "Zwei-Buchstaben Stein hinzufügen",
43
43
  "keyMap.board-and-rack.navigate": "Navigieren",
44
44
  "keyMap.board-and-rack.remove-tile": "Stein entfernen",
45
- "keyMap.board-and-rack.submit": "Lösen starten",
45
+ "keyMap.board-and-rack.submit": "Lösen",
46
46
  "keyMap.rack": "Ablage",
47
47
  "keyMap.rack.insert-blank": "Blanko hinzufügen",
48
48
  "menu": "Menü",
@@ -42,7 +42,7 @@
42
42
  "keyMap.board-and-rack.insert-two-letter-tile": "Wstaw dwuliterową płytkę",
43
43
  "keyMap.board-and-rack.navigate": "Nawigacja",
44
44
  "keyMap.board-and-rack.remove-tile": "Zdejmij płytkę",
45
- "keyMap.board-and-rack.submit": "Rozpocznij wyszukiwanie",
45
+ "keyMap.board-and-rack.submit": "Rozwiąż",
46
46
  "keyMap.rack": "Stojak",
47
47
  "keyMap.rack.insert-blank": "Wstaw blanka",
48
48
  "menu": "Menu",
@@ -42,7 +42,7 @@
42
42
  "keyMap.board-and-rack.insert-two-letter-tile": "Introducere piesa 2 litere",
43
43
  "keyMap.board-and-rack.navigate": "Navigare",
44
44
  "keyMap.board-and-rack.remove-tile": "Indeparteaza piesa",
45
- "keyMap.board-and-rack.submit": "Pornire cautare",
45
+ "keyMap.board-and-rack.submit": "Rezolvă",
46
46
  "keyMap.rack": "Grupa litere",
47
47
  "keyMap.rack.insert-blank": "Introducere joker",
48
48
  "menu": "Meniu",
@@ -42,7 +42,7 @@
42
42
  "keyMap.board-and-rack.insert-two-letter-tile": "Insertar mosaico de dos letras",
43
43
  "keyMap.board-and-rack.navigate": "Navegar",
44
44
  "keyMap.board-and-rack.remove-tile": "Quitar Letra",
45
- "keyMap.board-and-rack.submit": "Empezar a resolver",
45
+ "keyMap.board-and-rack.submit": "Resolver",
46
46
  "keyMap.rack": "Estante",
47
47
  "keyMap.rack.insert-blank": "Insertar espacio en blanco",
48
48
  "menu": "Menú",
@@ -42,7 +42,7 @@
42
42
  "keyMap.board-and-rack.insert-two-letter-tile": "İki harfli kutucuğu ekle",
43
43
  "keyMap.board-and-rack.navigate": "Gezinme",
44
44
  "keyMap.board-and-rack.remove-tile": "Taşı kaldır",
45
- "keyMap.board-and-rack.submit": "Çözmeye başla",
45
+ "keyMap.board-and-rack.submit": "Çöz",
46
46
  "keyMap.rack": "Deste",
47
47
  "keyMap.rack.insert-blank": "Joker ekle (spacebar)",
48
48
  "menu": "Menü",
@@ -1,4 +1,4 @@
1
- import type { Comparator } from 'types';
1
+ import type { Comparator } from '@/types';
2
2
 
3
3
  import { createStringComparator } from './createStringComparator';
4
4
  import { numberComparator } from './numberComparator';
@@ -1,4 +1,4 @@
1
- import { type Comparator } from 'types';
1
+ import { type Comparator } from '@/types';
2
2
 
3
3
  import { createStringComparator } from './createStringComparator';
4
4
  import { numberComparator } from './numberComparator';
@@ -1,4 +1,4 @@
1
- import { type Comparator } from 'types';
1
+ import { type Comparator } from '@/types';
2
2
 
3
3
  export const createStringComparator: (locale: string) => Comparator<string> = (locale) => {
4
4
  return (a, b) => {
@@ -1,4 +1,4 @@
1
- import { BOARD_TILE_FONT_SIZE_MIN, BOARD_TILE_FONT_SIZE_POINTS_MIN } from 'parameters';
1
+ import { BOARD_TILE_FONT_SIZE_MIN, BOARD_TILE_FONT_SIZE_POINTS_MIN } from '@/parameters';
2
2
 
3
3
  interface TileSizes {
4
4
  pointsFontSize: number;
@@ -1,3 +1,3 @@
1
- import { type Comparator } from 'types';
1
+ import { type Comparator } from '@/types';
2
2
 
3
3
  export const numberComparator: Comparator<number> = (a, b) => a - b;
@@ -1,4 +1,4 @@
1
- import { type Comparator } from 'types';
1
+ import { type Comparator } from '@/types';
2
2
 
3
3
  export const reverseComparator = <T>(comparator: Comparator<T>): Comparator<T> => {
4
4
  return (a: T, b: T): number => -comparator(a, b);
@@ -1,7 +1,7 @@
1
1
  import { BLANK } from '@scrabble-solver/constants';
2
2
  import { type Tile } from '@scrabble-solver/types';
3
3
 
4
- import { type Rack } from 'types';
4
+ import { type Rack } from '@/types';
5
5
 
6
6
  interface CharacterTilePair {
7
7
  character: string | null;
@@ -1,7 +1,7 @@
1
1
  import { type FunctionComponent, memo } from 'react';
2
2
 
3
- import { Dictionary, DictionaryInput, Modal } from 'components';
4
- import { useTranslate } from 'state';
3
+ import { Dictionary, DictionaryInput, Modal } from '@/components';
4
+ import { useTranslate } from '@/state';
5
5
 
6
6
  import styles from './DictionaryModal.module.scss';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { type FunctionComponent, memo } from 'react';
2
2
 
3
- import { Arrows, Backspace, Ctrl, Del, Enter, Key, Modal, Space } from 'components';
4
- import { selectConfig, useTranslate, useTypedSelector } from 'state';
3
+ import { Arrows, Backspace, Ctrl, Del, Enter, Key, Modal, Space } from '@/components';
4
+ import { selectConfig, useTranslate, useTypedSelector } from '@/state';
5
5
 
6
6
  import { Mapping } from './components';
7
7
 
@@ -1,10 +1,10 @@
1
1
  import { type FunctionComponent, memo } from 'react';
2
2
 
3
- import { Button, Modal } from 'components';
4
- import { LOCALE_FEATURES } from 'i18n';
5
- import { BookHalf, CardChecklist, Cog, Github, Sack } from 'icons';
6
- import { GITHUB_PROJECT_URL } from 'parameters';
7
- import { selectLocale, useTranslate, useTypedSelector } from 'state';
3
+ import { Button, Modal } from '@/components';
4
+ import { LOCALE_FEATURES } from '@/i18n';
5
+ import { BookHalf, CardChecklist, Cog, Github, Sack } from '@/icons';
6
+ import { GITHUB_PROJECT_URL } from '@/parameters';
7
+ import { selectLocale, useTranslate, useTypedSelector } from '@/state';
8
8
 
9
9
  import styles from './MenuModal.module.scss';
10
10
 
@@ -1,10 +1,10 @@
1
1
  import { type FunctionComponent, memo } from 'react';
2
2
 
3
- import { Badge, Modal } from 'components';
4
- import { LOCALE_FEATURES } from 'i18n';
5
- import { getTileSizes } from 'lib';
6
- import { REMAINING_TILES_TILE_SIZE } from 'parameters';
7
- import { selectLocale, useTranslate, useTypedSelector } from 'state';
3
+ import { Badge, Modal } from '@/components';
4
+ import { LOCALE_FEATURES } from '@/i18n';
5
+ import { getTileSizes } from '@/lib';
6
+ import { REMAINING_TILES_TILE_SIZE } from '@/parameters';
7
+ import { selectLocale, useTranslate, useTypedSelector } from '@/state';
8
8
 
9
9
  import { Character } from './components';
10
10
  import styles from './RemainingTilesModal.module.scss';
@@ -2,11 +2,11 @@ import { BLANK } from '@scrabble-solver/constants';
2
2
  import classNames from 'classnames';
3
3
  import { type FunctionComponent } from 'react';
4
4
 
5
- import { Progress, Tile } from 'components';
6
- import { LOCALE_FEATURES } from 'i18n';
7
- import { REMAINING_TILES_TILE_SIZE } from 'parameters';
8
- import { selectCharacterPoints, selectLocale, useTypedSelector } from 'state';
9
- import { type RemainingTile } from 'types';
5
+ import { Progress, Tile } from '@/components';
6
+ import { LOCALE_FEATURES } from '@/i18n';
7
+ import { REMAINING_TILES_TILE_SIZE } from '@/parameters';
8
+ import { selectCharacterPoints, selectLocale, useTypedSelector } from '@/state';
9
+ import { type RemainingTile } from '@/types';
10
10
 
11
11
  import styles from './Character.module.scss';
12
12
 
@@ -1,6 +1,6 @@
1
1
  import { BLANK, CONSONANTS, VOWELS } from '@scrabble-solver/constants';
2
2
 
3
- import { type RemainingTile, type RemainingTilesGroup } from 'types';
3
+ import { type RemainingTile, type RemainingTilesGroup } from '@/types';
4
4
 
5
5
  export const getRemainingTilesGroups = (remainingTiles: RemainingTile[]): RemainingTilesGroup[] => {
6
6
  const consonants = remainingTiles.filter(isConsonant);
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
 
3
- import { selectRemainingTiles } from 'state';
3
+ import { selectRemainingTiles } from '@/state';
4
4
 
5
5
  import { getRemainingTilesGroups } from './lib';
6
6
 
@@ -2,10 +2,10 @@ import { type Result } from '@scrabble-solver/types';
2
2
  import { type FunctionComponent, memo, useEffect, useMemo } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
- import { useAppLayout } from 'app-layout';
6
- import { Button, Dictionary, Modal, Results } from 'components';
7
- import { Check, EyeFill } from 'icons';
8
- import { resultsSlice, selectProcessedResults, selectResultCandidate, useTranslate, useTypedSelector } from 'state';
5
+ import { useAppLayout } from '@/app-layout';
6
+ import { Button, Dictionary, Modal, Results } from '@/components';
7
+ import { Check, EyeFill } from '@/icons';
8
+ import { resultsSlice, selectProcessedResults, selectResultCandidate, useTranslate, useTypedSelector } from '@/state';
9
9
 
10
10
  import styles from './ResultsModal.module.scss';
11
11
 
@@ -1,8 +1,8 @@
1
1
  import { type FunctionComponent, memo } from 'react';
2
2
 
3
- import { Modal } from 'components';
4
- import { useIsTouchDevice } from 'hooks';
5
- import { useTranslate } from 'state';
3
+ import { Modal } from '@/components';
4
+ import { useIsTouchDevice } from '@/hooks';
5
+ import { useTranslate } from '@/state';
6
6
 
7
7
  import {
8
8
  AutoGroupTilesSetting,
@@ -1,8 +1,8 @@
1
1
  import { type ChangeEvent, type FunctionComponent } from 'react';
2
2
  import { useDispatch } from 'react-redux';
3
3
 
4
- import { Radio } from 'components';
5
- import { selectAutoGroupTiles, settingsSlice, useTranslate, useTypedSelector } from 'state';
4
+ import { Radio } from '@/components';
5
+ import { selectAutoGroupTiles, settingsSlice, useTranslate, useTypedSelector } from '@/state';
6
6
 
7
7
  import styles from './AutoGroupTilesSetting.module.scss';
8
8
  import { NULL_VALUE } from './constants';
@@ -1,4 +1,4 @@
1
- import { type AutoGroupTiles } from 'types';
1
+ import { type AutoGroupTiles } from '@/types';
2
2
 
3
3
  import { NULL_VALUE } from './constants';
4
4
 
@@ -2,8 +2,8 @@ import { isGame } from '@scrabble-solver/types';
2
2
  import { type ChangeEvent, type FunctionComponent, useMemo } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
- import { Radio } from 'components';
6
- import { selectGame, selectLocale, settingsSlice, useTypedSelector } from 'state';
5
+ import { Radio } from '@/components';
6
+ import { selectGame, selectLocale, settingsSlice, useTypedSelector } from '@/state';
7
7
 
8
8
  import styles from './ConfigSetting.module.scss';
9
9
  import { getOptions } from './lib';
@@ -1,8 +1,8 @@
1
1
  import { type ChangeEvent, type FunctionComponent } from 'react';
2
2
  import { useDispatch } from 'react-redux';
3
3
 
4
- import { Radio } from 'components';
5
- import { selectInputMode, settingsSlice, useTranslate, useTypedSelector } from 'state';
4
+ import { Radio } from '@/components';
5
+ import { selectInputMode, settingsSlice, useTranslate, useTypedSelector } from '@/state';
6
6
 
7
7
  import styles from './InputModeSetting.module.scss';
8
8
  import { parseValue } from './lib';
@@ -1,4 +1,4 @@
1
- import { type InputMode } from 'types';
1
+ import { type InputMode } from '@/types';
2
2
 
3
3
  export const parseValue = (value: string): InputMode => {
4
4
  if (value === 'keyboard') {
@@ -3,9 +3,9 @@ import classNames from 'classnames';
3
3
  import { type ChangeEvent, type FunctionComponent } from 'react';
4
4
  import { useDispatch } from 'react-redux';
5
5
 
6
- import { Radio } from 'components';
7
- import { LOCALE_FEATURES } from 'i18n';
8
- import { selectLocale, settingsSlice, useTypedSelector } from 'state';
6
+ import { Radio } from '@/components';
7
+ import { LOCALE_FEATURES } from '@/i18n';
8
+ import { selectLocale, settingsSlice, useTypedSelector } from '@/state';
9
9
 
10
10
  import styles from './LocaleSetting.module.scss';
11
11
 
@@ -1,8 +1,8 @@
1
1
  import { type ChangeEvent, type FunctionComponent } from 'react';
2
2
  import { useDispatch } from 'react-redux';
3
3
 
4
- import { Radio } from 'components';
5
- import { selectRemoveCellFilters, settingsSlice, useTranslate, useTypedSelector } from 'state';
4
+ import { Radio } from '@/components';
5
+ import { selectRemoveCellFilters, settingsSlice, useTranslate, useTypedSelector } from '@/state';
6
6
 
7
7
  import { parseValue } from './lib';
8
8
  import styles from './RemoveCellFiltersSetting.module.scss';
@@ -1,4 +1,4 @@
1
- import { type RemoveCellFilters } from 'types';
1
+ import { type RemoveCellFilters } from '@/types';
2
2
 
3
3
  export const parseValue = (value: string): RemoveCellFilters => {
4
4
  if (value === 'always') {
@@ -2,8 +2,8 @@ import { type ShowCoordinates } from '@scrabble-solver/types';
2
2
  import { type ChangeEvent, type FunctionComponent } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
- import { Radio } from 'components';
6
- import { selectShowCoordinates, settingsSlice, useTranslate, useTypedSelector } from 'state';
5
+ import { Radio } from '@/components';
6
+ import { selectShowCoordinates, settingsSlice, useTranslate, useTypedSelector } from '@/state';
7
7
 
8
8
  import styles from './ShowCoordinatesSetting.module.scss';
9
9
 
@@ -1,9 +1,9 @@
1
1
  import classNames from 'classnames';
2
2
  import { type FunctionComponent, memo } from 'react';
3
3
 
4
- import { Badge, Modal } from 'components';
5
- import { Check, Cross } from 'icons';
6
- import { selectInvalidWords, selectLocale, selectValidWords, useTranslate, useTypedSelector } from 'state';
4
+ import { Badge, Modal } from '@/components';
5
+ import { Check, Cross } from '@/icons';
6
+ import { selectInvalidWords, selectLocale, selectValidWords, useTranslate, useTypedSelector } from '@/state';
7
7
 
8
8
  import styles from './WordsModal.module.scss';
9
9
 
@@ -4,9 +4,9 @@ import Head from 'next/head';
4
4
  import { type FunctionComponent } from 'react';
5
5
  import { Provider } from 'react-redux';
6
6
 
7
- import { AppLayoutProvider } from 'app-layout';
8
- import { SeoMessage } from 'components';
9
- import { store } from 'state';
7
+ import { AppLayoutProvider } from '@/app-layout';
8
+ import { SeoMessage } from '@/components';
9
+ import { store } from '@/state';
10
10
 
11
11
  import '../styles/global.scss';
12
12
 
@@ -6,7 +6,7 @@ import { type Locale, isLocale } from '@scrabble-solver/types';
6
6
  import { getWordDefinition } from '@scrabble-solver/word-definitions';
7
7
  import { type NextApiRequest, type NextApiResponse } from 'next';
8
8
 
9
- import { getServerLoggingData } from 'api';
9
+ import { getServerLoggingData } from '@/api';
10
10
 
11
11
  interface RequestData {
12
12
  locale: Locale;
@@ -3,7 +3,7 @@ import { logger } from '@scrabble-solver/logger';
3
3
  import { isLocale, type Locale } from '@scrabble-solver/types';
4
4
  import { type NextApiRequest, type NextApiResponse } from 'next';
5
5
 
6
- import { getServerLoggingData } from 'api';
6
+ import { getServerLoggingData } from '@/api';
7
7
 
8
8
  interface RequestData {
9
9
  locale: Locale;
@@ -15,8 +15,8 @@ import {
15
15
  } from '@scrabble-solver/types';
16
16
  import { type NextApiRequest, type NextApiResponse } from 'next';
17
17
 
18
- import { getServerLoggingData, isBoardValid, isCharacterValid } from 'api';
19
- import { isStringArray } from 'lib';
18
+ import { getServerLoggingData, isBoardValid, isCharacterValid } from '@/api';
19
+ import { isStringArray } from '@/lib';
20
20
 
21
21
  interface RequestData {
22
22
  board: Board;
@@ -4,7 +4,7 @@ import { logger } from '@scrabble-solver/logger';
4
4
  import { Board, type Config, type Game, type Locale, isBoardJson, isGame, isLocale } from '@scrabble-solver/types';
5
5
  import { type NextApiRequest, type NextApiResponse } from 'next';
6
6
 
7
- import { getServerLoggingData, isBoardValid } from 'api';
7
+ import { getServerLoggingData, isBoardValid } from '@/api';
8
8
 
9
9
  interface RequestData {
10
10
  board: Board;
@@ -1,7 +1,7 @@
1
1
  import { logger } from '@scrabble-solver/logger';
2
2
  import { type NextApiRequest, type NextApiResponse } from 'next';
3
3
 
4
- import { getServerLoggingData } from 'api';
4
+ import { getServerLoggingData } from '@/api';
5
5
 
6
6
  const visit = (request: NextApiRequest, response: NextApiResponse): void => {
7
7
  const meta = getServerLoggingData(request);
@@ -7,9 +7,9 @@ import { type FunctionComponent, useCallback, useState } from 'react';
7
7
  import ReactModal from 'react-modal';
8
8
  import { useDispatch } from 'react-redux';
9
9
 
10
- import { Logo, NavButtons, Solver } from 'components';
11
- import { useDirection, useEffectOnce, useLanguage, useLocalStorage } from 'hooks';
12
- import { LOCALE_FEATURES } from 'i18n';
10
+ import { Logo, NavButtons, Solver } from '@/components';
11
+ import { useDirection, useEffectOnce, useLanguage, useLocalStorage } from '@/hooks';
12
+ import { LOCALE_FEATURES } from '@/i18n';
13
13
  import {
14
14
  DictionaryModal,
15
15
  KeyMapModal,
@@ -18,9 +18,9 @@ import {
18
18
  ResultsModal,
19
19
  SettingsModal,
20
20
  WordsModal,
21
- } from 'modals';
22
- import { registerServiceWorker } from 'serviceWorkerManager';
23
- import { initialize, reset, selectConfig, selectLocale, useTypedSelector } from 'state';
21
+ } from '@/modals';
22
+ import { registerServiceWorker } from '@/serviceWorkerManager';
23
+ import { initialize, reset, selectConfig, selectLocale, useTypedSelector } from '@/state';
24
24
 
25
25
  import styles from './index.module.scss';
26
26
 
@@ -1,5 +1,5 @@
1
1
  'use-client';
2
2
 
3
- import { NotFound } from 'components';
3
+ import { NotFound } from '@/components';
4
4
 
5
5
  export default NotFound;
@@ -1,4 +1,4 @@
1
- import { ResultColumnId } from 'types';
1
+ import { ResultColumnId } from '@/types';
2
2
 
3
3
  export const BREAKPOINTS = {
4
4
  xs: 480,
@@ -5,7 +5,7 @@ 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 { type 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 { type VerifyRequestPayload } from 'types';
4
+ import { type VerifyRequestPayload } from '@/types';
5
5
 
6
6
  import { revalidateDictionary } from './dictionaries';
7
7
  import { getTrie } from './getTrie';
@@ -67,7 +67,30 @@ export const boardSlice = createSlice({
67
67
  }
68
68
 
69
69
  if (state.rows.length !== config.boardHeight || state.rows[0].length !== config.boardWidth) {
70
- return Board.create(config.boardWidth, config.boardHeight);
70
+ const newBoard = Board.create(config.boardWidth, config.boardHeight);
71
+ const offsetX = Math.floor(config.boardWidth / 2) - Math.floor(state.rows[0].length / 2);
72
+ const offsetY = Math.floor(config.boardHeight / 2) - Math.floor(state.rows.length / 2);
73
+
74
+ for (let y = 0; y < state.rows.length; ++y) {
75
+ for (let x = 0; x < state.rows[y].length; ++x) {
76
+ const cell = state.rows[y][x];
77
+
78
+ if (cell.isEmpty) {
79
+ continue;
80
+ }
81
+
82
+ const newX = x + offsetX;
83
+ const newY = y + offsetY;
84
+
85
+ if (newX < 0 || newX >= config.boardWidth || newY < 0 || newY >= config.boardHeight) {
86
+ continue;
87
+ }
88
+
89
+ newBoard.updateCell(newX, newY, () => new Cell({ ...cell, x: newX, y: newY }));
90
+ }
91
+ }
92
+
93
+ return newBoard;
71
94
  }
72
95
 
73
96
  return state;
@@ -1,4 +1,4 @@
1
- import type { CellFilterType } from 'types';
1
+ import type { CellFilterType } from '@/types';
2
2
 
3
3
  export const toggleCellFilterState = (type: CellFilterType): CellFilterType | null => {
4
4
  const chain: (CellFilterType | null)[] = ['include', 'exclude', null];
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
 
3
- import type { Point } from 'types';
3
+ import type { Point } from '@/types';
4
4
 
5
5
  import type { RootState } from '../types';
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
2
2
  import type { Cell } from '@scrabble-solver/types';
3
3
 
4
- import type { Point } from 'types';
4
+ import type { Point } from '@/types';
5
5
 
6
6
  import { cellFiltersInitialState } from './initialState';
7
7
  import { toggleCellFilterState } from './lib';
@@ -1,3 +1,3 @@
1
- import type { CellFilter } from 'types';
1
+ import type { CellFilter } from '@/types';
2
2
 
3
3
  export type CellFiltersState = CellFilter[];
package/src/state/lib.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BLANK } from '@scrabble-solver/constants';
2
2
  import { type Board, type Config } from '@scrabble-solver/types';
3
3
 
4
- import { createKeyComparator } from 'lib';
5
- import { type RemainingTile } from 'types';
4
+ import { createKeyComparator } from '@/lib';
5
+ import { type RemainingTile } from '@/types';
6
6
 
7
7
  export const getRemainingTiles = (
8
8
  config: Config,
@@ -1,7 +1,7 @@
1
1
  import { Board, type BoardJson, type Game, type Locale, type ShowCoordinates } from '@scrabble-solver/types';
2
2
  import store2 from 'store2';
3
3
 
4
- import type { AutoGroupTiles, InputMode, Rack, RemoveCellFilters } from 'types';
4
+ import type { AutoGroupTiles, InputMode, Rack, RemoveCellFilters } from '@/types';
5
5
 
6
6
  const AUTO_GROUP_TILES = 'auto-group-tiles';
7
7
  const BOARD = 'board';
@@ -1,8 +1,8 @@
1
1
  import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
2
2
  import { type Tile } from '@scrabble-solver/types';
3
3
 
4
- import { arrayEquals, createNullMovingComparator, inverseDirection, zipCharactersAndTiles } from 'lib';
5
- import { type AutoGroupTiles, type Rack } from 'types';
4
+ import { arrayEquals, createNullMovingComparator, inverseDirection, zipCharactersAndTiles } from '@/lib';
5
+ import { type AutoGroupTiles, type Rack } from '@/types';
6
6
 
7
7
  import { rackDefaultState, rackInitialState } from './initialState';
8
8
 
@@ -1,3 +1,3 @@
1
- import { type Rack } from 'types';
1
+ import { type Rack } from '@/types';
2
2
 
3
3
  export type RackState = Rack;
@@ -1,4 +1,4 @@
1
- import { ResultColumnId, SortDirection } from 'types';
1
+ import { ResultColumnId, SortDirection } from '@/types';
2
2
 
3
3
  import type { ResultsState } from './types';
4
4
 
@@ -1,7 +1,14 @@
1
1
  import { type Result, type ShowCoordinates } from '@scrabble-solver/types';
2
2
 
3
- import { createKeyComparator, createRegExp, createStringComparator, getCoordinate, reverseComparator } from 'lib';
4
- import { type CellFilter, type Comparator, type GroupedResults, ResultColumnId, type Sort, SortDirection } from 'types';
3
+ import { createKeyComparator, createRegExp, createStringComparator, getCoordinate, reverseComparator } from '@/lib';
4
+ import {
5
+ type CellFilter,
6
+ type Comparator,
7
+ type GroupedResults,
8
+ ResultColumnId,
9
+ type Sort,
10
+ SortDirection,
11
+ } from '@/types';
5
12
 
6
13
  export const getCoordinates = (result: Result, showCoordinates: ShowCoordinates): string => {
7
14
  if (showCoordinates === 'hidden') {
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
 
3
- import { createRegExp } from 'lib';
3
+ import { createRegExp } from '@/lib';
4
4
 
5
5
  import { selectCellFilters } from '../cellFilters';
6
6
  import { selectLocale, selectShowCoordinates } from '../settings';
@@ -1,7 +1,7 @@
1
1
  import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
2
2
  import { type Result } from '@scrabble-solver/types';
3
3
 
4
- import { type ResultColumnId, SortDirection } from 'types';
4
+ import { type ResultColumnId, SortDirection } from '@/types';
5
5
 
6
6
  import { resultsInitialState } from './initialState';
7
7