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.
Files changed (122) hide show
  1. package/.eslintignore +4 -1
  2. package/.nx/cache/d/server-process.json +1 -0
  3. package/.nx/cache/file-map.json +842 -862
  4. package/.nx/cache/lockfile.hash +1 -1
  5. package/.nx/cache/nx_files.nxt +0 -0
  6. package/.nx/workspace-data/file-map.json +2598 -0
  7. package/.nx/workspace-data/lockfile.hash +1 -0
  8. package/.nx/workspace-data/parsed-lock-file.json +31666 -0
  9. package/.nx/workspace-data/project-graph.json +31937 -0
  10. package/LICENSE +1 -1
  11. package/README.md +32 -25
  12. package/jest.setup.js +1 -1
  13. package/lerna.json +1 -1
  14. package/package.json +7 -6
  15. package/packages/configs/build/languages/english.js +1 -0
  16. package/packages/configs/package.json +3 -3
  17. package/packages/configs/src/languages/english.ts +2 -0
  18. package/packages/constants/package.json +1 -1
  19. package/packages/dictionaries/package-lock.json +2 -2
  20. package/packages/dictionaries/package.json +4 -4
  21. package/packages/logger/package-lock.json +2 -2
  22. package/packages/logger/package.json +1 -1
  23. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  24. package/packages/scrabble-solver/.next/build-manifest.json +11 -11
  25. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  26. package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
  27. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  28. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  29. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  30. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  31. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  32. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  33. package/packages/scrabble-solver/.next/prerender-manifest.js +1 -1
  34. package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
  35. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  36. package/packages/scrabble-solver/.next/server/chunks/577.js +1 -1
  37. package/packages/scrabble-solver/.next/server/chunks/807.js +1 -1
  38. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  39. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  40. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  41. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  42. package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
  43. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  44. package/packages/scrabble-solver/.next/static/chunks/{main-6e708370ad13b1f9.js → main-b5b360c6afb66b05.js} +1 -1
  45. package/packages/scrabble-solver/.next/static/chunks/pages/{404-9d5621b1ca024a45.js → 404-01653a877b233143.js} +1 -1
  46. package/packages/scrabble-solver/.next/static/chunks/pages/_app-735b5863675c1b5d.js +17 -0
  47. package/packages/scrabble-solver/.next/static/chunks/pages/{index-710b5c27542027be.js → index-36c448d585a58425.js} +1 -1
  48. package/packages/scrabble-solver/.next/static/css/6682db14f926d4c7.css +1 -0
  49. package/packages/scrabble-solver/.next/static/css/841a5b5f0b2fb131.css +2 -0
  50. package/packages/scrabble-solver/.next/static/eLvYNd4B2hzSgBZ_PuZcQ/_buildManifest.js +1 -0
  51. package/packages/scrabble-solver/.next/trace +44 -44
  52. package/packages/scrabble-solver/package-lock.json +5 -5
  53. package/packages/scrabble-solver/package.json +11 -11
  54. package/packages/scrabble-solver/public/service-worker.js +1 -1
  55. package/packages/scrabble-solver/public/service-worker.js.map +1 -1
  56. package/packages/scrabble-solver/src/components/Alert/Alert.module.scss +3 -12
  57. package/packages/scrabble-solver/src/components/Board/Board.module.scss +1 -4
  58. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -3
  59. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +27 -19
  60. package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.module.scss +7 -27
  61. package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.tsx +8 -12
  62. package/packages/scrabble-solver/src/components/Board/components/Actions/lib.ts +30 -0
  63. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +5 -32
  64. package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.module.scss +4 -18
  65. package/packages/scrabble-solver/src/components/Board/hooks/useBackgroundImage.tsx +18 -28
  66. package/packages/scrabble-solver/src/components/Button/Button.module.scss +1 -8
  67. package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss +1 -8
  68. package/packages/scrabble-solver/src/components/Loading/Loading.module.scss +1 -4
  69. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +2 -16
  70. package/packages/scrabble-solver/src/components/Rack/Rack.module.scss +4 -18
  71. package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +1 -4
  72. package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +2 -1
  73. package/packages/scrabble-solver/src/components/Results/Results.module.scss +7 -39
  74. package/packages/scrabble-solver/src/components/Results/useColumns.ts +1 -1
  75. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +9 -40
  76. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +6 -28
  77. package/packages/scrabble-solver/src/components/Tile/Tile.tsx +1 -15
  78. package/packages/scrabble-solver/src/components/Tooltip/Tooltip.module.scss +1 -0
  79. package/packages/scrabble-solver/src/components/index.ts +0 -1
  80. package/packages/scrabble-solver/src/hooks/useAppLayout.ts +0 -1
  81. package/packages/scrabble-solver/src/i18n/languages/english.json +2 -1
  82. package/packages/scrabble-solver/src/i18n/languages/french.json +2 -1
  83. package/packages/scrabble-solver/src/i18n/languages/german.json +3 -2
  84. package/packages/scrabble-solver/src/i18n/languages/persian.json +2 -1
  85. package/packages/scrabble-solver/src/i18n/languages/polish.json +2 -1
  86. package/packages/scrabble-solver/src/i18n/languages/romanian.json +2 -1
  87. package/packages/scrabble-solver/src/i18n/languages/spanish.json +2 -1
  88. package/packages/scrabble-solver/src/icons/Ban.svg +4 -0
  89. package/packages/scrabble-solver/src/icons/index.ts +1 -2
  90. package/packages/scrabble-solver/src/lib/groupResults.ts +4 -7
  91. package/packages/scrabble-solver/src/lib/index.ts +1 -0
  92. package/packages/scrabble-solver/src/lib/resultMatchesCellFilter.ts +23 -0
  93. package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +2 -2
  94. package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.module.scss +2 -15
  95. package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss +1 -7
  96. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +2 -15
  97. package/packages/scrabble-solver/src/parameters/index.ts +0 -9
  98. package/packages/scrabble-solver/src/state/sagas.ts +4 -4
  99. package/packages/scrabble-solver/src/state/selectors.ts +5 -8
  100. package/packages/scrabble-solver/src/state/slices/cellFilterInitialState.ts +2 -2
  101. package/packages/scrabble-solver/src/state/slices/cellFilterSlice.ts +29 -4
  102. package/packages/scrabble-solver/src/styles/mixins.scss +2 -5
  103. package/packages/scrabble-solver/src/types/index.ts +10 -1
  104. package/packages/solver/package-lock.json +2 -2
  105. package/packages/solver/package.json +5 -5
  106. package/packages/types/package.json +2 -2
  107. package/packages/word-definitions/package-lock.json +2 -2
  108. package/packages/word-definitions/package.json +2 -2
  109. package/packages/word-lists/package-lock.json +2 -2
  110. package/packages/word-lists/package.json +2 -2
  111. package/.eslintrc.prettier-only.js +0 -9
  112. package/packages/scrabble-solver/.next/static/QbBIK_mEs1LhYSpQwv6rZ/_buildManifest.js +0 -1
  113. package/packages/scrabble-solver/.next/static/chunks/pages/_app-7bc3bf713c40526a.js +0 -17
  114. package/packages/scrabble-solver/.next/static/css/11366b7489cf90ac.css +0 -1
  115. package/packages/scrabble-solver/.next/static/css/fe70298e6f597553.css +0 -2
  116. package/packages/scrabble-solver/src/components/Checkbox/Checkbox.module.scss +0 -45
  117. package/packages/scrabble-solver/src/components/Checkbox/Checkbox.tsx +0 -38
  118. package/packages/scrabble-solver/src/components/Checkbox/index.ts +0 -1
  119. package/packages/scrabble-solver/src/icons/CheckboxChecked.svg +0 -4
  120. package/packages/scrabble-solver/src/icons/CheckboxEmpty.svg +0 -4
  121. package/scrabble-solver.sublime-project +0 -10
  122. /package/packages/scrabble-solver/.next/static/{QbBIK_mEs1LhYSpQwv6rZ → eLvYNd4B2hzSgBZ_PuZcQ}/_ssgManifest.js +0 -0
@@ -14,18 +14,9 @@
14
14
  justify-content: center;
15
15
  padding: var(--spacing--m);
16
16
  color: var(--color--foreground--secondary);
17
-
18
- [dir='ltr'] & {
19
- border-top-left-radius: var(--border--radius);
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
- top: calc((100% - var(--size)) / 2);
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 { Point } from 'types';
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: Point[];
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
- {filteredCells.map(({ x, y }) => (
91
- <div
92
- className={styles.iconContainer}
93
- key={[x, y].join('-')}
94
- style={{
95
- height: cellSize,
96
- width: cellSize,
97
- left: direction === 'ltr' ? coordinatesSize + x * (cellSize + BORDER_WIDTH) : undefined,
98
- right: direction === 'rtl' ? coordinatesSize + x * (cellSize + BORDER_WIDTH) : undefined,
99
- top: coordinatesSize + y * (cellSize + BORDER_WIDTH),
100
- }}
101
- >
102
- <div className={styles.iconBackground} />
103
- <FlagFill className={styles.icon} />
104
- </div>
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
- [dir='ltr'] & {
22
- border-left: none;
23
- }
24
-
25
- [dir='rtl'] & {
26
- border-right: none;
27
- }
21
+ border-inline-start: none;
28
22
  }
29
23
 
30
- [dir='ltr'] & {
31
- &:first-child {
32
- border-top-right-radius: 0;
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
- [dir='rtl'] & {
43
- &:first-child {
44
- border-top-left-radius: 0;
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 { Flag, FlagFill, Keyboard, Square, SquareFill } from 'icons';
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 isFiltered = useTypedSelector((state) => selectCellIsFiltered(state, cell));
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('cell.filter-cell')}
66
+ aria-label={translate(labelTranslationKey)}
71
67
  className={classNames(styles.action)}
72
- Icon={isFiltered ? Flag : FlagFill}
73
- tooltip={translate('cell.filter-cell')}
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
- top: -100%;
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
- [dir='ltr'] & {
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
- [dir='ltr'] & {
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
- [dir='ltr'] & {
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
- [dir='ltr'] & {
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
- [dir='ltr'] & {
13
- border-top-right-radius: 0;
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
- [dir='ltr'] & {
36
- border-top-left-radius: 0;
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 { FlagFill, Star } from 'icons';
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
- <rect fill="white" height={viewBoxHeight} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
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]);
@@ -77,12 +77,5 @@
77
77
  flex: 1;
78
78
  font-size: var(--font--size--h3);
79
79
  transition: var(--transition);
80
-
81
- [dir='ltr'] & {
82
- text-align: left;
83
- }
84
-
85
- [dir='rtl'] & {
86
- text-align: right;
87
- }
80
+ text-align: start;
88
81
  }
@@ -55,14 +55,7 @@
55
55
 
56
56
  .definitions {
57
57
  margin: 0;
58
-
59
- [dir='ltr'] & {
60
- padding-left: var(--spacing--l);
61
- }
62
-
63
- [dir='rtl'] & {
64
- padding-right: var(--spacing--l);
65
- }
58
+ padding-inline-start: var(--spacing--l);
66
59
  }
67
60
 
68
61
  .definition {
@@ -1,10 +1,7 @@
1
1
  .loading,
2
2
  .dim {
3
3
  position: absolute;
4
- top: 0;
5
- bottom: 0;
6
- left: 0;
7
- right: 0;
4
+ inset: 0;
8
5
  }
9
6
 
10
7
  .loading {
@@ -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
- [dir='ltr'] & {
81
- border-top-left-radius: 0;
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
- [dir='ltr'] & {
93
- border-top-right-radius: 0;
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
  }
@@ -10,10 +10,7 @@
10
10
  @include text-input;
11
11
 
12
12
  position: absolute;
13
- top: 0;
14
- right: 0;
15
- bottom: 0;
16
- left: 0;
13
+ inset: 0;
17
14
  width: 100%;
18
15
  height: 100%;
19
16
  border-radius: var(--border--radius);
@@ -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: pointer;
39
+ cursor: inherit;
39
40
  }
40
41
 
41
42
  .icon {
@@ -24,10 +24,7 @@ $row-padding-horizontal: calc(var(--spacing--m) + var(--spacing--s));
24
24
 
25
25
  .listContainer {
26
26
  position: absolute;
27
- top: 0;
28
- left: 0;
29
- right: 0;
30
- bottom: 0;
27
+ inset: 0;
31
28
  }
32
29
 
33
30
  .list {
@@ -61,23 +58,11 @@ $row-padding-horizontal: calc(var(--spacing--m) + var(--spacing--s));
61
58
  background-color: var(--color--background);
62
59
 
63
60
  &:first-child {
64
- [dir='ltr'] & {
65
- border-top-left-radius: inherit;
66
- }
67
-
68
- [dir='rtl'] & {
69
- border-top-right-radius: inherit;
70
- }
61
+ border-start-start-radius: inherit;
71
62
  }
72
63
 
73
64
  &:last-child {
74
- [dir='ltr'] & {
75
- border-top-right-radius: inherit;
76
- }
77
-
78
- [dir='rtl'] & {
79
- border-top-left-radius: inherit;
80
- }
65
+ border-start-end-radius: inherit;
81
66
  }
82
67
  }
83
68
 
@@ -97,11 +82,7 @@ $row-padding-horizontal: calc(var(--spacing--m) + var(--spacing--s));
97
82
  @include ellipsis;
98
83
 
99
84
  flex: 0 1 auto;
100
- text-align: left;
101
-
102
- [dir='rtl'] & {
103
- text-align: right;
104
- }
85
+ text-align: start;
105
86
  }
106
87
 
107
88
  .result {
@@ -163,26 +144,13 @@ $row-padding-horizontal: calc(var(--spacing--m) + var(--spacing--s));
163
144
 
164
145
  .result &:first-child,
165
146
  .headerButton:first-child & {
166
- [dir='ltr'] & {
167
- padding-left: $row-padding-horizontal;
168
- text-align: left;
169
- }
170
-
171
- [dir='rtl'] & {
172
- padding-right: $row-padding-horizontal;
173
- text-align: right;
174
- }
147
+ text-align: start;
148
+ padding-inline-start: $row-padding-horizontal;
175
149
  }
176
150
 
177
151
  .result &:last-child,
178
152
  .headerButton:last-child & {
179
- [dir='ltr'] & {
180
- padding-right: $row-padding-horizontal;
181
- }
182
-
183
- [dir='rtl'] & {
184
- padding-left: $row-padding-horizontal;
185
- }
153
+ padding-inline-end: $row-padding-horizontal;
186
154
  }
187
155
 
188
156
  &:last-child {
@@ -7,7 +7,7 @@ import getCoordinatesColumn from './getCoordinatesColumn';
7
7
  import getLocaleColumns from './getLocaleColumns';
8
8
  import { Column } from './types';
9
9
 
10
- const COLUMNS_XS = [ResultColumn.Word, ResultColumn.Points];
10
+ const COLUMNS_XS = [ResultColumn.Coordinates, ResultColumn.Word, ResultColumn.Points];
11
11
 
12
12
  const COLUMNS_S = [...COLUMNS_XS, ResultColumn.BlanksCount, ResultColumn.WordsCount];
13
13