@scrabble-solver/scrabble-solver 2.9.1 → 2.9.2
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 +7 -7
- 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/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/413.js +6 -2
- package/.next/server/chunks/44.js +894 -3
- package/.next/server/chunks/515.js +10 -3
- 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 +2 -2
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js +121 -65
- package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/.next/server/pages/api/solve.js +1 -1
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js +1 -1
- package/.next/server/pages/api/verify.js.nft.json +1 -1
- package/.next/server/pages/index.html +2 -2
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/static/{Oki2Ia4sgLw021iM7byAe → Ntg-ilwD7GqTIFwRpSaTQ}/_buildManifest.js +1 -1
- package/.next/static/{Oki2Ia4sgLw021iM7byAe → Ntg-ilwD7GqTIFwRpSaTQ}/_ssgManifest.js +0 -0
- package/.next/static/chunks/{317-e7d5d859f1f95938.js → 317-5e5334962dd7c681.js} +1 -1
- package/.next/static/chunks/pages/{_app-10893b318367f97c.js → _app-183f598b1d4d480b.js} +1 -1
- package/.next/static/css/e8de67ad5ea35427.css +1 -0
- package/.next/trace +52 -52
- package/LICENSE +1 -1
- package/package.json +11 -11
- package/src/components/Dictionary/Dictionary.module.scss +1 -0
- package/src/components/Dictionary/Dictionary.tsx +7 -2
- package/src/i18n/en.json +2 -2
- package/src/pages/api/dictionary/[locale]/[word].ts +3 -1
- package/.next/server/chunks/452.js +0 -894
- package/.next/static/css/e3d218f4ea72c5fb.css +0 -1
- package/public/robots.txt +0 -4
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/scrabble-solver",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Scrabble Solver 2 - App",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"author": {
|
|
13
13
|
"name": "Kamil Mielnik",
|
|
14
|
-
"email": "kamil
|
|
15
|
-
"url": "https://kamilmielnik.com
|
|
14
|
+
"email": "kamil@kamilmielnik.com",
|
|
15
|
+
"url": "https://kamilmielnik.com"
|
|
16
16
|
},
|
|
17
17
|
"license": "CC BY-NC-ND 4.0",
|
|
18
18
|
"bugs": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@kamilmielnik/trie": "^2.0.1",
|
|
32
32
|
"@popperjs/core": "^2.11.6",
|
|
33
33
|
"@reduxjs/toolkit": "^1.8.6",
|
|
34
|
-
"@scrabble-solver/configs": "^2.9.
|
|
35
|
-
"@scrabble-solver/constants": "^2.9.
|
|
36
|
-
"@scrabble-solver/dictionaries": "^2.9.
|
|
37
|
-
"@scrabble-solver/logger": "^2.9.
|
|
38
|
-
"@scrabble-solver/solver": "^2.9.
|
|
39
|
-
"@scrabble-solver/types": "^2.9.
|
|
40
|
-
"@scrabble-solver/word-definitions": "^2.9.
|
|
34
|
+
"@scrabble-solver/configs": "^2.9.2",
|
|
35
|
+
"@scrabble-solver/constants": "^2.9.2",
|
|
36
|
+
"@scrabble-solver/dictionaries": "^2.9.2",
|
|
37
|
+
"@scrabble-solver/logger": "^2.9.2",
|
|
38
|
+
"@scrabble-solver/solver": "^2.9.2",
|
|
39
|
+
"@scrabble-solver/types": "^2.9.2",
|
|
40
|
+
"@scrabble-solver/word-definitions": "^2.9.2",
|
|
41
41
|
"classnames": "^2.3.2",
|
|
42
42
|
"next": "^12.3.1",
|
|
43
43
|
"normalize.css": "^8.0.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"sass": "^1.55.0",
|
|
75
75
|
"workbox-webpack-plugin": "^6.5.4"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "f50d782088cb89544f0c2c504f31fca81a6ff409"
|
|
78
78
|
}
|
|
@@ -31,7 +31,7 @@ const Dictionary: FunctionComponent<Props> = ({ className }) => {
|
|
|
31
31
|
</EmptyState>
|
|
32
32
|
)}
|
|
33
33
|
|
|
34
|
-
{results.map(({ definitions, isAllowed, word }) => (
|
|
34
|
+
{results.map(({ definitions, exists, isAllowed, word }) => (
|
|
35
35
|
<div
|
|
36
36
|
className={classNames(styles.result, {
|
|
37
37
|
[styles.isAllowed]: isAllowed === true,
|
|
@@ -51,7 +51,12 @@ const Dictionary: FunctionComponent<Props> = ({ className }) => {
|
|
|
51
51
|
|
|
52
52
|
{isAllowed === true && (
|
|
53
53
|
<>
|
|
54
|
-
{definitions.length === 0 &&
|
|
54
|
+
{definitions.length === 0 && (
|
|
55
|
+
<>
|
|
56
|
+
{exists && <div>{translate('dictionary.empty-state.no-definitions')}</div>}
|
|
57
|
+
{!exists && <div>{translate('dictionary.empty-state.no-results')}</div>}
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
55
60
|
|
|
56
61
|
{definitions.length > 0 && (
|
|
57
62
|
<ul className={styles.definitions}>
|
package/src/i18n/en.json
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"common.word": "Word",
|
|
16
16
|
"common.words": "Words",
|
|
17
17
|
"dictionary.empty-state.no-definitions": "Word exists in the dictionary but it does not have a definition.",
|
|
18
|
-
"dictionary.empty-state.no-results": "Unable to find word definition in dictionary.",
|
|
18
|
+
"dictionary.empty-state.no-results": "Unable to find word definition in the dictionary.",
|
|
19
19
|
"dictionary.empty-state.not-allowed": "This word is not allowed.",
|
|
20
|
-
"dictionary.empty-state.uninitialized": "Dictionary definition of the
|
|
20
|
+
"dictionary.empty-state.uninitialized": "Dictionary definition of the most recently highlighted word will be shown here.",
|
|
21
21
|
"dictionary.input.placeholder": "Search dictionary...",
|
|
22
22
|
"empty-state.error": "Error",
|
|
23
23
|
"empty-state.info": "Info",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { scrabble } from '@scrabble-solver/configs';
|
|
2
|
+
import { dictionaries } from '@scrabble-solver/dictionaries';
|
|
2
3
|
import logger from '@scrabble-solver/logger';
|
|
3
4
|
import { isLocale, Locale } from '@scrabble-solver/types';
|
|
4
5
|
import { getWordDefinition } from '@scrabble-solver/word-definitions';
|
|
@@ -27,7 +28,8 @@ const dictionary = async (request: NextApiRequest, response: NextApiResponse): P
|
|
|
27
28
|
},
|
|
28
29
|
});
|
|
29
30
|
|
|
30
|
-
const
|
|
31
|
+
const trie = await dictionaries.get(locale);
|
|
32
|
+
const results = await Promise.all(words.map((word) => getWordDefinition(locale, word, trie.has(word))));
|
|
31
33
|
response.status(200).send(results.map((result) => result.toJson()));
|
|
32
34
|
} catch (error) {
|
|
33
35
|
const message = error instanceof Error ? error.message : 'Unknown error';
|