scrabble-solver 2.13.8 → 2.13.10

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 (95) hide show
  1. package/.eslintignore +4 -1
  2. package/.nx/cache/nx_files.nxt +0 -0
  3. package/.nx/workspace-data/file-map.json +1322 -1313
  4. package/.nx/workspace-data/lockfile.hash +1 -1
  5. package/.nx/workspace-data/parsed-lock-file.json +14 -0
  6. package/.nx/workspace-data/project-graph.json +21 -0
  7. package/LICENSE +1 -1
  8. package/README.md +27 -11
  9. package/jest.setup.js +1 -1
  10. package/lerna.json +1 -1
  11. package/package.json +4 -3
  12. package/packages/configs/build/languages/english.js +1 -0
  13. package/packages/configs/package.json +3 -3
  14. package/packages/configs/src/languages/english.ts +2 -0
  15. package/packages/constants/package.json +1 -1
  16. package/packages/dictionaries/package-lock.json +2 -2
  17. package/packages/dictionaries/package.json +4 -4
  18. package/packages/logger/package-lock.json +2 -2
  19. package/packages/logger/package.json +1 -1
  20. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  21. package/packages/scrabble-solver/.next/build-manifest.json +6 -6
  22. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  23. package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
  24. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  25. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  26. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  27. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  28. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  29. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  30. package/packages/scrabble-solver/.next/prerender-manifest.js +1 -1
  31. package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
  32. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  33. package/packages/scrabble-solver/.next/server/chunks/807.js +1 -1
  34. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  35. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  36. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  37. package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
  38. package/packages/scrabble-solver/.next/server/pages/_error.js +1 -1
  39. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  40. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  41. package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
  42. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  43. package/packages/scrabble-solver/.next/static/{7zESQYo9UAqNh9LV0b7Sd → 0kOqO_aASkcT2xjhiptyo}/_buildManifest.js +1 -1
  44. package/packages/scrabble-solver/.next/static/chunks/pages/{404-63b972b24be99c62.js → 404-b447c5ca188dd7c1.js} +1 -1
  45. package/packages/scrabble-solver/.next/static/chunks/pages/_app-0bbddaa93fde16ea.js +17 -0
  46. package/packages/scrabble-solver/.next/static/chunks/pages/index-24b84719cf22731c.js +1 -0
  47. package/packages/scrabble-solver/.next/static/css/841a5b5f0b2fb131.css +2 -0
  48. package/packages/scrabble-solver/.next/trace +44 -44
  49. package/packages/scrabble-solver/package-lock.json +2 -2
  50. package/packages/scrabble-solver/package.json +9 -8
  51. package/packages/scrabble-solver/public/service-worker.js +1 -1
  52. package/packages/scrabble-solver/public/service-worker.js.map +1 -1
  53. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -3
  54. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +27 -19
  55. package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.tsx +8 -12
  56. package/packages/scrabble-solver/src/components/Board/components/Actions/lib.ts +30 -0
  57. package/packages/scrabble-solver/src/components/Board/hooks/useBackgroundImage.tsx +3 -24
  58. package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +2 -1
  59. package/packages/scrabble-solver/src/components/Results/Results.tsx +5 -1
  60. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +0 -2
  61. package/packages/scrabble-solver/src/components/Tile/Tile.tsx +1 -15
  62. package/packages/scrabble-solver/src/components/Tooltip/Tooltip.module.scss +1 -0
  63. package/packages/scrabble-solver/src/hooks/useAppLayout.ts +0 -1
  64. package/packages/scrabble-solver/src/i18n/languages/english.json +2 -1
  65. package/packages/scrabble-solver/src/i18n/languages/french.json +2 -1
  66. package/packages/scrabble-solver/src/i18n/languages/german.json +2 -1
  67. package/packages/scrabble-solver/src/i18n/languages/persian.json +2 -1
  68. package/packages/scrabble-solver/src/i18n/languages/polish.json +2 -1
  69. package/packages/scrabble-solver/src/i18n/languages/romanian.json +2 -1
  70. package/packages/scrabble-solver/src/i18n/languages/spanish.json +2 -1
  71. package/packages/scrabble-solver/src/icons/Ban.svg +4 -0
  72. package/packages/scrabble-solver/src/icons/index.ts +1 -0
  73. package/packages/scrabble-solver/src/lib/groupResults.ts +7 -13
  74. package/packages/scrabble-solver/src/lib/index.ts +2 -0
  75. package/packages/scrabble-solver/src/lib/resultMatchesCellFilter.ts +23 -0
  76. package/packages/scrabble-solver/src/lib/sortGroupedResults.ts +22 -0
  77. package/packages/scrabble-solver/src/parameters/index.ts +0 -9
  78. package/packages/scrabble-solver/src/state/sagas.ts +4 -4
  79. package/packages/scrabble-solver/src/state/selectors.ts +13 -13
  80. package/packages/scrabble-solver/src/state/slices/cellFilterInitialState.ts +2 -2
  81. package/packages/scrabble-solver/src/state/slices/cellFilterSlice.ts +29 -4
  82. package/packages/scrabble-solver/src/types/index.ts +18 -1
  83. package/packages/solver/package-lock.json +2 -2
  84. package/packages/solver/package.json +5 -5
  85. package/packages/types/package.json +2 -2
  86. package/packages/word-definitions/package-lock.json +2 -2
  87. package/packages/word-definitions/package.json +2 -2
  88. package/packages/word-lists/package-lock.json +2 -2
  89. package/packages/word-lists/package.json +2 -2
  90. package/.eslintrc.prettier-only.js +0 -9
  91. package/packages/scrabble-solver/.next/static/chunks/pages/_app-a2848b7efa6bb6b0.js +0 -17
  92. package/packages/scrabble-solver/.next/static/chunks/pages/index-7b73be2915cc7099.js +0 -1
  93. package/packages/scrabble-solver/.next/static/css/b37850c8d5270d91.css +0 -2
  94. package/scrabble-solver.sublime-project +0 -10
  95. /package/packages/scrabble-solver/.next/static/{7zESQYo9UAqNh9LV0b7Sd → 0kOqO_aASkcT2xjhiptyo}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
- import { Point } from 'types';
1
+ import { CellFilterEntry } from 'types';
2
2
 
3
- export type CellFilterState = Point[];
3
+ export type CellFilterState = CellFilterEntry[];
4
4
 
5
5
  const cellFilterInitialState: CellFilterState = [];
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
2
 
3
- import { Point } from 'types';
3
+ import { CellFilterType, Point } from 'types';
4
4
 
5
5
  import cellFilterInitialState from './cellFilterInitialState';
6
6
 
@@ -10,17 +10,42 @@ const cellFilterSlice = createSlice({
10
10
  reducers: {
11
11
  toggle: (state, action: PayloadAction<Point>) => {
12
12
  const { x, y } = action.payload;
13
- const has = state.some((point) => point.x === x && point.y === y);
13
+ const currentEntry = state.find((point) => point.x === x && point.y === y);
14
+ const has = Boolean(currentEntry);
15
+ const nextType = currentEntry ? toggleCellFilterState(currentEntry.type) : 'include';
14
16
 
15
- if (has) {
17
+ if (nextType === null) {
16
18
  return state.filter((point) => point.x !== x || point.y !== y);
17
19
  }
18
20
 
19
- return [...state, action.payload];
21
+ if (!has) {
22
+ return [...state, { ...action.payload, type: nextType }];
23
+ }
24
+
25
+ return state.map((entry) => {
26
+ if (entry.x === x && entry.y === y) {
27
+ return { ...entry, type: nextType };
28
+ }
29
+
30
+ return entry;
31
+ });
32
+ },
33
+
34
+ cancel: (state, action: PayloadAction<Point>) => {
35
+ const { x, y } = action.payload;
36
+
37
+ return state.filter((point) => point.x !== x || point.y !== y);
20
38
  },
21
39
 
22
40
  reset: () => cellFilterInitialState,
23
41
  },
24
42
  });
25
43
 
44
+ const toggleCellFilterState = (type: CellFilterType): CellFilterType | null => {
45
+ const chain: (CellFilterType | null)[] = ['include', 'exclude', null];
46
+ const index = chain.indexOf(type);
47
+ const nextIndex = (index + 1) % chain.length;
48
+ return chain[nextIndex];
49
+ };
50
+
26
51
  export default cellFilterSlice;
@@ -1,7 +1,17 @@
1
+ import { Result } from '@scrabble-solver/types';
2
+
1
3
  export type Comparator<T> = (a: T, B: T) => number;
2
4
 
3
5
  export type AutoGroupTiles = 'left' | 'right' | null;
4
6
 
7
+ export type CellFilterType = 'include' | 'exclude';
8
+
9
+ export type CellFilterEntry = {
10
+ x: Point['x'];
11
+ y: Point['y'];
12
+ type: CellFilterType;
13
+ };
14
+
5
15
  export type Direction = 'horizontal' | 'vertical';
6
16
 
7
17
  export type InputMode = 'keyboard' | 'touchscreen';
@@ -47,9 +57,16 @@ export enum ResultColumn {
47
57
  Word = 'word',
48
58
  WordsCount = 'words-count',
49
59
  }
60
+
61
+ export interface GroupedResults {
62
+ matching: Result[];
63
+ other: Result[];
64
+ }
65
+
50
66
  export type TranslationKey =
51
67
  | 'cell.enter-word'
52
- | 'cell.filter-cell'
68
+ | 'cell.filter-cell.exclude'
69
+ | 'cell.filter-cell.include'
53
70
  | 'cell.set-blank'
54
71
  | 'cell.set-not-blank'
55
72
  | 'cell.toggle-direction'
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/solver",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/solver",
9
- "version": "2.13.8",
9
+ "version": "2.13.10",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "@kamilmielnik/trie": "^3.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/solver",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "description": "Scrabble Solver 2 - Solver",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@kamilmielnik/trie": "^3.0.0",
27
- "@scrabble-solver/types": "^2.13.8"
27
+ "@scrabble-solver/types": "^2.13.10"
28
28
  },
29
29
  "devDependencies": {
30
- "@scrabble-solver/configs": "^2.13.8",
31
- "@scrabble-solver/constants": "^2.13.8",
32
- "@scrabble-solver/dictionaries": "^2.13.8"
30
+ "@scrabble-solver/configs": "^2.13.10",
31
+ "@scrabble-solver/constants": "^2.13.10",
32
+ "@scrabble-solver/dictionaries": "^2.13.10"
33
33
  },
34
34
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
35
35
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/types",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "description": "Scrabble Solver 2 - Types",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/constants": "^2.13.8"
26
+ "@scrabble-solver/constants": "^2.13.10"
27
27
  },
28
28
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
29
29
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/word-definitions",
9
- "version": "2.13.8",
9
+ "version": "2.13.10",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "cheerio": "^1.0.0-rc.12",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
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/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.13.8",
26
+ "@scrabble-solver/types": "^2.13.10",
27
27
  "cheerio": "^1.0.0-rc.12",
28
28
  "follow-redirects": "^1.15.6",
29
29
  "striptags": "^3.2.0"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/word-lists",
9
- "version": "2.13.8",
9
+ "version": "2.13.10",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "cheerio": "^1.0.0-rc.12",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.8",
3
+ "version": "2.13.10",
4
4
  "description": "Scrabble Solver 2 - Word lists",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.13.8",
26
+ "@scrabble-solver/types": "^2.13.10",
27
27
  "cheerio": "^1.0.0-rc.12",
28
28
  "follow-redirects": "^1.15.6",
29
29
  "latinize": "^1.0.0",
@@ -1,9 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const eslintConfigPath = './.eslintrc.js';
4
- const baseConfig = require(eslintConfigPath);
5
-
6
- module.exports = Object.assign({}, baseConfig, {
7
- extends: baseConfig.extends.filter((config) => config.includes('prettier')),
8
- rules: {},
9
- });