@scrabble-solver/scrabble-solver 2.15.21 → 2.15.23
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +16 -16
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/diagnostics/framework.json +1 -1
- package/.next/prerender-manifest.json +4 -4
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/712.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js.nft.json +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/server/pages/not-found.html +1 -1
- package/.next/static/chunks/{framework-93e577820ffb186a.js → framework-f7982db529c0590c.js} +1 -1
- package/.next/static/chunks/{main-f63f5bd5e9581250.js → main-ca07941c8a544c9a.js} +1 -1
- package/.next/static/chunks/pages/_app-a3061a79f91b3796.js +7 -0
- package/.next/static/chunks/pages/index-6c5b582e7afc063c.js +1 -0
- package/.next/static/chunks/webpack-1a7a166b34ed8d24.js +1 -0
- package/.next/static/{8q_9JlEMMcIoT2TpStZYx → zFnoNsMXUha-MKjuZn6AN}/_buildManifest.js +1 -1
- package/.next/trace +21 -21
- package/.next/trace-build +1 -1
- package/package.json +20 -20
- package/src/app-layout/AppLayoutContext.tsx +25 -0
- package/src/app-layout/index.ts +1 -0
- package/src/{hooks/useAppLayout.ts → app-layout/useAppLayoutValue.ts} +4 -6
- package/src/components/Board/Board.tsx +1 -1
- package/src/components/Board/components/InputPrompt/InputPrompt.tsx +9 -2
- package/src/components/Board/hooks/useBackgroundImage.tsx +228 -165
- package/src/components/Board/hooks/useBoardStyle.ts +1 -1
- package/src/components/Board/hooks/useFloatingActions.ts +1 -1
- package/src/components/Dictionary/Dictionary.tsx +1 -1
- package/src/components/DictionaryInput/DictionaryInput.tsx +2 -2
- package/src/components/Logo/Logo.tsx +1 -1
- package/src/components/NavButtons/NavButtons.tsx +1 -1
- package/src/components/Rack/Rack.tsx +1 -1
- package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +4 -4
- package/src/components/Results/Header.tsx +2 -1
- package/src/components/Results/Result.tsx +2 -1
- package/src/components/ResultsInput/ResultsInput.tsx +2 -2
- package/src/components/Solver/Solver.tsx +2 -1
- package/src/components/Tile/Tile.tsx +1 -1
- package/src/hooks/index.ts +0 -1
- package/src/lib/isMac.ts +0 -1
- package/src/modals/ResultsModal/ResultsModal.tsx +1 -1
- package/src/pages/_app.tsx +7 -4
- package/src/pages/index.tsx +42 -21
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/pages/_app-ac2ab0ef8f59ba92.js +0 -3
- package/.next/static/chunks/pages/index-3be9ce84ae513eaa.js +0 -1
- package/.next/static/chunks/webpack-49a83516933d4cf2.js +0 -1
- /package/.next/static/{8q_9JlEMMcIoT2TpStZYx → zFnoNsMXUha-MKjuZn6AN}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { type FunctionComponent, memo } from 'react';
|
|
3
3
|
|
|
4
|
-
import { useAppLayout } from '
|
|
4
|
+
import { useAppLayout } from 'app-layout';
|
|
5
5
|
import { CardChecklist, Cog, Eraser, Github, KeyboardFill, List, Sack } from 'icons';
|
|
6
6
|
import { GITHUB_PROJECT_URL } from 'parameters';
|
|
7
7
|
import { selectConfig, useTranslate, useTypedSelector } from 'state';
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import useOnclickOutside from 'react-cool-onclickoutside';
|
|
17
17
|
import { useDispatch } from 'react-redux';
|
|
18
18
|
|
|
19
|
-
import { useAppLayout } from '
|
|
19
|
+
import { useAppLayout } from 'app-layout';
|
|
20
20
|
import { LOCALE_FEATURES } from 'i18n';
|
|
21
21
|
import { createKeyboardNavigation, extractCharacters, extractInputValue, getTileSizes, isCtrl } from 'lib';
|
|
22
22
|
import { rackSlice, selectConfig, selectInputMode, selectLocale, selectRack, useTypedSelector } from 'state';
|
|
@@ -2,7 +2,7 @@ import classNames from 'classnames';
|
|
|
2
2
|
import {
|
|
3
3
|
type CSSProperties,
|
|
4
4
|
type ChangeEventHandler,
|
|
5
|
-
type
|
|
5
|
+
type SubmitEventHandler,
|
|
6
6
|
forwardRef,
|
|
7
7
|
useCallback,
|
|
8
8
|
useEffect,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from 'react';
|
|
11
11
|
import { useDispatch } from 'react-redux';
|
|
12
12
|
|
|
13
|
-
import { useAppLayout } from '
|
|
13
|
+
import { useAppLayout } from 'app-layout';
|
|
14
14
|
import { rackSlice, selectConfig, useTranslate, useTypedSelector } from 'state';
|
|
15
15
|
|
|
16
16
|
import styles from './InputPrompt.module.scss';
|
|
@@ -22,7 +22,7 @@ interface Props {
|
|
|
22
22
|
value: string;
|
|
23
23
|
onBlur: () => void;
|
|
24
24
|
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
25
|
-
onSubmit:
|
|
25
|
+
onSubmit: SubmitEventHandler<HTMLFormElement>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const InputPromptBase = forwardRef<HTMLFormElement, Props>(
|
|
@@ -33,7 +33,7 @@ const InputPromptBase = forwardRef<HTMLFormElement, Props>(
|
|
|
33
33
|
const config = useTypedSelector(selectConfig);
|
|
34
34
|
const [inputRef, setInputRef] = useState<HTMLInputElement | null>(null);
|
|
35
35
|
|
|
36
|
-
const handleSubmit:
|
|
36
|
+
const handleSubmit: SubmitEventHandler<HTMLFormElement> = useCallback(
|
|
37
37
|
(event) => {
|
|
38
38
|
event.preventDefault();
|
|
39
39
|
const characters = extractRack(config, value);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FunctionComponent } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useAppLayout
|
|
3
|
+
import { useAppLayout } from 'app-layout';
|
|
4
|
+
import { useColumns } from 'hooks';
|
|
4
5
|
import { GeoAlt, OneTwoThree, Square, SquareA, SquareB, Squares, Words } from 'icons';
|
|
5
6
|
import { RESULTS_COLUMN_WIDTH } from 'parameters';
|
|
6
7
|
import { ResultColumnId } from 'types';
|
|
@@ -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
|
|
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
|
|
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:
|
|
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
|
|
6
|
+
import { useAppLayout } from 'app-layout';
|
|
7
|
+
import { useIsTouchDevice } from 'hooks';
|
|
7
8
|
import {
|
|
8
9
|
resultsSlice,
|
|
9
10
|
selectAreResultsOutdated,
|
package/src/hooks/index.ts
CHANGED
package/src/lib/isMac.ts
CHANGED
|
@@ -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
|
|
package/src/pages/_app.tsx
CHANGED
|
@@ -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
|
-
<
|
|
81
|
+
<AppLayoutProvider>
|
|
82
|
+
<SeoMessage />
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
<FloatingDelayGroup delay={0}>
|
|
85
|
+
<Component {...pageProps} />
|
|
86
|
+
</FloatingDelayGroup>
|
|
87
|
+
</AppLayoutProvider>
|
|
85
88
|
</Provider>
|
|
86
89
|
</>
|
|
87
90
|
);
|
package/src/pages/index.tsx
CHANGED
|
@@ -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={
|
|
82
|
-
onShowKeyMap={
|
|
83
|
-
onShowMenu={
|
|
84
|
-
onShowRemainingTiles={
|
|
85
|
-
onShowSettings={
|
|
86
|
-
onShowWords={
|
|
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
|
-
<
|
|
110
|
+
<main>
|
|
111
|
+
<Solver className={styles.solver} onShowResults={handleShowResults} />
|
|
112
|
+
</main>
|
|
92
113
|
|
|
93
114
|
<MenuModal
|
|
94
115
|
isOpen={modals.menu}
|
|
95
|
-
onClose={
|
|
96
|
-
onShowDictionary={
|
|
97
|
-
onShowRemainingTiles={
|
|
98
|
-
onShowSettings={
|
|
99
|
-
onShowWords={
|
|
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={
|
|
123
|
+
<SettingsModal isOpen={modals.settings} onClose={handleCloseSettings} />
|
|
103
124
|
|
|
104
|
-
<KeyMapModal isOpen={modals.keyMap} onClose={
|
|
125
|
+
<KeyMapModal isOpen={modals.keyMap} onClose={handleCloseKeyMap} />
|
|
105
126
|
|
|
106
|
-
<WordsModal isOpen={modals.words} onClose={
|
|
127
|
+
<WordsModal isOpen={modals.words} onClose={handleCloseWords} />
|
|
107
128
|
|
|
108
129
|
{config.supportsRemainingTiles && (
|
|
109
|
-
<RemainingTilesModal isOpen={modals.remainingTiles} onClose={
|
|
130
|
+
<RemainingTilesModal isOpen={modals.remainingTiles} onClose={handleCloseRemainingTiles} />
|
|
110
131
|
)}
|
|
111
132
|
|
|
112
|
-
<ResultsModal isOpen={modals.results} onClose={
|
|
133
|
+
<ResultsModal isOpen={modals.results} onClose={handleCloseResults} />
|
|
113
134
|
|
|
114
|
-
<DictionaryModal isOpen={modals.dictionary} onClose={
|
|
135
|
+
<DictionaryModal isOpen={modals.dictionary} onClose={handleCloseDictionary} />
|
|
115
136
|
</>
|
|
116
137
|
);
|
|
117
138
|
};
|
package/tsconfig.json
CHANGED
|
@@ -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": [
|
|
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
|
}
|