@scrabble-solver/scrabble-solver 2.15.24 → 2.15.25
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 +7 -7
- 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/30.js +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/index.html +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/server/pages/not-found.html +1 -1
- package/.next/static/chunks/{main-ca07941c8a544c9a.js → main-65a5015b46ca9827.js} +1 -1
- package/.next/static/chunks/pages/{_app-369e5cb907606ad4.js → _app-c0932b8ca24945cb.js} +1 -1
- package/.next/trace +21 -21
- package/.next/trace-build +1 -1
- package/package.json +11 -11
- package/src/components/Modal/Modal.tsx +0 -1
- package/src/hooks/useMedia.ts +0 -1
- package/src/pages/_app.tsx +0 -1
- package/src/parameters/index.ts +3 -3
- package/src/sdk/fetchJson.ts +3 -7
- package/src/service-worker/index.ts +0 -1
- package/src/service-worker/routeSolveRequests.ts +18 -12
- package/src/state/board/slice.ts +6 -4
- package/src/state/sagas.ts +1 -2
- package/tsconfig.json +0 -1
- package/tsconfig.tsbuildinfo +1 -1
- /package/.next/static/{f_g0t0jBAscXxDrNYOuV0 → FDUqldlsD7FXe6iWhIJmu}/_buildManifest.js +0 -0
- /package/.next/static/{f_g0t0jBAscXxDrNYOuV0 → FDUqldlsD7FXe6iWhIJmu}/_ssgManifest.js +0 -0
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-typescript","duration":
|
|
1
|
+
[{"name":"run-typescript","duration":1839871,"timestamp":8669695789,"id":13,"parentId":1,"tags":{},"startTime":1777238332039,"traceId":"31012277f1d18357"},{"name":"run-webpack","duration":5956770,"timestamp":8671542760,"id":15,"parentId":1,"tags":{},"startTime":1777238333886,"traceId":"31012277f1d18357"},{"name":"static-check","duration":166808,"timestamp":8677579484,"id":2016,"parentId":1,"tags":{},"startTime":1777238339923,"traceId":"31012277f1d18357"},{"name":"static-generation","duration":871005,"timestamp":8677759211,"id":2034,"parentId":1,"tags":{},"startTime":1777238340102,"traceId":"31012277f1d18357"},{"name":"collect-build-traces","duration":3576476,"timestamp":8677746786,"id":2031,"parentId":1,"tags":{},"startTime":1777238340090,"traceId":"31012277f1d18357"},{"name":"telemetry-flush","duration":22,"timestamp":8681324409,"id":2046,"parentId":1,"tags":{},"startTime":1777238343667,"traceId":"31012277f1d18357"},{"name":"next-build","duration":11870716,"timestamp":8669453718,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1777238331797,"traceId":"31012277f1d18357"}]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/scrabble-solver",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.25",
|
|
4
4
|
"description": "Scrabble Solver 2 - App",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,24 +22,24 @@
|
|
|
22
22
|
"debug": "NODE_OPTIONS='--inspect' next dev --webpack",
|
|
23
23
|
"dev": "env-cmd next dev --webpack",
|
|
24
24
|
"start": "env-cmd next start -p 3333",
|
|
25
|
-
"type-check": "
|
|
25
|
+
"type-check": "tsgo --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@floating-ui/react": "^0.27.19",
|
|
29
29
|
"@kamilmielnik/trie": "^4.0.0",
|
|
30
30
|
"@reduxjs/toolkit": "^2.11.2",
|
|
31
|
-
"@scrabble-solver/configs": "^2.15.
|
|
32
|
-
"@scrabble-solver/constants": "^2.15.
|
|
33
|
-
"@scrabble-solver/dictionaries": "^2.15.
|
|
34
|
-
"@scrabble-solver/logger": "^2.15.
|
|
35
|
-
"@scrabble-solver/solver": "^2.15.
|
|
36
|
-
"@scrabble-solver/types": "^2.15.
|
|
37
|
-
"@scrabble-solver/word-definitions": "^2.15.
|
|
31
|
+
"@scrabble-solver/configs": "^2.15.25",
|
|
32
|
+
"@scrabble-solver/constants": "^2.15.25",
|
|
33
|
+
"@scrabble-solver/dictionaries": "^2.15.25",
|
|
34
|
+
"@scrabble-solver/logger": "^2.15.25",
|
|
35
|
+
"@scrabble-solver/solver": "^2.15.25",
|
|
36
|
+
"@scrabble-solver/types": "^2.15.25",
|
|
37
|
+
"@scrabble-solver/word-definitions": "^2.15.25",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
39
|
"env-cmd": "^11.0.0",
|
|
40
40
|
"include-media": "^2.0.0",
|
|
41
41
|
"include-media-query-builder": "^1.1.0",
|
|
42
|
-
"next": "^16.2.
|
|
42
|
+
"next": "^16.2.4",
|
|
43
43
|
"normalize.css": "^8.0.1",
|
|
44
44
|
"react": "^19.2.5",
|
|
45
45
|
"react-cool-onclickoutside": "^1.7.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"@types/redux": "^3.6.31",
|
|
70
70
|
"sass": "^1.99.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "804532994a83eec4bd83e573744093865b5d1fa7"
|
|
73
73
|
}
|
package/src/hooks/useMedia.ts
CHANGED
|
@@ -22,7 +22,6 @@ export const useMedia = (query: string, defaultState?: boolean) => {
|
|
|
22
22
|
setState(mediaQuery.matches);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
26
25
|
setState(mediaQuery.matches);
|
|
27
26
|
mediaQuery.addEventListener('change', handleChange);
|
|
28
27
|
|
package/src/pages/_app.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import { store } from '@/state';
|
|
|
11
11
|
import '../styles/global.scss';
|
|
12
12
|
|
|
13
13
|
const DESCRIPTION =
|
|
14
|
-
// eslint-disable-next-line max-len
|
|
15
14
|
'Scrabble Solver 2 - Free and open-source analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki and Kelimelik. Quickly find top scoring words using given letters and board state. Available in English, French, German, Persian, Polish, Romanian, Spanish, and Turkish.';
|
|
16
15
|
|
|
17
16
|
const KEYWORDS = [
|
package/src/parameters/index.ts
CHANGED
|
@@ -62,11 +62,13 @@ export const SPACING_XL = 40;
|
|
|
62
62
|
export const COMPONENTS_SPACING = SPACING_XL;
|
|
63
63
|
export const COMPONENTS_SPACING_SMALL = SPACING_L;
|
|
64
64
|
|
|
65
|
+
export const RACK_TILE_SIZE_MAX = 80;
|
|
66
|
+
|
|
65
67
|
export const BOARD_CELL_ACTIONS_OFFSET = 3;
|
|
66
68
|
export const BOARD_CELL_BORDER_WIDTH = 1;
|
|
67
69
|
export const BOARD_TILE_FONT_SIZE_MIN = 14;
|
|
68
70
|
export const BOARD_TILE_FONT_SIZE_POINTS_MIN = 10;
|
|
69
|
-
export const BOARD_TILE_SIZE_MAX =
|
|
71
|
+
export const BOARD_TILE_SIZE_MAX = RACK_TILE_SIZE_MAX;
|
|
70
72
|
|
|
71
73
|
export const BORDER_COLOR = '#cdcdcd';
|
|
72
74
|
export const BORDER_COLOR_LIGHT = '#d9d9d9';
|
|
@@ -119,8 +121,6 @@ export const PLAIN_TILES_VERSION_TILE_SIZE = TILE_SIZE;
|
|
|
119
121
|
export const PROGRESS_COLOR_VALUE = 'var(--color--violet--light)';
|
|
120
122
|
export const PROGRESS_COLOR_BACKGROUND = 'var(--color--inactive)';
|
|
121
123
|
|
|
122
|
-
export const RACK_TILE_SIZE_MAX = 80;
|
|
123
|
-
|
|
124
124
|
export const REMAINING_TILES_TILE_SIZE = 50;
|
|
125
125
|
|
|
126
126
|
export const RESULTS_COLUMN_WIDTH: Record<ResultColumnId, number | undefined> = {
|
package/src/sdk/fetchJson.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { fetch } from './fetch';
|
|
2
2
|
|
|
3
3
|
export const fetchJson = async <T>(input: RequestInfo | URL, init?: RequestInit): Promise<T> => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
headers: {
|
|
7
|
-
'Content-Type': 'application/json',
|
|
8
|
-
...init?.headers,
|
|
9
|
-
},
|
|
10
|
-
});
|
|
4
|
+
const headers = new Headers(init?.headers);
|
|
5
|
+
headers.set('Content-Type', 'application/json');
|
|
11
6
|
|
|
7
|
+
const response = await fetch(input, { ...init, headers });
|
|
12
8
|
return response.json();
|
|
13
9
|
};
|
|
@@ -19,18 +19,6 @@ const MIN_MEASUREMENTS = 5;
|
|
|
19
19
|
const localDurations: number[] = [];
|
|
20
20
|
const serverDurations: number[] = [];
|
|
21
21
|
|
|
22
|
-
const isSlowDevice = (): boolean | undefined => {
|
|
23
|
-
if (localDurations.length < MIN_MEASUREMENTS || serverDurations.length < MIN_MEASUREMENTS) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const count = Math.min(localDurations.length, serverDurations.length);
|
|
28
|
-
const local = localDurations.slice(0, count).sort().slice(1, -1);
|
|
29
|
-
const server = serverDurations.slice(0, count).sort().slice(1, -1);
|
|
30
|
-
|
|
31
|
-
return average(local) > average(server);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
22
|
export const routeSolveRequests = () => {
|
|
35
23
|
registerRoute(
|
|
36
24
|
({ url }) => url.origin === location.origin && url.pathname === '/api/solve',
|
|
@@ -83,3 +71,21 @@ export const routeSolveRequests = () => {
|
|
|
83
71
|
'POST',
|
|
84
72
|
);
|
|
85
73
|
};
|
|
74
|
+
|
|
75
|
+
const isSlowDevice = (): boolean | undefined => {
|
|
76
|
+
if (localDurations.length < MIN_MEASUREMENTS || serverDurations.length < MIN_MEASUREMENTS) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const count = Math.min(localDurations.length, serverDurations.length);
|
|
81
|
+
const local = localDurations
|
|
82
|
+
.slice(0, count)
|
|
83
|
+
.sort((a, b) => a - b)
|
|
84
|
+
.slice(1, -1);
|
|
85
|
+
const server = localDurations
|
|
86
|
+
.slice(0, count)
|
|
87
|
+
.sort((a, b) => a - b)
|
|
88
|
+
.slice(1, -1);
|
|
89
|
+
|
|
90
|
+
return average(local) > average(server);
|
|
91
|
+
};
|
package/src/state/board/slice.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const boardSlice = createSlice({
|
|
|
16
16
|
const result = action.payload;
|
|
17
17
|
|
|
18
18
|
result.cells.forEach((cell) => {
|
|
19
|
-
newBoard.updateCell(cell.x, cell.y, () => new Cell({
|
|
19
|
+
newBoard.updateCell(cell.x, cell.y, () => new Cell({ isEmpty: false, tile: cell.tile, x: cell.x, y: cell.y }));
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
return newBoard;
|
|
@@ -34,7 +34,7 @@ export const boardSlice = createSlice({
|
|
|
34
34
|
const tile = isEmpty ? Tile.Null : new Tile({ character: value });
|
|
35
35
|
|
|
36
36
|
newBoard.updateCell(x, y, (cell) => {
|
|
37
|
-
return new Cell({
|
|
37
|
+
return new Cell({ isEmpty, tile, x: cell.x, y: cell.y });
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
return newBoard;
|
|
@@ -50,8 +50,10 @@ export const boardSlice = createSlice({
|
|
|
50
50
|
const { x, y } = action.payload;
|
|
51
51
|
|
|
52
52
|
newBoard.updateCell(x, y, (cell) => {
|
|
53
|
-
const tile = cell.isEmpty
|
|
54
|
-
|
|
53
|
+
const tile = cell.isEmpty
|
|
54
|
+
? cell.tile
|
|
55
|
+
: new Tile({ isBlank: !cell.tile.isBlank, character: cell.tile.character });
|
|
56
|
+
return new Cell({ isEmpty: cell.isEmpty, tile, x: cell.x, y: cell.y });
|
|
55
57
|
});
|
|
56
58
|
|
|
57
59
|
return newBoard;
|
package/src/state/sagas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable max-lines
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
@@ -35,7 +35,6 @@ const memoizedFindWordDefinitions = memoize(findWordDefinitions);
|
|
|
35
35
|
|
|
36
36
|
// Can't conveniently type generators for sagas yet,
|
|
37
37
|
// see: https://github.com/microsoft/TypeScript/issues/43632
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
38
|
type AnyGenerator = Generator<any, any, any>;
|
|
40
39
|
|
|
41
40
|
export function* rootSaga(): AnyGenerator {
|