@scrabble-solver/scrabble-solver 2.15.9 → 2.15.10

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 +9 -9
  3. package/.next/cache/.rscinfo +1 -1
  4. package/.next/cache/.tsbuildinfo +1 -1
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  8. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  9. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/.next/cache/webpack/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/next-minimal-server.js.nft.json +1 -1
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +4 -4
  18. package/.next/required-server-files.json +1 -2
  19. package/.next/routes-manifest.json +1 -1
  20. package/.next/server/chunks/60.js +1 -1
  21. package/.next/server/chunks/812.js +1 -1
  22. package/.next/server/chunks/974.js +1 -1
  23. package/.next/server/middleware-build-manifest.js +1 -1
  24. package/.next/server/pages/404.html +1 -1
  25. package/.next/server/pages/404.js.nft.json +1 -1
  26. package/.next/server/pages/500.html +1 -1
  27. package/.next/server/pages/_app.js.nft.json +1 -1
  28. package/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
  29. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  30. package/.next/server/pages/api/dictionary/[locale].js +1 -1
  31. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  32. package/.next/server/pages/api/solve.js +1 -1
  33. package/.next/server/pages/api/solve.js.nft.json +1 -1
  34. package/.next/server/pages/api/verify.js +1 -1
  35. package/.next/server/pages/api/verify.js.nft.json +1 -1
  36. package/.next/server/pages/api/visit.js +1 -1
  37. package/.next/server/pages/index.html +1 -1
  38. package/.next/server/pages/index.js +1 -1
  39. package/.next/server/pages/index.js.nft.json +1 -1
  40. package/.next/server/pages/index.json +1 -1
  41. package/.next/server/webpack-api-runtime.js +1 -1
  42. package/.next/static/chunks/{main-b934e2c3dd3b55b5.js → main-016492249b3393e2.js} +1 -1
  43. package/.next/static/chunks/pages/{404-7451dd58396eaa39.js → 404-590e2a3839c1d9e0.js} +1 -1
  44. package/.next/static/chunks/pages/_app-ac93a74c390f2ab8.js +1 -0
  45. package/.next/static/chunks/pages/index-e5f1caa581e6d3b8.js +1 -0
  46. package/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_buildManifest.js +1 -1
  47. package/.next/trace +23 -23
  48. package/next.config.js +3 -0
  49. package/package.json +10 -10
  50. package/src/api/getServerLoggingData.ts +1 -3
  51. package/src/api/index.ts +5 -5
  52. package/src/api/isBoardValid.ts +3 -5
  53. package/src/api/isCellValid.ts +4 -6
  54. package/src/api/isCharacterValid.ts +2 -3
  55. package/src/api/isRowValid.ts +3 -5
  56. package/src/components/Alert/Alert.tsx +1 -3
  57. package/src/components/Alert/index.ts +1 -1
  58. package/src/components/Badge/Badge.tsx +1 -3
  59. package/src/components/Badge/index.ts +1 -1
  60. package/src/components/Board/Board.tsx +2 -4
  61. package/src/components/Board/BoardPure.tsx +2 -2
  62. package/src/components/Board/components/Actions/Actions.tsx +3 -5
  63. package/src/components/Board/components/Actions/index.ts +1 -1
  64. package/src/components/Board/components/Cell/Cell.tsx +3 -5
  65. package/src/components/Board/components/Cell/index.ts +1 -1
  66. package/src/components/Board/components/InputPrompt/InputPrompt.tsx +3 -5
  67. package/src/components/Board/components/InputPrompt/index.ts +1 -1
  68. package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +2 -4
  69. package/src/components/Board/components/ToggleDirectionButton/index.ts +1 -1
  70. package/src/components/Board/components/index.ts +4 -4
  71. package/src/components/Board/hooks/index.ts +6 -6
  72. package/src/components/Board/hooks/useBackgroundImage.tsx +7 -9
  73. package/src/components/Board/hooks/useBoardStyle.ts +7 -9
  74. package/src/components/Board/hooks/useFloatingActions.ts +1 -3
  75. package/src/components/Board/hooks/useFloatingFocus.ts +1 -3
  76. package/src/components/Board/hooks/useFloatingInputPrompt.ts +1 -3
  77. package/src/components/Board/hooks/useGrid.ts +2 -4
  78. package/src/components/Board/index.ts +1 -1
  79. package/src/components/Board/lib/getBonusColor.ts +1 -3
  80. package/src/components/Board/lib/getPositionInGrid.ts +1 -3
  81. package/src/components/Board/lib/index.ts +2 -2
  82. package/src/components/Button/Button.tsx +3 -3
  83. package/src/components/Button/Link.tsx +1 -3
  84. package/src/components/Button/index.ts +1 -1
  85. package/src/components/Dictionary/Dictionary.tsx +3 -5
  86. package/src/components/Dictionary/index.ts +1 -1
  87. package/src/components/DictionaryInput/DictionaryInput.tsx +1 -3
  88. package/src/components/DictionaryInput/index.ts +1 -1
  89. package/src/components/EmptyState/EmptyState.tsx +2 -4
  90. package/src/components/EmptyState/index.ts +1 -1
  91. package/src/components/IconButton/IconButton.tsx +3 -3
  92. package/src/components/IconButton/Link.tsx +1 -3
  93. package/src/components/IconButton/index.ts +1 -1
  94. package/src/components/Key/Key.tsx +1 -3
  95. package/src/components/Key/index.ts +1 -1
  96. package/src/components/Keys/Arrows/Arrows.tsx +2 -4
  97. package/src/components/Keys/Arrows/index.ts +1 -1
  98. package/src/components/{keys.tsx → Keys/index.tsx} +3 -1
  99. package/src/components/Loading/Loading.tsx +2 -4
  100. package/src/components/Loading/index.ts +1 -1
  101. package/src/components/Logo/Logo.tsx +1 -3
  102. package/src/components/Logo/LogoBlueprint.tsx +2 -4
  103. package/src/components/Logo/index.ts +1 -1
  104. package/src/components/Modal/Modal.tsx +3 -3
  105. package/src/components/Modal/components/Section/Section.tsx +1 -3
  106. package/src/components/Modal/components/Section/index.ts +1 -1
  107. package/src/components/Modal/components/index.ts +1 -1
  108. package/src/components/Modal/index.ts +1 -1
  109. package/src/components/NavButtons/NavButtons.tsx +3 -3
  110. package/src/components/NavButtons/index.ts +1 -1
  111. package/src/components/NotFound/NotFound.tsx +2 -4
  112. package/src/components/NotFound/index.ts +1 -1
  113. package/src/components/PlainTiles/PlainTiles.tsx +10 -4
  114. package/src/components/PlainTiles/Tile.tsx +1 -3
  115. package/src/components/PlainTiles/index.ts +1 -1
  116. package/src/components/PlainTiles/lib/createPlainTile.ts +10 -6
  117. package/src/components/PlainTiles/lib/createPlainTiles.ts +2 -4
  118. package/src/components/PlainTiles/lib/getViewbox.ts +1 -3
  119. package/src/components/PlainTiles/lib/getX.ts +1 -3
  120. package/src/components/PlainTiles/lib/getY.ts +1 -3
  121. package/src/components/PlainTiles/lib/index.ts +6 -6
  122. package/src/components/PlainTiles/lib/randomize.ts +1 -3
  123. package/src/components/Progress/Progress.tsx +1 -3
  124. package/src/components/Progress/index.ts +1 -1
  125. package/src/components/Rack/Rack.tsx +2 -4
  126. package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +2 -2
  127. package/src/components/Rack/components/InputPrompt/index.ts +1 -1
  128. package/src/components/Rack/components/RackTile/RackTile.tsx +4 -7
  129. package/src/components/Rack/components/RackTile/index.ts +1 -1
  130. package/src/components/Rack/components/index.ts +2 -2
  131. package/src/components/Rack/index.ts +1 -1
  132. package/src/components/Radio/Radio.tsx +1 -3
  133. package/src/components/Radio/index.ts +1 -1
  134. package/src/components/Results/Cell.tsx +9 -3
  135. package/src/components/Results/Header.tsx +2 -4
  136. package/src/components/Results/HeaderButton.tsx +1 -3
  137. package/src/components/Results/Result.tsx +2 -4
  138. package/src/components/Results/Results.tsx +7 -9
  139. package/src/components/Results/SolveButton.tsx +2 -4
  140. package/src/components/Results/index.ts +1 -1
  141. package/src/components/ResultsInput/ResultsInput.tsx +1 -3
  142. package/src/components/ResultsInput/index.ts +1 -1
  143. package/src/components/SeoMessage/SeoMessage.tsx +4 -6
  144. package/src/components/SeoMessage/index.ts +1 -1
  145. package/src/components/Solver/Solver.tsx +8 -8
  146. package/src/components/Solver/components/InsertButton/InsertButton.tsx +2 -4
  147. package/src/components/Solver/components/InsertButton/index.ts +1 -1
  148. package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +4 -6
  149. package/src/components/Solver/components/ResultCandidatePicker/index.ts +1 -1
  150. package/src/components/Solver/components/index.ts +2 -2
  151. package/src/components/Solver/index.ts +1 -1
  152. package/src/components/Spinner/Spinner.tsx +1 -3
  153. package/src/components/Spinner/index.ts +1 -1
  154. package/src/components/Tile/Tile.tsx +2 -4
  155. package/src/components/Tile/TilePure.tsx +2 -2
  156. package/src/components/Tile/index.ts +1 -1
  157. package/src/components/Tooltip/TooltipTrigger.tsx +5 -3
  158. package/src/components/index.ts +24 -25
  159. package/src/hooks/index.ts +13 -13
  160. package/src/hooks/useAppLayout.ts +19 -15
  161. package/src/hooks/useColumns.ts +2 -4
  162. package/src/hooks/useDirection.ts +1 -3
  163. package/src/hooks/useEffectOnce.ts +2 -4
  164. package/src/hooks/useIsTouchDevice.ts +2 -4
  165. package/src/hooks/useLanguage.ts +1 -3
  166. package/src/hooks/useLatest.ts +1 -3
  167. package/src/hooks/useLocalStorage.ts +1 -3
  168. package/src/hooks/useMedia.ts +1 -3
  169. package/src/hooks/useMediaQueries.ts +2 -4
  170. package/src/hooks/useMediaQuery.ts +2 -4
  171. package/src/hooks/useOnWindowResize.ts +1 -3
  172. package/src/hooks/useViewportSize.ts +2 -4
  173. package/src/i18n/i18n.ts +1 -3
  174. package/src/i18n/index.ts +1 -1
  175. package/src/lib/arrayEquals.ts +1 -3
  176. package/src/lib/createArray.ts +1 -3
  177. package/src/lib/createComparator.ts +3 -5
  178. package/src/lib/createGridOf.ts +2 -4
  179. package/src/lib/createKeyComparator.ts +6 -5
  180. package/src/lib/createKeyboardNavigation.ts +2 -4
  181. package/src/lib/createNullMovingComparator.test.ts +1 -1
  182. package/src/lib/createNullMovingComparator.ts +1 -3
  183. package/src/lib/createRegExp.ts +1 -3
  184. package/src/lib/createStringComparator.ts +5 -3
  185. package/src/lib/detectLocale.ts +1 -3
  186. package/src/lib/extractCharacters.test.ts +1 -1
  187. package/src/lib/extractCharacters.ts +1 -3
  188. package/src/lib/extractCharactersByCase.test.ts +1 -1
  189. package/src/lib/extractCharactersByCase.ts +2 -4
  190. package/src/lib/extractInputValue.ts +1 -3
  191. package/src/lib/findCell.ts +1 -3
  192. package/src/lib/getCellSize.ts +3 -5
  193. package/src/lib/getCoordinate.ts +1 -3
  194. package/src/lib/getCoordinates.ts +2 -4
  195. package/src/lib/getRemainingTiles.ts +8 -5
  196. package/src/lib/getRemainingTilesCount.ts +1 -3
  197. package/src/lib/getRemainingTilesGroups.ts +3 -5
  198. package/src/lib/getTileSizes.ts +1 -3
  199. package/src/lib/getTotalRemainingTilesCount.ts +1 -3
  200. package/src/lib/groupResults.ts +3 -5
  201. package/src/lib/guessLocale.ts +2 -4
  202. package/src/lib/index.ts +39 -39
  203. package/src/lib/inverseDirection.ts +1 -3
  204. package/src/lib/isCtrl.ts +1 -3
  205. package/src/lib/isMac.ts +3 -4
  206. package/src/lib/isRegExp.ts +1 -3
  207. package/src/lib/isStringArray.ts +1 -3
  208. package/src/lib/isUpperCase.ts +1 -3
  209. package/src/lib/memoize.ts +18 -20
  210. package/src/lib/noop.ts +1 -3
  211. package/src/lib/numberComparator.ts +1 -3
  212. package/src/lib/resultMatchesCellFilter.ts +1 -3
  213. package/src/lib/reverseComparator.ts +1 -3
  214. package/src/lib/sortGroupedResults.ts +2 -4
  215. package/src/lib/sortResults.ts +5 -7
  216. package/src/lib/unorderedArraysEqual.ts +2 -4
  217. package/src/lib/zipCharactersAndTiles.ts +1 -3
  218. package/src/modals/DictionaryModal/DictionaryModal.tsx +2 -2
  219. package/src/modals/DictionaryModal/index.ts +1 -1
  220. package/src/modals/KeyMapModal/KeyMapModal.tsx +2 -2
  221. package/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +1 -3
  222. package/src/modals/KeyMapModal/components/Mapping/index.ts +1 -1
  223. package/src/modals/KeyMapModal/components/index.ts +1 -1
  224. package/src/modals/KeyMapModal/index.ts +1 -1
  225. package/src/modals/MenuModal/MenuModal.tsx +2 -2
  226. package/src/modals/MenuModal/index.ts +1 -1
  227. package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +2 -2
  228. package/src/modals/RemainingTilesModal/components/Character/Character.tsx +1 -3
  229. package/src/modals/RemainingTilesModal/components/Character/index.ts +1 -1
  230. package/src/modals/RemainingTilesModal/components/index.ts +1 -1
  231. package/src/modals/RemainingTilesModal/index.ts +1 -1
  232. package/src/modals/ResultsModal/ResultsModal.tsx +2 -2
  233. package/src/modals/ResultsModal/index.ts +1 -1
  234. package/src/modals/SettingsModal/SettingsModal.tsx +2 -2
  235. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -3
  236. package/src/modals/SettingsModal/components/AutoGroupTilesSetting/index.ts +1 -1
  237. package/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +4 -10
  238. package/src/modals/SettingsModal/components/ConfigSetting/index.ts +1 -1
  239. package/src/modals/SettingsModal/components/ConfigSetting/lib.ts +19 -0
  240. package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +1 -3
  241. package/src/modals/SettingsModal/components/InputModeSetting/index.ts +1 -1
  242. package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +1 -3
  243. package/src/modals/SettingsModal/components/LocaleSetting/index.ts +1 -1
  244. package/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +1 -3
  245. package/src/modals/SettingsModal/components/ShowCoordinatesSetting/index.ts +1 -1
  246. package/src/modals/SettingsModal/components/index.ts +5 -5
  247. package/src/modals/SettingsModal/index.ts +1 -1
  248. package/src/modals/WordsModal/WordsModal.tsx +2 -2
  249. package/src/modals/WordsModal/index.ts +1 -1
  250. package/src/modals/index.ts +7 -7
  251. package/src/pages/_app.tsx +2 -1
  252. package/src/pages/api/dictionary/[locale]/[word].ts +1 -1
  253. package/src/pages/api/dictionary/[locale]/index.ts +1 -1
  254. package/src/pages/api/solve.ts +6 -4
  255. package/src/pages/api/verify.ts +6 -4
  256. package/src/pages/api/visit.ts +2 -2
  257. package/src/pages/index.tsx +7 -0
  258. package/src/sdk/fetch.ts +1 -3
  259. package/src/sdk/fetchJson.ts +2 -4
  260. package/src/sdk/findWordDefinitions.ts +2 -4
  261. package/src/sdk/getDictionary.ts +2 -4
  262. package/src/sdk/index.ts +4 -4
  263. package/src/sdk/solve.ts +2 -4
  264. package/src/sdk/verify.ts +2 -4
  265. package/src/sdk/visit.ts +1 -3
  266. package/src/service-worker/average.ts +1 -3
  267. package/src/service-worker/dictionaries/expirationManager.ts +1 -3
  268. package/src/service-worker/dictionaries/getDictionary.ts +3 -5
  269. package/src/service-worker/dictionaries/getDictionaryUrl.ts +1 -3
  270. package/src/service-worker/dictionaries/index.ts +2 -2
  271. package/src/service-worker/dictionaries/revalidateDictionary.ts +3 -5
  272. package/src/service-worker/getTrie.ts +1 -3
  273. package/src/service-worker/index.ts +4 -2
  274. package/src/service-worker/routeSolveRequests.ts +17 -11
  275. package/src/service-worker/routeVerifyRequests.ts +7 -5
  276. package/src/serviceWorkerManager.ts +4 -4
  277. package/src/state/index.ts +4 -4
  278. package/src/state/localStorage.ts +10 -12
  279. package/src/state/sagas.ts +4 -1
  280. package/src/state/selectors.ts +2 -5
  281. package/src/state/slices/boardInitialState.ts +6 -7
  282. package/src/state/slices/boardSlice.ts +5 -7
  283. package/src/state/slices/cellFilterInitialState.ts +1 -3
  284. package/src/state/slices/cellFilterSlice.ts +2 -4
  285. package/src/state/slices/dictionaryInitialState.ts +2 -4
  286. package/src/state/slices/dictionarySlice.ts +2 -4
  287. package/src/state/slices/index.ts +16 -16
  288. package/src/state/slices/rackInitialState.ts +2 -4
  289. package/src/state/slices/rackSlice.ts +2 -4
  290. package/src/state/slices/resultsInitialState.ts +1 -3
  291. package/src/state/slices/resultsSlice.ts +2 -4
  292. package/src/state/slices/settingsInitialState.ts +2 -4
  293. package/src/state/slices/settingsSlice.ts +2 -4
  294. package/src/state/slices/solveInitialState.ts +3 -5
  295. package/src/state/slices/solveSlice.ts +2 -4
  296. package/src/state/slices/verifyInitialState.ts +2 -4
  297. package/src/state/slices/verifySlice.ts +2 -4
  298. package/src/state/store.ts +1 -3
  299. package/src/state/useTranslate.ts +2 -4
  300. package/src/state/useTypedSelector.ts +1 -3
  301. package/src/types/api.ts +15 -0
  302. package/src/types/index.ts +2 -0
  303. package/tsconfig.json +1 -1
  304. package/.next/cache/eslint/.cache_8dgz12 +0 -1
  305. package/.next/static/chunks/pages/_app-735105409cfdb48f.js +0 -1
  306. package/.next/static/chunks/pages/index-d492616d9bc42176.js +0 -1
  307. package/src/components/Keys/index.ts +0 -1
  308. package/tsconfig.jest.json +0 -7
  309. /package/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_ssgManifest.js +0 -0
@@ -4,8 +4,8 @@ import { FunctionComponent } from 'react';
4
4
  import { useAppLayout } from 'hooks';
5
5
  import { selectDictionary, selectDictionaryError, useTranslate, useTypedSelector } from 'state';
6
6
 
7
- import EmptyState from '../EmptyState';
8
- import Loading from '../Loading';
7
+ import { EmptyState } from '../EmptyState';
8
+ import { Loading } from '../Loading';
9
9
 
10
10
  import styles from './Dictionary.module.scss';
11
11
 
@@ -13,7 +13,7 @@ interface Props {
13
13
  className?: string;
14
14
  }
15
15
 
16
- const Dictionary: FunctionComponent<Props> = ({ className }) => {
16
+ export const Dictionary: FunctionComponent<Props> = ({ className }) => {
17
17
  const translate = useTranslate();
18
18
  const { dictionaryResultsHeight } = useAppLayout();
19
19
  const { results, isLoading } = useTypedSelector(selectDictionary);
@@ -78,5 +78,3 @@ const Dictionary: FunctionComponent<Props> = ({ className }) => {
78
78
  </div>
79
79
  );
80
80
  };
81
-
82
- export default Dictionary;
@@ -1 +1 @@
1
- export { default } from './Dictionary';
1
+ export { Dictionary } from './Dictionary';
@@ -11,7 +11,7 @@ interface Props {
11
11
  className?: string;
12
12
  }
13
13
 
14
- const DictionaryInput: FunctionComponent<Props> = ({ className }) => {
14
+ export const DictionaryInput: FunctionComponent<Props> = ({ className }) => {
15
15
  const dispatch = useDispatch();
16
16
  const translate = useTranslate();
17
17
  const locale = useTypedSelector(selectLocale);
@@ -42,5 +42,3 @@ const DictionaryInput: FunctionComponent<Props> = ({ className }) => {
42
42
  </form>
43
43
  );
44
44
  };
45
-
46
- export default DictionaryInput;
@@ -1 +1 @@
1
- export { default } from './DictionaryInput';
1
+ export { DictionaryInput } from './DictionaryInput';
@@ -6,7 +6,7 @@ import { COLOR_BLUE, COLOR_GREEN, COLOR_RED, COLOR_YELLOW } from 'parameters';
6
6
  import { selectLocale, useTranslate, useTypedSelector } from 'state';
7
7
  import { Translations } from 'types';
8
8
 
9
- import PlainTiles from '../PlainTiles';
9
+ import { PlainTiles } from '../PlainTiles';
10
10
 
11
11
  import styles from './EmptyState.module.scss';
12
12
 
@@ -30,7 +30,7 @@ const COLORS_PER_TYPE: Record<Props['variant'], string> = {
30
30
  warning: COLOR_YELLOW,
31
31
  };
32
32
 
33
- const EmptyState: FunctionComponent<Props> = ({ children, className, variant }) => {
33
+ export const EmptyState: FunctionComponent<Props> = ({ children, className, variant }) => {
34
34
  const translate = useTranslate();
35
35
  const locale = useTypedSelector(selectLocale);
36
36
  const { direction } = LOCALE_FEATURES[locale];
@@ -45,5 +45,3 @@ const EmptyState: FunctionComponent<Props> = ({ children, className, variant })
45
45
  </div>
46
46
  );
47
47
  };
48
-
49
- export default EmptyState;
@@ -1 +1 @@
1
- export { default } from './EmptyState';
1
+ export { EmptyState } from './EmptyState';
@@ -4,7 +4,7 @@ import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler, SVGAttribut
4
4
  import { Tooltip } from '../Tooltip';
5
5
 
6
6
  import styles from './IconButton.module.scss';
7
- import Link from './Link';
7
+ import { Link } from './Link';
8
8
 
9
9
  interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
10
10
  'aria-label': string;
@@ -14,7 +14,7 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
14
14
  onClick: MouseEventHandler<HTMLButtonElement>;
15
15
  }
16
16
 
17
- const IconButton: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
17
+ const IconButtonBase: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
18
18
  return (
19
19
  <Tooltip tooltip={tooltip}>
20
20
  <button className={classNames(styles.iconButton, className)} type="button" {...props}>
@@ -26,6 +26,6 @@ const IconButton: FunctionComponent<Props> = ({ className, Icon, tooltip, ...pro
26
26
  );
27
27
  };
28
28
 
29
- export default Object.assign(IconButton, {
29
+ export const IconButton = Object.assign(IconButtonBase, {
30
30
  Link,
31
31
  });
@@ -13,7 +13,7 @@ interface Props extends AnchorHTMLAttributes<HTMLAnchorElement> {
13
13
  tooltip: string;
14
14
  }
15
15
 
16
- const Link: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
16
+ export const Link: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
17
17
  return (
18
18
  <Tooltip tooltip={tooltip}>
19
19
  <a className={classNames(styles.iconButton, className)} {...props}>
@@ -24,5 +24,3 @@ const Link: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props })
24
24
  </Tooltip>
25
25
  );
26
26
  };
27
-
28
- export default Link;
@@ -1 +1 @@
1
- export { default } from './IconButton';
1
+ export { IconButton } from './IconButton';
@@ -8,8 +8,6 @@ interface Props {
8
8
  className?: string;
9
9
  }
10
10
 
11
- const Key: FunctionComponent<Props> = ({ children, className }) => (
11
+ export const Key: FunctionComponent<Props> = ({ children, className }) => (
12
12
  <kbd className={classNames(styles.key, className)}>{children}</kbd>
13
13
  );
14
-
15
- export default Key;
@@ -1 +1 @@
1
- export { default } from './Key';
1
+ export { Key } from './Key';
@@ -3,7 +3,7 @@ import { FunctionComponent } from 'react';
3
3
 
4
4
  import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from 'icons';
5
5
 
6
- import Key from '../../Key';
6
+ import { Key } from '../../Key';
7
7
 
8
8
  import styles from './Arrows.module.scss';
9
9
 
@@ -11,7 +11,7 @@ interface Props {
11
11
  className?: string;
12
12
  }
13
13
 
14
- const Arrows: FunctionComponent<Props> = ({ className }) => (
14
+ export const Arrows: FunctionComponent<Props> = ({ className }) => (
15
15
  <div className={classNames(styles.arrows, className)}>
16
16
  <Key className={classNames(styles.arrow, styles.left)}>
17
17
  <ArrowLeft aria-hidden="true" role="img" />
@@ -27,5 +27,3 @@ const Arrows: FunctionComponent<Props> = ({ className }) => (
27
27
  </Key>
28
28
  </div>
29
29
  );
30
-
31
- export default Arrows;
@@ -1 +1 @@
1
- export { default } from './Arrows';
1
+ export { Arrows } from './Arrows';
@@ -3,7 +3,7 @@ import { FunctionComponent } from 'react';
3
3
  import { isMac } from 'lib';
4
4
  import { useTranslate } from 'state';
5
5
 
6
- import Key from './Key';
6
+ import { Key } from '../Key';
7
7
 
8
8
  interface Props {
9
9
  className?: string;
@@ -24,3 +24,5 @@ export const Space: FunctionComponent<Props> = ({ className }) => {
24
24
 
25
25
  return <Key className={className}>{` ${translate('common.space')} `}</Key>;
26
26
  };
27
+
28
+ export { Arrows } from './Arrows';
@@ -4,7 +4,7 @@ import { FunctionComponent, useMemo } from 'react';
4
4
  import { LOCALE_FEATURES } from 'i18n';
5
5
  import { selectLocale, useTranslate, useTypedSelector } from 'state';
6
6
 
7
- import PlainTiles from '../PlainTiles';
7
+ import { PlainTiles } from '../PlainTiles';
8
8
 
9
9
  import styles from './Loading.module.scss';
10
10
 
@@ -20,7 +20,7 @@ const prepareContent = (message: string): string[][] => {
20
20
  return [parts];
21
21
  };
22
22
 
23
- const Loading: FunctionComponent<Props> = ({ className, wave = true }) => {
23
+ export const Loading: FunctionComponent<Props> = ({ className, wave = true }) => {
24
24
  const translate = useTranslate();
25
25
  const locale = useTypedSelector(selectLocale);
26
26
  const { direction } = LOCALE_FEATURES[locale];
@@ -37,5 +37,3 @@ const Loading: FunctionComponent<Props> = ({ className, wave = true }) => {
37
37
  </div>
38
38
  );
39
39
  };
40
-
41
- export default Loading;
@@ -1 +1 @@
1
- export { default } from './Loading';
1
+ export { Loading } from './Loading';
@@ -8,12 +8,10 @@ interface Props {
8
8
  className?: string;
9
9
  }
10
10
 
11
- const Logo = forwardRef<HTMLImageElement, Props>((props, ref) => {
11
+ export const Logo = forwardRef<HTMLImageElement, Props>((props, ref) => {
12
12
  const { logoHeight, logoWidth } = useAppLayout();
13
13
 
14
14
  return (
15
15
  <Image {...props} alt="Scrabble Solver 2" height={logoHeight} priority ref={ref} src={LOGO_SRC} width={logoWidth} />
16
16
  );
17
17
  });
18
-
19
- export default Logo;
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { CSSProperties, FunctionComponent } from 'react';
9
9
 
10
- import PlainTiles from '../PlainTiles';
10
+ import { PlainTiles } from '../PlainTiles';
11
11
 
12
12
  interface Props {
13
13
  className?: string;
@@ -16,8 +16,6 @@ interface Props {
16
16
 
17
17
  const CONTENT = [['SCRABBLE'], ['SOLVER', '2']];
18
18
 
19
- const LogoBlueprint: FunctionComponent<Props> = ({ className, style }) => (
19
+ export const LogoBlueprint: FunctionComponent<Props> = ({ className, style }) => (
20
20
  <PlainTiles className={className} content={CONTENT} style={style} />
21
21
  );
22
-
23
- export default LogoBlueprint;
@@ -1 +1 @@
1
- export { default } from './Logo';
1
+ export { Logo } from './Logo';
@@ -6,7 +6,7 @@ import { CrossSquareFill } from 'icons';
6
6
  import { TRANSITION_DURATION_LONG } from 'parameters';
7
7
  import { useTranslate } from 'state';
8
8
 
9
- import IconButton from '../IconButton';
9
+ import { IconButton } from '../IconButton';
10
10
 
11
11
  import { Section } from './components';
12
12
  import styles from './Modal.module.scss';
@@ -20,7 +20,7 @@ export interface Props {
20
20
  onClose: () => void;
21
21
  }
22
22
 
23
- const Modal: FunctionComponent<Props> = ({ children, className, footer, isOpen, title, onClose }) => {
23
+ const ModalBase: FunctionComponent<Props> = ({ children, className, footer, isOpen, title, onClose }) => {
24
24
  const translate = useTranslate();
25
25
  const [shouldReturnFocusAfterClose, setShouldReturnFocusAfterClose] = useState(true);
26
26
 
@@ -83,6 +83,6 @@ const Modal: FunctionComponent<Props> = ({ children, className, footer, isOpen,
83
83
  );
84
84
  };
85
85
 
86
- export default Object.assign(Modal, {
86
+ export const Modal = Object.assign(ModalBase, {
87
87
  Section,
88
88
  });
@@ -10,11 +10,9 @@ interface Props {
10
10
  title: ReactNode;
11
11
  }
12
12
 
13
- const Section: FunctionComponent<Props> = ({ children, className, label, title }) => (
13
+ export const Section: FunctionComponent<Props> = ({ children, className, label, title }) => (
14
14
  <section aria-label={label} className={classNames(styles.section, className)}>
15
15
  <h2 className={styles.heading}>{title}</h2>
16
16
  <div>{children}</div>
17
17
  </section>
18
18
  );
19
-
20
- export default Section;
@@ -1 +1 @@
1
- export { default } from './Section';
1
+ export { Section } from './Section';
@@ -1 +1 @@
1
- export { default as Section } from './Section';
1
+ export { Section } from './Section';
@@ -1 +1 @@
1
- export { default } from './Modal';
1
+ export { Modal } from './Modal';
@@ -6,7 +6,7 @@ import { CardChecklist, Cog, Eraser, Github, KeyboardFill, List, Sack } from 'ic
6
6
  import { GITHUB_PROJECT_URL } from 'parameters';
7
7
  import { selectHasInvalidWords, selectHasOverusedTiles, useTranslate, useTypedSelector } from 'state';
8
8
 
9
- import IconButton from '../IconButton';
9
+ import { IconButton } from '../IconButton';
10
10
 
11
11
  import styles from './NavButtons.module.scss';
12
12
 
@@ -19,7 +19,7 @@ interface Props {
19
19
  onShowWords: () => void;
20
20
  }
21
21
 
22
- const NavButtons: FunctionComponent<Props> = ({
22
+ const NavButtonsBase: FunctionComponent<Props> = ({
23
23
  onClear,
24
24
  onShowKeyMap,
25
25
  onShowMenu,
@@ -136,4 +136,4 @@ const NavButtons: FunctionComponent<Props> = ({
136
136
  );
137
137
  };
138
138
 
139
- export default memo(NavButtons);
139
+ export const NavButtons = memo(NavButtonsBase);
@@ -1 +1 @@
1
- export { default } from './NavButtons';
1
+ export { NavButtons } from './NavButtons';
@@ -2,13 +2,13 @@ import { FunctionComponent } from 'react';
2
2
 
3
3
  import { DashCircleFill } from 'icons';
4
4
 
5
- import PlainTiles from '../PlainTiles';
5
+ import { PlainTiles } from '../PlainTiles';
6
6
 
7
7
  import styles from './NotFound.module.scss';
8
8
 
9
9
  const CONTENT = [['HTTP', '404']];
10
10
 
11
- const NotFound: FunctionComponent = () => (
11
+ export const NotFound: FunctionComponent = () => (
12
12
  <div className={styles.notFound}>
13
13
  <a className={styles.link} href="/">
14
14
  <DashCircleFill aria-hidden="true" className={styles.icon} role="img" />
@@ -16,5 +16,3 @@ const NotFound: FunctionComponent = () => (
16
16
  </a>
17
17
  </div>
18
18
  );
19
-
20
- export default NotFound;
@@ -1 +1 @@
1
- export { default } from './NotFound';
1
+ export { NotFound } from './NotFound';
@@ -3,7 +3,7 @@ import { CSSProperties, FunctionComponent, useMemo } from 'react';
3
3
 
4
4
  import { createPlainTiles, getViewbox } from './lib';
5
5
  import styles from './PlainTiles.module.scss';
6
- import Tile from './Tile';
6
+ import { Tile } from './Tile';
7
7
 
8
8
  interface Props {
9
9
  className?: string;
@@ -15,7 +15,15 @@ interface Props {
15
15
  wave?: boolean;
16
16
  }
17
17
 
18
- const PlainTiles: FunctionComponent<Props> = ({ className, color, content, dropShadow, showPoints, style, wave }) => {
18
+ export const PlainTiles: FunctionComponent<Props> = ({
19
+ className,
20
+ color,
21
+ content,
22
+ dropShadow,
23
+ showPoints,
24
+ style,
25
+ wave,
26
+ }) => {
19
27
  const tiles = useMemo(() => createPlainTiles({ color, content, showPoints }), [color, content, showPoints]);
20
28
 
21
29
  return (
@@ -44,5 +52,3 @@ const PlainTiles: FunctionComponent<Props> = ({ className, color, content, dropS
44
52
  </svg>
45
53
  );
46
54
  };
47
-
48
- export default PlainTiles;
@@ -11,7 +11,7 @@ interface Props {
11
11
  y: number;
12
12
  }
13
13
 
14
- const Tile: FunctionComponent<Props> = ({ character, className, color, points, size, transform, x, y }) => (
14
+ export const Tile: FunctionComponent<Props> = ({ character, className, color, points, size, transform, x, y }) => (
15
15
  <g className={className} fill="#222" transform={transform}>
16
16
  <rect fill={color} height={size} rx={size * 0.15} width={size} x={x} y={y} />
17
17
 
@@ -40,5 +40,3 @@ const Tile: FunctionComponent<Props> = ({ character, className, color, points, s
40
40
  )}
41
41
  </g>
42
42
  );
43
-
44
- export default Tile;
@@ -1 +1 @@
1
- export { default } from './PlainTiles';
1
+ export { PlainTiles } from './PlainTiles';
@@ -11,11 +11,17 @@ import {
11
11
 
12
12
  import { CreatePlainTileOptions, PlainTile } from '../types';
13
13
 
14
- import getX from './getX';
15
- import getY from './getY';
16
- import randomize from './randomize';
14
+ import { getX } from './getX';
15
+ import { getY } from './getY';
16
+ import { randomize } from './randomize';
17
17
 
18
- const createPlainTile = ({ cellIndex, character, color, rowIndex, showPoints }: CreatePlainTileOptions): PlainTile => {
18
+ export const createPlainTile = ({
19
+ cellIndex,
20
+ character,
21
+ color,
22
+ rowIndex,
23
+ showPoints,
24
+ }: CreatePlainTileOptions): PlainTile => {
19
25
  const configPoints = getConfig(Game.Literaki, Locale.EN_US).getCharacterPoints(character.toLowerCase());
20
26
  const points = showPoints ? configPoints : undefined;
21
27
  const defaultColor =
@@ -33,5 +39,3 @@ const createPlainTile = ({ cellIndex, character, color, rowIndex, showPoints }:
33
39
  y: randomize(getY(rowIndex), PLAIN_TILES_TILE_MAX_SCATTER),
34
40
  };
35
41
  };
36
-
37
- export default createPlainTile;
@@ -1,8 +1,8 @@
1
1
  import { CreatePlainTilesOptions, PlainTile } from '../types';
2
2
 
3
- import createPlainTile from './createPlainTile';
3
+ import { createPlainTile } from './createPlainTile';
4
4
 
5
- const createPlainTiles = ({ color, content, showPoints }: CreatePlainTilesOptions): PlainTile[] => {
5
+ export const createPlainTiles = ({ color, content, showPoints }: CreatePlainTilesOptions): PlainTile[] => {
6
6
  const rows = content.map((words, rowIndex) => {
7
7
  return words.map((word, wordIndex) => {
8
8
  const cellOffset = words.slice(0, wordIndex).reduce((result, { length }) => result + length + ' '.length, 0);
@@ -23,5 +23,3 @@ const createPlainTiles = ({ color, content, showPoints }: CreatePlainTilesOption
23
23
  const tiles = rows.flat(2);
24
24
  return tiles;
25
25
  };
26
-
27
- export default createPlainTiles;
@@ -1,6 +1,6 @@
1
1
  import { PLAIN_TILES_TILE_MARGIN, PLAIN_TILES_TILE_SIZE } from 'parameters';
2
2
 
3
- const getViewbox = (content: string[][]): string => {
3
+ export const getViewbox = (content: string[][]): string => {
4
4
  const longestRowLength = content.reduce((result, words) => {
5
5
  const wordsLength = words.reduce((sum, word) => sum + word.length, 0);
6
6
  const rowLength = wordsLength + Math.max(words.length - 1, 0);
@@ -15,5 +15,3 @@ const getViewbox = (content: string[][]): string => {
15
15
 
16
16
  return `0 0 ${width} ${height}`;
17
17
  };
18
-
19
- export default getViewbox;
@@ -1,7 +1,5 @@
1
1
  import { PLAIN_TILES_PADDING_HORIZONTAL, PLAIN_TILES_TILE_MARGIN, PLAIN_TILES_TILE_SIZE } from 'parameters';
2
2
 
3
- const getX = (index: number): number => {
3
+ export const getX = (index: number): number => {
4
4
  return PLAIN_TILES_PADDING_HORIZONTAL + index * (PLAIN_TILES_TILE_SIZE + PLAIN_TILES_TILE_MARGIN);
5
5
  };
6
-
7
- export default getX;
@@ -1,7 +1,5 @@
1
1
  import { PLAIN_TILES_PADDING_VERTICAL, PLAIN_TILES_TILE_MARGIN, PLAIN_TILES_TILE_SIZE } from 'parameters';
2
2
 
3
- const getY = (index: number): number => {
3
+ export const getY = (index: number): number => {
4
4
  return PLAIN_TILES_PADDING_VERTICAL + index * (PLAIN_TILES_TILE_SIZE + PLAIN_TILES_TILE_MARGIN);
5
5
  };
6
-
7
- export default getY;
@@ -1,6 +1,6 @@
1
- export { default as createPlainTile } from './createPlainTile';
2
- export { default as createPlainTiles } from './createPlainTiles';
3
- export { default as getViewbox } from './getViewbox';
4
- export { default as getX } from './getX';
5
- export { default as getY } from './getY';
6
- export { default as randomize } from './randomize';
1
+ export { createPlainTile } from './createPlainTile';
2
+ export { createPlainTiles } from './createPlainTiles';
3
+ export { getViewbox } from './getViewbox';
4
+ export { getX } from './getX';
5
+ export { getY } from './getY';
6
+ export { randomize } from './randomize';
@@ -1,3 +1 @@
1
- const randomize = (value: number, maxChange: number): number => value + maxChange * 2 * (0.5 - Math.random());
2
-
3
- export default randomize;
1
+ export const randomize = (value: number, maxChange: number): number => value + maxChange * 2 * (0.5 - Math.random());
@@ -17,7 +17,7 @@ const getGradient = (progress: number, color: string, background: string) => {
17
17
  return `linear-gradient(90deg, ${color} 0%, ${color} ${percent}%, ${background} ${percent}%, ${background} 100%)`;
18
18
  };
19
19
 
20
- const Progress: FunctionComponent<Props> = ({ className, max, min = 0, style, value, ...props }) => {
20
+ export const Progress: FunctionComponent<Props> = ({ className, max, min = 0, style, value, ...props }) => {
21
21
  const locale = useTypedSelector(selectLocale);
22
22
  const progress = value / (max - min);
23
23
  const percent = Math.round(100 * progress);
@@ -34,5 +34,3 @@ const Progress: FunctionComponent<Props> = ({ className, max, min = 0, style, va
34
34
  />
35
35
  );
36
36
  };
37
-
38
- export default Progress;
@@ -1 +1 @@
1
- export { default } from './Progress';
1
+ export { Progress } from './Progress';
@@ -45,7 +45,7 @@ interface Props {
45
45
  tileSize: number;
46
46
  }
47
47
 
48
- const Rack: FunctionComponent<Props> = ({ className, tileSize }) => {
48
+ export const Rack: FunctionComponent<Props> = ({ className, tileSize }) => {
49
49
  const dispatch = useDispatch();
50
50
  const config = useTypedSelector(selectConfig);
51
51
  const locale = useTypedSelector(selectLocale);
@@ -120,7 +120,7 @@ const Rack: FunctionComponent<Props> = ({ className, tileSize }) => {
120
120
  const handleFocus = useCallback(() => {
121
121
  setHasFocus(true);
122
122
  floatingInputPrompt.refs.setPositionReference(ref.current);
123
- const characters: string[] = rack.filter((character) => character !== null) as string[];
123
+ const characters = rack.filter((character) => character !== null);
124
124
  const uppercasedDigraphs = characters.map((character) => {
125
125
  return character.length > 1 ? character.toLocaleUpperCase(locale) : character;
126
126
  });
@@ -216,5 +216,3 @@ const Rack: FunctionComponent<Props> = ({ className, tileSize }) => {
216
216
  </>
217
217
  );
218
218
  };
219
-
220
- export default Rack;
@@ -25,7 +25,7 @@ interface Props {
25
25
  onSubmit: FormEventHandler<HTMLFormElement>;
26
26
  }
27
27
 
28
- const InputPrompt = forwardRef<HTMLFormElement, Props>(
28
+ const InputPromptBase = forwardRef<HTMLFormElement, Props>(
29
29
  ({ className, style, value, onBlur, onChange, onSubmit, ...props }, ref) => {
30
30
  const dispatch = useDispatch();
31
31
  const translate = useTranslate();
@@ -83,6 +83,6 @@ const InputPrompt = forwardRef<HTMLFormElement, Props>(
83
83
  },
84
84
  );
85
85
 
86
- export default Object.assign(InputPrompt, {
86
+ export const InputPrompt = Object.assign(InputPromptBase, {
87
87
  styles,
88
88
  });
@@ -1 +1 @@
1
- export { default } from './InputPrompt';
1
+ export { InputPrompt } from './InputPrompt';
@@ -8,7 +8,6 @@ import {
8
8
  FunctionComponent,
9
9
  KeyboardEventHandler,
10
10
  MouseEventHandler,
11
- MutableRefObject,
12
11
  RefObject,
13
12
  TouchEventHandler,
14
13
  useCallback,
@@ -28,12 +27,12 @@ import {
28
27
  useTypedSelector,
29
28
  } from 'state';
30
29
 
31
- import Tile from '../../../Tile';
30
+ import { Tile } from '../../../Tile';
32
31
 
33
32
  import styles from './RackTile.module.scss';
34
33
 
35
34
  interface Props {
36
- activeIndexRef: MutableRefObject<number | undefined>;
35
+ activeIndexRef: RefObject<number | undefined>;
37
36
  character: string | null;
38
37
  className?: string;
39
38
  index: number;
@@ -45,7 +44,7 @@ interface Props {
45
44
  onFocus: () => void;
46
45
  }
47
46
 
48
- const RackTile: FunctionComponent<Props> = ({
47
+ export const RackTile: FunctionComponent<Props> = ({
49
48
  activeIndexRef,
50
49
  character,
51
50
  className,
@@ -103,7 +102,7 @@ const RackTile: FunctionComponent<Props> = ({
103
102
  const twoTilesCharacter = config.getTwoCharacterTileByPrefix(event.key);
104
103
 
105
104
  if (twoTilesCharacter) {
106
- dispatch(rackSlice.actions.changeCharacter({ character: twoTilesCharacter!, index }));
105
+ dispatch(rackSlice.actions.changeCharacter({ character: twoTilesCharacter, index }));
107
106
  }
108
107
  }
109
108
 
@@ -160,5 +159,3 @@ const RackTile: FunctionComponent<Props> = ({
160
159
  />
161
160
  );
162
161
  };
163
-
164
- export default RackTile;
@@ -1 +1 @@
1
- export { default } from './RackTile';
1
+ export { RackTile } from './RackTile';
@@ -1,2 +1,2 @@
1
- export { default as InputPrompt } from './InputPrompt';
2
- export { default as RackTile } from './RackTile';
1
+ export { InputPrompt } from './InputPrompt';
2
+ export { RackTile } from './RackTile';
@@ -1 +1 @@
1
- export { default } from './Rack';
1
+ export { Rack } from './Rack';