scrabble-solver 2.15.20 → 2.15.22

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 (99) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/.github/workflows/build.yml +3 -3
  3. package/.github/workflows/cypress.yml +4 -4
  4. package/.github/workflows/deploy.yml +1 -1
  5. package/.github/workflows/eslint.yml +3 -3
  6. package/.github/workflows/jest.yml +3 -3
  7. package/.github/workflows/npx.yml +5 -5
  8. package/.next/trace +1 -1
  9. package/.next/trace-build +1 -0
  10. package/.nx/workspace-data/file-map.json +509 -501
  11. package/.nx/workspace-data/lockfile-dependencies.hash +1 -1
  12. package/.nx/workspace-data/lockfile-nodes.hash +1 -1
  13. package/.nx/workspace-data/nx_files.nxt +0 -0
  14. package/.nx/workspace-data/parsed-lock-file.dependencies.json +909 -369
  15. package/.nx/workspace-data/parsed-lock-file.nodes.json +1517 -1119
  16. package/.nx/workspace-data/project-graph.json +2086 -1253
  17. package/README.md +1 -1
  18. package/lerna.json +1 -1
  19. package/package.json +24 -24
  20. package/packages/configs/package.json +3 -3
  21. package/packages/constants/package.json +1 -1
  22. package/packages/dictionaries/package.json +4 -4
  23. package/packages/logger/package.json +1 -1
  24. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  25. package/packages/scrabble-solver/.next/build-manifest.json +12 -12
  26. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -1
  27. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  28. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  29. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  30. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  31. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  32. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  33. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  34. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  35. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  36. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  37. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  38. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  39. package/packages/scrabble-solver/.next/server/chunks/712.js +1 -1
  40. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  41. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  42. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  43. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  44. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  45. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  46. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  47. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  48. package/packages/scrabble-solver/.next/server/pages/api/verify.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 +1 -1
  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/server/pages/not-found.html +1 -1
  54. package/packages/scrabble-solver/.next/static/{ts_YBTGBs05Ixh5hd-ndp → MxQ5rcf448WOpfCa2_VVz}/_buildManifest.js +1 -1
  55. package/packages/scrabble-solver/.next/static/chunks/{framework-93e577820ffb186a.js → framework-906c47013125d174.js} +1 -1
  56. package/packages/scrabble-solver/.next/static/chunks/pages/_app-6a68c941d55599c8.js +7 -0
  57. package/packages/scrabble-solver/.next/static/chunks/pages/index-6c5b582e7afc063c.js +1 -0
  58. package/packages/scrabble-solver/.next/static/chunks/webpack-1a7a166b34ed8d24.js +1 -0
  59. package/packages/scrabble-solver/.next/trace +21 -21
  60. package/packages/scrabble-solver/.next/trace-build +1 -1
  61. package/packages/scrabble-solver/package.json +19 -19
  62. package/packages/scrabble-solver/public/service-worker.js +1 -1
  63. package/packages/scrabble-solver/src/app-layout/AppLayoutContext.tsx +25 -0
  64. package/packages/scrabble-solver/src/app-layout/index.ts +1 -0
  65. package/packages/scrabble-solver/src/{hooks/useAppLayout.ts → app-layout/useAppLayoutValue.ts} +4 -6
  66. package/packages/scrabble-solver/src/components/Board/Board.tsx +1 -1
  67. package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.tsx +9 -2
  68. package/packages/scrabble-solver/src/components/Board/hooks/useBackgroundImage.tsx +2 -1
  69. package/packages/scrabble-solver/src/components/Board/hooks/useBoardStyle.ts +1 -1
  70. package/packages/scrabble-solver/src/components/Board/hooks/useFloatingActions.ts +1 -1
  71. package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +1 -1
  72. package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.tsx +2 -2
  73. package/packages/scrabble-solver/src/components/Logo/Logo.tsx +1 -1
  74. package/packages/scrabble-solver/src/components/NavButtons/NavButtons.tsx +1 -1
  75. package/packages/scrabble-solver/src/components/Rack/Rack.tsx +1 -1
  76. package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.tsx +4 -4
  77. package/packages/scrabble-solver/src/components/Results/Header.tsx +2 -1
  78. package/packages/scrabble-solver/src/components/Results/Result.tsx +2 -1
  79. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.tsx +2 -2
  80. package/packages/scrabble-solver/src/components/Solver/Solver.tsx +2 -1
  81. package/packages/scrabble-solver/src/components/Tile/Tile.tsx +1 -1
  82. package/packages/scrabble-solver/src/hooks/index.ts +0 -1
  83. package/packages/scrabble-solver/src/lib/isMac.ts +0 -1
  84. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +1 -1
  85. package/packages/scrabble-solver/src/pages/_app.tsx +7 -4
  86. package/packages/scrabble-solver/src/pages/index.tsx +42 -21
  87. package/packages/scrabble-solver/tsconfig.json +3 -2
  88. package/packages/scrabble-solver/tsconfig.tsbuildinfo +1 -1
  89. package/packages/solver/package.json +5 -5
  90. package/packages/types/package.json +2 -2
  91. package/packages/word-definitions/package.json +4 -4
  92. package/packages/word-lists/build/lib/transliterateDiacritics.d.ts +2 -2
  93. package/packages/word-lists/package.json +4 -4
  94. package/packages/word-lists/src/lib/transliterateDiacritics.ts +2 -2
  95. package/tsconfig.json +5 -4
  96. package/packages/scrabble-solver/.next/static/chunks/pages/_app-ac2ab0ef8f59ba92.js +0 -3
  97. package/packages/scrabble-solver/.next/static/chunks/pages/index-3be9ce84ae513eaa.js +0 -1
  98. package/packages/scrabble-solver/.next/static/chunks/webpack-49a83516933d4cf2.js +0 -1
  99. /package/packages/scrabble-solver/.next/static/{ts_YBTGBs05Ixh5hd-ndp → MxQ5rcf448WOpfCa2_VVz}/_ssgManifest.js +0 -0
@@ -3,7 +3,8 @@ import { type FocusEventHandler, type MouseEventHandler, type ReactElement, useR
3
3
  import Highlighter from 'react-highlight-words';
4
4
  import { type RowComponentProps } from 'react-window';
5
5
 
6
- import { useAppLayout, useColumns } from 'hooks';
6
+ import { useAppLayout } from 'app-layout';
7
+ import { useColumns } from 'hooks';
7
8
  import { LOCALE_FEATURES } from 'i18n';
8
9
  import { noop } from 'lib';
9
10
  import {
@@ -1,5 +1,5 @@
1
1
  import classNames from 'classnames';
2
- import { type ChangeEvent, type FormEventHandler, type FunctionComponent, useState } from 'react';
2
+ import { type ChangeEvent, type FunctionComponent, type SubmitEventHandler, useState } from 'react';
3
3
  import { useDispatch } from 'react-redux';
4
4
 
5
5
  import { isRegExp } from 'lib';
@@ -27,7 +27,7 @@ export const ResultsInput: FunctionComponent<Props> = ({ className }) => {
27
27
  }
28
28
  };
29
29
 
30
- const handleSubmit: FormEventHandler = (event) => {
30
+ const handleSubmit: SubmitEventHandler = (event) => {
31
31
  event.preventDefault();
32
32
  };
33
33
 
@@ -3,7 +3,8 @@ import classNames from 'classnames';
3
3
  import { type FunctionComponent, memo, type SyntheticEvent, useEffect, useMemo } from 'react';
4
4
  import { useDispatch } from 'react-redux';
5
5
 
6
- import { useAppLayout, useIsTouchDevice } from 'hooks';
6
+ import { useAppLayout } from 'app-layout';
7
+ import { useIsTouchDevice } from 'hooks';
7
8
  import {
8
9
  resultsSlice,
9
10
  selectAreResultsOutdated,
@@ -13,7 +13,7 @@ import {
13
13
  useRef,
14
14
  } from 'react';
15
15
 
16
- import { useAppLayout } from 'hooks';
16
+ import { useAppLayout } from 'app-layout';
17
17
  import { getTileSizes, noop } from 'lib';
18
18
  import { selectLocale, useTypedSelector } from 'state';
19
19
 
@@ -1,4 +1,3 @@
1
- export { useAppLayout } from './useAppLayout';
2
1
  export { useColumns } from './useColumns';
3
2
  export { useDirection } from './useDirection';
4
3
  export { useEffectOnce } from './useEffectOnce';
@@ -3,6 +3,5 @@ export const isMac = (): boolean => {
3
3
  return false;
4
4
  }
5
5
 
6
- // eslint-disable-next-line @typescript-eslint/no-deprecated
7
6
  return globalThis.navigator.platform.startsWith('Mac') || globalThis.navigator.platform === 'iPhone';
8
7
  };
@@ -2,8 +2,8 @@ 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';
5
6
  import { Button, Dictionary, Modal, Results } from 'components';
6
- import { useAppLayout } from 'hooks';
7
7
  import { Check, EyeFill } from 'icons';
8
8
  import { resultsSlice, selectProcessedResults, selectResultCandidate, useTranslate, useTypedSelector } from 'state';
9
9
 
@@ -4,6 +4,7 @@ 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';
7
8
  import { SeoMessage } from 'components';
8
9
  import { store } from 'state';
9
10
 
@@ -77,11 +78,13 @@ const App: FunctionComponent<AppProps> = ({ Component, pageProps }) => (
77
78
  </Head>
78
79
 
79
80
  <Provider store={store}>
80
- <SeoMessage />
81
+ <AppLayoutProvider>
82
+ <SeoMessage />
81
83
 
82
- <FloatingDelayGroup delay={0}>
83
- <Component {...pageProps} />
84
- </FloatingDelayGroup>
84
+ <FloatingDelayGroup delay={0}>
85
+ <Component {...pageProps} />
86
+ </FloatingDelayGroup>
87
+ </AppLayoutProvider>
85
88
  </Provider>
86
89
  </>
87
90
  );
@@ -1,7 +1,9 @@
1
+ /* eslint-disable max-statements */
2
+
1
3
  import { isObject } from '@scrabble-solver/types';
2
4
  import fs from 'fs';
3
5
  import path from 'path';
4
- import { type FunctionComponent, useState } from 'react';
6
+ import { type FunctionComponent, useCallback, useState } from 'react';
5
7
  import ReactModal from 'react-modal';
6
8
  import { useDispatch } from 'react-redux';
7
9
 
@@ -45,9 +47,26 @@ const Index: FunctionComponent<Props> = ({ version }) => {
45
47
  words: false,
46
48
  });
47
49
 
48
- const patchModals = (patch: Partial<Record<Modal, boolean>>) => {
50
+ const patchModals = useCallback((patch: Partial<Record<Modal, boolean>>) => {
49
51
  setModals((current) => ({ ...current, ...patch }));
50
- };
52
+ }, []);
53
+
54
+ const handleClear = useCallback(() => dispatch(reset()), [dispatch]);
55
+
56
+ const handleShowDictionary = useCallback(() => patchModals({ dictionary: true }), [patchModals]);
57
+ const handleShowKeyMap = useCallback(() => patchModals({ keyMap: true }), [patchModals]);
58
+ const handleShowMenu = useCallback(() => patchModals({ menu: true }), [patchModals]);
59
+ const handleShowRemainingTiles = useCallback(() => patchModals({ remainingTiles: true }), [patchModals]);
60
+ const handleShowResults = useCallback(() => patchModals({ results: true }), [patchModals]);
61
+ const handleShowSettings = useCallback(() => patchModals({ settings: true }), [patchModals]);
62
+ const handleShowWords = useCallback(() => patchModals({ words: true }), [patchModals]);
63
+ const handleCloseDictionary = useCallback(() => patchModals({ dictionary: false }), [patchModals]);
64
+ const handleCloseKeyMap = useCallback(() => patchModals({ keyMap: false }), [patchModals]);
65
+ const handleCloseMenu = useCallback(() => patchModals({ menu: false }), [patchModals]);
66
+ const handleCloseRemainingTiles = useCallback(() => patchModals({ remainingTiles: false }), [patchModals]);
67
+ const handleCloseResults = useCallback(() => patchModals({ results: false }), [patchModals]);
68
+ const handleCloseSettings = useCallback(() => patchModals({ settings: false }), [patchModals]);
69
+ const handleCloseWords = useCallback(() => patchModals({ words: false }), [patchModals]);
51
70
 
52
71
  useDirection(LOCALE_FEATURES[locale].direction);
53
72
  useLanguage(locale);
@@ -78,40 +97,42 @@ const Index: FunctionComponent<Props> = ({ version }) => {
78
97
  </div>
79
98
 
80
99
  <NavButtons
81
- onClear={() => dispatch(reset())}
82
- onShowKeyMap={() => patchModals({ keyMap: true })}
83
- onShowMenu={() => patchModals({ menu: true })}
84
- onShowRemainingTiles={() => patchModals({ remainingTiles: true })}
85
- onShowSettings={() => patchModals({ settings: true })}
86
- onShowWords={() => patchModals({ words: true })}
100
+ onClear={handleClear}
101
+ onShowKeyMap={handleShowKeyMap}
102
+ onShowMenu={handleShowMenu}
103
+ onShowRemainingTiles={handleShowRemainingTiles}
104
+ onShowSettings={handleShowSettings}
105
+ onShowWords={handleShowWords}
87
106
  />
88
107
  </div>
89
108
  </nav>
90
109
 
91
- <Solver className={styles.solver} onShowResults={() => patchModals({ results: true })} />
110
+ <main>
111
+ <Solver className={styles.solver} onShowResults={handleShowResults} />
112
+ </main>
92
113
 
93
114
  <MenuModal
94
115
  isOpen={modals.menu}
95
- onClose={() => patchModals({ menu: false })}
96
- onShowDictionary={() => patchModals({ dictionary: true })}
97
- onShowRemainingTiles={() => patchModals({ remainingTiles: true })}
98
- onShowSettings={() => patchModals({ settings: true })}
99
- onShowWords={() => patchModals({ words: true })}
116
+ onClose={handleCloseMenu}
117
+ onShowDictionary={handleShowDictionary}
118
+ onShowRemainingTiles={handleShowRemainingTiles}
119
+ onShowSettings={handleShowSettings}
120
+ onShowWords={handleShowWords}
100
121
  />
101
122
 
102
- <SettingsModal isOpen={modals.settings} onClose={() => patchModals({ settings: false })} />
123
+ <SettingsModal isOpen={modals.settings} onClose={handleCloseSettings} />
103
124
 
104
- <KeyMapModal isOpen={modals.keyMap} onClose={() => patchModals({ keyMap: false })} />
125
+ <KeyMapModal isOpen={modals.keyMap} onClose={handleCloseKeyMap} />
105
126
 
106
- <WordsModal isOpen={modals.words} onClose={() => patchModals({ words: false })} />
127
+ <WordsModal isOpen={modals.words} onClose={handleCloseWords} />
107
128
 
108
129
  {config.supportsRemainingTiles && (
109
- <RemainingTilesModal isOpen={modals.remainingTiles} onClose={() => patchModals({ remainingTiles: false })} />
130
+ <RemainingTilesModal isOpen={modals.remainingTiles} onClose={handleCloseRemainingTiles} />
110
131
  )}
111
132
 
112
- <ResultsModal isOpen={modals.results} onClose={() => patchModals({ results: false })} />
133
+ <ResultsModal isOpen={modals.results} onClose={handleCloseResults} />
113
134
 
114
- <DictionaryModal isOpen={modals.dictionary} onClose={() => patchModals({ dictionary: false })} />
135
+ <DictionaryModal isOpen={modals.dictionary} onClose={handleCloseDictionary} />
115
136
  </>
116
137
  );
117
138
  };
@@ -11,6 +11,7 @@
11
11
  "noEmit": true,
12
12
  "paths": {
13
13
  "api": ["./src/api"],
14
+ "app-layout": ["./src/app-layout"],
14
15
  "components": ["./src/components"],
15
16
  "hooks": ["./src/hooks"],
16
17
  "icons": ["./src/icons"],
@@ -28,10 +29,10 @@
28
29
  "resolveJsonModule": true,
29
30
  "rootDir": "./src",
30
31
  "skipLibCheck": true,
31
- "typeRoots": ["./node_modules/@types", "./src/@types"],
32
+ "typeRoots": ["./node_modules/@types", "../../node_modules/@types", "./src/@types"],
32
33
  "incremental": true
33
34
  },
34
- "exclude": [ "node_modules", "**/*.test.ts"],
35
+ "exclude": ["node_modules", "**/*.test.ts"],
35
36
  "files": ["./src/@types/scss.d.ts", "./src/@types/svg.d.ts"],
36
37
  "include": ["next-env.d.ts", "./src"]
37
38
  }