scrabble-solver 2.15.12 → 2.15.14

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 (112) hide show
  1. package/.github/workflows/npx.yml +5 -1
  2. package/.nx/workspace-data/file-map.json +528 -528
  3. package/.nx/workspace-data/lockfile.hash +1 -1
  4. package/.nx/workspace-data/nx_files.nxt +0 -0
  5. package/.nx/workspace-data/parsed-lock-file.json +2319 -1589
  6. package/.nx/workspace-data/project-graph.json +2055 -1767
  7. package/README.md +2 -2
  8. package/eslint.config.mjs +4 -9
  9. package/lerna.json +1 -1
  10. package/package.json +28 -28
  11. package/packages/configs/package.json +3 -3
  12. package/packages/constants/package.json +1 -1
  13. package/packages/dictionaries/package.json +4 -4
  14. package/packages/logger/package.json +1 -1
  15. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  16. package/packages/scrabble-solver/.next/build-manifest.json +15 -15
  17. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -0
  18. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  19. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  20. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  21. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  22. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  23. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  24. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  25. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  26. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  27. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  28. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  29. package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
  30. package/packages/scrabble-solver/.next/next-minimal-server.js.nft.json +1 -1
  31. package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
  32. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  33. package/packages/scrabble-solver/.next/required-server-files.json +23 -14
  34. package/packages/scrabble-solver/.next/routes-manifest.json +11 -7
  35. package/packages/scrabble-solver/.next/server/chunks/30.js +4 -4
  36. package/packages/scrabble-solver/.next/server/chunks/318.js +1 -1
  37. package/packages/scrabble-solver/.next/server/chunks/717.js +1 -0
  38. package/packages/scrabble-solver/.next/server/chunks/791.js +19 -0
  39. package/packages/scrabble-solver/.next/server/chunks/812.js +1 -1
  40. package/packages/scrabble-solver/.next/server/chunks/829.js +1 -0
  41. package/packages/scrabble-solver/.next/server/chunks/929.js +1 -0
  42. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  43. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  44. package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
  45. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  46. package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
  47. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  48. package/packages/scrabble-solver/.next/server/pages/_document.js +1 -1
  49. package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
  50. package/packages/scrabble-solver/.next/server/pages/_error.js +1 -1
  51. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  52. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
  53. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  54. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
  55. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  56. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  57. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  58. package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
  59. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  60. package/packages/scrabble-solver/.next/server/pages/api/visit.js +1 -1
  61. package/packages/scrabble-solver/.next/server/pages/api/visit.js.nft.json +1 -1
  62. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  63. package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
  64. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  65. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  66. package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +1 -1
  67. package/packages/scrabble-solver/.next/server/webpack-runtime.js +1 -1
  68. package/packages/scrabble-solver/.next/static/{X6ny8arpUxpRCZ4OMm7Vo → UHBG2hxudxuZNMubluQ6A}/_buildManifest.js +1 -1
  69. package/packages/scrabble-solver/.next/static/chunks/framework-e4d8bdda7b6c00b3.js +1 -0
  70. package/packages/scrabble-solver/.next/static/chunks/main-40732898df2b5947.js +1 -0
  71. package/packages/scrabble-solver/.next/static/chunks/pages/404-3ab23f01145bda71.js +1 -0
  72. package/packages/scrabble-solver/.next/static/chunks/pages/_app-ca98ddb1c33cb8b1.js +1 -0
  73. package/packages/scrabble-solver/.next/static/chunks/pages/{_error-7ea2d37f66343175.js → _error-e7f663d1e0f43380.js} +1 -1
  74. package/packages/scrabble-solver/.next/static/chunks/pages/index-5c4af5351329bef5.js +1 -0
  75. package/packages/scrabble-solver/.next/static/css/d611d31bf52b6e25.css +2 -0
  76. package/packages/scrabble-solver/.next/trace +24 -23
  77. package/packages/scrabble-solver/.next/types/routes.d.ts +57 -0
  78. package/packages/scrabble-solver/.next/types/validator.ts +107 -0
  79. package/packages/scrabble-solver/next-env.d.ts +1 -0
  80. package/packages/scrabble-solver/package.json +20 -20
  81. package/packages/scrabble-solver/public/service-worker.js +2 -2
  82. package/packages/scrabble-solver/public/service-worker.js.map +1 -1
  83. package/packages/scrabble-solver/src/components/Results/Result.tsx +13 -17
  84. package/packages/scrabble-solver/src/components/Results/Results.tsx +23 -24
  85. package/packages/solver/package.json +5 -5
  86. package/packages/types/build/Board.js +2 -2
  87. package/packages/types/package.json +2 -2
  88. package/packages/types/src/Board.ts +2 -2
  89. package/packages/word-definitions/build/languages/romanian.js +1 -1
  90. package/packages/word-definitions/package.json +4 -4
  91. package/packages/word-definitions/src/__tests__/input/ro-RO.aciua.html +27 -29
  92. package/packages/word-definitions/src/languages/romanian.ts +1 -1
  93. package/packages/word-lists/build/languages/english.js +2 -2
  94. package/packages/word-lists/build/languages/french.js +1 -1
  95. package/packages/word-lists/build/languages/german.js +1 -1
  96. package/packages/word-lists/build/languages/persian.js +1 -1
  97. package/packages/word-lists/build/languages/polish.js +23 -9
  98. package/packages/word-lists/package.json +4 -4
  99. package/packages/word-lists/src/languages/english.ts +4 -2
  100. package/packages/word-lists/src/languages/french.ts +2 -1
  101. package/packages/word-lists/src/languages/german.ts +2 -1
  102. package/packages/word-lists/src/languages/persian.ts +2 -1
  103. package/packages/word-lists/src/languages/polish.ts +27 -10
  104. package/packages/scrabble-solver/.next/server/chunks/60.js +0 -1
  105. package/packages/scrabble-solver/.next/server/chunks/974.js +0 -1
  106. package/packages/scrabble-solver/.next/static/chunks/framework-57125a0cc6749ff9.js +0 -1
  107. package/packages/scrabble-solver/.next/static/chunks/main-03618e8bd3cd04dd.js +0 -1
  108. package/packages/scrabble-solver/.next/static/chunks/pages/404-18b9f6f5faa91442.js +0 -1
  109. package/packages/scrabble-solver/.next/static/chunks/pages/_app-2378fe90e1762e8c.js +0 -1
  110. package/packages/scrabble-solver/.next/static/chunks/pages/index-bfc599d9351773ae.js +0 -1
  111. package/packages/scrabble-solver/.next/static/css/1fae874a25934f54.css +0 -2
  112. /package/packages/scrabble-solver/.next/static/{X6ny8arpUxpRCZ4OMm7Vo → UHBG2hxudxuZNMubluQ6A}/_ssgManifest.js +0 -0
@@ -1,6 +1,7 @@
1
1
  import classNames from 'classnames';
2
- import { type CSSProperties, type FocusEventHandler, type MouseEventHandler, type ReactElement, useRef } from 'react';
2
+ import { type FocusEventHandler, type MouseEventHandler, type ReactElement, useRef } from 'react';
3
3
  import Highlighter from 'react-highlight-words';
4
+ import { type RowComponentProps } from 'react-window';
4
5
 
5
6
  import { useAppLayout, useColumns } from 'hooks';
6
7
  import { LOCALE_FEATURES } from 'i18n';
@@ -18,22 +19,17 @@ import { Cell } from './Cell';
18
19
  import styles from './Results.module.scss';
19
20
  import { type ResultData } from './types';
20
21
 
21
- interface Props {
22
- data: ResultData;
23
- index: number;
24
- style?: CSSProperties;
25
- }
26
-
27
- export const Result = ({ data, index, style }: Props): ReactElement => {
28
- const {
29
- highlightedIndex,
30
- results = [],
31
- onBlur = noop,
32
- onClick = noop,
33
- onFocus = noop,
34
- onMouseEnter = noop,
35
- onMouseLeave = noop,
36
- } = data;
22
+ export const Result = ({
23
+ index,
24
+ highlightedIndex,
25
+ results = [],
26
+ onBlur = noop,
27
+ onClick = noop,
28
+ onFocus = noop,
29
+ onMouseEnter = noop,
30
+ onMouseLeave = noop,
31
+ style,
32
+ }: RowComponentProps<ResultData>): ReactElement => {
37
33
  const { resultWordWidth } = useAppLayout();
38
34
  const ref = useRef<HTMLButtonElement>(null);
39
35
  const columns = useColumns();
@@ -1,17 +1,17 @@
1
1
  import classNames from 'classnames';
2
- import { type FunctionComponent, useEffect, useMemo, useState } from 'react';
3
- import { FixedSizeList } from 'react-window';
2
+ import { useEffect, useMemo, type FunctionComponent } from 'react';
3
+ import { List, useListRef } from 'react-window';
4
4
  import { useDebounce } from 'use-debounce';
5
5
 
6
- import { useAppLayout, useLatest } from 'hooks';
6
+ import { useLatest } from 'hooks';
7
7
  import { LOCALE_FEATURES } from 'i18n';
8
- import { BORDER_WIDTH, RESULTS_HEADER_HEIGHT, RESULTS_ITEM_HEIGHT, TEXT_INPUT_HEIGHT } from 'parameters';
8
+ import { RESULTS_ITEM_HEIGHT } from 'parameters';
9
9
  import {
10
10
  selectAreResultsOutdated,
11
- selectSolveIsLoading,
12
11
  selectLocale,
13
12
  selectProcessedResults,
14
13
  selectSolveError,
14
+ selectSolveIsLoading,
15
15
  useTranslate,
16
16
  useTypedSelector,
17
17
  } from 'state';
@@ -36,7 +36,6 @@ const IS_LOADING_DEBOUNCE = 100;
36
36
 
37
37
  export const Results: FunctionComponent<Props> = ({ callbacks, className, highlightedIndex }) => {
38
38
  const translate = useTranslate();
39
- const { resultsHeight, resultsWidth } = useAppLayout();
40
39
  const locale = useTypedSelector(selectLocale);
41
40
  const { direction } = LOCALE_FEATURES[locale];
42
41
  const results = useTypedSelector(selectProcessedResults);
@@ -44,22 +43,25 @@ export const Results: FunctionComponent<Props> = ({ callbacks, className, highli
44
43
  const [isLoadingDebounced] = useDebounce(isLoading, IS_LOADING_DEBOUNCE);
45
44
  const isOutdated = useTypedSelector(selectAreResultsOutdated);
46
45
  const error = useTypedSelector(selectSolveError);
47
- const itemData = useMemo(() => ({ ...callbacks, highlightedIndex, results }), [callbacks, highlightedIndex, results]);
48
- const [listRef, setListRef] = useState<FixedSizeList<ResultData> | null>(null);
46
+ const itemData = useMemo<ResultData>(
47
+ () => ({ ...callbacks, highlightedIndex, results }),
48
+ [callbacks, highlightedIndex, results],
49
+ );
50
+ const listRef = useListRef(null);
49
51
  const scrollToIndex = typeof highlightedIndex === 'number' ? highlightedIndex : 0;
50
52
  const scrollToIndexRef = useLatest(scrollToIndex);
51
53
  const hasResults = typeof error === 'undefined' && typeof results !== 'undefined';
52
54
  const showInput = hasResults && results.length > 0 && !isOutdated;
53
- const height = resultsHeight - RESULTS_HEADER_HEIGHT - (showInput ? TEXT_INPUT_HEIGHT : 0) - 2 * BORDER_WIDTH;
54
- const width = resultsWidth - 2 * BORDER_WIDTH;
55
55
 
56
56
  useEffect(() => {
57
57
  // without setTimeout, the initial scrolling offset is calculated
58
58
  // incorrectly, as the list is not fully rendered by the browser yet
59
59
  const timeout = globalThis.setTimeout(() => {
60
- if (listRef) {
61
- listRef.scrollToItem(scrollToIndexRef.current, 'center');
62
- }
60
+ listRef.current?.scrollToRow({
61
+ align: 'center',
62
+ behavior: 'instant',
63
+ index: scrollToIndexRef.current,
64
+ });
63
65
  }, 0);
64
66
 
65
67
  return () => {
@@ -104,20 +106,17 @@ export const Results: FunctionComponent<Props> = ({ callbacks, className, highli
104
106
 
105
107
  {!isOutdated && results.length > 0 && (
106
108
  <div className={styles.listContainer}>
107
- <FixedSizeList
109
+ <List
108
110
  className={classNames(styles.list, {
109
111
  [styles.outdated]: isOutdated,
110
112
  })}
111
- direction={direction}
112
- height={height}
113
- itemCount={results.length}
114
- itemData={itemData}
115
- itemSize={RESULTS_ITEM_HEIGHT}
116
- ref={setListRef}
117
- width={width}
118
- >
119
- {Result}
120
- </FixedSizeList>
113
+ dir={direction}
114
+ listRef={listRef}
115
+ rowComponent={Result}
116
+ rowCount={results.length}
117
+ rowHeight={RESULTS_ITEM_HEIGHT}
118
+ rowProps={itemData}
119
+ />
121
120
  </div>
122
121
  )}
123
122
  </>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/solver",
3
- "version": "2.15.12",
3
+ "version": "2.15.14",
4
4
  "description": "Scrabble Solver 2 - Solver",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@kamilmielnik/trie": "^4.0.0",
27
- "@scrabble-solver/types": "^2.15.12"
27
+ "@scrabble-solver/types": "^2.15.14"
28
28
  },
29
29
  "devDependencies": {
30
- "@scrabble-solver/configs": "^2.15.12",
31
- "@scrabble-solver/constants": "^2.15.12",
32
- "@scrabble-solver/dictionaries": "^2.15.12"
30
+ "@scrabble-solver/configs": "^2.15.14",
31
+ "@scrabble-solver/constants": "^2.15.14",
32
+ "@scrabble-solver/dictionaries": "^2.15.14"
33
33
  },
34
34
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
35
35
  }
@@ -136,6 +136,6 @@ const getHorizontalWords = (cells) => {
136
136
  }
137
137
  return words;
138
138
  };
139
- const wordToString = (currentWord) => {
140
- return currentWord.map((cell) => cell.tile.character).join('');
139
+ const wordToString = (word) => {
140
+ return word.map((cell) => cell.tile.character).join('');
141
141
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/types",
3
- "version": "2.15.12",
3
+ "version": "2.15.14",
4
4
  "description": "Scrabble Solver 2 - Types",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/constants": "^2.15.12"
26
+ "@scrabble-solver/constants": "^2.15.14"
27
27
  },
28
28
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
29
29
  }
@@ -177,6 +177,6 @@ const getHorizontalWords = (cells: Cell[][]): string[] => {
177
177
  return words;
178
178
  };
179
179
 
180
- const wordToString = (currentWord: Cell[]): string => {
181
- return currentWord.map((cell) => cell.tile.character).join('');
180
+ const wordToString = (word: Cell[]): string => {
181
+ return word.map((cell) => cell.tile.character).join('');
182
182
  };
@@ -15,7 +15,7 @@ const parse = (html) => {
15
15
  const $ = (0, cheerio_1.load)(html);
16
16
  const $activeTab = $('.tab-pane.show.active');
17
17
  $('.type-example').remove();
18
- const $definitions = $activeTab.find('li.type-meaning.depth-0 > .meaningContainer .def.html');
18
+ const $definitions = $activeTab.find('li.type-meaning.depth-0 > .meaningContainer .tree-def.html');
19
19
  $definitions.find('.meaningTree').remove();
20
20
  const definitions = Array.from($definitions).map((definition) => $(definition).text().replace(/\n/g, ''));
21
21
  return {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.15.12",
3
+ "version": "2.15.14",
4
4
  "description": "Scrabble Solver 2 - Word definitions",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,9 +23,9 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.15.12",
27
- "cheerio": "^1.0.0",
28
- "follow-redirects": "^1.15.9",
26
+ "@scrabble-solver/types": "^2.15.14",
27
+ "cheerio": "^1.1.2",
28
+ "follow-redirects": "^1.15.11",
29
29
  "striptags": "^3.2.0"
30
30
  },
31
31
  "devDependencies": {