@scrabble-solver/scrabble-solver 2.8.2 → 2.8.3
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 +5 -5
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/.next/cache/next-server.js.nft.json +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/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/413.js +391 -673
- package/.next/server/chunks/515.js +414 -500
- package/.next/server/chunks/907.js +397 -679
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/pages/_app.js +7 -10
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +0 -3
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js +114 -171
- package/.next/server/pages/api/solve.js +428 -1164
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +2 -2
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/static/OhUvTNKwyrrzmNwKBnpUU/_buildManifest.js +1 -0
- package/.next/static/{nXSSCVI5pGlS_NxEidxkS → OhUvTNKwyrrzmNwKBnpUU}/_ssgManifest.js +0 -0
- package/.next/static/chunks/{195-fcadef5c6eed8338.js → 195-4b75c9c697b7b455.js} +1 -1
- package/.next/static/chunks/pages/_app-72522bfb306a8aef.js +1 -0
- package/.next/trace +42 -42
- package/package.json +9 -9
- package/src/components/Board/Board.tsx +1 -1
- package/src/components/Board/BoardPure.tsx +1 -1
- package/src/components/Board/components/Cell/Button.tsx +1 -1
- package/src/components/Board/components/Cell/Cell.tsx +1 -1
- package/src/components/Board/components/Cell/CellPure.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Dictionary/Dictionary.tsx +1 -1
- package/src/components/DictionaryInput/DictionaryInput.tsx +1 -1
- package/src/components/EmptyState/EmptyState.tsx +1 -1
- package/src/components/Key/Key.tsx +1 -1
- package/src/components/KeyMap/KeyMap.tsx +1 -1
- package/src/components/KeyMap/components/Mapping/Mapping.tsx +1 -1
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/Logo/Logo.tsx +1 -1
- package/src/components/NavButtons/NavButtons.tsx +1 -1
- package/src/components/NotFound/NotFound.tsx +1 -1
- package/src/components/PlainTiles/PlainTiles.tsx +1 -1
- package/src/components/PlainTiles/Tile.tsx +1 -1
- package/src/components/Rack/Rack.tsx +1 -1
- package/src/components/Rack/RackTile.tsx +1 -1
- package/src/components/Radio/Radio.tsx +1 -1
- package/src/components/RemainingTiles/Character.tsx +1 -1
- package/src/components/RemainingTiles/RemainingTiles.tsx +1 -1
- package/src/components/Results/Cell.tsx +1 -1
- package/src/components/Results/HeaderButton.tsx +1 -1
- package/src/components/Results/Result.tsx +1 -1
- package/src/components/Results/Results.tsx +1 -1
- package/src/components/Results/SolveButton.tsx +1 -1
- package/src/components/ResultsInput/ResultsInput.tsx +1 -1
- package/src/components/Screen/Screen.tsx +1 -1
- package/src/components/Settings/Settings.tsx +1 -1
- package/src/components/Settings/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -1
- package/src/components/Settings/components/ConfigSetting/ConfigSetting.tsx +1 -1
- package/src/components/Settings/components/LocaleSetting/LocaleSetting.tsx +1 -1
- package/src/components/Sidebar/Sidebar.tsx +1 -1
- package/src/components/Sidebar/components/Section/Section.tsx +1 -1
- package/src/components/Splash/Splash.tsx +1 -1
- package/src/components/SquareButton/Link.tsx +1 -1
- package/src/components/SquareButton/SquareButton.tsx +1 -1
- package/src/components/Tile/Tile.tsx +1 -1
- package/src/components/Tile/TilePure.tsx +1 -1
- package/src/components/Tooltip/useTooltip.tsx +1 -1
- package/src/components/Well/Well.tsx +1 -1
- package/src/hooks/usePortal.tsx +19 -9
- package/src/lib/memoize.ts +1 -1
- package/src/pages/_app.tsx +1 -1
- package/src/pages/_document.tsx +1 -1
- package/src/pages/index.tsx +1 -1
- package/.next/static/chunks/pages/_app-f4030148d742bcd2.js +0 -1
- package/.next/static/nXSSCVI5pGlS_NxEidxkS/_buildManifest.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/scrabble-solver",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.3",
|
|
4
4
|
"description": "Scrabble Solver 2 - App",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.0.0"
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@popperjs/core": "^2.11.6",
|
|
32
32
|
"@reduxjs/toolkit": "^1.8.5",
|
|
33
|
-
"@scrabble-solver/configs": "^2.8.
|
|
34
|
-
"@scrabble-solver/constants": "^2.8.
|
|
35
|
-
"@scrabble-solver/dictionaries": "^2.8.
|
|
36
|
-
"@scrabble-solver/logger": "^2.8.
|
|
37
|
-
"@scrabble-solver/solver": "^2.8.
|
|
38
|
-
"@scrabble-solver/types": "^2.8.
|
|
39
|
-
"@scrabble-solver/word-definitions": "^2.8.
|
|
33
|
+
"@scrabble-solver/configs": "^2.8.3",
|
|
34
|
+
"@scrabble-solver/constants": "^2.8.3",
|
|
35
|
+
"@scrabble-solver/dictionaries": "^2.8.3",
|
|
36
|
+
"@scrabble-solver/logger": "^2.8.3",
|
|
37
|
+
"@scrabble-solver/solver": "^2.8.3",
|
|
38
|
+
"@scrabble-solver/types": "^2.8.3",
|
|
39
|
+
"@scrabble-solver/word-definitions": "^2.8.3",
|
|
40
40
|
"classnames": "^2.3.2",
|
|
41
41
|
"next": "^12.3.1",
|
|
42
42
|
"normalize.css": "^8.0.1",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"env-cmd": "^10.1.0",
|
|
69
69
|
"sass": "^1.54.9"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "116f214733e7ad071044f556bcf67e867da3d9ca"
|
|
72
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cell } from '@scrabble-solver/types';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { FunctionComponent, KeyboardEventHandler, memo, Ref, RefObject } from 'react';
|
|
4
4
|
|
|
5
5
|
import styles from './Board.module.scss';
|
|
6
6
|
import { Cell as CellComponent } from './components';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useTooltip } from '../../../Tooltip';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EMPTY_CELL } from '@scrabble-solver/constants';
|
|
2
2
|
import { Cell as CellModel } from '@scrabble-solver/types';
|
|
3
|
-
import
|
|
3
|
+
import { FunctionComponent, RefObject, useCallback, useMemo } from 'react';
|
|
4
4
|
import { useDispatch } from 'react-redux';
|
|
5
5
|
|
|
6
6
|
import { getTileSizes } from 'lib';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Bonus, Cell, Tile as TileModel } from '@scrabble-solver/types';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { CSSProperties, FocusEventHandler, FunctionComponent, memo, MouseEventHandler, RefObject } from 'react';
|
|
4
4
|
|
|
5
5
|
import { ArrowDown } from 'icons';
|
|
6
6
|
import { Translate } from 'types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler, ReactNode, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useTooltip } from '../Tooltip';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { ChangeEvent, FormEvent, FunctionComponent } from 'react';
|
|
3
3
|
import { useDispatch } from 'react-redux';
|
|
4
4
|
|
|
5
5
|
import { dictionarySlice, selectDictionary, useTranslate, useTypedSelector } from 'state';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { FunctionComponent, ReactNode, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { COLOR_BLUE, COLOR_GREEN, COLOR_RED, COLOR_YELLOW } from 'parameters';
|
|
5
5
|
import { useTranslate } from 'state';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { CSSProperties, FunctionComponent, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { createPlainTiles, getViewbox } from './lib';
|
|
5
5
|
import styles from './PlainTiles.module.scss';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BLANK } from '@scrabble-solver/constants';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { createRef, FunctionComponent, useCallback, useMemo, useRef } from 'react';
|
|
4
4
|
|
|
5
5
|
import { createArray, createKeyboardNavigation, zipCharactersAndTiles } from 'lib';
|
|
6
6
|
import { selectConfig, selectRack, selectResultCandidateTiles, useTypedSelector } from 'state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BLANK } from '@scrabble-solver/constants';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { FunctionComponent } from 'react';
|
|
4
4
|
|
|
5
5
|
import { REMAINING_TILES_TILE_SIZE } from 'parameters';
|
|
6
6
|
import { selectCharacterPoints, useTypedSelector } from 'state';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { FunctionComponent } from 'react';
|
|
3
3
|
import { FixedSizeList } from 'react-window';
|
|
4
4
|
|
|
5
5
|
import { RESULTS_HEADER_HEIGHT, RESULTS_INPUT_HEIGHT, RESULTS_ITEM_HEIGHT } from 'parameters';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { ChangeEvent, FunctionComponent } from 'react';
|
|
3
3
|
import { useDispatch } from 'react-redux';
|
|
4
4
|
|
|
5
5
|
import { resultsSlice, selectResultsQuery, useTranslate, useTypedSelector } from 'state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from '@scrabble-solver/types';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { ChangeEvent, FunctionComponent } from 'react';
|
|
4
4
|
import { useDispatch } from 'react-redux';
|
|
5
5
|
|
|
6
6
|
import { selectLocale, settingsSlice, useTypedSelector } from 'state';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useTooltip } from '../Tooltip';
|
|
5
5
|
|
package/src/hooks/usePortal.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode, useLayoutEffect, useRef } from 'react';
|
|
2
|
+
import { createRoot, Root } from 'react-dom/client';
|
|
3
3
|
import { Portal } from 'react-portal';
|
|
4
4
|
|
|
5
5
|
import { canUseDom, noop } from 'lib';
|
|
@@ -12,26 +12,36 @@ interface Props {
|
|
|
12
12
|
type TagName = Parameters<typeof document.createElement>[0];
|
|
13
13
|
|
|
14
14
|
const usePortal = (children: ReactNode, { disabled = false, tagName = 'div' }: Props = {}): void => {
|
|
15
|
-
const
|
|
15
|
+
const rootRef = useRef<Root | null>(null);
|
|
16
16
|
|
|
17
17
|
useLayoutEffect(() => {
|
|
18
18
|
if (disabled) {
|
|
19
19
|
return noop;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
const element = document.createElement(tagName);
|
|
22
23
|
document.body.appendChild(element);
|
|
24
|
+
const root = createRoot(element);
|
|
25
|
+
rootRef.current = root;
|
|
23
26
|
|
|
24
27
|
return () => {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
// We need setTimeout for async unmount, otherwise we get this warning:
|
|
29
|
+
// "Attempted to synchronously unmount a root while React was already
|
|
30
|
+
// rendering. React cannot finish unmounting the root until the current
|
|
31
|
+
// render has completed, which may lead to a race condition.""
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
rootRef.current = null;
|
|
34
|
+
root.unmount();
|
|
35
|
+
element.remove();
|
|
36
|
+
}, 0);
|
|
27
37
|
};
|
|
28
|
-
}, [disabled,
|
|
38
|
+
}, [disabled, tagName]);
|
|
29
39
|
|
|
30
40
|
useLayoutEffect(() => {
|
|
31
|
-
if (
|
|
32
|
-
render(<Portal>{children}</Portal
|
|
41
|
+
if (rootRef.current) {
|
|
42
|
+
rootRef.current.render(<Portal>{children}</Portal>);
|
|
33
43
|
}
|
|
34
|
-
}, [children, disabled,
|
|
44
|
+
}, [children, disabled, rootRef]);
|
|
35
45
|
};
|
|
36
46
|
|
|
37
47
|
export default canUseDom ? usePortal : noop;
|
package/src/lib/memoize.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface AnyFunction {
|
|
2
|
-
(...parameters: any): any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
2
|
+
(...parameters: any[]): any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
interface AnyCachedFunction<T extends AnyFunction> extends AnyFunction {
|
package/src/pages/_app.tsx
CHANGED
package/src/pages/_document.tsx
CHANGED
package/src/pages/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import
|
|
4
|
+
import { AnimationEvent, FormEvent, FunctionComponent, useState } from 'react';
|
|
5
5
|
import Modal from 'react-modal';
|
|
6
6
|
import { useDispatch } from 'react-redux';
|
|
7
7
|
import { useEffectOnce, useMeasure } from 'react-use';
|