scrabble-solver 2.10.11 → 2.11.1

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 (172) hide show
  1. package/lerna.json +1 -1
  2. package/package.json +8 -8
  3. package/packages/configs/package.json +3 -3
  4. package/packages/constants/package.json +1 -1
  5. package/packages/dictionaries/package-lock.json +2 -2
  6. package/packages/dictionaries/package.json +4 -4
  7. package/packages/logger/package-lock.json +8 -8
  8. package/packages/logger/package.json +1 -1
  9. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  10. package/packages/scrabble-solver/.next/build-manifest.json +12 -12
  11. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  12. package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
  13. package/packages/scrabble-solver/.next/cache/next-server.js.nft.json +1 -1
  14. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  15. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  16. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  17. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  18. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  19. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  20. package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
  21. package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
  22. package/packages/scrabble-solver/.next/required-server-files.json +1 -1
  23. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  24. package/packages/scrabble-solver/.next/server/chunks/{176.js → 277.js} +956 -930
  25. package/packages/scrabble-solver/.next/server/chunks/{290.js → 417.js} +3 -3
  26. package/packages/scrabble-solver/.next/server/chunks/50.js +371 -343
  27. package/packages/scrabble-solver/.next/server/chunks/664.js +15 -15
  28. package/packages/scrabble-solver/.next/server/chunks/859.js +17 -10
  29. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  30. package/packages/scrabble-solver/.next/server/next-font-manifest.js +1 -0
  31. package/packages/scrabble-solver/.next/server/pages/404.html +2 -2
  32. package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
  33. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  34. package/packages/scrabble-solver/.next/server/pages/_app.js +4 -28
  35. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  36. package/packages/scrabble-solver/.next/server/pages/_document.js +2 -2
  37. package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
  38. package/packages/scrabble-solver/.next/server/pages/_error.js +4 -4
  39. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +4 -4
  40. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  41. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +3 -3
  42. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  43. package/packages/scrabble-solver/.next/server/pages/api/solve.js +9 -11
  44. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  45. package/packages/scrabble-solver/.next/server/pages/api/verify.js +3 -3
  46. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  47. package/packages/scrabble-solver/.next/server/pages/api/visit.js +3 -3
  48. package/packages/scrabble-solver/.next/server/pages/api/visit.js.nft.json +1 -1
  49. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  50. package/packages/scrabble-solver/.next/server/pages/index.js +256 -210
  51. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  52. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  53. package/packages/scrabble-solver/.next/static/chunks/main-0ecb9ccfcb6c9b24.js +1 -0
  54. package/packages/scrabble-solver/.next/static/chunks/pages/404-448ba28510855455.js +1 -0
  55. package/packages/scrabble-solver/.next/static/chunks/pages/_app-270526803bc274eb.js +28 -0
  56. package/packages/scrabble-solver/.next/static/chunks/pages/{_error-8353112a01355ec2.js → _error-54de1933a164a1ff.js} +1 -1
  57. package/packages/scrabble-solver/.next/static/chunks/pages/index-c6e7754ccf3532df.js +1 -0
  58. package/packages/scrabble-solver/.next/static/css/ad39b36eab07e613.css +1 -0
  59. package/packages/scrabble-solver/.next/static/css/e5803e581e4c0451.css +2 -0
  60. package/packages/scrabble-solver/.next/static/esK8DG-6aS5V7QFRtR3YE/_buildManifest.js +1 -0
  61. package/packages/scrabble-solver/.next/trace +53 -55
  62. package/packages/scrabble-solver/package-lock.json +224 -310
  63. package/packages/scrabble-solver/package.json +11 -16
  64. package/packages/scrabble-solver/src/components/{Solver/components/EmptyState/EmptyState.module.scss → Alert/Alert.module.scss} +11 -7
  65. package/packages/scrabble-solver/src/components/{Solver/components/EmptyState/EmptyState.tsx → Alert/Alert.tsx} +8 -6
  66. package/packages/scrabble-solver/src/components/Alert/index.ts +1 -0
  67. package/packages/scrabble-solver/src/components/Board/Board.module.scss +55 -0
  68. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +4 -0
  69. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +42 -0
  70. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +12 -0
  71. package/packages/scrabble-solver/src/components/Board/components/Cell/CellPure.tsx +12 -0
  72. package/packages/scrabble-solver/src/components/Board/hooks/useGrid.ts +8 -24
  73. package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss +17 -8
  74. package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +5 -5
  75. package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.module.scss +1 -0
  76. package/packages/scrabble-solver/src/components/EmptyState/EmptyState.module.scss +2 -1
  77. package/packages/scrabble-solver/src/components/EmptyState/EmptyState.tsx +1 -2
  78. package/packages/scrabble-solver/src/components/Loading/Loading.module.scss +1 -1
  79. package/packages/scrabble-solver/src/components/Loading/Loading.tsx +1 -1
  80. package/packages/scrabble-solver/src/components/Logo/Logo.tsx +5 -0
  81. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +2 -1
  82. package/packages/scrabble-solver/src/components/NavButtons/NavButtons.tsx +4 -5
  83. package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.module.scss +1 -1
  84. package/packages/scrabble-solver/src/components/PlainTiles/Tile.tsx +3 -3
  85. package/packages/scrabble-solver/src/components/Rack/Rack.module.scss +25 -0
  86. package/packages/scrabble-solver/src/components/Rack/Rack.tsx +5 -4
  87. package/packages/scrabble-solver/src/components/Rack/RackTile.tsx +6 -13
  88. package/packages/scrabble-solver/src/components/Results/Results.module.scss +33 -2
  89. package/packages/scrabble-solver/src/components/Results/Results.tsx +11 -11
  90. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss +1 -0
  91. package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +6 -4
  92. package/packages/scrabble-solver/src/components/Solver/Solver.tsx +16 -28
  93. package/packages/scrabble-solver/src/components/Solver/components/FloatingSolveButton/FloatingSolveButton.module.scss +7 -0
  94. package/packages/scrabble-solver/src/components/Solver/components/{SolveButton/SolveButton.tsx → FloatingSolveButton/FloatingSolveButton.tsx} +6 -6
  95. package/packages/scrabble-solver/src/components/Solver/components/FloatingSolveButton/index.ts +1 -0
  96. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +19 -4
  97. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +13 -1
  98. package/packages/scrabble-solver/src/components/Solver/components/index.ts +1 -2
  99. package/packages/scrabble-solver/src/components/Spinner/Spinner.module.scss +11 -0
  100. package/packages/scrabble-solver/src/components/Spinner/Spinner.tsx +19 -0
  101. package/packages/scrabble-solver/src/components/Spinner/index.ts +1 -0
  102. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +14 -2
  103. package/packages/scrabble-solver/src/components/Tile/Tile.tsx +5 -5
  104. package/packages/scrabble-solver/src/components/Tooltip/Tooltip.module.scss +1 -72
  105. package/packages/scrabble-solver/src/components/Tooltip/useTooltip.tsx +25 -35
  106. package/packages/scrabble-solver/src/components/index.ts +2 -0
  107. package/packages/scrabble-solver/src/hooks/index.ts +1 -1
  108. package/packages/scrabble-solver/src/hooks/useAppLayout.ts +29 -0
  109. package/packages/scrabble-solver/src/i18n/de.json +1 -0
  110. package/packages/scrabble-solver/src/i18n/en.json +1 -0
  111. package/packages/scrabble-solver/src/i18n/es.json +1 -0
  112. package/packages/scrabble-solver/src/i18n/fa.json +1 -0
  113. package/packages/scrabble-solver/src/i18n/fr.json +1 -0
  114. package/packages/scrabble-solver/src/i18n/index.ts +1 -1
  115. package/packages/scrabble-solver/src/i18n/pl.json +1 -0
  116. package/packages/scrabble-solver/src/lib/index.ts +0 -1
  117. package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.module.scss +23 -0
  118. package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.tsx +27 -0
  119. package/packages/scrabble-solver/src/modals/DictionaryModal/index.ts +1 -0
  120. package/packages/scrabble-solver/src/modals/KeyMapModal/KeyMapModal.tsx +5 -21
  121. package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +4 -0
  122. package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +7 -1
  123. package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.module.scss +1 -0
  124. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.module.scss +19 -0
  125. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +8 -7
  126. package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +2 -0
  127. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +8 -1
  128. package/packages/scrabble-solver/src/modals/index.ts +1 -0
  129. package/packages/scrabble-solver/src/pages/api/solve.ts +9 -10
  130. package/packages/scrabble-solver/src/pages/index.tsx +20 -15
  131. package/packages/scrabble-solver/src/state/createAppStore.ts +26 -10
  132. package/packages/scrabble-solver/src/state/localStorage.ts +0 -9
  133. package/packages/scrabble-solver/src/state/types.ts +20 -2
  134. package/packages/scrabble-solver/src/styles/animations.scss +10 -0
  135. package/packages/scrabble-solver/src/styles/global.scss +1 -1
  136. package/packages/scrabble-solver/src/styles/mixins.scss +22 -0
  137. package/packages/scrabble-solver/src/styles/variables.scss +17 -2
  138. package/packages/scrabble-solver/src/types/index.ts +1 -0
  139. package/packages/solver/package-lock.json +2 -2
  140. package/packages/solver/package.json +5 -5
  141. package/packages/types/build/Bonus.d.ts +2 -1
  142. package/packages/types/package.json +2 -2
  143. package/packages/types/src/Bonus.ts +3 -1
  144. package/packages/word-definitions/build/lib/normalizeDefinition.js +1 -1
  145. package/packages/word-definitions/package-lock.json +8 -8
  146. package/packages/word-definitions/package.json +2 -2
  147. package/packages/word-definitions/src/lib/normalizeDefinition.ts +1 -1
  148. package/packages/word-definitions/src/parse/__tests__/expected/en-US.oe.json +7 -0
  149. package/packages/word-definitions/src/parse/__tests__/input/en-US.oe.html +1337 -0
  150. package/packages/word-definitions/src/parse/parse.test.ts +1 -0
  151. package/packages/word-lists/package-lock.json +8 -8
  152. package/packages/word-lists/package.json +2 -2
  153. package/packages/configs/package-lock.json +0 -58
  154. package/packages/constants/package-lock.json +0 -13
  155. package/packages/scrabble-solver/.next/server/font-loader-manifest.js +0 -1
  156. package/packages/scrabble-solver/.next/static/chunks/main-74c4d6b2b5c362f3.js +0 -1
  157. package/packages/scrabble-solver/.next/static/chunks/pages/404-6c1a6e3251710371.js +0 -1
  158. package/packages/scrabble-solver/.next/static/chunks/pages/_app-d98e480ff8c583de.js +0 -28
  159. package/packages/scrabble-solver/.next/static/chunks/pages/index-bd1c7d3872c37456.js +0 -1
  160. package/packages/scrabble-solver/.next/static/css/a9b55372a26cf77d.css +0 -1
  161. package/packages/scrabble-solver/.next/static/css/b8954b85e2fa5b63.css +0 -2
  162. package/packages/scrabble-solver/.next/static/msKI0ZURgJImoGBJvCBiF/_buildManifest.js +0 -1
  163. package/packages/scrabble-solver/src/components/Solver/components/EmptyState/index.ts +0 -1
  164. package/packages/scrabble-solver/src/components/Solver/components/SolveButton/SolveButton.module.scss +0 -4
  165. package/packages/scrabble-solver/src/components/Solver/components/SolveButton/index.ts +0 -1
  166. package/packages/scrabble-solver/src/components/Tooltip/constants.ts +0 -28
  167. package/packages/scrabble-solver/src/hooks/useUniqueId.ts +0 -9
  168. package/packages/scrabble-solver/src/lib/isCtrl.ts +0 -7
  169. package/packages/scrabble-solver/src/state/rootReducer.ts +0 -25
  170. package/packages/types/package-lock.json +0 -30
  171. /package/packages/scrabble-solver/.next/server/{font-loader-manifest.json → next-font-manifest.json} +0 -0
  172. /package/packages/scrabble-solver/.next/static/{msKI0ZURgJImoGBJvCBiF → esK8DG-6aS5V7QFRtR3YE}/_ssgManifest.js +0 -0
@@ -57,30 +57,29 @@ const parseRequest = (request: NextApiRequest): RequestData => {
57
57
  throw new Error('Invalid "configId" parameter');
58
58
  }
59
59
 
60
- const config = getLocaleConfig(configId, locale);
61
-
62
- if (!isBoardJson(boardJson) || !isBoardValid(boardJson, config)) {
63
- throw new Error('Invalid "board" parameter');
64
- }
65
-
66
60
  if (!isStringArray(characters) || characters.length === 0) {
67
61
  throw new Error('Invalid "characters" parameter');
68
62
  }
69
63
 
64
+ const config = getLocaleConfig(configId, locale);
65
+
70
66
  for (const character of characters) {
71
67
  if (!config.hasCharacter(character) && character !== BLANK) {
72
68
  throw new Error('Invalid "characters" parameter');
73
69
  }
74
70
  }
75
-
76
- const board = Board.fromJson(boardJson);
77
- const blankTilesCount = characters.filter((character) => character === BLANK).length;
78
- const blanksCount = board.getBlanksCount() + blankTilesCount;
71
+ const blanksCount = characters.filter((character) => character === BLANK).length;
79
72
 
80
73
  if (blanksCount > config.blanksCount) {
81
74
  throw new Error('Too many blank tiles passed');
82
75
  }
83
76
 
77
+ if (!isBoardJson(boardJson) || !isBoardValid(boardJson, config)) {
78
+ throw new Error('Invalid "board" parameter');
79
+ }
80
+
81
+ const board = Board.fromJson(boardJson);
82
+
84
83
  return {
85
84
  board,
86
85
  characters,
@@ -1,18 +1,26 @@
1
1
  import classNames from 'classnames';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- import { AnimationEvent, FunctionComponent, useEffect, useState } from 'react';
4
+ import { FunctionComponent, useEffect, useState } from 'react';
5
5
  import ReactModal from 'react-modal';
6
6
  import { useDispatch } from 'react-redux';
7
7
  import { useEffectOnce, useMeasure } from 'react-use';
8
8
 
9
9
  import { Logo, LogoSplashScreen, NavButtons, Solver, SvgFontFix } from 'components';
10
- import { useDirection, useLanguage, useLocalStorage, useMediaQuery } from 'hooks';
10
+ import { useAppLayout, useDirection, useLanguage, useLocalStorage } from 'hooks';
11
11
  import { LOCALE_FEATURES } from 'i18n';
12
- import { KeyMapModal, MenuModal, RemainingTilesModal, ResultsModal, SettingsModal, WordsModal } from 'modals';
12
+ import {
13
+ DictionaryModal,
14
+ KeyMapModal,
15
+ MenuModal,
16
+ RemainingTilesModal,
17
+ ResultsModal,
18
+ SettingsModal,
19
+ WordsModal,
20
+ } from 'modals';
13
21
  import { INITIALIZATION_DURATION } from 'parameters';
14
22
  import { registerServiceWorker } from 'serviceWorkerManager';
15
- import { initialize, localStorage, reset, selectLocale, useTypedSelector } from 'state';
23
+ import { initialize, reset, selectLocale, useTypedSelector } from 'state';
16
24
 
17
25
  import styles from './index.module.scss';
18
26
 
@@ -26,7 +34,8 @@ interface Props {
26
34
  const Index: FunctionComponent<Props> = ({ version }) => {
27
35
  const dispatch = useDispatch();
28
36
  const locale = useTypedSelector(selectLocale);
29
- const isLessThanL = useMediaQuery('<l');
37
+ const { showResultsInModal } = useAppLayout();
38
+ const [showDictionary, setShowDictionary] = useState(false);
30
39
  const [showKeyMap, setShowKeyMap] = useState(false);
31
40
  const [showMenu, setShowMenu] = useState(false);
32
41
  const [showRemainingTiles, setShowRemainingTiles] = useState(false);
@@ -44,13 +53,6 @@ const Index: FunctionComponent<Props> = ({ version }) => {
44
53
  dispatch(reset());
45
54
  };
46
55
 
47
- const handleSplashAnimationEnd = (event: AnimationEvent<HTMLDivElement>) => {
48
- if (event.target === event.currentTarget && !localStorage.getHasVisited()) {
49
- setShowSettings(true);
50
- localStorage.setHasVisited(true);
51
- }
52
- };
53
-
54
56
  useDirection(LOCALE_FEATURES[locale].direction);
55
57
  useLanguage(locale);
56
58
  useLocalStorage();
@@ -65,10 +67,10 @@ const Index: FunctionComponent<Props> = ({ version }) => {
65
67
  });
66
68
 
67
69
  useEffect(() => {
68
- if (!isLessThanL) {
70
+ if (!showResultsInModal) {
69
71
  setShowResults(false);
70
72
  }
71
- }, [isLessThanL]);
73
+ }, [showResultsInModal]);
72
74
 
73
75
  useEffect(() => {
74
76
  if (process.env.NODE_ENV === 'production') {
@@ -115,6 +117,7 @@ const Index: FunctionComponent<Props> = ({ version }) => {
115
117
  <MenuModal
116
118
  isOpen={showMenu}
117
119
  onClose={() => setShowMenu(false)}
120
+ onShowDictionary={() => setShowDictionary(true)}
118
121
  onShowRemainingTiles={() => setShowRemainingTiles(true)}
119
122
  onShowSettings={() => setShowSettings(true)}
120
123
  onShowWords={() => setShowWords(true)}
@@ -130,7 +133,9 @@ const Index: FunctionComponent<Props> = ({ version }) => {
130
133
 
131
134
  <ResultsModal isOpen={showResults} onClose={() => setShowResults(false)} />
132
135
 
133
- <LogoSplashScreen forceShow={!isInitialized} onAnimationEnd={handleSplashAnimationEnd} />
136
+ <DictionaryModal isOpen={showDictionary} onClose={() => setShowDictionary(false)} />
137
+
138
+ <LogoSplashScreen forceShow={!isInitialized} />
134
139
  </>
135
140
  );
136
141
  };
@@ -1,21 +1,37 @@
1
- import { applyMiddleware, compose, createStore } from 'redux';
1
+ import { configureStore } from '@reduxjs/toolkit';
2
2
  import reduxSaga from 'redux-saga';
3
3
 
4
- import rootReducer from './rootReducer';
5
4
  import { rootSaga } from './sagas';
6
- import { RootState } from './types';
5
+ import {
6
+ boardSlice,
7
+ cellFilterSlice,
8
+ dictionarySlice,
9
+ rackSlice,
10
+ resultsSlice,
11
+ settingsSlice,
12
+ solveSlice,
13
+ verifySlice,
14
+ } from './slices';
7
15
 
8
16
  const sagaMiddleware = reduxSaga();
9
- const initialState: Partial<RootState> | undefined = undefined;
10
17
 
11
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
- // @ts-ignore
13
- // eslint-disable-next-line no-underscore-dangle
14
- const composeEnhancers = globalThis.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
18
+ const createAppStore = () => {
19
+ const store = configureStore({
20
+ reducer: {
21
+ board: boardSlice.reducer,
22
+ cellFilter: cellFilterSlice.reducer,
23
+ dictionary: dictionarySlice.reducer,
24
+ rack: rackSlice.reducer,
25
+ results: resultsSlice.reducer,
26
+ settings: settingsSlice.reducer,
27
+ solve: solveSlice.reducer,
28
+ verify: verifySlice.reducer,
29
+ },
30
+ middleware: [sagaMiddleware],
31
+ });
15
32
 
16
- const createAppStore = (): ReturnType<typeof createStore> => {
17
- const store = createStore(rootReducer, initialState, composeEnhancers(applyMiddleware(sagaMiddleware)));
18
33
  sagaMiddleware.run(rootSaga);
34
+
19
35
  return store;
20
36
  };
21
37
 
@@ -3,7 +3,6 @@ import store2 from 'store2';
3
3
 
4
4
  const BOARD = 'board';
5
5
  const CONFIG_ID = 'config-id';
6
- const HAS_VISITED = 'has-visited';
7
6
  const LOCALE = 'locale';
8
7
  const RACK = 'rack';
9
8
 
@@ -28,14 +27,6 @@ const localStorage = {
28
27
  store.set(CONFIG_ID, configId, true);
29
28
  },
30
29
 
31
- getHasVisited(): boolean {
32
- return Boolean(store.get(HAS_VISITED));
33
- },
34
-
35
- setHasVisited(hasVisited: boolean): void {
36
- store.set(HAS_VISITED, hasVisited, true);
37
- },
38
-
39
30
  getLocale(): Locale | undefined {
40
31
  return store.get(LOCALE);
41
32
  },
@@ -1,3 +1,21 @@
1
- import rootReducer from './rootReducer';
1
+ import {
2
+ boardSlice,
3
+ cellFilterSlice,
4
+ dictionarySlice,
5
+ rackSlice,
6
+ resultsSlice,
7
+ settingsSlice,
8
+ solveSlice,
9
+ verifySlice,
10
+ } from './slices';
2
11
 
3
- export type RootState = ReturnType<typeof rootReducer>;
12
+ export type RootState = {
13
+ board: ReturnType<typeof boardSlice.reducer>;
14
+ cellFilter: ReturnType<typeof cellFilterSlice.reducer>;
15
+ dictionary: ReturnType<typeof dictionarySlice.reducer>;
16
+ rack: ReturnType<typeof rackSlice.reducer>;
17
+ results: ReturnType<typeof resultsSlice.reducer>;
18
+ settings: ReturnType<typeof settingsSlice.reducer>;
19
+ solve: ReturnType<typeof solveSlice.reducer>;
20
+ verify: ReturnType<typeof verifySlice.reducer>;
21
+ };
@@ -28,6 +28,16 @@
28
28
  }
29
29
  }
30
30
 
31
+ @keyframes rotate {
32
+ 0% {
33
+ transform: rotate(0deg);
34
+ }
35
+
36
+ 100% {
37
+ transform: rotate(360deg);
38
+ }
39
+ }
40
+
31
41
  @keyframes pulse {
32
42
  0% {
33
43
  transform: scale(1);
@@ -54,5 +54,5 @@ h4 {
54
54
 
55
55
  [lang='fa-IR'] {
56
56
  --font--family: 'Vazirmatn', sans-serif;
57
- --font--family--title: 'Vazirmatn', sans-serif;
57
+ --font--family--title: var(--font--family);
58
58
  }
@@ -12,6 +12,28 @@ $media-expressions: (
12
12
  touch: '(hover: none)',
13
13
  );
14
14
 
15
+ @mixin scrollbars {
16
+ scrollbar-color: var(--scrollbar--thumb--color) var(--scrollbar--thumb--track);
17
+ scrollbar-width: auto;
18
+
19
+ &::-webkit-scrollbar {
20
+ width: var(--scrollbar--size);
21
+ background-color: var(--scrollbar--track--color);
22
+ }
23
+
24
+ &::-webkit-scrollbar-thumb {
25
+ background-color: var(--scrollbar--thumb--color);
26
+ }
27
+
28
+ &:hover {
29
+ scrollbar-color: var(--scrollbar--thumb--color--highlight) var(--scrollbar--track--color);
30
+
31
+ &::-webkit-scrollbar-thumb {
32
+ background-color: var(--scrollbar--thumb--color--highlight);
33
+ }
34
+ }
35
+ }
36
+
15
37
  /**
16
38
  * It does not work when applied on input elements.
17
39
  */
@@ -1,3 +1,5 @@
1
+ @import 'styles/mixins';
2
+
1
3
  $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
2
4
 
3
5
  :root {
@@ -8,7 +10,7 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
8
10
  --border--width: 1px;
9
11
 
10
12
  --box-shadow: 0 0 var(--box-shadow--blur) var(--box-shadow--spread) var(--box-shadow--color);
11
- --box-shadow--blur: 10px;
13
+ --box-shadow--blur: 8px;
12
14
  --box-shadow--color: rgba(0, 0, 0, 0.15);
13
15
  --box-shadow--spread: 1px;
14
16
  --box-shadow--null: 0 0 var(--box-shadow--blur) var(--box-shadow--spread) transparent;
@@ -74,6 +76,11 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
74
76
  --spacing--xl: 40px;
75
77
  --spacing--xxl: 80px;
76
78
 
79
+ --scrollbar--size: 5px;
80
+ --scrollbar--thumb--color: var(--border--color);
81
+ --scrollbar--thumb--color--highlight: var(--color--foreground--secondary);
82
+ --scrollbar--track--color: transparent;
83
+
77
84
  --transition: all var(--transition--duration) var(--transition--easing);
78
85
  --transition--long: all var(--transition--duration--long) var(--transition--easing);
79
86
  --transition--duration: 100ms;
@@ -86,10 +93,18 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
86
93
  --z-index--close-button: 101;
87
94
  --z-index--tooltip: 102;
88
95
 
96
+ --button--icon--size: 24px;
89
97
  --dictionary--height: 260px;
90
98
  --modal--width: 370px;
91
99
  --solver-column--width: 580px;
92
100
  --square-button--size: 32px;
93
- --button--icon--size: 24px;
94
101
  --text-input--height: 40px;
102
+
103
+ @include media('<s') {
104
+ --box-shadow--blur: 5px;
105
+ }
106
+
107
+ @include media('<xs') {
108
+ --box-shadow--blur: 3px;
109
+ }
95
110
  }
@@ -50,6 +50,7 @@ export type TranslationKey =
50
50
  | 'common.vowels'
51
51
  | 'common.word'
52
52
  | 'common.words'
53
+ | 'dictionary'
53
54
  | 'dictionary.empty-state.no-definitions'
54
55
  | 'dictionary.empty-state.no-results'
55
56
  | 'dictionary.empty-state.not-allowed'
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/solver",
3
- "version": "2.10.11",
3
+ "version": "2.11.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/solver",
9
- "version": "2.10.11",
9
+ "version": "2.11.1",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "@kamilmielnik/trie": "^2.0.1"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/solver",
3
- "version": "2.10.11",
3
+ "version": "2.11.1",
4
4
  "description": "Scrabble Solver 2 - Solver",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@kamilmielnik/trie": "^2.0.1",
28
- "@scrabble-solver/types": "^2.10.11"
28
+ "@scrabble-solver/types": "^2.11.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@scrabble-solver/configs": "^2.10.11",
32
- "@scrabble-solver/constants": "^2.10.11",
33
- "@scrabble-solver/dictionaries": "^2.10.11"
31
+ "@scrabble-solver/configs": "^2.11.1",
32
+ "@scrabble-solver/constants": "^2.11.1",
33
+ "@scrabble-solver/dictionaries": "^2.11.1"
34
34
  },
35
35
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
36
36
  }
@@ -1,3 +1,4 @@
1
+ import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
1
2
  import BonusJson from './BonusJson';
2
3
  import BonusValue from './BonusValue';
3
4
  import Cell from './Cell';
@@ -5,7 +6,7 @@ import Config from './Config';
5
6
  declare abstract class Bonus {
6
7
  readonly multiplier: number;
7
8
  readonly score: number | undefined;
8
- abstract readonly type: string;
9
+ abstract readonly type: typeof BONUS_CHARACTER | typeof BONUS_WORD;
9
10
  readonly x: number;
10
11
  readonly y: number;
11
12
  constructor({ multiplier, score, x, y }: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/types",
3
- "version": "2.10.11",
3
+ "version": "2.11.1",
4
4
  "description": "Scrabble Solver 2 - Types",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/constants": "^2.10.11"
27
+ "@scrabble-solver/constants": "^2.11.1"
28
28
  },
29
29
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
30
30
  }
@@ -1,3 +1,5 @@
1
+ import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
2
+
1
3
  import BonusJson from './BonusJson';
2
4
  import BonusValue from './BonusValue';
3
5
  import Cell from './Cell';
@@ -8,7 +10,7 @@ abstract class Bonus {
8
10
 
9
11
  public readonly score: number | undefined;
10
12
 
11
- public abstract readonly type: string;
13
+ public abstract readonly type: typeof BONUS_CHARACTER | typeof BONUS_WORD;
12
14
 
13
15
  public readonly x: number;
14
16
 
@@ -7,7 +7,7 @@ const striptags_1 = __importDefault(require("striptags"));
7
7
  const EMPHASIS_TAGS = ['a', 'b', 'em', 'internalXref'];
8
8
  const normalizeHtmlTags = (definition) => (0, striptags_1.default)((0, striptags_1.default)(definition, EMPHASIS_TAGS), undefined, '"');
9
9
  const normalizeLineBreaks = (definition) => definition.replace(/\r\n/g, '\n');
10
- const normalizeWhitespace = (definition) => definition.replace(/[ ]+/g, ' ');
10
+ const normalizeWhitespace = (definition) => definition.replace(/[^\S\n ]+/g, ' ').replace(/[ ]+/g, ' ');
11
11
  const normalizeQuotes = (definition) => definition.replace(/\."/g, '".');
12
12
  /**
13
13
  * `(1.2) definition` -> `definition`
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.10.11",
3
+ "version": "2.11.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/word-definitions",
9
- "version": "2.10.11",
9
+ "version": "2.11.1",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "cheerio": "^1.0.0-rc.12",
@@ -27,9 +27,9 @@
27
27
  }
28
28
  },
29
29
  "node_modules/@types/node": {
30
- "version": "18.14.2",
31
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz",
32
- "integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==",
30
+ "version": "18.15.0",
31
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.0.tgz",
32
+ "integrity": "sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==",
33
33
  "dev": true
34
34
  },
35
35
  "node_modules/boolbase": {
@@ -249,9 +249,9 @@
249
249
  }
250
250
  },
251
251
  "@types/node": {
252
- "version": "18.14.2",
253
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz",
254
- "integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==",
252
+ "version": "18.15.0",
253
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.0.tgz",
254
+ "integrity": "sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==",
255
255
  "dev": true
256
256
  },
257
257
  "boolbase": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.10.11",
3
+ "version": "2.11.1",
4
4
  "description": "Scrabble Solver 2 - Word definitions",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "clean": "rimraf build/ node_modules/ package-lock.json"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.10.11",
26
+ "@scrabble-solver/types": "^2.11.1",
27
27
  "cheerio": "^1.0.0-rc.12",
28
28
  "follow-redirects": "^1.15.2",
29
29
  "striptags": "^3.2.0"
@@ -8,7 +8,7 @@ const normalizeHtmlTags: Normalize = (definition) => striptags(striptags(definit
8
8
 
9
9
  const normalizeLineBreaks: Normalize = (definition) => definition.replace(/\r\n/g, '\n');
10
10
 
11
- const normalizeWhitespace: Normalize = (definition) => definition.replace(/[ ]+/g, ' ');
11
+ const normalizeWhitespace: Normalize = (definition) => definition.replace(/[^\S\n ]+/g, ' ').replace(/[ ]+/g, ' ');
12
12
 
13
13
  const normalizeQuotes: Normalize = (definition) => definition.replace(/\."/g, '".');
14
14
 
@@ -0,0 +1,7 @@
1
+ {
2
+ "definitions": [
3
+ "oersted",
4
+ "Kenzaburo 1935– Japanese writer"
5
+ ],
6
+ "exists": true
7
+ }