@scrabble-solver/scrabble-solver 2.13.6 → 2.13.8
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/chunks/977.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/_app.js +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/api/solve.js +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/server/pages-manifest.json +1 -1
- package/.next/static/7zESQYo9UAqNh9LV0b7Sd/_buildManifest.js +1 -0
- package/.next/static/chunks/{main-6e708370ad13b1f9.js → main-b5b360c6afb66b05.js} +1 -1
- package/.next/static/chunks/pages/{404-129e0943628b6fab.js → 404-63b972b24be99c62.js} +1 -1
- package/.next/static/chunks/pages/_app-a2848b7efa6bb6b0.js +17 -0
- package/.next/static/chunks/pages/index-7b73be2915cc7099.js +1 -0
- package/.next/static/css/6682db14f926d4c7.css +1 -0
- package/.next/static/css/b37850c8d5270d91.css +2 -0
- package/.next/trace +44 -44
- package/package.json +12 -13
- package/src/components/Alert/Alert.module.scss +3 -12
- package/src/components/Board/Board.module.scss +1 -4
- package/src/components/Board/BoardPure.tsx +1 -1
- package/src/components/Board/components/Actions/Actions.module.scss +7 -27
- 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 +15 -4
- package/src/components/Board/hooks/useGrid.ts +13 -5
- package/src/components/Board/lib/index.ts +0 -1
- package/src/components/Button/Button.module.scss +1 -8
- package/src/components/Button/Button.tsx +16 -17
- package/src/components/Button/Link.tsx +15 -16
- package/src/components/Dictionary/Dictionary.module.scss +1 -8
- package/src/components/IconButton/IconButton.tsx +8 -8
- package/src/components/IconButton/Link.tsx +8 -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/Results/Cell.tsx +4 -5
- package/src/components/Results/HeaderButton.tsx +25 -22
- package/src/components/Results/Result.tsx +15 -3
- package/src/components/Results/Results.module.scss +31 -48
- package/src/components/Results/Results.tsx +1 -1
- package/src/components/Results/getCoordinatesColumn.ts +15 -0
- package/src/components/Results/getLocaleColumns.ts +7 -0
- package/src/components/Results/types.ts +1 -0
- package/src/components/Results/useColumns.ts +10 -7
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +9 -40
- package/src/components/Tile/Tile.module.scss +6 -26
- package/src/components/Tooltip/Tooltip.tsx +28 -0
- package/src/components/Tooltip/TooltipContent.tsx +53 -0
- package/src/components/Tooltip/TooltipTrigger.tsx +26 -0
- package/src/components/Tooltip/context.ts +17 -0
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Tooltip/useTooltip.ts +54 -0
- package/src/components/index.ts +1 -2
- package/src/hooks/index.ts +0 -1
- package/src/i18n/languages/german.json +1 -1
- package/src/icons/index.ts +0 -2
- package/src/lib/getCoordinates.ts +18 -0
- package/src/lib/groupResults.ts +16 -11
- package/src/lib/index.ts +2 -1
- package/src/lib/sortResults.ts +1 -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/pages/_app.tsx +5 -1
- package/src/parameters/index.ts +1 -0
- package/src/styles/mixins.scss +2 -5
- package/src/types/index.ts +1 -0
- package/.next/static/4GWIKe7khKxREyq3ZamDK/_buildManifest.js +0 -1
- package/.next/static/chunks/pages/_app-cccda36d00fa2328.js +0 -17
- package/.next/static/chunks/pages/index-caaf20b2488cb10e.js +0 -1
- package/.next/static/css/11366b7489cf90ac.css +0 -1
- package/.next/static/css/f549d7823f599b8d.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/components/Tooltip/useTooltip.tsx +0 -134
- package/src/hooks/usePortal.tsx +0 -47
- package/src/icons/CheckboxChecked.svg +0 -4
- package/src/icons/CheckboxEmpty.svg +0 -4
- package/src/lib/canUseDom.ts +0 -3
- /package/.next/static/{4GWIKe7khKxREyq3ZamDK → 7zESQYo9UAqNh9LV0b7Sd}/_ssgManifest.js +0 -0
- /package/src/{components/Board/lib → lib}/getCoordinate.ts +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Placement,
|
|
3
|
+
arrow,
|
|
4
|
+
autoUpdate,
|
|
5
|
+
flip,
|
|
6
|
+
offset,
|
|
7
|
+
shift,
|
|
8
|
+
useDelayGroup,
|
|
9
|
+
useDismiss,
|
|
10
|
+
useFloating,
|
|
11
|
+
useFocus,
|
|
12
|
+
useHover,
|
|
13
|
+
useInteractions,
|
|
14
|
+
useRole,
|
|
15
|
+
} from '@floating-ui/react';
|
|
16
|
+
import { useMemo, useRef, useState } from 'react';
|
|
17
|
+
|
|
18
|
+
const ARROW_SIZE = 7;
|
|
19
|
+
const ARROW_GAP = 3;
|
|
20
|
+
const PADDING = 10;
|
|
21
|
+
|
|
22
|
+
interface TooltipOptions {
|
|
23
|
+
placement?: Placement;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const useTooltip = ({ placement = 'top' }: TooltipOptions = {}) => {
|
|
27
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
28
|
+
const arrowRef = useRef(null);
|
|
29
|
+
const data = useFloating({
|
|
30
|
+
placement,
|
|
31
|
+
open: isOpen,
|
|
32
|
+
onOpenChange: setIsOpen,
|
|
33
|
+
whileElementsMounted: autoUpdate,
|
|
34
|
+
middleware: [flip(), shift({ padding: PADDING }), offset(ARROW_SIZE + ARROW_GAP), arrow({ element: arrowRef })],
|
|
35
|
+
});
|
|
36
|
+
const { context } = data;
|
|
37
|
+
const { delay } = useDelayGroup(context);
|
|
38
|
+
const hover = useHover(context, { move: false, delay });
|
|
39
|
+
const focus = useFocus(context);
|
|
40
|
+
const dismiss = useDismiss(context);
|
|
41
|
+
const role = useRole(context, { role: 'tooltip' });
|
|
42
|
+
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
43
|
+
|
|
44
|
+
return useMemo(
|
|
45
|
+
() => ({
|
|
46
|
+
arrowRef,
|
|
47
|
+
open: isOpen,
|
|
48
|
+
setOpen: setIsOpen,
|
|
49
|
+
...interactions,
|
|
50
|
+
...data,
|
|
51
|
+
}),
|
|
52
|
+
[arrowRef, isOpen, setIsOpen, interactions, data],
|
|
53
|
+
);
|
|
54
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ export { default as Alert } from './Alert';
|
|
|
2
2
|
export { default as Badge } from './Badge';
|
|
3
3
|
export { default as Board } from './Board';
|
|
4
4
|
export { default as Button } from './Button';
|
|
5
|
-
export { default as Checkbox } from './Checkbox';
|
|
6
5
|
export { default as Dictionary } from './Dictionary';
|
|
7
6
|
export { default as DictionaryInput } from './DictionaryInput';
|
|
8
7
|
export { default as EmptyState } from './EmptyState';
|
|
@@ -23,4 +22,4 @@ export { default as SeoMessage } from './SeoMessage';
|
|
|
23
22
|
export { default as Solver } from './Solver';
|
|
24
23
|
export { default as Spinner } from './Spinner';
|
|
25
24
|
export { default as Tile } from './Tile';
|
|
26
|
-
export
|
|
25
|
+
export * from './Tooltip';
|
package/src/hooks/index.ts
CHANGED
|
@@ -9,5 +9,4 @@ export { default as useMedia } from './useMedia';
|
|
|
9
9
|
export { default as useMediaQueries } from './useMediaQueries';
|
|
10
10
|
export { default as useMediaQuery } from './useMediaQuery';
|
|
11
11
|
export { default as useOnWindowResize } from './useOnWindowResize';
|
|
12
|
-
export { default as usePortal } from './usePortal';
|
|
13
12
|
export { default as useViewportSize } from './useViewportSize';
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dictionary.empty-state.no-definitions": "Wort existiert im Wörterbuch aber hat keine Definition.",
|
|
23
23
|
"dictionary.empty-state.no-results": "Wort kann nicht im Wörterbuch gefunden werden.",
|
|
24
24
|
"dictionary.empty-state.not-allowed": "Dieses Wort ist nicht erlaubt.",
|
|
25
|
-
"dictionary.empty-state.uninitialized": "Die
|
|
25
|
+
"dictionary.empty-state.uninitialized": "Die Wörterbuchdefinition wird hier angezeigt.",
|
|
26
26
|
"dictionary.input.placeholder": "Durchsuche Wörterbuch…",
|
|
27
27
|
"dictionary.input.title": "Durch Kommas getrennte Wörter",
|
|
28
28
|
"empty-state.error": "Fehler",
|
package/src/icons/index.ts
CHANGED
|
@@ -5,8 +5,6 @@ export { default as ArrowUp } from './ArrowUp.svg';
|
|
|
5
5
|
export { default as BookHalf } from './BookHalf.svg';
|
|
6
6
|
export { default as CardChecklist } from './CardChecklist.svg';
|
|
7
7
|
export { default as Check } from './Check.svg';
|
|
8
|
-
export { default as CheckboxChecked } from './CheckboxChecked.svg';
|
|
9
|
-
export { default as CheckboxEmpty } from './CheckboxEmpty.svg';
|
|
10
8
|
export { default as ChevronDown } from './ChevronDown.svg';
|
|
11
9
|
export { default as ChevronLeft } from './ChevronLeft.svg';
|
|
12
10
|
export { default as ChevronRight } from './ChevronRight.svg';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Result, ShowCoordinates } from '@scrabble-solver/types';
|
|
2
|
+
|
|
3
|
+
import getCoordinate from './getCoordinate';
|
|
4
|
+
|
|
5
|
+
const getCoordinates = (result: Result, showCoordinates: ShowCoordinates): string => {
|
|
6
|
+
if (showCoordinates === 'hidden') {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const firstCell = result.cells[0];
|
|
11
|
+
const isHorizontal = firstCell.x !== result.cells[1].x;
|
|
12
|
+
const x = getCoordinate(firstCell.x, showCoordinates === 'original' ? 'letter' : 'number');
|
|
13
|
+
const y = getCoordinate(firstCell.y, showCoordinates === 'original' ? 'number' : 'letter');
|
|
14
|
+
|
|
15
|
+
return isHorizontal ? `${y}${x}` : `${x}${y}`;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default getCoordinates;
|
package/src/lib/groupResults.ts
CHANGED
|
@@ -18,18 +18,23 @@ const groupResults = (
|
|
|
18
18
|
return results;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const regExp = createRegExp(query);
|
|
22
|
+
|
|
21
23
|
return results.reduce<GroupedResults>(
|
|
22
|
-
(
|
|
23
|
-
const matchesQuery =
|
|
24
|
-
const matchesCellFilter =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
matching
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
(groupedResults, result) => {
|
|
25
|
+
const matchesQuery = () => regExp.test(result.word);
|
|
26
|
+
const matchesCellFilter = () =>
|
|
27
|
+
cellFilter.every(({ x, y }) => {
|
|
28
|
+
return result.cells.some((cell) => cell.x === x && cell.y === y);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (matchesCellFilter() && matchesQuery()) {
|
|
32
|
+
groupedResults.matching.push(result);
|
|
33
|
+
} else {
|
|
34
|
+
groupedResults.other.push(result);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return groupedResults;
|
|
33
38
|
},
|
|
34
39
|
{ matching: [], other: [] },
|
|
35
40
|
);
|
package/src/lib/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as arrayEquals } from './arrayEquals';
|
|
2
|
-
export { default as canUseDom } from './canUseDom';
|
|
3
2
|
export { default as createArray } from './createArray';
|
|
4
3
|
export { default as createComparator } from './createComparator';
|
|
5
4
|
export { default as createGridOf } from './createGridOf';
|
|
@@ -15,6 +14,8 @@ export { default as extractCharactersByCase } from './extractCharactersByCase';
|
|
|
15
14
|
export { default as extractInputValue } from './extractInputValue';
|
|
16
15
|
export { default as findCell } from './findCell';
|
|
17
16
|
export { default as getCellSize } from './getCellSize';
|
|
17
|
+
export { default as getCoordinate } from './getCoordinate';
|
|
18
|
+
export { default as getCoordinates } from './getCoordinates';
|
|
18
19
|
export { default as getRemainingTiles } from './getRemainingTiles';
|
|
19
20
|
export { default as getRemainingTilesCount } from './getRemainingTilesCount';
|
|
20
21
|
export { default as getRemainingTilesGroups } from './getRemainingTilesGroups';
|
package/src/lib/sortResults.ts
CHANGED
|
@@ -8,6 +8,7 @@ import reverseComparator from './reverseComparator';
|
|
|
8
8
|
const comparators: Record<ResultColumn, (locale: string) => Comparator<Result>> = {
|
|
9
9
|
[ResultColumn.BlanksCount]: (locale: string) => createKeyComparator('blanksCount', locale),
|
|
10
10
|
[ResultColumn.ConsonantsCount]: (locale: string) => createKeyComparator('consonantsCount', locale),
|
|
11
|
+
[ResultColumn.Coordinates]: () => () => 0,
|
|
11
12
|
[ResultColumn.Points]: (locale: string) => createKeyComparator('points', locale),
|
|
12
13
|
[ResultColumn.TilesCount]: (locale: string) => createKeyComparator('tilesCount', locale),
|
|
13
14
|
[ResultColumn.VowelsCount]: (locale: string) => createKeyComparator('vowelsCount', locale),
|
|
@@ -31,13 +31,7 @@
|
|
|
31
31
|
--aspect-ratio: var(--highest-flag-aspect-ratio);
|
|
32
32
|
--padding: calc(var(--spacing--l) + var(--button--icon--size) * var(--aspect-ratio));
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
padding-right: var(--padding);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[dir='rtl'] & {
|
|
39
|
-
padding-left: var(--padding);
|
|
40
|
-
}
|
|
34
|
+
padding-inline-end: var(--padding);
|
|
41
35
|
}
|
|
42
36
|
|
|
43
37
|
.flag {
|
|
@@ -45,12 +39,5 @@
|
|
|
45
39
|
height: var(--button--icon--size);
|
|
46
40
|
border-radius: var(--border--radius);
|
|
47
41
|
box-shadow: 0 0 0 1px var(--box-shadow--color);
|
|
48
|
-
|
|
49
|
-
[dir='ltr'] & {
|
|
50
|
-
right: calc(2 * var(--spacing--l));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
[dir='rtl'] & {
|
|
54
|
-
left: calc(2 * var(--spacing--l));
|
|
55
|
-
}
|
|
42
|
+
inset-inline-end: calc(2 * var(--spacing--l));
|
|
56
43
|
}
|
|
@@ -6,13 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.badge {
|
|
9
|
-
|
|
10
|
-
margin-left: var(--spacing--m);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[dir='rtl'] & {
|
|
14
|
-
margin-right: var(--spacing--m);
|
|
15
|
-
}
|
|
9
|
+
margin-inline-start: var(--spacing--m);
|
|
16
10
|
}
|
|
17
11
|
|
|
18
12
|
.word {
|
|
@@ -37,12 +31,5 @@
|
|
|
37
31
|
|
|
38
32
|
width: $size;
|
|
39
33
|
height: $size;
|
|
40
|
-
|
|
41
|
-
[dir='ltr'] & {
|
|
42
|
-
margin-right: var(--spacing--s);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
[dir='rtl'] & {
|
|
46
|
-
margin-left: var(--spacing--s);
|
|
47
|
-
}
|
|
34
|
+
margin-inline-end: var(--spacing--s);
|
|
48
35
|
}
|
package/src/pages/_app.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FloatingDelayGroup } from '@floating-ui/react';
|
|
1
2
|
import { AppProps } from 'next/app';
|
|
2
3
|
import Head from 'next/head';
|
|
3
4
|
import { FunctionComponent } from 'react';
|
|
@@ -64,7 +65,10 @@ const App: FunctionComponent<AppProps> = ({ Component, pageProps }) => (
|
|
|
64
65
|
|
|
65
66
|
<Provider store={store}>
|
|
66
67
|
<SeoMessage />
|
|
67
|
-
|
|
68
|
+
|
|
69
|
+
<FloatingDelayGroup delay={0}>
|
|
70
|
+
<Component {...pageProps} />
|
|
71
|
+
</FloatingDelayGroup>
|
|
68
72
|
</Provider>
|
|
69
73
|
</>
|
|
70
74
|
);
|
package/src/parameters/index.ts
CHANGED
|
@@ -90,6 +90,7 @@ export const MODAL_HEADER_HEIGHT = 45;
|
|
|
90
90
|
export const NAV_PADDING = SPACING_L;
|
|
91
91
|
|
|
92
92
|
export const TILE_SIZE = 80;
|
|
93
|
+
export const TOOLTIP_DURATION = TRANSITION_DURATION;
|
|
93
94
|
|
|
94
95
|
export const PLAIN_TILES_COLOR_DEFAULT = COLOR_GREEN;
|
|
95
96
|
export const PLAIN_TILES_PADDING_HORIZONTAL = 0;
|
package/src/styles/mixins.scss
CHANGED
|
@@ -14,7 +14,7 @@ $media-expressions: (
|
|
|
14
14
|
|
|
15
15
|
@mixin scrollbars {
|
|
16
16
|
scrollbar-color: var(--scrollbar--thumb--color) var(--scrollbar--thumb--track);
|
|
17
|
-
scrollbar-width:
|
|
17
|
+
scrollbar-width: thin;
|
|
18
18
|
|
|
19
19
|
&::-webkit-scrollbar {
|
|
20
20
|
width: var(--scrollbar--size);
|
|
@@ -44,10 +44,7 @@ $media-expressions: (
|
|
|
44
44
|
|
|
45
45
|
&::after {
|
|
46
46
|
position: absolute;
|
|
47
|
-
|
|
48
|
-
right: 0;
|
|
49
|
-
bottom: 0;
|
|
50
|
-
left: 0;
|
|
47
|
+
inset: 0;
|
|
51
48
|
z-index: var(--z-index--focus-effect);
|
|
52
49
|
transition: var(--transition);
|
|
53
50
|
border-radius: var(--border--radius);
|
package/src/types/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/css/11366b7489cf90ac.css","static/chunks/pages/index-caaf20b2488cb10e.js"],"/404":["static/chunks/pages/404-129e0943628b6fab.js"],"/_error":["static/chunks/pages/_error-6f16571cf9224b25.js"],sortedPages:["/","/404","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|