scrabble-solver 2.15.12 → 2.15.14
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/.github/workflows/npx.yml +5 -1
- package/.nx/workspace-data/file-map.json +528 -528
- package/.nx/workspace-data/lockfile.hash +1 -1
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/parsed-lock-file.json +2319 -1589
- package/.nx/workspace-data/project-graph.json +2055 -1767
- package/README.md +2 -2
- package/eslint.config.mjs +4 -9
- package/lerna.json +1 -1
- package/package.json +28 -28
- package/packages/configs/package.json +3 -3
- package/packages/constants/package.json +1 -1
- package/packages/dictionaries/package.json +4 -4
- package/packages/logger/package.json +1 -1
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +15 -15
- package/packages/scrabble-solver/.next/cache/.previewinfo +1 -0
- package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
- package/packages/scrabble-solver/.next/next-minimal-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
- package/packages/scrabble-solver/.next/required-server-files.json +23 -14
- package/packages/scrabble-solver/.next/routes-manifest.json +11 -7
- package/packages/scrabble-solver/.next/server/chunks/30.js +4 -4
- package/packages/scrabble-solver/.next/server/chunks/318.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/717.js +1 -0
- package/packages/scrabble-solver/.next/server/chunks/791.js +19 -0
- package/packages/scrabble-solver/.next/server/chunks/812.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/829.js +1 -0
- package/packages/scrabble-solver/.next/server/chunks/929.js +1 -0
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/_document.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/_error.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/visit.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/visit.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +1 -1
- package/packages/scrabble-solver/.next/server/webpack-runtime.js +1 -1
- package/packages/scrabble-solver/.next/static/{X6ny8arpUxpRCZ4OMm7Vo → UHBG2hxudxuZNMubluQ6A}/_buildManifest.js +1 -1
- package/packages/scrabble-solver/.next/static/chunks/framework-e4d8bdda7b6c00b3.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/main-40732898df2b5947.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/404-3ab23f01145bda71.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-ca98ddb1c33cb8b1.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/{_error-7ea2d37f66343175.js → _error-e7f663d1e0f43380.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/index-5c4af5351329bef5.js +1 -0
- package/packages/scrabble-solver/.next/static/css/d611d31bf52b6e25.css +2 -0
- package/packages/scrabble-solver/.next/trace +24 -23
- package/packages/scrabble-solver/.next/types/routes.d.ts +57 -0
- package/packages/scrabble-solver/.next/types/validator.ts +107 -0
- package/packages/scrabble-solver/next-env.d.ts +1 -0
- package/packages/scrabble-solver/package.json +20 -20
- package/packages/scrabble-solver/public/service-worker.js +2 -2
- package/packages/scrabble-solver/public/service-worker.js.map +1 -1
- package/packages/scrabble-solver/src/components/Results/Result.tsx +13 -17
- package/packages/scrabble-solver/src/components/Results/Results.tsx +23 -24
- package/packages/solver/package.json +5 -5
- package/packages/types/build/Board.js +2 -2
- package/packages/types/package.json +2 -2
- package/packages/types/src/Board.ts +2 -2
- package/packages/word-definitions/build/languages/romanian.js +1 -1
- package/packages/word-definitions/package.json +4 -4
- package/packages/word-definitions/src/__tests__/input/ro-RO.aciua.html +27 -29
- package/packages/word-definitions/src/languages/romanian.ts +1 -1
- package/packages/word-lists/build/languages/english.js +2 -2
- package/packages/word-lists/build/languages/french.js +1 -1
- package/packages/word-lists/build/languages/german.js +1 -1
- package/packages/word-lists/build/languages/persian.js +1 -1
- package/packages/word-lists/build/languages/polish.js +23 -9
- package/packages/word-lists/package.json +4 -4
- package/packages/word-lists/src/languages/english.ts +4 -2
- package/packages/word-lists/src/languages/french.ts +2 -1
- package/packages/word-lists/src/languages/german.ts +2 -1
- package/packages/word-lists/src/languages/persian.ts +2 -1
- package/packages/word-lists/src/languages/polish.ts +27 -10
- package/packages/scrabble-solver/.next/server/chunks/60.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/974.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/framework-57125a0cc6749ff9.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/main-03618e8bd3cd04dd.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/404-18b9f6f5faa91442.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-2378fe90e1762e8c.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/index-bfc599d9351773ae.js +0 -1
- package/packages/scrabble-solver/.next/static/css/1fae874a25934f54.css +0 -2
- /package/packages/scrabble-solver/.next/static/{X6ny8arpUxpRCZ4OMm7Vo → UHBG2hxudxuZNMubluQ6A}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FocusEventHandler, type MouseEventHandler, type ReactElement, useRef } from 'react';
|
|
3
3
|
import Highlighter from 'react-highlight-words';
|
|
4
|
+
import { type RowComponentProps } from 'react-window';
|
|
4
5
|
|
|
5
6
|
import { useAppLayout, useColumns } from 'hooks';
|
|
6
7
|
import { LOCALE_FEATURES } from 'i18n';
|
|
@@ -18,22 +19,17 @@ import { Cell } from './Cell';
|
|
|
18
19
|
import styles from './Results.module.scss';
|
|
19
20
|
import { type ResultData } from './types';
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onClick = noop,
|
|
33
|
-
onFocus = noop,
|
|
34
|
-
onMouseEnter = noop,
|
|
35
|
-
onMouseLeave = noop,
|
|
36
|
-
} = data;
|
|
22
|
+
export const Result = ({
|
|
23
|
+
index,
|
|
24
|
+
highlightedIndex,
|
|
25
|
+
results = [],
|
|
26
|
+
onBlur = noop,
|
|
27
|
+
onClick = noop,
|
|
28
|
+
onFocus = noop,
|
|
29
|
+
onMouseEnter = noop,
|
|
30
|
+
onMouseLeave = noop,
|
|
31
|
+
style,
|
|
32
|
+
}: RowComponentProps<ResultData>): ReactElement => {
|
|
37
33
|
const { resultWordWidth } = useAppLayout();
|
|
38
34
|
const ref = useRef<HTMLButtonElement>(null);
|
|
39
35
|
const columns = useColumns();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useEffect, useMemo, type FunctionComponent } from 'react';
|
|
3
|
+
import { List, useListRef } from 'react-window';
|
|
4
4
|
import { useDebounce } from 'use-debounce';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { useLatest } from 'hooks';
|
|
7
7
|
import { LOCALE_FEATURES } from 'i18n';
|
|
8
|
-
import {
|
|
8
|
+
import { RESULTS_ITEM_HEIGHT } from 'parameters';
|
|
9
9
|
import {
|
|
10
10
|
selectAreResultsOutdated,
|
|
11
|
-
selectSolveIsLoading,
|
|
12
11
|
selectLocale,
|
|
13
12
|
selectProcessedResults,
|
|
14
13
|
selectSolveError,
|
|
14
|
+
selectSolveIsLoading,
|
|
15
15
|
useTranslate,
|
|
16
16
|
useTypedSelector,
|
|
17
17
|
} from 'state';
|
|
@@ -36,7 +36,6 @@ const IS_LOADING_DEBOUNCE = 100;
|
|
|
36
36
|
|
|
37
37
|
export const Results: FunctionComponent<Props> = ({ callbacks, className, highlightedIndex }) => {
|
|
38
38
|
const translate = useTranslate();
|
|
39
|
-
const { resultsHeight, resultsWidth } = useAppLayout();
|
|
40
39
|
const locale = useTypedSelector(selectLocale);
|
|
41
40
|
const { direction } = LOCALE_FEATURES[locale];
|
|
42
41
|
const results = useTypedSelector(selectProcessedResults);
|
|
@@ -44,22 +43,25 @@ export const Results: FunctionComponent<Props> = ({ callbacks, className, highli
|
|
|
44
43
|
const [isLoadingDebounced] = useDebounce(isLoading, IS_LOADING_DEBOUNCE);
|
|
45
44
|
const isOutdated = useTypedSelector(selectAreResultsOutdated);
|
|
46
45
|
const error = useTypedSelector(selectSolveError);
|
|
47
|
-
const itemData = useMemo(
|
|
48
|
-
|
|
46
|
+
const itemData = useMemo<ResultData>(
|
|
47
|
+
() => ({ ...callbacks, highlightedIndex, results }),
|
|
48
|
+
[callbacks, highlightedIndex, results],
|
|
49
|
+
);
|
|
50
|
+
const listRef = useListRef(null);
|
|
49
51
|
const scrollToIndex = typeof highlightedIndex === 'number' ? highlightedIndex : 0;
|
|
50
52
|
const scrollToIndexRef = useLatest(scrollToIndex);
|
|
51
53
|
const hasResults = typeof error === 'undefined' && typeof results !== 'undefined';
|
|
52
54
|
const showInput = hasResults && results.length > 0 && !isOutdated;
|
|
53
|
-
const height = resultsHeight - RESULTS_HEADER_HEIGHT - (showInput ? TEXT_INPUT_HEIGHT : 0) - 2 * BORDER_WIDTH;
|
|
54
|
-
const width = resultsWidth - 2 * BORDER_WIDTH;
|
|
55
55
|
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
// without setTimeout, the initial scrolling offset is calculated
|
|
58
58
|
// incorrectly, as the list is not fully rendered by the browser yet
|
|
59
59
|
const timeout = globalThis.setTimeout(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
listRef.current?.scrollToRow({
|
|
61
|
+
align: 'center',
|
|
62
|
+
behavior: 'instant',
|
|
63
|
+
index: scrollToIndexRef.current,
|
|
64
|
+
});
|
|
63
65
|
}, 0);
|
|
64
66
|
|
|
65
67
|
return () => {
|
|
@@ -104,20 +106,17 @@ export const Results: FunctionComponent<Props> = ({ callbacks, className, highli
|
|
|
104
106
|
|
|
105
107
|
{!isOutdated && results.length > 0 && (
|
|
106
108
|
<div className={styles.listContainer}>
|
|
107
|
-
<
|
|
109
|
+
<List
|
|
108
110
|
className={classNames(styles.list, {
|
|
109
111
|
[styles.outdated]: isOutdated,
|
|
110
112
|
})}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
>
|
|
119
|
-
{Result}
|
|
120
|
-
</FixedSizeList>
|
|
113
|
+
dir={direction}
|
|
114
|
+
listRef={listRef}
|
|
115
|
+
rowComponent={Result}
|
|
116
|
+
rowCount={results.length}
|
|
117
|
+
rowHeight={RESULTS_ITEM_HEIGHT}
|
|
118
|
+
rowProps={itemData}
|
|
119
|
+
/>
|
|
121
120
|
</div>
|
|
122
121
|
)}
|
|
123
122
|
</>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/solver",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.14",
|
|
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": "^4.0.0",
|
|
27
|
-
"@scrabble-solver/types": "^2.15.
|
|
27
|
+
"@scrabble-solver/types": "^2.15.14"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@scrabble-solver/configs": "^2.15.
|
|
31
|
-
"@scrabble-solver/constants": "^2.15.
|
|
32
|
-
"@scrabble-solver/dictionaries": "^2.15.
|
|
30
|
+
"@scrabble-solver/configs": "^2.15.14",
|
|
31
|
+
"@scrabble-solver/constants": "^2.15.14",
|
|
32
|
+
"@scrabble-solver/dictionaries": "^2.15.14"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
|
|
35
35
|
}
|
|
@@ -136,6 +136,6 @@ const getHorizontalWords = (cells) => {
|
|
|
136
136
|
}
|
|
137
137
|
return words;
|
|
138
138
|
};
|
|
139
|
-
const wordToString = (
|
|
140
|
-
return
|
|
139
|
+
const wordToString = (word) => {
|
|
140
|
+
return word.map((cell) => cell.tile.character).join('');
|
|
141
141
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/types",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.14",
|
|
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.15.
|
|
26
|
+
"@scrabble-solver/constants": "^2.15.14"
|
|
27
27
|
},
|
|
28
28
|
"gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
|
|
29
29
|
}
|
|
@@ -177,6 +177,6 @@ const getHorizontalWords = (cells: Cell[][]): string[] => {
|
|
|
177
177
|
return words;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
const wordToString = (
|
|
181
|
-
return
|
|
180
|
+
const wordToString = (word: Cell[]): string => {
|
|
181
|
+
return word.map((cell) => cell.tile.character).join('');
|
|
182
182
|
};
|
|
@@ -15,7 +15,7 @@ const parse = (html) => {
|
|
|
15
15
|
const $ = (0, cheerio_1.load)(html);
|
|
16
16
|
const $activeTab = $('.tab-pane.show.active');
|
|
17
17
|
$('.type-example').remove();
|
|
18
|
-
const $definitions = $activeTab.find('li.type-meaning.depth-0 > .meaningContainer .def.html');
|
|
18
|
+
const $definitions = $activeTab.find('li.type-meaning.depth-0 > .meaningContainer .tree-def.html');
|
|
19
19
|
$definitions.find('.meaningTree').remove();
|
|
20
20
|
const definitions = Array.from($definitions).map((definition) => $(definition).text().replace(/\n/g, ''));
|
|
21
21
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/word-definitions",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.14",
|
|
4
4
|
"description": "Scrabble Solver 2 - Word definitions",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"clean": "rimraf build/"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@scrabble-solver/types": "^2.15.
|
|
27
|
-
"cheerio": "^1.
|
|
28
|
-
"follow-redirects": "^1.15.
|
|
26
|
+
"@scrabble-solver/types": "^2.15.14",
|
|
27
|
+
"cheerio": "^1.1.2",
|
|
28
|
+
"follow-redirects": "^1.15.11",
|
|
29
29
|
"striptags": "^3.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|