@scrabble-solver/scrabble-solver 2.10.3 → 2.10.5

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 (194) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +13 -13
  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/routes-manifest.json +1 -1
  15. package/.next/server/chunks/176.js +1439 -1658
  16. package/.next/server/chunks/579.js +50 -26
  17. package/.next/server/middleware-build-manifest.js +1 -1
  18. package/.next/server/pages/404.html +2 -2
  19. package/.next/server/pages/404.js.nft.json +1 -1
  20. package/.next/server/pages/500.html +2 -2
  21. package/.next/server/pages/_app.js.nft.json +1 -1
  22. package/.next/server/pages/api/solve.js +22 -6
  23. package/.next/server/pages/index.html +2 -2
  24. package/.next/server/pages/index.js +1509 -52
  25. package/.next/server/pages/index.js.nft.json +1 -1
  26. package/.next/server/pages/index.json +1 -1
  27. package/.next/server/pages-manifest.json +2 -2
  28. package/.next/static/WILX-RgqlLTd4ZoPs8C_E/_buildManifest.js +1 -0
  29. package/.next/static/{FJkPF91uL-OCAJKTTpVSP → WILX-RgqlLTd4ZoPs8C_E}/_ssgManifest.js +0 -0
  30. package/.next/static/chunks/144-6768fe9a92865ec8.js +1 -0
  31. package/.next/static/chunks/490-d29992f1c264d70e.js +5 -0
  32. package/.next/static/chunks/pages/{404-24f9617eeb8d6dc1.js → 404-7619583a9e7188b1.js} +1 -1
  33. package/.next/static/chunks/pages/_app-fa0661b072fc6af9.js +24 -0
  34. package/.next/static/chunks/pages/index-1a6bbb880f28606a.js +1 -0
  35. package/.next/static/css/78e42ad01f580f64.css +1 -0
  36. package/.next/static/css/d80ffccf2315791a.css +1 -0
  37. package/.next/static/css/e737d5d7fbed2434.css +1 -0
  38. package/.next/trace +55 -52
  39. package/package.json +11 -9
  40. package/src/components/Badge/Badge.module.scss +4 -5
  41. package/src/components/Board/BoardPure.tsx +5 -5
  42. package/src/components/Board/components/Cell/Cell.module.scss +11 -11
  43. package/src/components/Button/Button.module.scss +34 -40
  44. package/src/components/Button/Button.tsx +28 -8
  45. package/src/components/Button/Link.tsx +44 -0
  46. package/src/components/Dictionary/Dictionary.module.scss +1 -2
  47. package/src/components/Dictionary/Dictionary.tsx +2 -6
  48. package/src/components/DictionaryInput/DictionaryInput.module.scss +1 -3
  49. package/src/components/EmptyState/EmptyState.module.scss +6 -7
  50. package/src/components/EmptyState/EmptyState.tsx +6 -6
  51. package/src/components/Key/Key.module.scss +0 -1
  52. package/src/components/{Splash/Splash.module.scss → LogoSplashScreen/LogoSplashScreen.module.scss} +1 -1
  53. package/src/components/{Splash/Splash.tsx → LogoSplashScreen/LogoSplashScreen.tsx} +7 -7
  54. package/src/components/LogoSplashScreen/index.ts +1 -0
  55. package/src/components/{Sidebar/Sidebar.module.scss → Modal/Modal.module.scss} +25 -20
  56. package/src/components/{Sidebar/Sidebar.tsx → Modal/Modal.tsx} +9 -9
  57. package/src/components/{Sidebar → Modal}/components/Section/Section.module.scss +0 -0
  58. package/src/components/{Sidebar → Modal}/components/Section/Section.tsx +0 -0
  59. package/src/components/{Sidebar → Modal}/components/Section/index.ts +0 -0
  60. package/src/components/{Sidebar → Modal}/components/index.ts +0 -0
  61. package/src/components/Modal/index.ts +1 -0
  62. package/src/components/NavButtons/NavButtons.tsx +22 -3
  63. package/src/components/Progress/Progress.module.scss +9 -0
  64. package/src/components/Progress/Progress.tsx +38 -0
  65. package/src/components/Progress/index.ts +1 -0
  66. package/src/components/Rack/Rack.module.scss +2 -0
  67. package/src/components/Rack/Rack.tsx +3 -1
  68. package/src/components/Rack/RackTile.tsx +3 -2
  69. package/src/components/Radio/Radio.module.scss +2 -2
  70. package/src/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +76 -0
  71. package/src/components/ResultCandidatePicker/ResultCandidatePicker.tsx +38 -0
  72. package/src/components/ResultCandidatePicker/index.ts +1 -0
  73. package/src/components/Results/Result.tsx +64 -43
  74. package/src/components/Results/Results.module.scss +9 -16
  75. package/src/components/Results/Results.tsx +45 -28
  76. package/src/components/Results/SolveButton.tsx +10 -7
  77. package/src/components/Results/{getColumns.ts → getLocaleColumns.ts} +2 -2
  78. package/src/components/Results/types.ts +16 -0
  79. package/src/components/Results/useColumns.ts +44 -0
  80. package/src/components/ResultsInput/ResultsInput.module.scss +1 -3
  81. package/src/components/Sizer/Sizer.module.scss +10 -0
  82. package/src/components/Sizer/Sizer.tsx +10 -0
  83. package/src/components/Sizer/index.ts +1 -0
  84. package/src/components/Solver/Solver.module.scss +83 -27
  85. package/src/components/Solver/Solver.tsx +158 -25
  86. package/src/components/Solver/components/ApplyButton/ApplyButton.module.scss +5 -0
  87. package/src/components/Solver/components/ApplyButton/ApplyButton.tsx +38 -0
  88. package/src/components/Solver/components/ApplyButton/index.ts +1 -0
  89. package/src/components/Solver/components/EmptyState/EmptyState.module.scss +59 -0
  90. package/src/components/Solver/components/EmptyState/EmptyState.tsx +41 -0
  91. package/src/components/Solver/components/EmptyState/index.ts +1 -0
  92. package/src/components/Solver/components/SolveButton/SolveButton.module.scss +4 -0
  93. package/src/components/Solver/components/SolveButton/SolveButton.tsx +43 -0
  94. package/src/components/Solver/components/SolveButton/index.ts +1 -0
  95. package/src/components/Solver/components/index.ts +3 -0
  96. package/src/components/{Screen/Screen.module.scss → SplashScreen/SplashScreen.module.scss} +2 -12
  97. package/src/components/{Screen/Screen.tsx → SplashScreen/SplashScreen.tsx} +4 -4
  98. package/src/components/SplashScreen/index.ts +1 -0
  99. package/src/components/SquareButton/SquareButton.module.scss +3 -3
  100. package/src/components/SquareButton/SquareButton.tsx +2 -2
  101. package/src/components/Tile/Tile.module.scss +39 -30
  102. package/src/components/Tile/Tile.tsx +2 -2
  103. package/src/components/Tile/TilePure.tsx +9 -5
  104. package/src/components/Tooltip/Tooltip.module.scss +5 -6
  105. package/src/components/index.ts +6 -7
  106. package/src/hooks/index.ts +1 -1
  107. package/src/hooks/useMediaQuery.ts +11 -0
  108. package/src/hooks/usePortal.tsx +1 -1
  109. package/src/i18n/de.json +2 -0
  110. package/src/i18n/en.json +2 -0
  111. package/src/i18n/es.json +2 -0
  112. package/src/i18n/fa.json +2 -0
  113. package/src/i18n/fr.json +2 -0
  114. package/src/i18n/pl.json +2 -0
  115. package/src/icons/CardChecklist.svg +5 -0
  116. package/src/icons/Check.svg +2 -2
  117. package/src/icons/ChevronDown.svg +4 -0
  118. package/src/icons/CrossCircleFill.svg +4 -0
  119. package/src/icons/{CrossFill.svg → CrossSquareFill.svg} +0 -0
  120. package/src/icons/ExclamationTriangleFill.svg +4 -0
  121. package/src/icons/InfoCircleFill.svg +4 -0
  122. package/src/icons/List.svg +4 -0
  123. package/src/icons/Search.svg +4 -0
  124. package/src/icons/index.ts +8 -2
  125. package/src/{components/KeyMap/KeyMap.tsx → modals/KeyMapModal/KeyMapModal.tsx} +11 -13
  126. package/src/{components/KeyMap → modals/KeyMapModal}/components/Mapping/Mapping.module.scss +0 -0
  127. package/src/{components/KeyMap → modals/KeyMapModal}/components/Mapping/Mapping.tsx +0 -0
  128. package/src/{components/KeyMap → modals/KeyMapModal}/components/Mapping/index.ts +0 -0
  129. package/src/{components/KeyMap → modals/KeyMapModal}/components/index.ts +0 -0
  130. package/src/modals/KeyMapModal/index.ts +1 -0
  131. package/src/{components/KeyMap → modals/KeyMapModal}/keys.tsx +1 -2
  132. package/src/modals/MenuModal/MenuModal.module.scss +11 -0
  133. package/src/modals/MenuModal/MenuModal.tsx +56 -0
  134. package/src/modals/MenuModal/index.ts +1 -0
  135. package/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss +28 -0
  136. package/src/{components/RemainingTiles/RemainingTiles.tsx → modals/RemainingTilesModal/RemainingTilesModal.tsx} +14 -12
  137. package/src/{components/RemainingTiles → modals/RemainingTilesModal/components/Character}/Character.module.scss +7 -3
  138. package/src/{components/RemainingTiles → modals/RemainingTilesModal/components/Character}/Character.tsx +11 -3
  139. package/src/modals/RemainingTilesModal/components/Character/index.ts +1 -0
  140. package/src/modals/RemainingTilesModal/components/index.ts +1 -0
  141. package/src/modals/RemainingTilesModal/index.ts +1 -0
  142. package/src/modals/ResultsModal/ResultsModal.module.scss +7 -0
  143. package/src/modals/ResultsModal/ResultsModal.tsx +58 -0
  144. package/src/modals/ResultsModal/index.ts +1 -0
  145. package/src/modals/SettingsModal/SettingsModal.tsx +34 -0
  146. package/src/{components/Settings → modals/SettingsModal}/components/AutoGroupTilesSetting/AutoGroupTilesSetting.module.scss +0 -0
  147. package/src/{components/Settings → modals/SettingsModal}/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -2
  148. package/src/{components/Settings → modals/SettingsModal}/components/AutoGroupTilesSetting/constants.ts +0 -0
  149. package/src/{components/Settings → modals/SettingsModal}/components/AutoGroupTilesSetting/index.ts +0 -0
  150. package/src/{components/Settings → modals/SettingsModal}/components/AutoGroupTilesSetting/lib.ts +0 -0
  151. package/src/{components/Settings → modals/SettingsModal}/components/ConfigSetting/ConfigSetting.module.scss +0 -0
  152. package/src/{components/Settings → modals/SettingsModal}/components/ConfigSetting/ConfigSetting.tsx +1 -2
  153. package/src/{components/Settings → modals/SettingsModal}/components/ConfigSetting/index.ts +0 -0
  154. package/src/{components/Settings → modals/SettingsModal}/components/ConfigSetting/options.ts +0 -0
  155. package/src/{components/Settings → modals/SettingsModal}/components/ConfigSetting/types.ts +0 -0
  156. package/src/{components/Settings → modals/SettingsModal}/components/LocaleSetting/LocaleSetting.module.scss +0 -0
  157. package/src/{components/Settings → modals/SettingsModal}/components/LocaleSetting/LocaleSetting.tsx +1 -2
  158. package/src/{components/Settings → modals/SettingsModal}/components/LocaleSetting/index.ts +0 -0
  159. package/src/{components/Settings → modals/SettingsModal}/components/LocaleSetting/options.ts +0 -0
  160. package/src/{components/Settings → modals/SettingsModal}/components/LocaleSetting/types.ts +0 -0
  161. package/src/{components/Settings → modals/SettingsModal}/components/index.ts +0 -0
  162. package/src/modals/SettingsModal/index.ts +1 -0
  163. package/src/{components/Words/Words.module.scss → modals/WordsModal/WordsModal.module.scss} +7 -1
  164. package/src/{components/Words/Words.tsx → modals/WordsModal/WordsModal.tsx} +10 -12
  165. package/src/modals/WordsModal/index.ts +1 -0
  166. package/src/modals/index.ts +6 -0
  167. package/src/pages/index.module.scss +6 -4
  168. package/src/pages/index.tsx +63 -26
  169. package/src/parameters/index.ts +28 -6
  170. package/src/state/createAppStore.ts +7 -4
  171. package/src/styles/mixins.scss +17 -15
  172. package/src/styles/variables.scss +15 -17
  173. package/src/types/index.ts +2 -0
  174. package/tsconfig.json +1 -0
  175. package/.next/cache/webpack/client-development/7.pack_ +0 -0
  176. package/.next/static/FJkPF91uL-OCAJKTTpVSP/_buildManifest.js +0 -1
  177. package/.next/static/chunks/361-d16f336a9752a55a.js +0 -1
  178. package/.next/static/chunks/724-eb48df4d1ba3df8b.js +0 -5
  179. package/.next/static/chunks/pages/_app-959e495f0f221247.js +0 -24
  180. package/.next/static/chunks/pages/index-1e30dafa41bddb80.js +0 -1
  181. package/.next/static/css/aafd07997120f1e4.css +0 -1
  182. package/.next/static/css/cb5b206454513f3c.css +0 -1
  183. package/.next/static/css/eb9d57f7103525ab.css +0 -1
  184. package/src/components/KeyMap/index.ts +0 -1
  185. package/src/components/RemainingTiles/RemainingTiles.module.scss +0 -16
  186. package/src/components/RemainingTiles/index.ts +0 -1
  187. package/src/components/Screen/index.ts +0 -1
  188. package/src/components/Settings/Settings.tsx +0 -35
  189. package/src/components/Settings/index.ts +0 -1
  190. package/src/components/Sidebar/index.ts +0 -1
  191. package/src/components/Splash/index.ts +0 -1
  192. package/src/components/Words/index.ts +0 -1
  193. package/src/hooks/useIsTablet.ts +0 -10
  194. package/src/icons/Play.svg +0 -4
@@ -17,11 +17,11 @@ interface Props {
17
17
  autoFocus?: boolean;
18
18
  canShowPoints?: boolean;
19
19
  character?: string;
20
+ characterStyle?: CSSProperties;
20
21
  className?: string;
21
22
  disabled?: boolean;
22
23
  highlighted?: boolean;
23
24
  inputRef: RefObject<HTMLInputElement>;
24
- inputStyle?: CSSProperties;
25
25
  isBlank?: boolean;
26
26
  isValid?: boolean;
27
27
  placeholder?: string;
@@ -40,11 +40,11 @@ const TilePure: FunctionComponent<Props> = ({
40
40
  autoFocus,
41
41
  canShowPoints,
42
42
  character,
43
+ characterStyle,
43
44
  className,
44
45
  disabled,
45
46
  highlighted,
46
47
  inputRef,
47
- inputStyle,
48
48
  isBlank,
49
49
  isValid,
50
50
  placeholder,
@@ -61,6 +61,8 @@ const TilePure: FunctionComponent<Props> = ({
61
61
  <div
62
62
  className={classNames(styles.tile, className, {
63
63
  [styles.blank]: isBlank,
64
+ [styles.disabled]: disabled,
65
+ [styles.empty]: !character,
64
66
  [styles.highlighted]: highlighted,
65
67
  [styles.invalid]: !isValid,
66
68
  [styles.raised]: raised,
@@ -77,12 +79,10 @@ const TilePure: FunctionComponent<Props> = ({
77
79
  autoComplete="off"
78
80
  autoCorrect="off"
79
81
  autoFocus={autoFocus}
80
- className={styles.character}
82
+ className={styles.input}
81
83
  disabled={disabled}
82
- placeholder={placeholder}
83
84
  ref={inputRef}
84
85
  spellCheck={false}
85
- style={inputStyle}
86
86
  tabIndex={tabIndex}
87
87
  value={character || ''}
88
88
  onChange={onChange}
@@ -90,6 +90,10 @@ const TilePure: FunctionComponent<Props> = ({
90
90
  onKeyDown={onKeyDown}
91
91
  />
92
92
 
93
+ <div className={styles.character} style={characterStyle} tabIndex={-1}>
94
+ {character || placeholder}
95
+ </div>
96
+
93
97
  {canShowPoints && (
94
98
  <span className={styles.points} style={pointsStyle}>
95
99
  {pointsFormatted}
@@ -12,14 +12,13 @@ $arrow-size: 4px;
12
12
  border-radius: var(--border--radius);
13
13
  background-color: var(--tooltip--background);
14
14
  color: var(--tooltip--foreground);
15
- font-size: var(--font--size--s);
16
15
  z-index: 200;
17
16
 
18
17
  &.top {
19
18
  .arrow {
20
19
  bottom: -$arrow-size;
21
20
 
22
- &:after {
21
+ &::after {
23
22
  left: 0;
24
23
  bottom: 0;
25
24
  border-top-color: var(--tooltip--background);
@@ -32,7 +31,7 @@ $arrow-size: 4px;
32
31
  .arrow {
33
32
  left: -$arrow-size;
34
33
 
35
- &:after {
34
+ &::after {
36
35
  left: 0;
37
36
  top: 0;
38
37
  border-right-color: var(--tooltip--background);
@@ -45,7 +44,7 @@ $arrow-size: 4px;
45
44
  .arrow {
46
45
  top: -$arrow-size;
47
46
 
48
- &:after {
47
+ &::after {
49
48
  top: 0;
50
49
  left: 0;
51
50
  border-bottom-color: var(--tooltip--background);
@@ -58,7 +57,7 @@ $arrow-size: 4px;
58
57
  .arrow {
59
58
  right: -$arrow-size;
60
59
 
61
- &:after {
60
+ &::after {
62
61
  right: 0;
63
62
  top: 0;
64
63
  border-left-color: var(--tooltip--background);
@@ -73,7 +72,7 @@ $arrow-size: 4px;
73
72
  width: 2 * $arrow-size;
74
73
  height: 2 * $arrow-size;
75
74
 
76
- &:after {
75
+ &::after {
77
76
  content: ' ';
78
77
  position: absolute;
79
78
  height: 0;
@@ -6,26 +6,25 @@ export { default as Dictionary } from './Dictionary';
6
6
  export { default as DictionaryInput } from './DictionaryInput';
7
7
  export { default as EmptyState } from './EmptyState';
8
8
  export { default as Key } from './Key';
9
- export { default as KeyMap } from './KeyMap';
10
9
  export { default as Loading } from './Loading';
11
10
  export { default as Logo } from './Logo';
11
+ export { default as LogoSplashScreen } from './LogoSplashScreen';
12
+ export { default as Modal } from './Modal';
12
13
  export { default as NavButtons } from './NavButtons';
13
14
  export { default as NotFound } from './NotFound';
14
15
  export { default as PlainTiles } from './PlainTiles';
16
+ export { default as Progress } from './Progress';
15
17
  export { default as Rack } from './Rack';
16
18
  export { default as Radio } from './Radio';
17
- export { default as RemainingTiles } from './RemainingTiles';
19
+ export { default as ResultCandidatePicker } from './ResultCandidatePicker';
18
20
  export { default as Results } from './Results';
19
21
  export { default as ResultsInput } from './ResultsInput';
20
- export { default as Screen } from './Screen';
21
- export { default as Settings } from './Settings';
22
- export { default as Sidebar } from './Sidebar';
22
+ export { default as Sizer } from './Sizer';
23
23
  export { default as Solver } from './Solver';
24
- export { default as Splash } from './Splash';
24
+ export { default as SplashScreen } from './SplashScreen';
25
25
  export { default as SquareButton } from './SquareButton';
26
26
  export { default as SvgFontCss } from './SvgFontCss';
27
27
  export { default as SvgFontFix } from './SvgFontFix';
28
28
  export { default as Tile } from './Tile';
29
29
  export { useTooltip } from './Tooltip';
30
30
  export { default as Well } from './Well';
31
- export { default as Words } from './Words';
@@ -1,7 +1,7 @@
1
1
  export { default as useDirection } from './useDirection';
2
- export { default as useIsTablet } from './useIsTablet';
3
2
  export { default as useIsTouchDevice } from './useIsTouchDevice';
4
3
  export { default as useLanguage } from './useLanguage';
5
4
  export { default as useLocalStorage } from './useLocalStorage';
5
+ export { default as useMediaQuery } from './useMediaQuery';
6
6
  export { default as usePortal } from './usePortal';
7
7
  export { default as useUniqueId } from './useUniqueId';
@@ -0,0 +1,11 @@
1
+ import { buildMediaQuery } from 'include-media-query-builder';
2
+ import { useMedia } from 'react-use';
3
+
4
+ import { BREAKPOINTS } from 'parameters';
5
+
6
+ const useMediaQuery = (query: string | string[], defaultState?: boolean | undefined): boolean => {
7
+ const mediaQuery = buildMediaQuery(BREAKPOINTS, query);
8
+ return useMedia(mediaQuery, defaultState);
9
+ };
10
+
11
+ export default useMediaQuery;
@@ -29,7 +29,7 @@ const usePortal = (children: ReactNode, { disabled = false, tagName = 'div' }: P
29
29
  // "Attempted to synchronously unmount a root while React was already
30
30
  // rendering. React cannot finish unmounting the root until the current
31
31
  // render has completed, which may lead to a race condition.""
32
- setTimeout(() => {
32
+ globalThis.setTimeout(() => {
33
33
  rootRef.current = null;
34
34
  root.unmount();
35
35
  element.remove();
package/src/i18n/de.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "Lösen starten",
36
36
  "keyMap.rack": "Ablage",
37
37
  "keyMap.rack.insert-blank": "Blanko hinzufügen (Leertaste)",
38
+ "menu": "Menü",
38
39
  "rack.placeholder": "Steine…",
39
40
  "remaining-tiles": "Restliche Steine",
41
+ "results": "Ergebnisse",
40
42
  "results.empty-state.no-filtered-results": "Keine Ergebnisse für diese Anfrage.",
41
43
  "results.empty-state.no-results": "Keine Ergebnisse - kein Wort konnte generiert werden.",
42
44
  "results.empty-state.outdated": "Ergebnisse sind alt. Klicken zum Aktualisieren.",
package/src/i18n/en.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "Start solving",
36
36
  "keyMap.rack": "Rack",
37
37
  "keyMap.rack.insert-blank": "Insert blank (spacebar)",
38
+ "menu": "Menu",
38
39
  "rack.placeholder": "Letters",
39
40
  "remaining-tiles": "Remaining tiles",
41
+ "results": "Results",
40
42
  "results.empty-state.no-filtered-results": "No result matches this query.",
41
43
  "results.empty-state.no-results": "No results - unable to generate any words.",
42
44
  "results.empty-state.outdated": "Results are outdated. Click below to update.",
package/src/i18n/es.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "Empezar a resolver",
36
36
  "keyMap.rack": "Estante",
37
37
  "keyMap.rack.insert-blank": "Insertar espacio en blanco (barra espaciadora)",
38
+ "menu": "Menú",
38
39
  "rack.placeholder": "Letras…",
39
40
  "remaining-tiles": "Casillas restantes",
41
+ "results": "Resultados",
40
42
  "results.empty-state.no-filtered-results": "Ningún resultado coincide con esta consulta.",
41
43
  "results.empty-state.no-results": "No hay resultados; no se pueden generar palabras",
42
44
  "results.empty-state.outdated": "Los resultados están desactualizados. Haga clic a continuación para actualizar.",
package/src/i18n/fa.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "حل کردن",
36
36
  "keyMap.rack": "طاقچه",
37
37
  "keyMap.rack.insert-blank": "وارد کردن کاشی خالی (دکمه اسپیس)",
38
+ "menu": "منو",
38
39
  "rack.placeholder": "لیستحرف",
39
40
  "remaining-tiles": "کاشی های باقی مانده",
41
+ "results": "نتایج",
40
42
  "results.empty-state.no-filtered-results": "پاسخی یافت نشد.",
41
43
  "results.empty-state.no-results": "کلمه قابل استفاده پیدا نشد.",
42
44
  "results.empty-state.outdated": "نتایج به روز نیستند، برای بروز رسانی کلیک کنید.",
package/src/i18n/fr.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "Commencer la résolution",
36
36
  "keyMap.rack": "Chevalet",
37
37
  "keyMap.rack.insert-blank": "Inserer une case vide (spacebar)",
38
+ "menu": "Menu",
38
39
  "rack.placeholder": "Lettres",
39
40
  "remaining-tiles": "Cases restantes",
41
+ "results": "Résultats",
40
42
  "results.empty-state.no-filtered-results": "Aucun résultat ne correspond à cette requête",
41
43
  "results.empty-state.no-results": "Pas de résultats - impossible de générer des mots.",
42
44
  "results.empty-state.outdated": "Les résultats sont dépassé. Cliquer ci-dessous pour mettre à jour.",
package/src/i18n/pl.json CHANGED
@@ -35,8 +35,10 @@
35
35
  "keyMap.board-and-rack.submit": "Rozpocznij wyszukiwanie",
36
36
  "keyMap.rack": "Stojak",
37
37
  "keyMap.rack.insert-blank": "Wstaw blanka (spacja)",
38
+ "menu": "Menu",
38
39
  "rack.placeholder": "Literki",
39
40
  "remaining-tiles": "Pozostałe płytki",
41
+ "results": "Wyniki",
40
42
  "results.empty-state.no-filtered-results": "Żaden wynik nie pasuje do tej kwerendy.",
41
43
  "results.empty-state.no-results": "Brak wyników - nie można wygenerować żadnego słowa.",
42
44
  "results.empty-state.outdated": "Wyniki są nieaktualne. Kliknij poniżej, aby zaktualizować.",
@@ -0,0 +1,5 @@
1
+ <!-- https://icons.getbootstrap.com/icons/card-checklist/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z" fill="currentColor" />
4
+ <path d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z" fill="currentColor" />
5
+ </svg>
@@ -1,4 +1,4 @@
1
- <!-- https://icons.getbootstrap.com/icons/check/ -->
1
+ <!-- https://icons.getbootstrap.com/icons/check2/ -->
2
2
  <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z" fill="currentColor" />
3
+ <path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" fill="currentColor" />
4
4
  </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/chevron-down/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z" fill="currentColor" />
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/x-circle-fill/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z" fill="currentColor" />
4
+ </svg>
File without changes
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/exclamation-triangle-fill/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" fill="currentColor" />
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/info-circle-fill/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" fill="currentColor" />
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/list/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" >
3
+ <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z" fill="currentColor" />
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/search/ -->
2
+ <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" fill="currentColor" />
4
+ </svg>
@@ -3,15 +3,19 @@ export { default as ArrowLeft } from './ArrowLeft.svg';
3
3
  export { default as ArrowRight } from './ArrowRight.svg';
4
4
  export { default as ArrowUp } from './ArrowUp.svg';
5
5
  export { default as BookHalf } from './BookHalf.svg';
6
+ export { default as CardChecklist } from './CardChecklist.svg';
6
7
  export { default as Check } from './Check.svg';
7
8
  export { default as CheckboxChecked } from './CheckboxChecked.svg';
8
9
  export { default as CheckboxEmpty } from './CheckboxEmpty.svg';
10
+ export { default as ChevronDown } from './ChevronDown.svg';
9
11
  export { default as Cog } from './Cog.svg';
10
12
  export { default as Cross } from './Cross.svg';
11
- export { default as CrossFill } from './CrossFill.svg';
13
+ export { default as CrossCircleFill } from './CrossCircleFill.svg';
14
+ export { default as CrossSquareFill } from './CrossSquareFill.svg';
12
15
  export { default as DashCircleFill } from './DashCircleFill.svg';
13
16
  export { default as Eraser } from './Eraser.svg';
14
17
  export { default as ExclamationSquareFill } from './ExclamationSquareFill.svg';
18
+ export { default as ExclamationTriangleFill } from './ExclamationTriangleFill.svg';
15
19
  export { default as Flag } from './Flag.svg';
16
20
  export { default as FlagEs } from './FlagEs.svg';
17
21
  export { default as FlagFa } from './FlagFa.svg';
@@ -21,9 +25,11 @@ export { default as FlagPl } from './FlagPl.svg';
21
25
  export { default as FlagUs } from './FlagUs.svg';
22
26
  export { default as FlagDe } from './FlagDe.svg';
23
27
  export { default as Github } from './Github.svg';
28
+ export { default as InfoCircleFill } from './InfoCircleFill.svg';
24
29
  export { default as Keyboard } from './Keyboard.svg';
25
- export { default as Play } from './Play.svg';
30
+ export { default as List } from './List.svg';
26
31
  export { default as Sack } from './Sack.svg';
32
+ export { default as Search } from './Search.svg';
27
33
  export { default as SortDown } from './SortDown.svg';
28
34
  export { default as SortUp } from './SortUp.svg';
29
35
  export { default as Star } from './Star.svg';
@@ -1,10 +1,8 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
+ import { Key, Modal } from 'components';
3
4
  import { selectConfig, useTranslate, useTypedSelector } from 'state';
4
5
 
5
- import Key from '../Key';
6
- import Sidebar from '../Sidebar';
7
-
8
6
  import { Mapping } from './components';
9
7
  import { ARROWS, BACKSPACE, CTRL, DEL, ENTER, SPACE } from './keys';
10
8
 
@@ -14,13 +12,13 @@ interface Props {
14
12
  onClose: () => void;
15
13
  }
16
14
 
17
- const KeyMap: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
15
+ const KeyMapModal: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
18
16
  const translate = useTranslate();
19
17
  const config = useTypedSelector(selectConfig);
20
18
 
21
19
  return (
22
- <Sidebar className={className} isOpen={isOpen} title={translate('keyMap')} onClose={onClose}>
23
- <Sidebar.Section title={translate('keyMap.board-and-rack')}>
20
+ <Modal className={className} isOpen={isOpen} title={translate('keyMap')} onClose={onClose}>
21
+ <Modal.Section title={translate('keyMap.board-and-rack')}>
24
22
  <Mapping description={translate('keyMap.board-and-rack.navigate')} mapping={[ARROWS]} />
25
23
  <Mapping description={translate('keyMap.board-and-rack.remove-tile')} mapping={[DEL, BACKSPACE]} />
26
24
  <Mapping description={translate('keyMap.board-and-rack.submit')} mapping={[ENTER]} />
@@ -39,18 +37,18 @@ const KeyMap: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
39
37
  ]}
40
38
  />
41
39
  )}
42
- </Sidebar.Section>
40
+ </Modal.Section>
43
41
 
44
- <Sidebar.Section title={translate('keyMap.board')}>
42
+ <Modal.Section title={translate('keyMap.board')}>
45
43
  <Mapping description={translate('keyMap.board.toggle-blank')} mapping={[SPACE, [CTRL, <Key key="b">B</Key>]]} />
46
44
  <Mapping description={translate('keyMap.board.toggle-direction')} mapping={[[CTRL, ARROWS]]} />
47
- </Sidebar.Section>
45
+ </Modal.Section>
48
46
 
49
- <Sidebar.Section title={translate('keyMap.rack')}>
47
+ <Modal.Section title={translate('keyMap.rack')}>
50
48
  <Mapping description={translate('keyMap.rack.insert-blank')} mapping={[SPACE]} />
51
- </Sidebar.Section>
52
- </Sidebar>
49
+ </Modal.Section>
50
+ </Modal>
53
51
  );
54
52
  };
55
53
 
56
- export default KeyMap;
54
+ export default KeyMapModal;
@@ -0,0 +1 @@
1
+ export { default } from './KeyMapModal';
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Key } from 'components';
3
4
  import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from 'icons';
4
5
  import { isMac } from 'lib';
5
6
 
6
- import Key from '../Key';
7
-
8
7
  export const ARROW_DOWN = (
9
8
  <Key>
10
9
  <ArrowLeft />
@@ -0,0 +1,11 @@
1
+ @import 'styles/mixins';
2
+
3
+ .button {
4
+ width: 100%;
5
+ margin-bottom: var(--spacing--m);
6
+ text-transform: none;
7
+
8
+ &:last-child {
9
+ margin-bottom: 0;
10
+ }
11
+ }
@@ -0,0 +1,56 @@
1
+ import { FunctionComponent } from 'react';
2
+
3
+ import { Button, Modal } from 'components';
4
+ import { CardChecklist, Cog, Github, Sack } from 'icons';
5
+ import { GITHUB_PROJECT_URL } from 'parameters';
6
+ import { useTranslate } from 'state';
7
+
8
+ import styles from './MenuModal.module.scss';
9
+
10
+ interface Props {
11
+ className?: string;
12
+ isOpen: boolean;
13
+ onClose: () => void;
14
+ onShowRemainingTiles: () => void;
15
+ onShowSettings: () => void;
16
+ onShowWords: () => void;
17
+ }
18
+
19
+ const Menu: FunctionComponent<Props> = ({
20
+ className,
21
+ isOpen,
22
+ onClose,
23
+ onShowRemainingTiles,
24
+ onShowSettings,
25
+ onShowWords,
26
+ }) => {
27
+ const translate = useTranslate();
28
+
29
+ return (
30
+ <Modal className={className} isOpen={isOpen} title={translate('menu')} onClose={onClose}>
31
+ <Button className={styles.button} Icon={Sack} onClick={onShowRemainingTiles}>
32
+ {translate('remaining-tiles')}
33
+ </Button>
34
+
35
+ <Button className={styles.button} Icon={CardChecklist} onClick={onShowWords}>
36
+ {translate('words')}
37
+ </Button>
38
+
39
+ <Button.Link
40
+ className={styles.button}
41
+ href={GITHUB_PROJECT_URL}
42
+ Icon={Github}
43
+ rel="noopener noreferrer"
44
+ target="_blank"
45
+ >
46
+ {translate('github')}
47
+ </Button.Link>
48
+
49
+ <Button className={styles.button} Icon={Cog} onClick={onShowSettings}>
50
+ {translate('settings')}
51
+ </Button>
52
+ </Modal>
53
+ );
54
+ };
55
+
56
+ export default Menu;
@@ -0,0 +1 @@
1
+ export { default } from './MenuModal';
@@ -0,0 +1,28 @@
1
+ .title {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ flex-wrap: wrap;
6
+ }
7
+
8
+ .content {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ gap: var(--spacing--l);
12
+ }
13
+
14
+ .badge {
15
+ [dir='ltr'] & {
16
+ margin-left: var(--spacing--m);
17
+ }
18
+
19
+ [dir='rtl'] & {
20
+ margin-right: var(--spacing--m);
21
+ }
22
+ }
23
+
24
+ .character {
25
+ display: flex;
26
+ flex: 0 1;
27
+ max-width: 50px;
28
+ }
@@ -1,13 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
+ import { Badge, Modal } from 'components';
3
4
  import { LOCALE_FEATURES } from 'i18n';
4
5
  import { selectLocale, selectRemainingTilesGroups, useTranslate, useTypedSelector } from 'state';
5
6
 
6
- import Badge from '../Badge';
7
- import Sidebar from '../Sidebar';
8
-
9
- import Character from './Character';
10
- import styles from './RemainingTiles.module.scss';
7
+ import { Character } from './components';
8
+ import styles from './RemainingTilesModal.module.scss';
11
9
 
12
10
  interface Props {
13
11
  className?: string;
@@ -15,20 +13,20 @@ interface Props {
15
13
  onClose: () => void;
16
14
  }
17
15
 
18
- const RemainingTiles: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
16
+ const RemainingTilesModal: FunctionComponent<Props> = ({ className, isOpen, onClose }) => {
19
17
  const translate = useTranslate();
20
18
  const locale = useTypedSelector(selectLocale);
21
19
  const groups = useTypedSelector(selectRemainingTilesGroups);
22
20
  const { direction } = LOCALE_FEATURES[locale];
23
21
 
24
22
  return (
25
- <Sidebar className={className} isOpen={isOpen} title={translate('remaining-tiles')} onClose={onClose}>
23
+ <Modal className={className} isOpen={isOpen} title={translate('remaining-tiles')} onClose={onClose}>
26
24
  {groups.map(({ remainingCount, tiles, translationKey, totalCount }) => {
27
25
  const current = direction === 'ltr' ? remainingCount : totalCount;
28
26
  const total = direction === 'ltr' ? totalCount : remainingCount;
29
27
 
30
28
  return (
31
- <Sidebar.Section
29
+ <Modal.Section
32
30
  key={translationKey}
33
31
  title={
34
32
  <span className={styles.title}>
@@ -41,14 +39,18 @@ const RemainingTiles: FunctionComponent<Props> = ({ className, isOpen, onClose }
41
39
  >
42
40
  <div className={styles.content}>
43
41
  {tiles.map((tile) => {
44
- return <Character key={tile.character} tile={tile} />;
42
+ return (
43
+ <div className={styles.character} key={tile.character}>
44
+ <Character tile={tile} />
45
+ </div>
46
+ );
45
47
  })}
46
48
  </div>
47
- </Sidebar.Section>
49
+ </Modal.Section>
48
50
  );
49
51
  })}
50
- </Sidebar>
52
+ </Modal>
51
53
  );
52
54
  };
53
55
 
54
- export default RemainingTiles;
56
+ export default RemainingTilesModal;
@@ -12,7 +12,7 @@
12
12
  opacity: 1;
13
13
 
14
14
  .tile {
15
- &:after {
15
+ &::after {
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -25,8 +25,12 @@
25
25
  }
26
26
  }
27
27
 
28
+ .remaining {
29
+ height: 6px;
30
+ margin-top: var(--spacing--m);
31
+ }
32
+
28
33
  .count {
29
34
  padding: var(--spacing--xs) 0;
30
- text-align: center;
31
- font-size: var(--font--size--s);
35
+ white-space: nowrap;
32
36
  }