@scrabble-solver/scrabble-solver 2.10.0 → 2.10.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.
Files changed (144) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +19 -31
  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-development/0.pack +0 -0
  7. package/.next/cache/webpack/client-development/1.pack +0 -0
  8. package/.next/cache/webpack/client-development/2.pack +0 -0
  9. package/.next/cache/webpack/client-development/3.pack +0 -0
  10. package/.next/cache/webpack/client-development/4.pack +0 -0
  11. package/.next/cache/webpack/client-development/index.pack +0 -0
  12. package/.next/cache/webpack/client-development/index.pack.old +0 -0
  13. package/.next/cache/webpack/client-production/0.pack +0 -0
  14. package/.next/cache/webpack/client-production/index.pack +0 -0
  15. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  16. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  17. package/.next/cache/webpack/server-development/0.pack +0 -0
  18. package/.next/cache/webpack/server-development/10.pack_ +0 -0
  19. package/.next/cache/webpack/server-development/5.pack_ +0 -0
  20. package/.next/cache/webpack/server-development/8.pack_ +0 -0
  21. package/.next/cache/webpack/server-development/index.pack +0 -0
  22. package/.next/cache/webpack/server-production/0.pack +0 -0
  23. package/.next/cache/webpack/server-production/index.pack +0 -0
  24. package/.next/images-manifest.json +1 -1
  25. package/.next/next-server.js.nft.json +1 -1
  26. package/.next/prerender-manifest.json +1 -1
  27. package/.next/required-server-files.json +1 -1
  28. package/.next/routes-manifest.json +1 -1
  29. package/.next/server/chunks/131.js +1399 -117
  30. package/.next/server/chunks/{515.js → 176.js} +850 -732
  31. package/.next/server/chunks/210.js +122 -0
  32. package/.next/server/chunks/{939.js → 290.js} +4 -3
  33. package/.next/server/chunks/44.js +33 -33
  34. package/.next/server/chunks/50.js +5 -9
  35. package/.next/server/chunks/{413.js → 579.js} +184 -117
  36. package/.next/server/chunks/664.js +537 -350
  37. package/.next/server/chunks/859.js +56 -23
  38. package/.next/server/chunks/865.js +1 -1
  39. package/.next/server/middleware-build-manifest.js +1 -1
  40. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  41. package/.next/server/pages/404.html +2 -2
  42. package/.next/server/pages/404.js.nft.json +1 -1
  43. package/.next/server/pages/500.html +2 -2
  44. package/.next/server/pages/_app.js +23 -5
  45. package/.next/server/pages/_app.js.nft.json +1 -1
  46. package/.next/server/pages/_document.js +2 -2
  47. package/.next/server/pages/_error.js +206 -25
  48. package/.next/server/pages/_error.js.nft.json +1 -1
  49. package/.next/server/pages/api/dictionary/[locale]/[word].js +11 -11
  50. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  51. package/.next/server/pages/api/dictionary/[locale].js +10 -10
  52. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  53. package/.next/server/pages/api/solve.js +34 -36
  54. package/.next/server/pages/api/solve.js.nft.json +1 -1
  55. package/.next/server/pages/api/verify.js +10 -10
  56. package/.next/server/pages/api/verify.js.nft.json +1 -1
  57. package/.next/server/pages/api/visit.js +3 -3
  58. package/.next/server/pages/api/visit.js.nft.json +1 -1
  59. package/.next/server/pages/index.html +2 -2
  60. package/.next/server/pages/index.js +44 -128
  61. package/.next/server/pages/index.js.nft.json +1 -1
  62. package/.next/server/pages/index.json +1 -1
  63. package/.next/server/pages-manifest.json +4 -4
  64. package/.next/static/FjrbXpI5fkt4lmko-vL_7/_buildManifest.js +1 -0
  65. package/.next/static/{vscqn7BEtAxJteWSwNnas → FjrbXpI5fkt4lmko-vL_7}/_ssgManifest.js +0 -0
  66. package/.next/static/chunks/361-d16f336a9752a55a.js +1 -0
  67. package/.next/static/chunks/724-eb48df4d1ba3df8b.js +5 -0
  68. package/.next/static/chunks/amp.js +720 -0
  69. package/.next/static/chunks/framework-2c79e2a64abdb08b.js +33 -0
  70. package/.next/static/chunks/main-f11614d8aa7ee555.js +1 -0
  71. package/.next/static/chunks/main.js +1076 -0
  72. package/.next/static/chunks/pages/404-24f9617eeb8d6dc1.js +1 -0
  73. package/.next/static/chunks/pages/_app-959e495f0f221247.js +24 -0
  74. package/.next/static/chunks/pages/_app.js +2121 -0
  75. package/.next/static/chunks/pages/_error-8353112a01355ec2.js +1 -0
  76. package/.next/static/chunks/pages/_error.js +28 -0
  77. package/.next/static/chunks/pages/index-1e30dafa41bddb80.js +1 -0
  78. package/.next/static/chunks/pages/index.js +5314 -0
  79. package/.next/static/chunks/react-refresh.js +62 -0
  80. package/.next/static/chunks/webpack-59c5c889f52620d6.js +1 -0
  81. package/.next/static/chunks/webpack.js +1237 -0
  82. package/.next/static/css/aafd07997120f1e4.css +1 -0
  83. package/.next/static/css/c8d26240c04079b9.css +1 -0
  84. package/.next/static/css/eb9d57f7103525ab.css +1 -0
  85. package/.next/static/development/_buildManifest.js +1 -0
  86. package/.next/static/development/_ssgManifest.js +1 -0
  87. package/.next/static/webpack/fb4b50d5e70ee127.webpack.hot-update.json +1 -0
  88. package/.next/static/webpack/pages/index.fb4b50d5e70ee127.hot-update.js +171 -0
  89. package/.next/static/webpack/webpack.fb4b50d5e70ee127.hot-update.js +18 -0
  90. package/.next/trace +52 -52
  91. package/package.json +21 -21
  92. package/public/og.png +0 -0
  93. package/src/components/Board/Board.module.scss +1 -2
  94. package/src/components/Board/BoardPure.tsx +2 -0
  95. package/src/components/Board/components/Cell/Cell.module.scss +65 -55
  96. package/src/components/Board/components/Cell/Cell.tsx +9 -0
  97. package/src/components/Board/components/Cell/CellPure.tsx +11 -2
  98. package/src/components/Board/hooks/useGrid.ts +6 -6
  99. package/src/components/NavButtons/NavButtons.tsx +11 -1
  100. package/src/components/Rack/Rack.tsx +16 -4
  101. package/src/components/Rack/RackTile.tsx +10 -1
  102. package/src/components/RemainingTiles/Character.module.scss +0 -1
  103. package/src/components/RemainingTiles/Character.tsx +1 -0
  104. package/src/components/Results/Results.tsx +2 -2
  105. package/src/components/Settings/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +2 -2
  106. package/src/components/Settings/components/LocaleSetting/options.ts +9 -1
  107. package/src/components/Solver/Solver.module.scss +85 -0
  108. package/src/components/Solver/Solver.tsx +75 -0
  109. package/src/components/Solver/index.ts +1 -0
  110. package/src/components/Tile/Tile.module.scss +51 -7
  111. package/src/components/Tile/Tile.tsx +3 -0
  112. package/src/components/Tile/TilePure.tsx +8 -1
  113. package/src/components/index.ts +1 -0
  114. package/src/hooks/index.ts +1 -0
  115. package/src/hooks/useIsTouchDevice.ts +7 -0
  116. package/src/i18n/fr.json +1 -1
  117. package/src/icons/ExclamationSquareFill.svg +4 -0
  118. package/src/icons/index.ts +1 -0
  119. package/src/lib/getRemainingTilesGroups.ts +24 -26
  120. package/src/pages/index.module.scss +1 -75
  121. package/src/pages/index.tsx +11 -73
  122. package/src/parameters/index.ts +2 -0
  123. package/src/sdk/findWordDefinitions.ts +1 -1
  124. package/src/service-worker/average.ts +9 -0
  125. package/src/service-worker/routeSolveRequests.ts +46 -7
  126. package/src/state/sagas.ts +19 -5
  127. package/src/state/selectors.ts +30 -2
  128. package/src/state/slices/boardInitialState.ts +27 -0
  129. package/src/styles/mixins.scss +6 -1
  130. package/src/styles/variables.scss +6 -3
  131. package/.next/InjectManifest.js.nft.json +0 -1
  132. package/.next/static/chunks/368-d423e70be6c0c473.js +0 -1
  133. package/.next/static/chunks/546-447e243fc9de2c59.js +0 -1
  134. package/.next/static/chunks/framework-4556c45dd113b893.js +0 -1
  135. package/.next/static/chunks/main-a75cf611e061d8f8.js +0 -1
  136. package/.next/static/chunks/pages/404-932294135c3206dd.js +0 -1
  137. package/.next/static/chunks/pages/_app-3f5508a5f544d9eb.js +0 -1
  138. package/.next/static/chunks/pages/_error-a4ba2246ff8fb532.js +0 -1
  139. package/.next/static/chunks/pages/index-8af7a9d7a2cd98a7.js +0 -1
  140. package/.next/static/chunks/webpack-5752944655d749a0.js +0 -1
  141. package/.next/static/css/6b1833fd19d3a74a.css +0 -1
  142. package/.next/static/css/a6154e4ca046ca13.css +0 -1
  143. package/.next/static/css/bad53af6f8616677.css +0 -1
  144. package/.next/static/vscqn7BEtAxJteWSwNnas/_buildManifest.js +0 -1
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ exports.id = 210;
3
+ exports.ids = [210];
4
+ exports.modules = {
5
+
6
+ /***/ 6495:
7
+ /***/ ((__unused_webpack_module, exports) => {
8
+
9
+ var __webpack_unused_export__;
10
+
11
+ __webpack_unused_export__ = ({
12
+ value: true
13
+ });
14
+ Object.defineProperty(exports, "Z", ({
15
+ enumerable: true,
16
+ get: function() {
17
+ return _extends;
18
+ }
19
+ }));
20
+ function extends_() {
21
+ extends_ = Object.assign || function(target) {
22
+ for(var i = 1; i < arguments.length; i++){
23
+ var source = arguments[i];
24
+ for(var key in source){
25
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
26
+ target[key] = source[key];
27
+ }
28
+ }
29
+ }
30
+ return target;
31
+ };
32
+ return extends_.apply(this, arguments);
33
+ }
34
+ function _extends() {
35
+ return extends_.apply(this, arguments);
36
+ }
37
+
38
+
39
+ /***/ }),
40
+
41
+ /***/ 92648:
42
+ /***/ ((__unused_webpack_module, exports) => {
43
+
44
+ var __webpack_unused_export__;
45
+
46
+ __webpack_unused_export__ = ({
47
+ value: true
48
+ });
49
+ Object.defineProperty(exports, "Z", ({
50
+ enumerable: true,
51
+ get: function() {
52
+ return _interopRequireDefault;
53
+ }
54
+ }));
55
+ function _interopRequireDefault(obj) {
56
+ return obj && obj.__esModule ? obj : {
57
+ default: obj
58
+ };
59
+ }
60
+
61
+
62
+ /***/ }),
63
+
64
+ /***/ 91598:
65
+ /***/ ((__unused_webpack_module, exports) => {
66
+
67
+ var __webpack_unused_export__;
68
+
69
+ __webpack_unused_export__ = ({
70
+ value: true
71
+ });
72
+ Object.defineProperty(exports, "Z", ({
73
+ enumerable: true,
74
+ get: function() {
75
+ return _interopRequireWildcard;
76
+ }
77
+ }));
78
+ function _getRequireWildcardCache(nodeInterop) {
79
+ if (typeof WeakMap !== "function") return null;
80
+ var cacheBabelInterop = new WeakMap();
81
+ var cacheNodeInterop = new WeakMap();
82
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
83
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
84
+ })(nodeInterop);
85
+ }
86
+ function _interopRequireWildcard(obj, nodeInterop) {
87
+ if (!nodeInterop && obj && obj.__esModule) {
88
+ return obj;
89
+ }
90
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
91
+ return {
92
+ default: obj
93
+ };
94
+ }
95
+ var cache = _getRequireWildcardCache(nodeInterop);
96
+ if (cache && cache.has(obj)) {
97
+ return cache.get(obj);
98
+ }
99
+ var newObj = {};
100
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
101
+ for(var key in obj){
102
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
103
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
104
+ if (desc && (desc.get || desc.set)) {
105
+ Object.defineProperty(newObj, key, desc);
106
+ } else {
107
+ newObj[key] = obj[key];
108
+ }
109
+ }
110
+ }
111
+ newObj.default = obj;
112
+ if (cache) {
113
+ cache.set(obj, newObj);
114
+ }
115
+ return newObj;
116
+ }
117
+
118
+
119
+ /***/ })
120
+
121
+ };
122
+ ;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 939;
3
- exports.ids = [939];
2
+ exports.id = 290;
3
+ exports.ids = [290];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 38436:
@@ -29,6 +29,7 @@ exports.CONSONANTS = [
29
29
  'm',
30
30
  'n',
31
31
  'ń',
32
+ 'ñ',
32
33
  'p',
33
34
  'q',
34
35
  'r',
@@ -113,7 +114,7 @@ exports["default"] = logger;
113
114
 
114
115
  /***/ }),
115
116
 
116
- /***/ 81025:
117
+ /***/ 81087:
117
118
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
118
119
 
119
120
 
@@ -391,11 +391,6 @@ const constants_1 = __webpack_require__(38436);
391
391
  const Cell_1 = __importDefault(__webpack_require__(70902));
392
392
  const Tile_1 = __importDefault(__webpack_require__(580));
393
393
  class Board {
394
- constructor({ rows }) {
395
- this.rows = rows;
396
- this.columnsCount = rows[0].length;
397
- this.rowsCount = rows.length;
398
- }
399
394
  static create(width, height) {
400
395
  return Board.fromStringArray(Array(height).fill(Array(width).fill(' ').join('')));
401
396
  }
@@ -414,6 +409,11 @@ class Board {
414
409
  }))),
415
410
  });
416
411
  }
412
+ constructor({ rows }) {
413
+ this.rows = rows;
414
+ this.columnsCount = rows[0].length;
415
+ this.rowsCount = rows.length;
416
+ }
417
417
  get center() {
418
418
  const x = Math.floor(this.columnsCount / 2);
419
419
  const y = Math.floor(this.rowsCount / 2);
@@ -577,13 +577,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
577
577
  Object.defineProperty(exports, "__esModule", ({ value: true }));
578
578
  const Tile_1 = __importDefault(__webpack_require__(580));
579
579
  class Cell {
580
- // eslint-disable-next-line no-undef
581
- constructor({ isEmpty = true, tile = Tile_1.default.Null, x, y }) {
582
- this.isEmpty = isEmpty;
583
- this.tile = tile;
584
- this.x = x;
585
- this.y = y;
586
- }
587
580
  static fromJson(json) {
588
581
  return new Cell({
589
582
  isEmpty: json.isEmpty,
@@ -592,6 +585,13 @@ class Cell {
592
585
  y: json.y,
593
586
  });
594
587
  }
588
+ // eslint-disable-next-line no-undef
589
+ constructor({ isEmpty = true, tile = Tile_1.default.Null, x, y }) {
590
+ this.isEmpty = isEmpty;
591
+ this.tile = tile;
592
+ this.x = x;
593
+ this.y = y;
594
+ }
595
595
  clone() {
596
596
  return new Cell({
597
597
  isEmpty: this.isEmpty,
@@ -697,14 +697,14 @@ const constants_1 = __webpack_require__(38436);
697
697
  const CharacterBonus_1 = __importDefault(__webpack_require__(95699));
698
698
  const WordBonus_1 = __importDefault(__webpack_require__(39667));
699
699
  class Config {
700
+ static fromJson(json) {
701
+ return new Config(json);
702
+ }
700
703
  constructor(config) {
701
704
  this.bonuses = getBonuses(config);
702
705
  this.config = config;
703
706
  this.pointsMap = getPointsMap(this.config);
704
707
  }
705
- static fromJson(json) {
706
- return new Config(json);
707
- }
708
708
  get allTilesBonusScore() {
709
709
  return this.config.allTilesBonusScore;
710
710
  }
@@ -948,6 +948,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
948
948
  const constants_1 = __webpack_require__(38436);
949
949
  const Cell_1 = __importDefault(__webpack_require__(70902));
950
950
  class Result {
951
+ static fromJson(json) {
952
+ return new Result({
953
+ id: json.id,
954
+ cells: json.cells.map(Cell_1.default.fromJson),
955
+ collisions: json.collisions.map((collision) => collision.map(Cell_1.default.fromJson)),
956
+ points: json.points,
957
+ });
958
+ }
951
959
  constructor({ cells, id, collisions, points, }) {
952
960
  const tiles = getTiles(cells);
953
961
  this.blanksCount = getBlanks(tiles).length;
@@ -965,14 +973,6 @@ class Result {
965
973
  this.words = getWords(cells, collisions);
966
974
  this.wordsCount = 1 + this.collisions.length;
967
975
  }
968
- static fromJson(json) {
969
- return new Result({
970
- id: json.id,
971
- cells: json.cells.map(Cell_1.default.fromJson),
972
- collisions: json.collisions.map((collision) => collision.map(Cell_1.default.fromJson)),
973
- points: json.points,
974
- });
975
- }
976
976
  toJson() {
977
977
  return {
978
978
  cells: this.cells.map((cell) => cell.toJson()),
@@ -1004,10 +1004,6 @@ exports["default"] = Result;
1004
1004
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1005
1005
  const constants_1 = __webpack_require__(38436);
1006
1006
  class Tile {
1007
- constructor({ character, isBlank = false }) {
1008
- this.character = character;
1009
- this.isBlank = isBlank;
1010
- }
1011
1007
  static fromJson(json) {
1012
1008
  if (!json) {
1013
1009
  return Tile.Null;
@@ -1017,6 +1013,10 @@ class Tile {
1017
1013
  isBlank: json.isBlank,
1018
1014
  });
1019
1015
  }
1016
+ constructor({ character, isBlank = false }) {
1017
+ this.character = character;
1018
+ this.isBlank = isBlank;
1019
+ }
1020
1020
  clone() {
1021
1021
  return new Tile({
1022
1022
  character: this.character,
@@ -1143,12 +1143,6 @@ exports["default"] = WordBonus;
1143
1143
 
1144
1144
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1145
1145
  class WordDefinition {
1146
- constructor({ definitions, exists, isAllowed, word }) {
1147
- this.definitions = definitions;
1148
- this.exists = exists;
1149
- this.isAllowed = isAllowed;
1150
- this.word = word;
1151
- }
1152
1146
  static fromJson(json) {
1153
1147
  if (!json) {
1154
1148
  return WordDefinition.Null;
@@ -1160,6 +1154,12 @@ class WordDefinition {
1160
1154
  word: json.word,
1161
1155
  });
1162
1156
  }
1157
+ constructor({ definitions, exists, isAllowed, word }) {
1158
+ this.definitions = definitions;
1159
+ this.exists = exists;
1160
+ this.isAllowed = isAllowed;
1161
+ this.word = word;
1162
+ }
1163
1163
  toJson() {
1164
1164
  return {
1165
1165
  definitions: this.definitions,
@@ -7537,9 +7537,8 @@ exports.configure = configure
7537
7537
 
7538
7538
  module.exports = stringify
7539
7539
 
7540
- // eslint-disable-next-line
7540
+ // eslint-disable-next-line no-control-regex
7541
7541
  const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/
7542
- // eslint-disable-next-line
7543
7542
  const strEscapeSequencesReplacer = new RegExp(strEscapeSequencesRegExp, 'g')
7544
7543
 
7545
7544
  // Escaped special characters. Use empty strings to fill up unused entries.
@@ -7648,7 +7647,7 @@ function stringifyTypedArray (array, separator, maximumBreadth) {
7648
7647
  }
7649
7648
 
7650
7649
  function getCircularValueOption (options) {
7651
- if (options && hasOwnProperty.call(options, 'circularValue')) {
7650
+ if (hasOwnProperty.call(options, 'circularValue')) {
7652
7651
  const circularValue = options.circularValue
7653
7652
  if (typeof circularValue === 'string') {
7654
7653
  return `"${circularValue}"`
@@ -7670,7 +7669,7 @@ function getCircularValueOption (options) {
7670
7669
 
7671
7670
  function getBooleanOption (options, key) {
7672
7671
  let value
7673
- if (options && hasOwnProperty.call(options, key)) {
7672
+ if (hasOwnProperty.call(options, key)) {
7674
7673
  value = options[key]
7675
7674
  if (typeof value !== 'boolean') {
7676
7675
  throw new TypeError(`The "${key}" argument must be of type boolean`)
@@ -7681,7 +7680,7 @@ function getBooleanOption (options, key) {
7681
7680
 
7682
7681
  function getPositiveIntegerOption (options, key) {
7683
7682
  let value
7684
- if (options && hasOwnProperty.call(options, key)) {
7683
+ if (hasOwnProperty.call(options, key)) {
7685
7684
  value = options[key]
7686
7685
  if (typeof value !== 'number') {
7687
7686
  throw new TypeError(`The "${key}" argument must be of type number`)
@@ -7714,7 +7713,7 @@ function getUniqueReplacerSet (replacerArray) {
7714
7713
  }
7715
7714
 
7716
7715
  function getStrictOption (options) {
7717
- if (options && hasOwnProperty.call(options, 'strict')) {
7716
+ if (hasOwnProperty.call(options, 'strict')) {
7718
7717
  const value = options.strict
7719
7718
  if (typeof value !== 'boolean') {
7720
7719
  throw new TypeError('The "strict" argument must be of type boolean')
@@ -7915,9 +7914,6 @@ function configure (options) {
7915
7914
  stack.pop()
7916
7915
  return `[${res}]`
7917
7916
  }
7918
- if (replacer.size === 0) {
7919
- return '{}'
7920
- }
7921
7917
  stack.push(value)
7922
7918
  let whitespace = ''
7923
7919
  if (spacer !== '') {