@scrabble-solver/scrabble-solver 2.13.7 → 2.13.9
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 +11 -11
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_8dgz12 +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/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-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/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/577.js +1 -1
- package/.next/server/chunks/807.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.js +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/static/chunks/{main-6e708370ad13b1f9.js → main-b5b360c6afb66b05.js} +1 -1
- package/.next/static/chunks/pages/{404-9d5621b1ca024a45.js → 404-01653a877b233143.js} +1 -1
- package/.next/static/chunks/pages/_app-735b5863675c1b5d.js +17 -0
- package/.next/static/chunks/pages/{index-710b5c27542027be.js → index-36c448d585a58425.js} +1 -1
- package/.next/static/css/6682db14f926d4c7.css +1 -0
- package/.next/static/css/841a5b5f0b2fb131.css +2 -0
- package/.next/static/eLvYNd4B2hzSgBZ_PuZcQ/_buildManifest.js +1 -0
- package/.next/trace +44 -44
- package/LICENSE +1 -1
- package/package.json +12 -12
- package/src/components/Alert/Alert.module.scss +3 -12
- package/src/components/Board/Board.module.scss +1 -4
- package/src/components/Board/Board.tsx +3 -3
- package/src/components/Board/BoardPure.tsx +27 -19
- package/src/components/Board/components/Actions/Actions.module.scss +7 -27
- package/src/components/Board/components/Actions/Actions.tsx +8 -12
- package/src/components/Board/components/Actions/lib.ts +30 -0
- package/src/components/Board/components/Cell/Cell.module.scss +5 -32
- package/src/components/Board/components/InputPrompt/InputPrompt.module.scss +4 -18
- package/src/components/Board/hooks/useBackgroundImage.tsx +18 -28
- package/src/components/Button/Button.module.scss +1 -8
- package/src/components/Dictionary/Dictionary.module.scss +1 -8
- package/src/components/Loading/Loading.module.scss +1 -4
- package/src/components/Modal/Modal.module.scss +2 -16
- package/src/components/Rack/Rack.module.scss +4 -18
- package/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +1 -4
- package/src/components/Radio/Radio.module.scss +2 -1
- package/src/components/Results/Results.module.scss +7 -39
- package/src/components/Results/useColumns.ts +1 -1
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +9 -40
- package/src/components/Tile/Tile.module.scss +6 -28
- package/src/components/Tile/Tile.tsx +1 -15
- package/src/components/Tooltip/Tooltip.module.scss +1 -0
- package/src/components/index.ts +0 -1
- package/src/hooks/useAppLayout.ts +0 -1
- package/src/i18n/languages/english.json +2 -1
- package/src/i18n/languages/french.json +2 -1
- package/src/i18n/languages/german.json +3 -2
- package/src/i18n/languages/persian.json +2 -1
- package/src/i18n/languages/polish.json +2 -1
- package/src/i18n/languages/romanian.json +2 -1
- package/src/i18n/languages/spanish.json +2 -1
- package/src/icons/Ban.svg +4 -0
- package/src/icons/index.ts +1 -2
- package/src/lib/groupResults.ts +4 -7
- package/src/lib/index.ts +1 -0
- package/src/lib/resultMatchesCellFilter.ts +23 -0
- package/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +2 -2
- package/src/modals/MenuModal/MenuModal.module.scss +2 -15
- package/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss +1 -7
- package/src/modals/WordsModal/WordsModal.module.scss +2 -15
- package/src/parameters/index.ts +0 -9
- package/src/state/sagas.ts +4 -4
- package/src/state/selectors.ts +5 -8
- package/src/state/slices/cellFilterInitialState.ts +2 -2
- package/src/state/slices/cellFilterSlice.ts +29 -4
- package/src/styles/mixins.scss +2 -5
- package/src/types/index.ts +10 -1
- package/.next/static/QbBIK_mEs1LhYSpQwv6rZ/_buildManifest.js +0 -1
- package/.next/static/chunks/pages/_app-7bc3bf713c40526a.js +0 -17
- package/.next/static/css/11366b7489cf90ac.css +0 -1
- package/.next/static/css/fe70298e6f597553.css +0 -2
- package/src/components/Checkbox/Checkbox.module.scss +0 -45
- package/src/components/Checkbox/Checkbox.tsx +0 -38
- package/src/components/Checkbox/index.ts +0 -1
- package/src/icons/CheckboxChecked.svg +0 -4
- package/src/icons/CheckboxEmpty.svg +0 -4
- /package/.next/static/{QbBIK_mEs1LhYSpQwv6rZ → eLvYNd4B2hzSgBZ_PuZcQ}/_ssgManifest.js +0 -0
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/scrabble-solver",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.9",
|
|
4
4
|
"description": "Scrabble Solver 2 - App",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"start": "env-cmd next start -p 3333"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@floating-ui/react": "^0.26.
|
|
30
|
+
"@floating-ui/react": "^0.26.17",
|
|
31
31
|
"@kamilmielnik/trie": "^3.0.0",
|
|
32
32
|
"@reduxjs/toolkit": "^2.2.5",
|
|
33
|
-
"@scrabble-solver/configs": "^2.13.
|
|
34
|
-
"@scrabble-solver/constants": "^2.13.
|
|
35
|
-
"@scrabble-solver/dictionaries": "^2.13.
|
|
36
|
-
"@scrabble-solver/logger": "^2.13.
|
|
37
|
-
"@scrabble-solver/solver": "^2.13.
|
|
38
|
-
"@scrabble-solver/types": "^2.13.
|
|
39
|
-
"@scrabble-solver/word-definitions": "^2.13.
|
|
33
|
+
"@scrabble-solver/configs": "^2.13.9",
|
|
34
|
+
"@scrabble-solver/constants": "^2.13.9",
|
|
35
|
+
"@scrabble-solver/dictionaries": "^2.13.9",
|
|
36
|
+
"@scrabble-solver/logger": "^2.13.9",
|
|
37
|
+
"@scrabble-solver/solver": "^2.13.9",
|
|
38
|
+
"@scrabble-solver/types": "^2.13.9",
|
|
39
|
+
"@scrabble-solver/word-definitions": "^2.13.9",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"env-cmd": "^10.1.0",
|
|
42
42
|
"include-media": "^2.0.0",
|
|
43
43
|
"include-media-query-builder": "^1.1.0",
|
|
44
|
-
"next": "^14.2.
|
|
44
|
+
"next": "^14.2.4",
|
|
45
45
|
"normalize.css": "^8.0.1",
|
|
46
46
|
"react": "^18.3.1",
|
|
47
47
|
"react-cool-onclickoutside": "^1.7.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/react-window": "^1.8.8",
|
|
71
71
|
"@types/redux": "^3.6.31",
|
|
72
72
|
"@types/redux-saga": "^0.10.5",
|
|
73
|
-
"sass": "^1.77.
|
|
73
|
+
"sass": "^1.77.5"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d09676296f8fafadb7da0cf1e11fb240aaf309ee"
|
|
76
76
|
}
|
|
@@ -14,18 +14,9 @@
|
|
|
14
14
|
justify-content: center;
|
|
15
15
|
padding: var(--spacing--m);
|
|
16
16
|
color: var(--color--foreground--secondary);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
border-bottom-left-radius: var(--border--radius);
|
|
21
|
-
border-right: var(--border);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
[dir='rtl'] & {
|
|
25
|
-
border-top-right-radius: var(--border--radius);
|
|
26
|
-
border-bottom-right-radius: var(--border--radius);
|
|
27
|
-
border-left: var(--border);
|
|
28
|
-
}
|
|
17
|
+
border-start-start-radius: var(--border--radius);
|
|
18
|
+
border-end-start-radius: var(--border--radius);
|
|
19
|
+
border-inline-end: var(--border);
|
|
29
20
|
|
|
30
21
|
.error & {
|
|
31
22
|
background-color: var(--color--red--light);
|
|
@@ -46,10 +46,7 @@
|
|
|
46
46
|
.iconBackground,
|
|
47
47
|
.icon {
|
|
48
48
|
position: absolute;
|
|
49
|
-
|
|
50
|
-
right: calc((100% - var(--size)) / 2);
|
|
51
|
-
bottom: calc((100% - var(--size)) / 2);
|
|
52
|
-
left: calc((100% - var(--size)) / 2);
|
|
49
|
+
inset: calc((100% - var(--size)) / 2);
|
|
53
50
|
width: var(--size);
|
|
54
51
|
height: var(--size);
|
|
55
52
|
}
|
|
@@ -9,7 +9,7 @@ import { useDispatch } from 'react-redux';
|
|
|
9
9
|
|
|
10
10
|
import { useAppLayout } from 'hooks';
|
|
11
11
|
import { LOCALE_FEATURES } from 'i18n';
|
|
12
|
-
import { TRANSITION } from 'parameters';
|
|
12
|
+
import { BORDER_WIDTH, TRANSITION } from 'parameters';
|
|
13
13
|
import {
|
|
14
14
|
boardSlice,
|
|
15
15
|
cellFilterSlice,
|
|
@@ -176,8 +176,8 @@ const Board: FunctionComponent<Props> = ({ className }) => {
|
|
|
176
176
|
ref={floatingFocus.refs.setFloating}
|
|
177
177
|
style={{
|
|
178
178
|
position: floatingFocus.strategy,
|
|
179
|
-
top: floatingFocus.y ? floatingFocus.y + cellSize : 0,
|
|
180
|
-
left: floatingFocus.x ?? 0,
|
|
179
|
+
top: (floatingFocus.y ? floatingFocus.y + cellSize : 0) - (showCoordinates === 'hidden' ? 0 : BORDER_WIDTH),
|
|
180
|
+
left: (floatingFocus.x ?? 0) - (showCoordinates === 'hidden' ? 0 : BORDER_WIDTH),
|
|
181
181
|
width: cellSize,
|
|
182
182
|
height: cellSize,
|
|
183
183
|
opacity: hasFocus ? 1 : 0,
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
memo,
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
|
-
import { FlagFill } from 'icons';
|
|
15
|
+
import { Ban, FlagFill } from 'icons';
|
|
16
16
|
import { getCoordinate } from 'lib';
|
|
17
17
|
import { BORDER_WIDTH } from 'parameters';
|
|
18
|
-
import {
|
|
18
|
+
import { CellFilterEntry } from 'types';
|
|
19
19
|
|
|
20
20
|
import styles from './Board.module.scss';
|
|
21
21
|
import { Cell } from './components';
|
|
@@ -26,7 +26,7 @@ interface Props {
|
|
|
26
26
|
coordinatesFontSize: number;
|
|
27
27
|
coordinatesSize: number;
|
|
28
28
|
direction: 'ltr' | 'rtl';
|
|
29
|
-
filteredCells:
|
|
29
|
+
filteredCells: CellFilterEntry[];
|
|
30
30
|
inputRefs: RefObject<HTMLInputElement>[][];
|
|
31
31
|
rows: CellModel[][];
|
|
32
32
|
showCoordinates: ShowCoordinates;
|
|
@@ -87,22 +87,30 @@ const BoardPure = forwardRef<HTMLDivElement, Props>(
|
|
|
87
87
|
</>
|
|
88
88
|
)}
|
|
89
89
|
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
90
|
+
{/* The dynamic changes to the board presentation need to be outside of useBackgroundImage
|
|
91
|
+
to prevent flickering on blob URL change (i.e. when flagging a field,
|
|
92
|
+
but not when changing game type since user's attention is not on the board
|
|
93
|
+
when that happens)*/}
|
|
94
|
+
{filteredCells.map(({ x, y, type }) => {
|
|
95
|
+
const Icon = type === 'exclude' ? Ban : FlagFill;
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<div
|
|
99
|
+
className={styles.iconContainer}
|
|
100
|
+
key={[x, y].join('-')}
|
|
101
|
+
style={{
|
|
102
|
+
height: cellSize,
|
|
103
|
+
width: cellSize,
|
|
104
|
+
left: direction === 'ltr' ? coordinatesSize + BORDER_WIDTH + x * (cellSize + BORDER_WIDTH) : undefined,
|
|
105
|
+
right: direction === 'rtl' ? coordinatesSize + BORDER_WIDTH + x * (cellSize + BORDER_WIDTH) : undefined,
|
|
106
|
+
top: coordinatesSize + BORDER_WIDTH + y * (cellSize + BORDER_WIDTH),
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
<div className={styles.iconBackground} />
|
|
110
|
+
<Icon className={styles.icon} />
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
})}
|
|
106
114
|
|
|
107
115
|
{rows.map((cells, y) => (
|
|
108
116
|
<Fragment key={y}>
|
|
@@ -18,36 +18,16 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
& + & {
|
|
21
|
-
|
|
22
|
-
border-left: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[dir='rtl'] & {
|
|
26
|
-
border-right: none;
|
|
27
|
-
}
|
|
21
|
+
border-inline-start: none;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-bottom-right-radius: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:last-child {
|
|
37
|
-
border-top-left-radius: 0;
|
|
38
|
-
border-bottom-left-radius: 0;
|
|
39
|
-
}
|
|
24
|
+
&:first-child {
|
|
25
|
+
border-start-end-radius: 0;
|
|
26
|
+
border-end-end-radius: 0;
|
|
40
27
|
}
|
|
41
28
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
border-bottom-left-radius: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:last-child {
|
|
49
|
-
border-top-right-radius: 0;
|
|
50
|
-
border-bottom-right-radius: 0;
|
|
51
|
-
}
|
|
29
|
+
&:last-child {
|
|
30
|
+
border-start-start-radius: 0;
|
|
31
|
+
border-end-start-radius: 0;
|
|
52
32
|
}
|
|
53
33
|
}
|
|
@@ -3,21 +3,16 @@ import { Cell } from '@scrabble-solver/types';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { forwardRef, HTMLProps, MouseEventHandler } from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { Keyboard, Square, SquareFill } from 'icons';
|
|
7
7
|
import { findCell } from 'lib';
|
|
8
|
-
import {
|
|
9
|
-
selectCellIsFiltered,
|
|
10
|
-
selectInputMode,
|
|
11
|
-
selectResultCandidateCells,
|
|
12
|
-
useTranslate,
|
|
13
|
-
useTypedSelector,
|
|
14
|
-
} from 'state';
|
|
8
|
+
import { selectCellFilter, selectInputMode, selectResultCandidateCells, useTranslate, useTypedSelector } from 'state';
|
|
15
9
|
import { Direction } from 'types';
|
|
16
10
|
|
|
17
11
|
import Button from '../../../Button';
|
|
18
12
|
import ToggleDirectionButton from '../ToggleDirectionButton';
|
|
19
13
|
|
|
20
14
|
import styles from './Actions.module.scss';
|
|
15
|
+
import { getNextCellFilter } from './lib';
|
|
21
16
|
|
|
22
17
|
interface Props extends HTMLProps<HTMLDivElement> {
|
|
23
18
|
cell: Cell;
|
|
@@ -35,10 +30,11 @@ const Actions = forwardRef<HTMLDivElement, Props>(
|
|
|
35
30
|
) => {
|
|
36
31
|
const translate = useTranslate();
|
|
37
32
|
const inputMode = useTypedSelector(selectInputMode);
|
|
38
|
-
const
|
|
33
|
+
const filter = useTypedSelector((state) => selectCellFilter(state, cell));
|
|
39
34
|
const resultCandidateCells = useTypedSelector(selectResultCandidateCells);
|
|
40
35
|
const isBlank = cell.tile.isBlank;
|
|
41
36
|
const isEmpty = cell.tile.character === EMPTY_CELL || Boolean(findCell(resultCandidateCells, cell.x, cell.y));
|
|
37
|
+
const { Icon, labelTranslationKey } = getNextCellFilter(filter);
|
|
42
38
|
|
|
43
39
|
// On iOS it helps with losing focus too early which makes Actions disappear
|
|
44
40
|
const handleMouseDown: MouseEventHandler = (event) => event.preventDefault();
|
|
@@ -67,10 +63,10 @@ const Actions = forwardRef<HTMLDivElement, Props>(
|
|
|
67
63
|
|
|
68
64
|
{isEmpty && (
|
|
69
65
|
<Button
|
|
70
|
-
aria-label={translate(
|
|
66
|
+
aria-label={translate(labelTranslationKey)}
|
|
71
67
|
className={classNames(styles.action)}
|
|
72
|
-
Icon={
|
|
73
|
-
tooltip={translate(
|
|
68
|
+
Icon={Icon}
|
|
69
|
+
tooltip={translate(labelTranslationKey)}
|
|
74
70
|
onClick={onToggleFilterCell}
|
|
75
71
|
onMouseDown={handleMouseDown}
|
|
76
72
|
/>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FunctionComponent, SVGAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Ban, Eraser, FlagFill } from 'icons';
|
|
4
|
+
import { CellFilterEntry, TranslationKey } from 'types';
|
|
5
|
+
|
|
6
|
+
export const getNextCellFilter = (
|
|
7
|
+
filter: CellFilterEntry | undefined,
|
|
8
|
+
): {
|
|
9
|
+
Icon: FunctionComponent<SVGAttributes<SVGElement>>;
|
|
10
|
+
labelTranslationKey: TranslationKey;
|
|
11
|
+
} => {
|
|
12
|
+
if (filter?.type === 'exclude') {
|
|
13
|
+
return {
|
|
14
|
+
Icon: Eraser,
|
|
15
|
+
labelTranslationKey: 'common.clear',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (filter?.type === 'include') {
|
|
20
|
+
return {
|
|
21
|
+
Icon: Ban,
|
|
22
|
+
labelTranslationKey: 'cell.filter-cell.exclude',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
Icon: FlagFill,
|
|
28
|
+
labelTranslationKey: 'cell.filter-cell.include',
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
input {
|
|
9
9
|
position: absolute;
|
|
10
|
-
|
|
11
|
-
right: -100%;
|
|
12
|
-
left: -100%;
|
|
13
|
-
bottom: -100%;
|
|
10
|
+
inset: -100%;
|
|
14
11
|
width: 300%;
|
|
15
12
|
height: 300%;
|
|
16
13
|
clip-path: inset((100% / 3));
|
|
@@ -55,43 +52,19 @@
|
|
|
55
52
|
@include lighthouse-input-size-hack;
|
|
56
53
|
|
|
57
54
|
&.sharpTopLeft {
|
|
58
|
-
|
|
59
|
-
border-top-left-radius: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
[dir='rtl'] & {
|
|
63
|
-
border-top-right-radius: 0;
|
|
64
|
-
}
|
|
55
|
+
border-start-start-radius: 0;
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
&.sharpTopRight {
|
|
68
|
-
|
|
69
|
-
border-top-right-radius: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[dir='rtl'] & {
|
|
73
|
-
border-top-left-radius: 0;
|
|
74
|
-
}
|
|
59
|
+
border-start-end-radius: 0;
|
|
75
60
|
}
|
|
76
61
|
|
|
77
62
|
&.sharpBottomLeft {
|
|
78
|
-
|
|
79
|
-
border-bottom-left-radius: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[dir='rtl'] & {
|
|
83
|
-
border-bottom-right-radius: 0;
|
|
84
|
-
}
|
|
63
|
+
border-end-start-radius: 0;
|
|
85
64
|
}
|
|
86
65
|
|
|
87
66
|
&.sharpBottomRight {
|
|
88
|
-
|
|
89
|
-
border-bottom-right-radius: 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
[dir='rtl'] & {
|
|
93
|
-
border-bottom-left-radius: 0;
|
|
94
|
-
}
|
|
67
|
+
border-end-end-radius: 0;
|
|
95
68
|
}
|
|
96
69
|
|
|
97
70
|
&:focus-within {
|
|
@@ -9,15 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.toggleDirection {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-bottom-right-radius: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[dir='rtl'] & {
|
|
18
|
-
border-top-left-radius: 0;
|
|
19
|
-
border-bottom-left-radius: 0;
|
|
20
|
-
}
|
|
12
|
+
border-start-end-radius: 0;
|
|
13
|
+
border-end-end-radius: 0;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
.input {
|
|
@@ -32,15 +25,8 @@
|
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
.insert {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
border-bottom-left-radius: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[dir='rtl'] & {
|
|
41
|
-
border-top-right-radius: 0;
|
|
42
|
-
border-bottom-right-radius: 0;
|
|
43
|
-
}
|
|
28
|
+
border-start-start-radius: 0;
|
|
29
|
+
border-end-start-radius: 0;
|
|
44
30
|
}
|
|
45
31
|
|
|
46
32
|
.insertIcon {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable max-statements */
|
|
1
|
+
/* eslint-disable max-lines, max-statements */
|
|
2
2
|
|
|
3
3
|
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
4
4
|
import { useMemo } from 'react';
|
|
@@ -7,16 +7,9 @@ import { Provider } from 'react-redux';
|
|
|
7
7
|
|
|
8
8
|
import { useAppLayout, useMediaQueries } from 'hooks';
|
|
9
9
|
import { LOCALE_FEATURES } from 'i18n';
|
|
10
|
-
import {
|
|
10
|
+
import { Star } from 'icons';
|
|
11
11
|
import { dataUrlToBlob, getTileSizes } from 'lib';
|
|
12
|
-
import {
|
|
13
|
-
BORDER_COLOR_LIGHT,
|
|
14
|
-
BORDER_RADIUS,
|
|
15
|
-
BORDER_WIDTH,
|
|
16
|
-
COLOR_BACKGROUND,
|
|
17
|
-
COLOR_BONUS_START,
|
|
18
|
-
COLOR_FILTERED,
|
|
19
|
-
} from 'parameters';
|
|
12
|
+
import { BORDER_COLOR_LIGHT, BORDER_RADIUS, BORDER_WIDTH, COLOR_BACKGROUND, COLOR_BONUS_START } from 'parameters';
|
|
20
13
|
import { selectConfig, selectLocale, selectShowCoordinates, store, useTypedSelector } from 'state';
|
|
21
14
|
import { Point } from 'types';
|
|
22
15
|
|
|
@@ -30,7 +23,6 @@ const BONUS = 'b';
|
|
|
30
23
|
const BONUS_WORD_2 = 'b2';
|
|
31
24
|
const BONUS_WORD_3 = 'b3';
|
|
32
25
|
const BONUS_WORD_4 = 'b4';
|
|
33
|
-
const CELL_FILTER = 'c';
|
|
34
26
|
|
|
35
27
|
const useBackgroundImage = () => {
|
|
36
28
|
const { boardSize, cellSize, coordinatesSize } = useAppLayout();
|
|
@@ -131,25 +123,23 @@ const useBackgroundImage = () => {
|
|
|
131
123
|
x4
|
|
132
124
|
</text>
|
|
133
125
|
</symbol>
|
|
134
|
-
|
|
135
|
-
<symbol id={CELL_FILTER}>
|
|
136
|
-
<rect
|
|
137
|
-
fill={COLOR_FILTERED}
|
|
138
|
-
height={bonusSize}
|
|
139
|
-
rx={borderRadius}
|
|
140
|
-
width={bonusSize}
|
|
141
|
-
x={bonusOffset}
|
|
142
|
-
y={bonusOffset}
|
|
143
|
-
/>
|
|
144
|
-
|
|
145
|
-
<FlagFill color="white" height={iconSize} width={iconSize} x={iconOffset} y={iconOffset} />
|
|
146
|
-
</symbol>
|
|
147
126
|
</defs>
|
|
148
127
|
|
|
149
|
-
|
|
128
|
+
{showCoordinates === 'hidden' && (
|
|
129
|
+
<rect fill="white" height={viewBoxHeight} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
130
|
+
)}
|
|
150
131
|
|
|
151
132
|
{showCoordinates !== 'hidden' && (
|
|
152
133
|
<>
|
|
134
|
+
<rect fill={COLOR_BACKGROUND} height={viewBoxHeight} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
135
|
+
<rect
|
|
136
|
+
fill="white"
|
|
137
|
+
height={viewBoxHeight - coordinatesSize}
|
|
138
|
+
width={viewBoxWidth - coordinatesSize}
|
|
139
|
+
x={direction === 'ltr' ? coordinatesSize : 0}
|
|
140
|
+
y={coordinatesSize}
|
|
141
|
+
/>
|
|
142
|
+
|
|
153
143
|
<rect fill={COLOR_BACKGROUND} height={coordinatesSize} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
154
144
|
<rect
|
|
155
145
|
fill={COLOR_BACKGROUND}
|
|
@@ -159,10 +149,10 @@ const useBackgroundImage = () => {
|
|
|
159
149
|
y="0"
|
|
160
150
|
width={coordinatesSize}
|
|
161
151
|
/>
|
|
162
|
-
<use href={`#${HORIZONTAL_LINE}`} y={coordinatesSize} />
|
|
152
|
+
<use href={`#${HORIZONTAL_LINE}`} y={coordinatesSize - BORDER_WIDTH} />
|
|
163
153
|
<use
|
|
164
154
|
href={`#${VERTICAL_LINE}`}
|
|
165
|
-
x={direction === 'ltr' ? coordinatesSize : viewBoxWidth - coordinatesSize - BORDER_WIDTH}
|
|
155
|
+
x={direction === 'ltr' ? coordinatesSize - BORDER_WIDTH : viewBoxWidth - coordinatesSize - BORDER_WIDTH}
|
|
166
156
|
/>
|
|
167
157
|
</>
|
|
168
158
|
)}
|
|
@@ -219,7 +209,7 @@ const useBackgroundImage = () => {
|
|
|
219
209
|
</Provider>,
|
|
220
210
|
);
|
|
221
211
|
|
|
222
|
-
const encodedSvg = globalThis.btoa(backgroundSvg);
|
|
212
|
+
const encodedSvg = useMemo(() => globalThis.btoa(backgroundSvg), [backgroundSvg]);
|
|
223
213
|
const dataUrl = `data:image/svg+xml;base64,${encodedSvg}`;
|
|
224
214
|
const blob = useMemo(() => dataUrlToBlob(dataUrl), [dataUrl]);
|
|
225
215
|
const blobUrl = useMemo(() => URL.createObjectURL(blob), [blob]);
|
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
.modal,
|
|
4
4
|
.closeButton {
|
|
5
5
|
top: 0;
|
|
6
|
-
|
|
7
|
-
[dir='ltr'] & {
|
|
8
|
-
right: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
[dir='rtl'] & {
|
|
12
|
-
left: 0;
|
|
13
|
-
}
|
|
6
|
+
inset-inline-end: 0;
|
|
14
7
|
}
|
|
15
8
|
|
|
16
9
|
.modal {
|
|
@@ -92,14 +85,7 @@
|
|
|
92
85
|
.title {
|
|
93
86
|
font-size: var(--font--size--h1);
|
|
94
87
|
font-weight: 300;
|
|
95
|
-
|
|
96
|
-
[dir='ltr'] & {
|
|
97
|
-
padding-right: calc(var(--square-button--size) + var(--spacing--s));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[dir='rtl'] & {
|
|
101
|
-
padding-left: calc(var(--square-button--size) + var(--spacing--s));
|
|
102
|
-
}
|
|
88
|
+
padding-inline-end: calc(var(--square-button--size) + var(--spacing--s));
|
|
103
89
|
}
|
|
104
90
|
|
|
105
91
|
.closeButton {
|
|
@@ -77,25 +77,11 @@
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.sharpLeft {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
border-bottom-left-radius: 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
[dir='rtl'] & {
|
|
86
|
-
border-top-right-radius: 0;
|
|
87
|
-
border-bottom-right-radius: 0;
|
|
88
|
-
}
|
|
80
|
+
border-start-start-radius: 0;
|
|
81
|
+
border-end-start-radius: 0;
|
|
89
82
|
}
|
|
90
83
|
|
|
91
84
|
.sharpRight {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
border-bottom-right-radius: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
[dir='rtl'] & {
|
|
98
|
-
border-top-left-radius: 0;
|
|
99
|
-
border-bottom-left-radius: 0;
|
|
100
|
-
}
|
|
85
|
+
border-start-end-radius: 0;
|
|
86
|
+
border-end-end-radius: 0;
|
|
101
87
|
}
|
|
@@ -25,6 +25,7 @@ $radio-box-size: $radio-size + 2 * $radio-inner-border;
|
|
|
25
25
|
|
|
26
26
|
&.disabled {
|
|
27
27
|
opacity: var(--opacity--disabled);
|
|
28
|
+
cursor: not-allowed;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -35,7 +36,7 @@ $radio-box-size: $radio-size + 2 * $radio-inner-border;
|
|
|
35
36
|
width: 100%;
|
|
36
37
|
height: 100%;
|
|
37
38
|
opacity: 0;
|
|
38
|
-
cursor:
|
|
39
|
+
cursor: inherit;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
.icon {
|