@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.
Files changed (42) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +7 -7
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack.old +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/prerender-manifest.json +4 -4
  16. package/.next/routes-manifest.json +1 -1
  17. package/.next/server/chunks/30.js +1 -1
  18. package/.next/server/chunks/712.js +1 -1
  19. package/.next/server/middleware-build-manifest.js +1 -1
  20. package/.next/server/pages/404.html +1 -1
  21. package/.next/server/pages/500.html +1 -1
  22. package/.next/server/pages/index.html +1 -1
  23. package/.next/server/pages/index.json +1 -1
  24. package/.next/server/pages/not-found.html +1 -1
  25. package/.next/static/chunks/{main-ca07941c8a544c9a.js → main-65a5015b46ca9827.js} +1 -1
  26. package/.next/static/chunks/pages/{_app-369e5cb907606ad4.js → _app-c0932b8ca24945cb.js} +1 -1
  27. package/.next/trace +21 -21
  28. package/.next/trace-build +1 -1
  29. package/package.json +11 -11
  30. package/src/components/Modal/Modal.tsx +0 -1
  31. package/src/hooks/useMedia.ts +0 -1
  32. package/src/pages/_app.tsx +0 -1
  33. package/src/parameters/index.ts +3 -3
  34. package/src/sdk/fetchJson.ts +3 -7
  35. package/src/service-worker/index.ts +0 -1
  36. package/src/service-worker/routeSolveRequests.ts +18 -12
  37. package/src/state/board/slice.ts +6 -4
  38. package/src/state/sagas.ts +1 -2
  39. package/tsconfig.json +0 -1
  40. package/tsconfig.tsbuildinfo +1 -1
  41. /package/.next/static/{f_g0t0jBAscXxDrNYOuV0 → FDUqldlsD7FXe6iWhIJmu}/_buildManifest.js +0 -0
  42. /package/.next/static/{f_g0t0jBAscXxDrNYOuV0 → FDUqldlsD7FXe6iWhIJmu}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-typescript","duration":1924166,"timestamp":5612708199,"id":13,"parentId":1,"tags":{},"startTime":1776200797413,"traceId":"a247f46abd30b936"},{"name":"run-webpack","duration":6261220,"timestamp":5614634557,"id":15,"parentId":1,"tags":{},"startTime":1776200799339,"traceId":"a247f46abd30b936"},{"name":"static-check","duration":185822,"timestamp":5620982865,"id":2016,"parentId":1,"tags":{},"startTime":1776200805688,"traceId":"a247f46abd30b936"},{"name":"static-generation","duration":834210,"timestamp":5621177262,"id":2034,"parentId":1,"tags":{},"startTime":1776200805882,"traceId":"a247f46abd30b936"},{"name":"collect-build-traces","duration":3625253,"timestamp":5621169330,"id":2031,"parentId":1,"tags":{},"startTime":1776200805874,"traceId":"a247f46abd30b936"},{"name":"telemetry-flush","duration":18,"timestamp":5624795666,"id":2046,"parentId":1,"tags":{},"startTime":1776200809500,"traceId":"a247f46abd30b936"},{"name":"next-build","duration":12329041,"timestamp":5612466647,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1776200797171,"traceId":"a247f46abd30b936"}]
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.24",
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": "tsc --noEmit"
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.24",
32
- "@scrabble-solver/constants": "^2.15.24",
33
- "@scrabble-solver/dictionaries": "^2.15.24",
34
- "@scrabble-solver/logger": "^2.15.24",
35
- "@scrabble-solver/solver": "^2.15.24",
36
- "@scrabble-solver/types": "^2.15.24",
37
- "@scrabble-solver/word-definitions": "^2.15.24",
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.3",
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": "28330eeb094266d16a0e2c80f3333f534c70dea1"
72
+ "gitHead": "804532994a83eec4bd83e573744093865b5d1fa7"
73
73
  }
@@ -46,7 +46,6 @@ const ModalBase: FunctionComponent<Props> = ({ children, className, footer, isOp
46
46
 
47
47
  useEffect(() => {
48
48
  if (isOpen) {
49
- // eslint-disable-next-line react-hooks/set-state-in-effect
50
49
  setShouldReturnFocusAfterClose(true);
51
50
  }
52
51
  }, [isOpen]);
@@ -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
 
@@ -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 = [
@@ -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 = 64;
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> = {
@@ -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 response = await fetch(input, {
5
- ...init,
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
  };
@@ -18,7 +18,6 @@ self.addEventListener('activate', () => {
18
18
  });
19
19
 
20
20
  cleanupOutdatedCaches();
21
- // eslint-disable-next-line no-underscore-dangle
22
21
  precacheAndRoute(self.__WB_MANIFEST);
23
22
  routeSolveRequests();
24
23
  routeVerifyRequests();
@@ -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
+ };
@@ -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({ ...cell, isEmpty: false }));
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({ ...cell, isEmpty, tile });
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 ? cell.tile : new Tile({ ...cell.tile, isBlank: !cell.tile.isBlank });
54
- return new Cell({ ...cell, tile });
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;
@@ -1,4 +1,4 @@
1
- /* eslint-disable max-lines, no-implicit-globals */
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 {
package/tsconfig.json CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  "compilerOptions": {
5
5
  "allowJs": true,
6
- "baseUrl": ".",
7
6
  "declaration": false,
8
7
  "isolatedModules": true,
9
8
  "jsx": "preserve",