@scrabble-solver/scrabble-solver 2.9.1 → 2.9.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.
Files changed (56) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +9 -9
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_8dgz12 +1 -1
  5. package/.next/cache/next-server.js.nft.json +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  9. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/.next/next-server.js.nft.json +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/required-server-files.json +1 -1
  15. package/.next/routes-manifest.json +1 -1
  16. package/.next/server/chunks/413.js +6 -2
  17. package/.next/server/chunks/44.js +894 -3
  18. package/.next/server/chunks/515.js +119 -27
  19. package/.next/server/middleware-build-manifest.js +1 -1
  20. package/.next/server/pages/404.html +2 -2
  21. package/.next/server/pages/404.js.nft.json +1 -1
  22. package/.next/server/pages/500.html +2 -2
  23. package/.next/server/pages/_app.js.nft.json +1 -1
  24. package/.next/server/pages/api/dictionary/[locale]/[word].js +121 -65
  25. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  26. package/.next/server/pages/api/dictionary/[locale].js +1 -1
  27. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  28. package/.next/server/pages/api/solve.js +1 -1
  29. package/.next/server/pages/api/solve.js.nft.json +1 -1
  30. package/.next/server/pages/api/verify.js +1 -1
  31. package/.next/server/pages/api/verify.js.nft.json +1 -1
  32. package/.next/server/pages/index.html +1 -13
  33. package/.next/server/pages/index.js.nft.json +1 -1
  34. package/.next/server/pages/index.json +1 -1
  35. package/.next/static/chunks/880-18e3aea6915aebe7.js +1 -0
  36. package/.next/static/chunks/pages/{404-7082923654d5996f.js → 404-8650986dc56dab75.js} +1 -1
  37. package/.next/static/chunks/pages/{_app-10893b318367f97c.js → _app-183f598b1d4d480b.js} +1 -1
  38. package/.next/static/chunks/pages/index-f1cef1e67e14d022.js +1 -0
  39. package/.next/static/css/e8de67ad5ea35427.css +1 -0
  40. package/.next/static/s5pE_3C3ebZuSfaqE7xat/_buildManifest.js +1 -0
  41. package/.next/static/{Oki2Ia4sgLw021iM7byAe → s5pE_3C3ebZuSfaqE7xat}/_ssgManifest.js +0 -0
  42. package/.next/trace +52 -52
  43. package/LICENSE +1 -1
  44. package/package.json +11 -11
  45. package/src/components/Dictionary/Dictionary.module.scss +1 -0
  46. package/src/components/Dictionary/Dictionary.tsx +7 -2
  47. package/src/components/Logo/Logo.svg +62 -0
  48. package/src/components/Logo/index.ts +1 -1
  49. package/src/i18n/en.json +2 -2
  50. package/src/pages/api/dictionary/[locale]/[word].ts +3 -1
  51. package/.next/server/chunks/452.js +0 -894
  52. package/.next/static/Oki2Ia4sgLw021iM7byAe/_buildManifest.js +0 -1
  53. package/.next/static/chunks/317-e7d5d859f1f95938.js +0 -1
  54. package/.next/static/chunks/pages/index-b1ffeaddd9fb64b5.js +0 -1
  55. package/.next/static/css/e3d218f4ea72c5fb.css +0 -1
  56. package/public/robots.txt +0 -4
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Kamil Mielnik <kamil.adam.mielnik@gmail.com>
1
+ Copyright (c) 2022 Kamil Mielnik <kamil@kamilmielnik.com>
2
2
 
3
3
  Attribution-NonCommercial-NoDerivatives 4.0 International
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/scrabble-solver",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
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.adam.mielnik@gmail.com",
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.1",
35
- "@scrabble-solver/constants": "^2.9.1",
36
- "@scrabble-solver/dictionaries": "^2.9.1",
37
- "@scrabble-solver/logger": "^2.9.1",
38
- "@scrabble-solver/solver": "^2.9.1",
39
- "@scrabble-solver/types": "^2.9.1",
40
- "@scrabble-solver/word-definitions": "^2.9.1",
34
+ "@scrabble-solver/configs": "^2.9.3",
35
+ "@scrabble-solver/constants": "^2.9.3",
36
+ "@scrabble-solver/dictionaries": "^2.9.3",
37
+ "@scrabble-solver/logger": "^2.9.3",
38
+ "@scrabble-solver/solver": "^2.9.3",
39
+ "@scrabble-solver/types": "^2.9.3",
40
+ "@scrabble-solver/word-definitions": "^2.9.3",
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": "4849b4d123131fe043174f000c523868f3bd68c5"
77
+ "gitHead": "ef8d030cbb76256a377f747f7ebe4b85b7eba61e"
78
78
  }
@@ -53,6 +53,7 @@
53
53
 
54
54
  .definition {
55
55
  margin-bottom: var(--spacing--s);
56
+ white-space: pre-wrap;
56
57
 
57
58
  &:last-child {
58
59
  margin-bottom: 0;
@@ -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 && <div>{translate('dictionary.empty-state.no-definitions')}</div>}
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}>
@@ -0,0 +1,62 @@
1
+ <svg viewBox="0 0 682 166" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
2
+ <g transform="rotate(0, 40, 40)">
3
+ <path fill="#efe3ae" d="M 0,0 H 80 V 80 H 0 Z" />
4
+ <path aria-label="S" d="m 51.167969,47.628907 q 0,3.046875 -1.476563,5.296875 -1.476562,2.25 -4.3125,3.46875 -2.8125,1.21875 -6.84375,1.21875 -1.78125,0 -3.492187,-0.234375 -1.6875,-0.234375 -3.257813,-0.679687 -1.546875,-0.46875 -2.953125,-1.148438 v -6.75 q 2.4375,1.078125 5.0625,1.945313 2.625,0.867187 5.203125,0.867187 1.78125,0 2.859375,-0.46875 1.101563,-0.46875 1.59375,-1.289062 0.492188,-0.820313 0.492188,-1.875 0,-1.289063 -0.867188,-2.203125 -0.867187,-0.914063 -2.390625,-1.710938 -1.5,-0.796875 -3.398437,-1.710937 -1.195313,-0.5625 -2.601563,-1.359375 -1.40625,-0.820313 -2.671875,-1.992188 -1.265625,-1.171875 -2.085937,-2.835937 -0.796875,-1.6875 -0.796875,-4.03125 0,-3.070313 1.40625,-5.25 1.40625,-2.179688 4.007812,-3.328125 2.625,-1.171875 6.1875,-1.171875 2.671875,0 5.085938,0.632812 2.4375,0.609375 5.085937,1.78125 l -2.34375,5.648438 q -2.367187,-0.960938 -4.242187,-1.476563 -1.875,-0.539062 -3.820313,-0.539062 -1.359375,0 -2.320312,0.445312 -0.960938,0.421875 -1.453125,1.21875 -0.492188,0.773438 -0.492188,1.804688 0,1.21875 0.703125,2.0625 0.726563,0.820312 2.15625,1.59375 1.453125,0.773437 3.609375,1.804687 2.625,1.242188 4.476563,2.601563 1.875,1.335937 2.882812,3.164062 1.007813,1.804688 1.007813,4.5 z" />
5
+ </g>
6
+ <g transform="rotate(0, 126, 40)">
7
+ <path fill="#c7d8f9" d="m 86,0 h 80 V 80 H 86 Z" />
8
+ <path aria-label="C" d="m 129.57422,28.433595 q -2.08594,0 -3.70313,0.820312 -1.59375,0.796875 -2.69531,2.320313 -1.07812,1.523437 -1.64062,3.679687 -0.5625,2.15625 -0.5625,4.851563 0,3.632812 0.89062,6.210937 0.91406,2.554688 2.8125,3.914063 1.89844,1.335937 4.89844,1.335937 2.08594,0 4.17187,-0.46875 2.10938,-0.46875 4.57032,-1.335937 v 6.09375 q -2.27344,0.9375 -4.47657,1.335937 -2.20312,0.421875 -4.94531,0.421875 -5.29687,0 -8.71875,-2.179687 -3.39844,-2.203125 -5.03906,-6.140625 -1.64063,-3.960938 -1.64063,-9.234375 0,-3.890625 1.05469,-7.125 1.05469,-3.234375 3.09375,-5.601563 2.03906,-2.367187 5.03906,-3.65625 3,-1.289062 6.89063,-1.289062 2.55469,0 5.10937,0.65625 2.57813,0.632812 4.92188,1.757812 l -2.34375,5.90625 q -1.92188,-0.914062 -3.86719,-1.59375 -1.94531,-0.679687 -3.82031,-0.679687 z" />
9
+ </g>
10
+ <g transform="rotate(0, 212, 40)">
11
+ <path fill="#efe3ae" d="m 172,0 h 80 v 80 h -80 z" />
12
+ <path aria-label="R" d="m 210.45312,22.867188 q 4.66407,0 7.6875,1.125 3.04688,1.125 4.52344,3.398438 1.47656,2.273437 1.47656,5.742187 0,2.34375 -0.89062,4.101563 -0.89063,1.757812 -2.34375,2.976562 -1.45313,1.21875 -3.14063,1.992188 l 10.07813,14.929687 h -8.0625 l -8.17969,-13.148437 h -3.86719 v 13.148437 h -7.26562 V 22.867188 Z m -0.51562,5.953125 h -2.20313 v 9.257813 h 2.34375 q 3.60938,0 5.15625,-1.195313 1.57032,-1.21875 1.57032,-3.5625 0,-2.4375 -1.6875,-3.46875 -1.66407,-1.03125 -5.17969,-1.03125 z" />
13
+ </g>
14
+ <g transform="rotate(0, 298, 40)">
15
+ <path fill="#efe3ae" d="m 258,0 h 80 v 80 h -80 z" />
16
+ <path aria-label="A" d="m 306.73047,57.203126 -2.48438,-8.15625 h -12.49218 l -2.48438,8.15625 h -7.82812 l 12.09375,-34.40625 h 8.88281 l 12.14062,34.40625 z m -4.21875,-14.25 -2.48438,-7.96875 q -0.23437,-0.796875 -0.63281,-2.039063 -0.375,-1.265625 -0.77344,-2.554687 -0.375,-1.3125 -0.60937,-2.273438 -0.23438,0.960938 -0.65625,2.390625 -0.39844,1.40625 -0.77344,2.671875 -0.375,1.265625 -0.53906,1.804688 l -2.46094,7.96875 z" />
17
+ </g>
18
+ <g transform="rotate(0, 384, 40)">
19
+ <path fill="#c7d8f9" d="m 344,0 h 80 v 80 h -80 z" />
20
+ <path aria-label="B" d="m 372.1875,22.867188 h 10.66406 q 6.84375,0 10.35938,1.921875 3.51562,1.921875 3.51562,6.75 0,1.945313 -0.63281,3.515625 -0.60938,1.570313 -1.78125,2.578125 -1.17188,1.007813 -2.85938,1.3125 v 0.234375 q 1.71094,0.351563 3.09375,1.21875 1.38282,0.84375 2.20313,2.484375 0.84375,1.617188 0.84375,4.3125 0,3.117188 -1.52344,5.34375 -1.52344,2.226563 -4.35937,3.421875 -2.8125,1.171875 -6.70313,1.171875 H 372.1875 Z m 7.26562,13.570313 h 4.21875 q 3.16407,0 4.38282,-0.984375 1.21875,-1.007813 1.21875,-2.953125 0,-1.96875 -1.45313,-2.8125 -1.42969,-0.867188 -4.54687,-0.867188 h -3.82032 z m 0,5.765625 v 8.929687 h 4.73438 q 3.28125,0 4.57031,-1.265625 1.28906,-1.265625 1.28906,-3.398437 0,-1.265625 -0.5625,-2.226563 -0.5625,-0.960937 -1.89843,-1.5 -1.3125,-0.539062 -3.63282,-0.539062 z" />
21
+ </g>
22
+ <g transform="rotate(0, 470, 40)">
23
+ <path fill="#c7d8f9" d="m 430,0 h 80 v 80 h -80 z" />
24
+ <path aria-label="B" d="m 458.1875,22.867188 h 10.66406 q 6.84375,0 10.35938,1.921875 3.51562,1.921875 3.51562,6.75 0,1.945313 -0.63281,3.515625 -0.60938,1.570313 -1.78125,2.578125 -1.17188,1.007813 -2.85938,1.3125 v 0.234375 q 1.71094,0.351563 3.09375,1.21875 1.38282,0.84375 2.20313,2.484375 0.84375,1.617188 0.84375,4.3125 0,3.117188 -1.52344,5.34375 -1.52344,2.226563 -4.35937,3.421875 -2.8125,1.171875 -6.70313,1.171875 H 458.1875 Z m 7.26562,13.570313 h 4.21875 q 3.16407,0 4.38282,-0.984375 1.21875,-1.007813 1.21875,-2.953125 0,-1.96875 -1.45313,-2.8125 -1.42969,-0.867188 -4.54687,-0.867188 h -3.82032 z m 0,5.765625 v 8.929687 h 4.73438 q 3.28125,0 4.57031,-1.265625 1.28906,-1.265625 1.28906,-3.398437 0,-1.265625 -0.5625,-2.226563 -0.5625,-0.960937 -1.89843,-1.5 -1.3125,-0.539062 -3.63282,-0.539062 z" />
25
+ </g>
26
+ <g transform="rotate(0, 556, 40)">
27
+ <path fill="#efe3ae" d="m 516,0 h 80 v 80 h -80 z" />
28
+ <path aria-label="L" d="M 546.75391,57.132813 V 22.867188 h 7.26562 v 28.265625 h 13.89844 v 6 z" />
29
+ </g>
30
+ <g transform="rotate(0, 642, 40)">
31
+ <path fill="#efe3ae" d="m 602,0 h 80 v 80 h -80 z" />
32
+ <path aria-label="E" d="M 652.60547,57.132813 H 632.87109 V 22.867188 h 19.73438 v 5.953125 h -12.46875 v 7.523438 h 11.60156 v 5.953125 h -11.60156 v 8.835937 h 12.46875 z" />
33
+ </g>
34
+ <g transform="rotate(0, 40, 40)">
35
+ <path fill="#efe3ae" d="m 0,86 h 80 v 80 H 0 Z" />
36
+ <path aria-label="S" d="m 51.320312,133.6289 q 0,3.04688 -1.476562,5.29688 -1.476563,2.25 -4.3125,3.46875 -2.8125,1.21875 -6.84375,1.21875 -1.78125,0 -3.492188,-0.23438 -1.6875,-0.23437 -3.257812,-0.67968 -1.546875,-0.46875 -2.953125,-1.14844 v -6.75 q 2.4375,1.07812 5.0625,1.94531 2.625,0.86719 5.203125,0.86719 1.78125,0 2.859375,-0.46875 1.101562,-0.46875 1.59375,-1.28906 0.492187,-0.82032 0.492187,-1.875 0,-1.28907 -0.867187,-2.20313 -0.867188,-0.91406 -2.390625,-1.71094 -1.5,-0.79687 -3.398438,-1.71093 -1.195312,-0.5625 -2.601562,-1.35938 -1.40625,-0.82031 -2.671875,-1.99219 Q 31,123.83203 30.179687,122.16797 q -0.796875,-1.6875 -0.796875,-4.03125 0,-3.07032 1.40625,-5.25 1.40625,-2.17969 4.007813,-3.32813 2.625,-1.17187 6.1875,-1.17187 2.671875,0 5.085937,0.63281 2.4375,0.60937 5.085938,1.78125 l -2.34375,5.64844 q -2.367188,-0.96094 -4.242188,-1.47657 -1.875,-0.53906 -3.820312,-0.53906 -1.359375,0 -2.320313,0.44531 -0.960937,0.42188 -1.453125,1.21875 -0.492187,0.77344 -0.492187,1.80469 0,1.21875 0.703125,2.0625 0.726562,0.82031 2.15625,1.59375 1.453125,0.77344 3.609375,1.80469 2.625,1.24219 4.476562,2.60156 1.875,1.33594 2.882813,3.16406 1.007812,1.80469 1.007812,4.5 z" />
37
+ </g>
38
+ <g transform="rotate(0, 126, 40)">
39
+ <path fill="#efe3ae" d="m 86,86 h 80 v 80 H 86 Z" />
40
+ <path aria-label="O" d="m 142.3125,125.98828 q 0,3.96094 -0.98438,7.21875 -0.98437,3.23437 -3,5.57812 -1.99218,2.34375 -5.0625,3.60938 -3.07031,1.24219 -7.26562,1.24219 -4.19531,0 -7.26562,-1.24219 -3.07032,-1.26563 -5.08594,-3.60938 -1.99219,-2.34375 -2.97656,-5.60156 -0.98438,-3.25781 -0.98438,-7.24219 0,-5.32031 1.73438,-9.25781 1.75781,-3.96094 5.39062,-6.14062 3.63281,-2.17969 9.23438,-2.17969 5.57812,0 9.16406,2.17969 3.60937,2.17968 5.34375,6.14062 1.75781,3.96094 1.75781,9.30469 z m -25.00781,0 q 0,3.58594 0.89062,6.1875 0.91407,2.57812 2.83594,3.98437 1.92188,1.38282 4.96875,1.38282 3.09375,0 5.01562,-1.38282 1.92188,-1.40625 2.78907,-3.98437 0.89062,-2.60156 0.89062,-6.1875 0,-5.39063 -2.01562,-8.48438 -2.01563,-3.09375 -6.63281,-3.09375 -3.07032,0 -5.01563,1.40625 -1.92187,1.38282 -2.83594,3.98438 -0.89062,2.57812 -0.89062,6.1875 z" />
41
+ </g>
42
+ <g transform="rotate(0, 212, 40)">
43
+ <path fill="#efe3ae" d="m 172,86 h 80 v 80 h -80 z" />
44
+ <path aria-label="L" d="m 202.75391,143.13281 v -34.26563 h 7.26562 v 28.26563 h 13.89844 v 6 z" />
45
+ </g>
46
+ <g transform="rotate(0, 298, 40)">
47
+ <path fill="#f7c2aa" d="m 258,86 h 80 v 80 h -80 z" />
48
+ <path aria-label="V" d="m 313.59766,108.86718 -11.64844,34.26563 h -7.92188 l -11.625,-34.26563 h 7.33594 l 6.44531,20.39063 q 0.16407,0.51562 0.53907,1.94531 0.375,1.40625 0.75,3 0.39843,1.57031 0.53906,2.60156 0.14062,-1.03125 0.49219,-2.60156 0.375,-1.57031 0.72656,-2.97656 0.375,-1.42969 0.53906,-1.96875 l 6.49219,-20.39063 z" />
49
+ </g>
50
+ <g transform="rotate(0, 384, 40)">
51
+ <path fill="#efe3ae" d="m 344,86 h 80 v 80 h -80 z" />
52
+ <path aria-label="E" d="m 394.60547,143.13281 h -19.73438 v -34.26563 h 19.73438 v 5.95313 h -12.46875 v 7.52344 h 11.60156 v 5.95312 h -11.60156 v 8.83594 h 12.46875 z" />
53
+ </g>
54
+ <g transform="rotate(0, 470, 40)">
55
+ <path fill="#efe3ae" d="m 430,86 h 80 v 80 h -80 z" />
56
+ <path aria-label="R" d="m 468.45312,108.86718 q 4.66407,0 7.6875,1.125 3.04688,1.125 4.52344,3.39844 1.47656,2.27344 1.47656,5.74219 0,2.34375 -0.89062,4.10156 -0.89063,1.75781 -2.34375,2.97656 -1.45313,1.21875 -3.14063,1.99219 l 10.07813,14.92969 h -8.0625 l -8.17969,-13.14844 h -3.86719 v 13.14844 h -7.26562 v -34.26563 z m -0.51562,5.95313 h -2.20313 v 9.25781 h 2.34375 q 3.60938,0 5.15625,-1.19531 1.57032,-1.21875 1.57032,-3.5625 0,-2.4375 -1.6875,-3.46875 -1.66407,-1.03125 -5.17969,-1.03125 z" />
57
+ </g>
58
+ <g transform="rotate(0, 642, 40)">
59
+ <path fill="#bae3ba" d="m 602,86 h 80 v 80 h -80 z" />
60
+ <path aria-label="2" d="m 654.15234,143.3789 h -23.95312 v -5.03906 l 8.60156,-8.69531 q 2.60156,-2.67188 4.17188,-4.45313 1.59375,-1.80468 2.29687,-3.28125 0.72656,-1.47656 0.72656,-3.16406 0,-2.03906 -1.14843,-3.04687 -1.125,-1.03125 -3.02344,-1.03125 -1.99219,0 -3.86719,0.91406 -1.875,0.91406 -3.91406,2.60156 l -3.9375,-4.66406 q 1.47656,-1.26563 3.11719,-2.39063 1.66406,-1.125 3.84375,-1.80468 2.20312,-0.70313 5.27343,-0.70313 3.375,0 5.78907,1.21875 2.4375,1.21875 3.75,3.32813 1.3125,2.08593 1.3125,4.73437 0,2.83594 -1.125,5.17969 -1.125,2.34375 -3.28125,4.64062 -2.13282,2.29688 -5.15625,5.08594 l -4.40625,4.14844 v 0.32812 h 14.92968 z" />
61
+ </g>
62
+ </svg>
@@ -1 +1 @@
1
- export { default } from './Logo';
1
+ export { default } from './Logo.svg';
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 last highlighted word will be shown here.",
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 results = await Promise.all(words.map((word) => getWordDefinition(locale, word)));
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';