@scrabble-solver/scrabble-solver 2.11.1 → 2.11.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 +6 -6
- 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/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/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/210.js +109 -0
- package/.next/server/chunks/277.js +380 -258
- package/.next/server/chunks/44.js +47 -0
- package/.next/server/chunks/987.js +91 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -73
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js +3 -4
- package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale].js +3 -4
- package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/.next/server/pages/api/solve.js +38 -13
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js +5 -5
- package/.next/server/pages/api/verify.js.nft.json +1 -1
- package/.next/server/pages/api/visit.js +3 -4
- package/.next/server/pages/api/visit.js.nft.json +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +141 -237
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/static/{esK8DG-6aS5V7QFRtR3YE → USLkKOoHbITebIEHkMGX_}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/_app-21c83ddb81fc09d0.js +28 -0
- package/.next/static/chunks/pages/index-0858deea02b2a417.js +1 -0
- package/.next/static/css/885da289cec275b3.css +1 -0
- package/.next/static/css/ea1c8134fe9a143e.css +2 -0
- package/.next/trace +53 -53
- package/package.json +9 -9
- package/src/api/index.ts +1 -0
- package/src/api/isCellValid.ts +3 -2
- package/src/api/isCharacterValid.ts +13 -0
- package/src/components/Board/components/Cell/Cell.module.scss +10 -2
- package/src/components/Board/hooks/useGrid.ts +1 -2
- package/src/components/Board/lib/getPositionInGrid.ts +1 -1
- package/src/components/Button/Button.module.scss +14 -1
- package/src/components/LogoSplashScreen/LogoSplashScreen.module.scss +4 -1
- package/src/components/Modal/Modal.module.scss +21 -1
- package/src/components/Modal/Modal.tsx +4 -1
- package/src/components/NotFound/NotFound.module.scss +13 -4
- package/src/components/NotFound/NotFound.tsx +4 -7
- package/src/components/Rack/Rack.tsx +3 -1
- package/src/components/Results/HeaderButton.tsx +5 -12
- package/src/components/Results/Result.tsx +5 -3
- package/src/components/Results/Results.module.scss +13 -1
- package/src/components/Results/Results.tsx +29 -43
- package/src/components/Results/types.ts +1 -1
- package/src/components/Solver/Solver.module.scss +4 -0
- package/src/components/Solver/Solver.tsx +9 -12
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -6
- package/src/components/Tile/Tile.module.scss +53 -79
- package/src/components/Tile/Tile.tsx +1 -3
- package/src/components/Tile/TilePure.tsx +4 -14
- package/src/hooks/useAppLayout.ts +3 -1
- package/src/i18n/constants.ts +65 -0
- package/src/i18n/de.json +1 -1
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +1 -1
- package/src/i18n/fa.json +1 -1
- package/src/i18n/fr.json +1 -1
- package/src/i18n/i18n.module.scss +27 -0
- package/src/i18n/pl.json +1 -1
- package/src/icons/DashCircleFill.svg +1 -0
- package/src/icons/EyeFill.svg +5 -0
- package/src/icons/index.ts +3 -2
- package/src/lib/createRegExp.ts +13 -0
- package/src/lib/groupResults.ts +38 -0
- package/src/lib/guessLocale.ts +22 -0
- package/src/lib/index.ts +4 -1
- package/src/lib/sortResults.ts +6 -10
- package/src/modals/DictionaryModal/DictionaryModal.module.scss +0 -1
- package/src/modals/MenuModal/MenuModal.module.scss +23 -0
- package/src/modals/MenuModal/MenuModal.tsx +8 -2
- package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +4 -1
- package/src/modals/RemainingTilesModal/components/Character/Character.module.scss +8 -0
- package/src/modals/ResultsModal/ResultsModal.module.scss +2 -3
- package/src/modals/ResultsModal/ResultsModal.tsx +47 -11
- package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +3 -44
- package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +4 -2
- package/src/pages/api/dictionary/[locale]/[word].ts +0 -1
- package/src/pages/api/dictionary/[locale]/index.ts +0 -1
- package/src/pages/api/solve.ts +3 -3
- package/src/pages/api/verify.ts +0 -1
- package/src/pages/api/visit.ts +0 -1
- package/src/pages/index.tsx +13 -15
- package/src/parameters/index.ts +2 -2
- package/src/state/sagas.ts +1 -0
- package/src/state/selectors.ts +37 -37
- package/src/state/slices/boardInitialState.ts +3 -1
- package/src/state/slices/cellFilterInitialState.ts +3 -3
- package/src/state/slices/cellFilterSlice.ts +3 -1
- package/src/state/slices/dictionaryInitialState.ts +2 -2
- package/src/state/slices/rackInitialState.ts +3 -1
- package/src/state/slices/resultsInitialState.ts +11 -4
- package/src/state/slices/settingsInitialState.ts +10 -21
- package/src/state/slices/solveInitialState.ts +2 -2
- package/src/state/slices/solveSlice.ts +2 -0
- package/src/state/slices/verifyInitialState.ts +13 -4
- package/src/styles/mixins.scss +5 -1
- package/src/styles/variables.scss +13 -0
- package/src/types/index.ts +11 -2
- package/.next/server/chunks/417.js +0 -221
- package/.next/server/chunks/664.js +0 -621
- package/.next/static/chunks/pages/_app-270526803bc274eb.js +0 -28
- package/.next/static/chunks/pages/index-c6e7754ccf3532df.js +0 -1
- package/.next/static/css/ad39b36eab07e613.css +0 -1
- package/.next/static/css/e5803e581e4c0451.css +0 -2
- package/src/components/Board/types/index.ts +0 -4
- package/src/modals/SettingsModal/components/LocaleSetting/options.ts +0 -68
- /package/.next/static/{esK8DG-6aS5V7QFRtR3YE → USLkKOoHbITebIEHkMGX_}/_ssgManifest.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { WordDefinition } from '@scrabble-solver/types';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
export interface DictionaryState {
|
|
4
4
|
error: unknown | undefined;
|
|
5
5
|
input: string;
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
results: WordDefinition[];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const dictionaryInitialState:
|
|
10
|
+
const dictionaryInitialState: DictionaryState = {
|
|
11
11
|
error: undefined,
|
|
12
12
|
input: '',
|
|
13
13
|
isLoading: false,
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Result } from '@scrabble-solver/types';
|
|
2
2
|
|
|
3
|
-
import { ResultColumn, SortDirection } from 'types';
|
|
3
|
+
import { ResultColumn, Sort, SortDirection } from 'types';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
candidate:
|
|
5
|
+
export interface ResultsState {
|
|
6
|
+
candidate: Result | null;
|
|
7
|
+
query: string;
|
|
8
|
+
results: Result[] | undefined;
|
|
9
|
+
sort: Sort;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const resultsInitialState: ResultsState = {
|
|
13
|
+
candidate: null,
|
|
7
14
|
query: '',
|
|
8
|
-
results: undefined
|
|
15
|
+
results: undefined,
|
|
9
16
|
sort: {
|
|
10
17
|
column: ResultColumn.Points,
|
|
11
18
|
direction: SortDirection.Descending,
|
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import { scrabble } from '@scrabble-solver/configs';
|
|
1
|
+
import { literaki, scrabble } from '@scrabble-solver/configs';
|
|
2
2
|
import { Locale } from '@scrabble-solver/types';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
if (!globalThis.navigator) {
|
|
6
|
-
return Locale.EN_US;
|
|
7
|
-
}
|
|
4
|
+
import { guessLocale } from 'lib';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export interface SettingsState {
|
|
7
|
+
autoGroupTiles: 'left' | 'right' | null;
|
|
8
|
+
configId: typeof literaki.id | typeof scrabble.id;
|
|
9
|
+
locale: Locale;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const partialMatch = locales.find((locale) => {
|
|
17
|
-
return globalThis.navigator.language === locale.substring(0, 2);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return partialMatch || Locale.EN_US;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const settingsInitialState = {
|
|
24
|
-
autoGroupTiles: 'left' as 'left' | 'right' | null,
|
|
12
|
+
const settingsInitialState: SettingsState = {
|
|
13
|
+
autoGroupTiles: 'left',
|
|
25
14
|
configId: scrabble.id,
|
|
26
|
-
locale:
|
|
15
|
+
locale: guessLocale(),
|
|
27
16
|
};
|
|
28
17
|
|
|
29
18
|
export default settingsInitialState;
|
|
@@ -2,7 +2,7 @@ import { Board } from '@scrabble-solver/types';
|
|
|
2
2
|
|
|
3
3
|
import boardInitialState from './boardInitialState';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
export interface SolveState {
|
|
6
6
|
error: unknown | undefined;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
lastSolvedParameters: {
|
|
@@ -11,7 +11,7 @@ interface SolveInitialState {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const solveInitialState:
|
|
14
|
+
const solveInitialState: SolveState = {
|
|
15
15
|
error: undefined,
|
|
16
16
|
isLoading: false,
|
|
17
17
|
lastSolvedParameters: {
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import boardInitialState from './boardInitialState';
|
|
1
|
+
import boardInitialState, { BoardState } from './boardInitialState';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export interface VerifyState {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
lastSolvedParameters: {
|
|
6
|
+
board: BoardState;
|
|
7
|
+
};
|
|
8
|
+
invalidWords: string[];
|
|
9
|
+
validWords: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const verifyInitialState: VerifyState = {
|
|
4
13
|
isLoading: false,
|
|
5
14
|
lastSolvedParameters: {
|
|
6
15
|
board: boardInitialState,
|
|
7
16
|
},
|
|
8
|
-
invalidWords: []
|
|
9
|
-
validWords: []
|
|
17
|
+
invalidWords: [],
|
|
18
|
+
validWords: [],
|
|
10
19
|
};
|
|
11
20
|
|
|
12
21
|
export default verifyInitialState;
|
package/src/styles/mixins.scss
CHANGED
|
@@ -43,7 +43,6 @@ $media-expressions: (
|
|
|
43
43
|
position: relative;
|
|
44
44
|
|
|
45
45
|
&::after {
|
|
46
|
-
content: '';
|
|
47
46
|
position: absolute;
|
|
48
47
|
top: 0;
|
|
49
48
|
right: 0;
|
|
@@ -63,6 +62,7 @@ $media-expressions: (
|
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
&::after {
|
|
65
|
+
content: '';
|
|
66
66
|
box-shadow: 0 0 0 var(--focus-effect--size) var(--color--focus);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -119,7 +119,9 @@ $media-expressions: (
|
|
|
119
119
|
input {
|
|
120
120
|
position: absolute;
|
|
121
121
|
top: -100%;
|
|
122
|
+
right: -100%;
|
|
122
123
|
left: -100%;
|
|
124
|
+
bottom: -100%;
|
|
123
125
|
width: 300%;
|
|
124
126
|
height: 300%;
|
|
125
127
|
clip-path: inset((100% / 3));
|
|
@@ -151,6 +153,7 @@ $media-expressions: (
|
|
|
151
153
|
&:nth-child(3) {
|
|
152
154
|
input {
|
|
153
155
|
left: -200%;
|
|
156
|
+
right: 0;
|
|
154
157
|
clip-path: polygon((200% / 3) (100% / 3), 100% (100% / 3), 100% (200% / 3), (200% / 3) (200% / 3));
|
|
155
158
|
}
|
|
156
159
|
}
|
|
@@ -160,6 +163,7 @@ $media-expressions: (
|
|
|
160
163
|
&:nth-last-child(3) {
|
|
161
164
|
input {
|
|
162
165
|
left: 0;
|
|
166
|
+
right: -200%;
|
|
163
167
|
clip-path: polygon(0 (100% / 3), (100% / 3) (100% / 3), (100% / 3) (200% / 3), 0 (200% / 3));
|
|
164
168
|
}
|
|
165
169
|
}
|
|
@@ -12,9 +12,13 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
|
|
|
12
12
|
--box-shadow: 0 0 var(--box-shadow--blur) var(--box-shadow--spread) var(--box-shadow--color);
|
|
13
13
|
--box-shadow--blur: 8px;
|
|
14
14
|
--box-shadow--color: rgba(0, 0, 0, 0.15);
|
|
15
|
+
--box-shadow--color--inverse: rgba(255, 255, 255, 0.85);
|
|
16
|
+
--box-shadow--color--raised: rgba(34, 34, 34, 0.8);
|
|
15
17
|
--box-shadow--spread: 1px;
|
|
16
18
|
--box-shadow--null: 0 0 var(--box-shadow--blur) var(--box-shadow--spread) transparent;
|
|
17
19
|
--box-shadow--error: 0 0 var(--box-shadow--blur) var(--box-shadow--spread) var(--color--error);
|
|
20
|
+
--box-shadow--raised: inset -2px -2px 2px -1px var(--box-shadow--color--raised);
|
|
21
|
+
--box-shadow--raised--subtle: inset -1px -1px 1px 0 var(--box-shadow--color--raised);
|
|
18
22
|
|
|
19
23
|
--color--white: #ffffff;
|
|
20
24
|
--color--blue: #c7d8f9;
|
|
@@ -41,6 +45,7 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
|
|
|
41
45
|
--color--success: #00a900;
|
|
42
46
|
--color--warning: hsl(35, 90%, 60%);
|
|
43
47
|
--color--primary: var(--color--violet);
|
|
48
|
+
--color--primary--light: var(--color--violet--light);
|
|
44
49
|
--color--primary--opposite: var(--color--white);
|
|
45
50
|
|
|
46
51
|
--color--bonus--character--1: var(--color--yellow--light);
|
|
@@ -93,6 +98,14 @@ $easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);
|
|
|
93
98
|
--z-index--close-button: 101;
|
|
94
99
|
--z-index--tooltip: 102;
|
|
95
100
|
|
|
101
|
+
--flag--de--aspect-ratio: 20 / 12;
|
|
102
|
+
--flag--es--aspect-ratio: 750 / 500;
|
|
103
|
+
--flag--fa--aspect-ratio: 630 / 360;
|
|
104
|
+
--flag--fr--aspect-ratio: 24 / 15;
|
|
105
|
+
--flag--gb--aspect-ratio: 60 / 30;
|
|
106
|
+
--flag--pl--aspect-ratio: 16 / 10;
|
|
107
|
+
--flag--us--aspect-ratio: 7410 / 3900;
|
|
108
|
+
|
|
96
109
|
--button--icon--size: 24px;
|
|
97
110
|
--dictionary--height: 260px;
|
|
98
111
|
--modal--width: 370px;
|
package/src/types/index.ts
CHANGED
|
@@ -2,6 +2,16 @@ export type Comparator<T> = (a: T, B: T) => number;
|
|
|
2
2
|
|
|
3
3
|
export type Direction = 'horizontal' | 'vertical';
|
|
4
4
|
|
|
5
|
+
export interface Point {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Sort {
|
|
11
|
+
column: ResultColumn;
|
|
12
|
+
direction: SortDirection;
|
|
13
|
+
}
|
|
14
|
+
|
|
5
15
|
export enum SortDirection {
|
|
6
16
|
Ascending = 'ascending',
|
|
7
17
|
Descending = 'descending',
|
|
@@ -30,7 +40,6 @@ export enum ResultColumn {
|
|
|
30
40
|
Word = 'word',
|
|
31
41
|
WordsCount = 'words-count',
|
|
32
42
|
}
|
|
33
|
-
|
|
34
43
|
export type TranslationKey =
|
|
35
44
|
| 'cell.filter-cell'
|
|
36
45
|
| 'cell.set-blank'
|
|
@@ -78,12 +87,12 @@ export type TranslationKey =
|
|
|
78
87
|
| 'rack.tile.location'
|
|
79
88
|
| 'remaining-tiles'
|
|
80
89
|
| 'results'
|
|
81
|
-
| 'results.empty-state.no-filtered-results'
|
|
82
90
|
| 'results.empty-state.no-results'
|
|
83
91
|
| 'results.empty-state.outdated'
|
|
84
92
|
| 'results.empty-state.uninitialized'
|
|
85
93
|
| 'results.input.placeholder'
|
|
86
94
|
| 'results.insert'
|
|
95
|
+
| 'results.preview'
|
|
87
96
|
| 'results.solve'
|
|
88
97
|
| 'settings'
|
|
89
98
|
| 'settings.autoGroupTiles'
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 417;
|
|
3
|
-
exports.ids = [417];
|
|
4
|
-
exports.modules = {
|
|
5
|
-
|
|
6
|
-
/***/ 38436:
|
|
7
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11
|
-
exports.VOWELS = exports.CONSONANTS = exports.NO_BONUS = exports.EMPTY_CELL = exports.BONUS_WORD = exports.BONUS_CHARACTER = exports.BLANK = exports.COMMA_LATIN = exports.COMMA_ARABIC = void 0;
|
|
12
|
-
exports.COMMA_ARABIC = '،';
|
|
13
|
-
exports.COMMA_LATIN = ',';
|
|
14
|
-
exports.BLANK = ' ';
|
|
15
|
-
exports.BONUS_CHARACTER = 'BONUS_CHARACTER';
|
|
16
|
-
exports.BONUS_WORD = 'BONUS_WORD';
|
|
17
|
-
exports.EMPTY_CELL = ' ';
|
|
18
|
-
exports.NO_BONUS = { characterMultiplier: 1, wordMultiplier: 1 };
|
|
19
|
-
exports.CONSONANTS = [
|
|
20
|
-
'b',
|
|
21
|
-
'c',
|
|
22
|
-
'ć',
|
|
23
|
-
'd',
|
|
24
|
-
'f',
|
|
25
|
-
'g',
|
|
26
|
-
'h',
|
|
27
|
-
'j',
|
|
28
|
-
'k',
|
|
29
|
-
'l',
|
|
30
|
-
'ł',
|
|
31
|
-
'm',
|
|
32
|
-
'n',
|
|
33
|
-
'ń',
|
|
34
|
-
'ñ',
|
|
35
|
-
'p',
|
|
36
|
-
'q',
|
|
37
|
-
'r',
|
|
38
|
-
's',
|
|
39
|
-
'ś',
|
|
40
|
-
't',
|
|
41
|
-
'v',
|
|
42
|
-
'w',
|
|
43
|
-
'x',
|
|
44
|
-
'z',
|
|
45
|
-
'ź',
|
|
46
|
-
'ż',
|
|
47
|
-
];
|
|
48
|
-
exports.VOWELS = ['a', 'ą', 'ä', 'e', 'ę', 'i', 'o', 'ó', 'ö', 'u', 'ü', 'y'];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/***/ }),
|
|
52
|
-
|
|
53
|
-
/***/ 98793:
|
|
54
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
58
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59
|
-
};
|
|
60
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
61
|
-
exports.OUTPUT_DIRECTORY = void 0;
|
|
62
|
-
const os_1 = __importDefault(__webpack_require__(22037));
|
|
63
|
-
const path_1 = __importDefault(__webpack_require__(71017));
|
|
64
|
-
exports.OUTPUT_DIRECTORY = path_1.default.resolve(os_1.default.homedir(), '.scrabble-solver', 'logs');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
/***/ }),
|
|
68
|
-
|
|
69
|
-
/***/ 52954:
|
|
70
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
74
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
75
|
-
};
|
|
76
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
77
|
-
exports["default"] = void 0;
|
|
78
|
-
var logger_1 = __webpack_require__(6730);
|
|
79
|
-
Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return __importDefault(logger_1).default; } }));
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/***/ }),
|
|
83
|
-
|
|
84
|
-
/***/ 6730:
|
|
85
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
89
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
90
|
-
};
|
|
91
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
92
|
-
const path_1 = __importDefault(__webpack_require__(71017));
|
|
93
|
-
const winston_1 = __webpack_require__(46050);
|
|
94
|
-
const constants_1 = __webpack_require__(98793);
|
|
95
|
-
const logger = (0, winston_1.createLogger)({
|
|
96
|
-
level: 'info',
|
|
97
|
-
format: winston_1.format.combine(winston_1.format.timestamp({
|
|
98
|
-
format: 'YYYY-MM-DD HH:mm:ss',
|
|
99
|
-
}), winston_1.format.errors({ stack: true }), winston_1.format.splat(), winston_1.format.json(), winston_1.format.prettyPrint()),
|
|
100
|
-
transports: [
|
|
101
|
-
new winston_1.transports.File({
|
|
102
|
-
filename: path_1.default.resolve(constants_1.OUTPUT_DIRECTORY, 'error.log'),
|
|
103
|
-
level: 'error',
|
|
104
|
-
}),
|
|
105
|
-
new winston_1.transports.File({
|
|
106
|
-
filename: path_1.default.resolve(constants_1.OUTPUT_DIRECTORY, 'all.log'),
|
|
107
|
-
}),
|
|
108
|
-
new winston_1.transports.Console({
|
|
109
|
-
format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.simple()),
|
|
110
|
-
level: 'error',
|
|
111
|
-
}),
|
|
112
|
-
],
|
|
113
|
-
});
|
|
114
|
-
exports["default"] = logger;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/***/ }),
|
|
118
|
-
|
|
119
|
-
/***/ 78570:
|
|
120
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// EXPORTS
|
|
124
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
125
|
-
"X8": () => (/* reexport */ api_getServerLoggingData),
|
|
126
|
-
"p2": () => (/* reexport */ api_isBoardValid)
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// UNUSED EXPORTS: isCellValid, isRowValid
|
|
130
|
-
|
|
131
|
-
;// CONCATENATED MODULE: ./src/api/getServerLoggingData.ts
|
|
132
|
-
const getServerLoggingData = (request)=>({
|
|
133
|
-
origin: request.headers.origin,
|
|
134
|
-
referer: request.headers.referer,
|
|
135
|
-
userAgent: request.headers["user-agent"],
|
|
136
|
-
xForwardedFor: request.headers["x-forwarded-for"],
|
|
137
|
-
xRealIp: request.headers["x-real-ip"]
|
|
138
|
-
});
|
|
139
|
-
/* harmony default export */ const api_getServerLoggingData = (getServerLoggingData);
|
|
140
|
-
|
|
141
|
-
// EXTERNAL MODULE: ../constants/build/index.js
|
|
142
|
-
var build = __webpack_require__(38436);
|
|
143
|
-
;// CONCATENATED MODULE: ./src/api/isCellValid.ts
|
|
144
|
-
|
|
145
|
-
const isCellValid = (cell, config)=>{
|
|
146
|
-
const { isEmpty , tile , x , y } = cell;
|
|
147
|
-
if (x < 0 || x >= config.boardWidth) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
if (y < 0 || y >= config.boardHeight) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
if (isEmpty && tile !== null) {
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
if (tile !== null && !config.hasCharacter(tile.character) && tile.character !== build.BLANK) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
};
|
|
161
|
-
/* harmony default export */ const api_isCellValid = (isCellValid);
|
|
162
|
-
|
|
163
|
-
;// CONCATENATED MODULE: ./src/api/isRowValid.ts
|
|
164
|
-
|
|
165
|
-
const isRowValid = (row, config)=>{
|
|
166
|
-
if (row.length !== config.boardWidth) {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
for (const cell of row){
|
|
170
|
-
if (!api_isCellValid(cell, config)) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return true;
|
|
175
|
-
};
|
|
176
|
-
/* harmony default export */ const api_isRowValid = (isRowValid);
|
|
177
|
-
|
|
178
|
-
;// CONCATENATED MODULE: ./src/api/isBoardValid.ts
|
|
179
|
-
|
|
180
|
-
const isBoardValid = (board, config)=>{
|
|
181
|
-
if (board.length !== config.boardHeight) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
for (const row of board){
|
|
185
|
-
if (!api_isRowValid(row, config)) {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return areTwoCharacterTilesValid(board, config);
|
|
190
|
-
};
|
|
191
|
-
const areTwoCharacterTilesValid = (board, config)=>{
|
|
192
|
-
const cells = board.flat().filter((cell)=>cell && cell.tile && config.isTwoCharacterTilePrefix(cell.tile.character));
|
|
193
|
-
for (const cell of cells){
|
|
194
|
-
for (const characters of config.twoCharacterTiles){
|
|
195
|
-
const canCheckDown = cell.y + 1 < board.length;
|
|
196
|
-
const canCheckRight = cell.x + 1 < board[0].length;
|
|
197
|
-
const cellDown = board[cell.y + 1][cell.x];
|
|
198
|
-
const cellRight = board[cell.y][cell.x + 1];
|
|
199
|
-
const collidesDown = canCheckDown && cellDown.tile && cellDown.tile.character === characters[1];
|
|
200
|
-
const collidesRight = canCheckRight && cellRight.tile && cellRight.tile.character === characters[1];
|
|
201
|
-
const collides = collidesDown || collidesRight;
|
|
202
|
-
if (cell.tile && characters.startsWith(cell.tile.character) && collides) {
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return true;
|
|
208
|
-
};
|
|
209
|
-
/* harmony default export */ const api_isBoardValid = (isBoardValid);
|
|
210
|
-
|
|
211
|
-
;// CONCATENATED MODULE: ./src/api/index.ts
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
/***/ })
|
|
219
|
-
|
|
220
|
-
};
|
|
221
|
-
;
|