scrabble-solver 2.15.9 → 2.15.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nx/workspace-data/file-map.json +1332 -1336
- package/.nx/workspace-data/lockfile.hash +1 -1
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/parsed-lock-file.json +204 -48
- package/.nx/workspace-data/project-graph.json +215 -49
- package/README.md +1 -1
- package/cypress/support/lib/actions.ts +2 -2
- package/cypress/support/lib/selectors.ts +9 -9
- package/cypress/tsconfig.json +2 -1
- package/cypress.config.ts +1 -0
- package/eslint.config.mjs +31 -8
- package/lerna.json +1 -1
- package/package.json +13 -11
- package/packages/configs/build/games/index.d.ts +1 -0
- package/packages/configs/build/games/index.js +1 -0
- package/packages/configs/build/games/kelimelik.d.ts +2 -1
- package/packages/configs/build/games/kelimelik.js +2 -1
- package/packages/configs/build/games/literaki.d.ts +2 -1
- package/packages/configs/build/games/literaki.js +2 -1
- package/packages/configs/build/games/scrabble.d.ts +2 -1
- package/packages/configs/build/games/scrabble.js +2 -1
- package/packages/configs/build/games/scrabbleDuel.d.ts +17 -0
- package/packages/configs/build/games/scrabbleDuel.js +50 -0
- package/packages/configs/build/games/superScrabble.d.ts +2 -1
- package/packages/configs/build/games/superScrabble.js +2 -1
- package/packages/configs/build/languages/english.d.ts +2 -0
- package/packages/configs/build/languages/english.js +65 -1
- package/packages/configs/package.json +3 -3
- package/packages/configs/src/games/index.ts +1 -0
- package/packages/configs/src/games/kelimelik.ts +2 -1
- package/packages/configs/src/games/literaki.ts +2 -1
- package/packages/configs/src/games/scrabble.ts +2 -1
- package/packages/configs/src/games/scrabbleDuel.ts +56 -0
- package/packages/configs/src/games/superScrabble.ts +2 -1
- package/packages/configs/src/languages/english.ts +67 -1
- package/packages/constants/package.json +1 -1
- package/packages/dictionaries/build/Dictionaries.d.ts +1 -2
- package/packages/dictionaries/build/Dictionaries.js +6 -5
- package/packages/dictionaries/build/index.d.ts +1 -1
- package/packages/dictionaries/build/index.js +2 -5
- package/packages/dictionaries/build/lib/DiskCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/DiskCache.js +7 -6
- package/packages/dictionaries/build/lib/LayeredCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/LayeredCache.js +7 -9
- package/packages/dictionaries/build/lib/MemoryCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/MemoryCache.js +2 -1
- package/packages/dictionaries/build/lib/createAsyncProxy.d.ts +2 -2
- package/packages/dictionaries/build/lib/createAsyncProxy.js +2 -1
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.d.ts +1 -2
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.js +2 -1
- package/packages/dictionaries/build/lib/downloadDictionary.d.ts +1 -2
- package/packages/dictionaries/build/lib/downloadDictionary.js +5 -7
- package/packages/dictionaries/build/lib/getDictionaryFilepath.d.ts +1 -2
- package/packages/dictionaries/build/lib/getDictionaryFilepath.js +2 -1
- package/packages/dictionaries/build/lib/index.d.ts +7 -7
- package/packages/dictionaries/build/lib/index.js +7 -10
- package/packages/dictionaries/build/{types/Cache.d.ts → types.d.ts} +1 -2
- package/packages/dictionaries/package.json +4 -4
- package/packages/dictionaries/src/Dictionaries.ts +3 -4
- package/packages/dictionaries/src/index.ts +2 -1
- package/packages/dictionaries/src/lib/DiskCache.ts +2 -4
- package/packages/dictionaries/src/lib/LayeredCache.ts +4 -6
- package/packages/dictionaries/src/lib/MemoryCache.ts +2 -3
- package/packages/dictionaries/src/lib/createAsyncProxy.ts +1 -3
- package/packages/dictionaries/src/lib/createCacheTimestampComparator.ts +1 -3
- package/packages/dictionaries/src/lib/downloadDictionary.ts +2 -4
- package/packages/dictionaries/src/lib/getDictionaryFilepath.ts +1 -3
- package/packages/dictionaries/src/lib/index.ts +7 -7
- package/packages/dictionaries/src/{types/Cache.ts → types.ts} +1 -3
- package/packages/logger/build/index.d.ts +1 -1
- package/packages/logger/build/index.js +2 -5
- package/packages/logger/build/logger.d.ts +1 -2
- package/packages/logger/build/logger.js +2 -2
- package/packages/logger/package.json +1 -1
- package/packages/logger/src/index.ts +1 -1
- package/packages/logger/src/logger.ts +1 -3
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +9 -9
- package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
- package/packages/scrabble-solver/.next/next-minimal-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
- package/packages/scrabble-solver/.next/required-server-files.json +1 -2
- package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
- package/packages/scrabble-solver/.next/server/chunks/60.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/812.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/974.js +1 -1
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/visit.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +1 -1
- package/packages/scrabble-solver/.next/static/chunks/{main-b934e2c3dd3b55b5.js → main-016492249b3393e2.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/{404-7451dd58396eaa39.js → 404-590e2a3839c1d9e0.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-ac93a74c390f2ab8.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/index-e5f1caa581e6d3b8.js +1 -0
- package/packages/scrabble-solver/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_buildManifest.js +1 -1
- package/packages/scrabble-solver/.next/trace +23 -23
- package/packages/scrabble-solver/next.config.js +3 -0
- package/packages/scrabble-solver/package.json +9 -9
- package/packages/scrabble-solver/public/service-worker.js +2 -2
- package/packages/scrabble-solver/public/service-worker.js.map +1 -1
- package/packages/scrabble-solver/src/api/getServerLoggingData.ts +1 -3
- package/packages/scrabble-solver/src/api/index.ts +5 -5
- package/packages/scrabble-solver/src/api/isBoardValid.ts +3 -5
- package/packages/scrabble-solver/src/api/isCellValid.ts +4 -6
- package/packages/scrabble-solver/src/api/isCharacterValid.ts +2 -3
- package/packages/scrabble-solver/src/api/isRowValid.ts +3 -5
- package/packages/scrabble-solver/src/components/Alert/Alert.tsx +1 -3
- package/packages/scrabble-solver/src/components/Alert/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Badge/Badge.tsx +1 -3
- package/packages/scrabble-solver/src/components/Badge/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/Board.tsx +2 -4
- package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +2 -2
- package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/Actions/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/Cell/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/index.ts +4 -4
- package/packages/scrabble-solver/src/components/Board/hooks/index.ts +6 -6
- package/packages/scrabble-solver/src/components/Board/hooks/useBackgroundImage.tsx +7 -9
- package/packages/scrabble-solver/src/components/Board/hooks/useBoardStyle.ts +7 -9
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingActions.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingFocus.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingInputPrompt.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useGrid.ts +2 -4
- package/packages/scrabble-solver/src/components/Board/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/lib/getBonusColor.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/lib/getPositionInGrid.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/lib/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Button/Button.tsx +3 -3
- package/packages/scrabble-solver/src/components/Button/Link.tsx +1 -3
- package/packages/scrabble-solver/src/components/Button/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +3 -5
- package/packages/scrabble-solver/src/components/Dictionary/index.ts +1 -1
- package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.tsx +1 -3
- package/packages/scrabble-solver/src/components/DictionaryInput/index.ts +1 -1
- package/packages/scrabble-solver/src/components/EmptyState/EmptyState.tsx +2 -4
- package/packages/scrabble-solver/src/components/EmptyState/index.ts +1 -1
- package/packages/scrabble-solver/src/components/IconButton/IconButton.tsx +3 -3
- package/packages/scrabble-solver/src/components/IconButton/Link.tsx +1 -3
- package/packages/scrabble-solver/src/components/IconButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Key/Key.tsx +1 -3
- package/packages/scrabble-solver/src/components/Key/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.tsx +2 -4
- package/packages/scrabble-solver/src/components/Keys/Arrows/index.ts +1 -1
- package/packages/scrabble-solver/src/components/{keys.tsx → Keys/index.tsx} +3 -1
- package/packages/scrabble-solver/src/components/Loading/Loading.tsx +2 -4
- package/packages/scrabble-solver/src/components/Loading/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Logo/Logo.tsx +1 -3
- package/packages/scrabble-solver/src/components/Logo/LogoBlueprint.tsx +2 -4
- package/packages/scrabble-solver/src/components/Logo/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/Modal.tsx +3 -3
- package/packages/scrabble-solver/src/components/Modal/components/Section/Section.tsx +1 -3
- package/packages/scrabble-solver/src/components/Modal/components/Section/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/index.ts +1 -1
- package/packages/scrabble-solver/src/components/NavButtons/NavButtons.tsx +3 -3
- package/packages/scrabble-solver/src/components/NavButtons/index.ts +1 -1
- package/packages/scrabble-solver/src/components/NotFound/NotFound.tsx +2 -4
- package/packages/scrabble-solver/src/components/NotFound/index.ts +1 -1
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.tsx +10 -4
- package/packages/scrabble-solver/src/components/PlainTiles/Tile.tsx +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/index.ts +1 -1
- package/packages/scrabble-solver/src/components/PlainTiles/lib/createPlainTile.ts +10 -6
- package/packages/scrabble-solver/src/components/PlainTiles/lib/createPlainTiles.ts +2 -4
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getViewbox.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getX.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getY.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/index.ts +6 -6
- package/packages/scrabble-solver/src/components/PlainTiles/lib/randomize.ts +1 -3
- package/packages/scrabble-solver/src/components/Progress/Progress.tsx +1 -3
- package/packages/scrabble-solver/src/components/Progress/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/Rack.tsx +2 -4
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.tsx +2 -2
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.tsx +4 -7
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/components/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Rack/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Radio/Radio.tsx +1 -3
- package/packages/scrabble-solver/src/components/Radio/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Results/Cell.tsx +9 -3
- package/packages/scrabble-solver/src/components/Results/Header.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/HeaderButton.tsx +1 -3
- package/packages/scrabble-solver/src/components/Results/Result.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/Results.tsx +7 -9
- package/packages/scrabble-solver/src/components/Results/SolveButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/index.ts +1 -1
- package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.tsx +1 -3
- package/packages/scrabble-solver/src/components/ResultsInput/index.ts +1 -1
- package/packages/scrabble-solver/src/components/SeoMessage/SeoMessage.tsx +4 -6
- package/packages/scrabble-solver/src/components/SeoMessage/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/Solver.tsx +8 -8
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +4 -6
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/components/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Solver/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Spinner/Spinner.tsx +1 -3
- package/packages/scrabble-solver/src/components/Spinner/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Tile/Tile.tsx +2 -4
- package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +2 -2
- package/packages/scrabble-solver/src/components/Tile/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Tooltip/TooltipTrigger.tsx +5 -3
- package/packages/scrabble-solver/src/components/index.ts +24 -25
- package/packages/scrabble-solver/src/hooks/index.ts +13 -13
- package/packages/scrabble-solver/src/hooks/useAppLayout.ts +19 -15
- package/packages/scrabble-solver/src/hooks/useColumns.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useDirection.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useEffectOnce.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useIsTouchDevice.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useLanguage.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useLatest.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useLocalStorage.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useMedia.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useMediaQueries.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useMediaQuery.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useOnWindowResize.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useViewportSize.ts +2 -4
- package/packages/scrabble-solver/src/i18n/i18n.ts +1 -3
- package/packages/scrabble-solver/src/i18n/index.ts +1 -1
- package/packages/scrabble-solver/src/lib/arrayEquals.ts +1 -3
- package/packages/scrabble-solver/src/lib/createArray.ts +1 -3
- package/packages/scrabble-solver/src/lib/createComparator.ts +3 -5
- package/packages/scrabble-solver/src/lib/createGridOf.ts +2 -4
- package/packages/scrabble-solver/src/lib/createKeyComparator.ts +6 -5
- package/packages/scrabble-solver/src/lib/createKeyboardNavigation.ts +2 -4
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/createRegExp.ts +1 -3
- package/packages/scrabble-solver/src/lib/createStringComparator.ts +5 -3
- package/packages/scrabble-solver/src/lib/detectLocale.ts +1 -3
- package/packages/scrabble-solver/src/lib/extractCharacters.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/extractCharacters.ts +1 -3
- package/packages/scrabble-solver/src/lib/extractCharactersByCase.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/extractCharactersByCase.ts +2 -4
- package/packages/scrabble-solver/src/lib/extractInputValue.ts +1 -3
- package/packages/scrabble-solver/src/lib/findCell.ts +1 -3
- package/packages/scrabble-solver/src/lib/getCellSize.ts +3 -5
- package/packages/scrabble-solver/src/lib/getCoordinate.ts +1 -3
- package/packages/scrabble-solver/src/lib/getCoordinates.ts +2 -4
- package/packages/scrabble-solver/src/lib/getRemainingTiles.ts +8 -5
- package/packages/scrabble-solver/src/lib/getRemainingTilesCount.ts +1 -3
- package/packages/scrabble-solver/src/lib/getRemainingTilesGroups.ts +3 -5
- package/packages/scrabble-solver/src/lib/getTileSizes.ts +1 -3
- package/packages/scrabble-solver/src/lib/getTotalRemainingTilesCount.ts +1 -3
- package/packages/scrabble-solver/src/lib/groupResults.ts +3 -5
- package/packages/scrabble-solver/src/lib/guessLocale.ts +2 -4
- package/packages/scrabble-solver/src/lib/index.ts +39 -39
- package/packages/scrabble-solver/src/lib/inverseDirection.ts +1 -3
- package/packages/scrabble-solver/src/lib/isCtrl.ts +1 -3
- package/packages/scrabble-solver/src/lib/isMac.ts +3 -4
- package/packages/scrabble-solver/src/lib/isRegExp.ts +1 -3
- package/packages/scrabble-solver/src/lib/isStringArray.ts +1 -3
- package/packages/scrabble-solver/src/lib/isUpperCase.ts +1 -3
- package/packages/scrabble-solver/src/lib/memoize.ts +18 -20
- package/packages/scrabble-solver/src/lib/noop.ts +1 -3
- package/packages/scrabble-solver/src/lib/numberComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/resultMatchesCellFilter.ts +1 -3
- package/packages/scrabble-solver/src/lib/reverseComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/sortGroupedResults.ts +2 -4
- package/packages/scrabble-solver/src/lib/sortResults.ts +5 -7
- package/packages/scrabble-solver/src/lib/unorderedArraysEqual.ts +2 -4
- package/packages/scrabble-solver/src/lib/zipCharactersAndTiles.ts +1 -3
- package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/DictionaryModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/KeyMapModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +1 -3
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/MenuModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +1 -3
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/ResultsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/SettingsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +4 -10
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/lib.ts +19 -0
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/index.ts +5 -5
- package/packages/scrabble-solver/src/modals/SettingsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/WordsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/index.ts +7 -7
- package/packages/scrabble-solver/src/pages/_app.tsx +2 -1
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/[word].ts +1 -1
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/index.ts +1 -1
- package/packages/scrabble-solver/src/pages/api/solve.ts +6 -4
- package/packages/scrabble-solver/src/pages/api/verify.ts +6 -4
- package/packages/scrabble-solver/src/pages/api/visit.ts +2 -2
- package/packages/scrabble-solver/src/pages/index.tsx +7 -0
- package/packages/scrabble-solver/src/sdk/fetch.ts +1 -3
- package/packages/scrabble-solver/src/sdk/fetchJson.ts +2 -4
- package/packages/scrabble-solver/src/sdk/findWordDefinitions.ts +2 -4
- package/packages/scrabble-solver/src/sdk/getDictionary.ts +2 -4
- package/packages/scrabble-solver/src/sdk/index.ts +4 -4
- package/packages/scrabble-solver/src/sdk/solve.ts +2 -4
- package/packages/scrabble-solver/src/sdk/verify.ts +2 -4
- package/packages/scrabble-solver/src/sdk/visit.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/average.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/expirationManager.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/getDictionary.ts +3 -5
- package/packages/scrabble-solver/src/service-worker/dictionaries/getDictionaryUrl.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/index.ts +2 -2
- package/packages/scrabble-solver/src/service-worker/dictionaries/revalidateDictionary.ts +3 -5
- package/packages/scrabble-solver/src/service-worker/getTrie.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/index.ts +4 -2
- package/packages/scrabble-solver/src/service-worker/routeSolveRequests.ts +17 -11
- package/packages/scrabble-solver/src/service-worker/routeVerifyRequests.ts +7 -5
- package/packages/scrabble-solver/src/serviceWorkerManager.ts +4 -4
- package/packages/scrabble-solver/src/state/index.ts +4 -4
- package/packages/scrabble-solver/src/state/localStorage.ts +10 -12
- package/packages/scrabble-solver/src/state/sagas.ts +4 -1
- package/packages/scrabble-solver/src/state/selectors.ts +2 -5
- package/packages/scrabble-solver/src/state/slices/boardInitialState.ts +6 -7
- package/packages/scrabble-solver/src/state/slices/boardSlice.ts +5 -7
- package/packages/scrabble-solver/src/state/slices/cellFilterInitialState.ts +1 -3
- package/packages/scrabble-solver/src/state/slices/cellFilterSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/dictionaryInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/dictionarySlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/index.ts +16 -16
- package/packages/scrabble-solver/src/state/slices/rackInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/rackSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/resultsInitialState.ts +1 -3
- package/packages/scrabble-solver/src/state/slices/resultsSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/settingsInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/settingsSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/solveInitialState.ts +3 -5
- package/packages/scrabble-solver/src/state/slices/solveSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/verifyInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/verifySlice.ts +2 -4
- package/packages/scrabble-solver/src/state/store.ts +1 -3
- package/packages/scrabble-solver/src/state/useTranslate.ts +2 -4
- package/packages/scrabble-solver/src/state/useTypedSelector.ts +1 -3
- package/packages/scrabble-solver/src/types/api.ts +15 -0
- package/packages/scrabble-solver/src/types/index.ts +2 -0
- package/packages/scrabble-solver/tsconfig.json +1 -1
- package/packages/solver/build/areDigraphsValid.d.ts +1 -2
- package/packages/solver/build/areDigraphsValid.js +2 -1
- package/packages/solver/build/fillPattern.d.ts +1 -2
- package/packages/solver/build/fillPattern.js +2 -2
- package/packages/solver/build/generateEndIndices.d.ts +1 -2
- package/packages/solver/build/generateEndIndices.js +2 -1
- package/packages/solver/build/generateHorizontalPatterns.d.ts +1 -2
- package/packages/solver/build/generateHorizontalPatterns.js +7 -8
- package/packages/solver/build/generatePattern.d.ts +1 -2
- package/packages/solver/build/generatePattern.js +6 -8
- package/packages/solver/build/generatePatterns.d.ts +1 -2
- package/packages/solver/build/generatePatterns.js +6 -8
- package/packages/solver/build/generateStartIndices.d.ts +1 -2
- package/packages/solver/build/generateStartIndices.js +2 -1
- package/packages/solver/build/generateVectors.d.ts +2 -2
- package/packages/solver/build/generateVectors.js +2 -1
- package/packages/solver/build/generateVerticalPatterns.d.ts +1 -2
- package/packages/solver/build/generateVerticalPatterns.js +7 -8
- package/packages/solver/build/getCellsScore.d.ts +1 -2
- package/packages/solver/build/getCellsScore.js +2 -1
- package/packages/solver/build/getPatternHash.d.ts +1 -2
- package/packages/solver/build/getPatternHash.js +2 -1
- package/packages/solver/build/getPatternScore.d.ts +1 -2
- package/packages/solver/build/getPatternScore.js +4 -6
- package/packages/solver/build/getUniquePatterns.d.ts +1 -2
- package/packages/solver/build/getUniquePatterns.js +4 -6
- package/packages/solver/build/index.d.ts +14 -14
- package/packages/solver/build/index.js +14 -17
- package/packages/solver/build/solve.d.ts +1 -2
- package/packages/solver/build/solve.js +12 -14
- package/packages/solver/package.json +5 -5
- package/packages/solver/src/areDigraphsValid.ts +1 -3
- package/packages/solver/src/fillPattern.test.ts +1 -1
- package/packages/solver/src/fillPattern.ts +1 -3
- package/packages/solver/src/generateEndIndices.test.ts +1 -1
- package/packages/solver/src/generateEndIndices.ts +1 -3
- package/packages/solver/src/generateHorizontalPatterns.test.ts +3 -2
- package/packages/solver/src/generateHorizontalPatterns.ts +5 -6
- package/packages/solver/src/generatePattern.ts +3 -5
- package/packages/solver/src/generatePatterns.test.ts +2 -2
- package/packages/solver/src/generatePatterns.ts +3 -5
- package/packages/solver/src/generateStartIndices.test.ts +1 -1
- package/packages/solver/src/generateStartIndices.ts +1 -3
- package/packages/solver/src/generateVectors.test.ts +1 -1
- package/packages/solver/src/generateVectors.ts +1 -3
- package/packages/solver/src/generateVerticalPatterns.test.ts +3 -2
- package/packages/solver/src/generateVerticalPatterns.ts +5 -6
- package/packages/solver/src/getCellsScore.ts +1 -3
- package/packages/solver/src/getPatternHash.test.ts +1 -1
- package/packages/solver/src/getPatternHash.ts +1 -3
- package/packages/solver/src/getPatternScore.test.ts +1 -1
- package/packages/solver/src/getPatternScore.ts +2 -4
- package/packages/solver/src/getUniquePatterns.ts +2 -4
- package/packages/solver/src/index.ts +14 -14
- package/packages/solver/src/solve.test.ts +1 -1
- package/packages/solver/src/solve.ts +6 -8
- package/packages/types/build/Board.d.ts +5 -6
- package/packages/types/build/Board.js +17 -16
- package/packages/types/build/BoardJson.d.ts +2 -3
- package/packages/types/build/Bonus.d.ts +5 -6
- package/packages/types/build/Bonus.js +2 -1
- package/packages/types/build/BonusJson.d.ts +1 -2
- package/packages/types/build/BonusValue.d.ts +1 -2
- package/packages/types/build/Cell.d.ts +4 -5
- package/packages/types/build/Cell.js +13 -15
- package/packages/types/build/CellJson.d.ts +2 -3
- package/packages/types/build/CellJson.js +2 -5
- package/packages/types/build/CharacterBonus.d.ts +5 -6
- package/packages/types/build/CharacterBonus.js +4 -6
- package/packages/types/build/Collision.d.ts +2 -3
- package/packages/types/build/CollisionJson.d.ts +2 -3
- package/packages/types/build/Config.d.ts +12 -12
- package/packages/types/build/Config.js +14 -13
- package/packages/types/build/ConfigJson.d.ts +7 -7
- package/packages/types/build/Dictionary.d.ts +2 -3
- package/packages/types/build/FinalPattern.d.ts +2 -3
- package/packages/types/build/FinalPattern.js +4 -6
- package/packages/types/build/Game.d.ts +2 -2
- package/packages/types/build/Game.js +3 -3
- package/packages/types/build/HorizontalPattern.d.ts +2 -3
- package/packages/types/build/HorizontalPattern.js +5 -7
- package/packages/types/build/Locale.d.ts +1 -2
- package/packages/types/build/Locale.js +2 -3
- package/packages/types/build/Pattern.d.ts +5 -6
- package/packages/types/build/Pattern.js +2 -1
- package/packages/types/build/PatternJson.d.ts +2 -3
- package/packages/types/build/Result.d.ts +6 -6
- package/packages/types/build/Result.js +11 -13
- package/packages/types/build/ResultJson.d.ts +3 -4
- package/packages/types/build/ShowCoordinates.d.ts +1 -2
- package/packages/types/build/Tile.d.ts +3 -4
- package/packages/types/build/Tile.js +11 -10
- package/packages/types/build/TileConfig.d.ts +1 -2
- package/packages/types/build/TileJson.d.ts +1 -2
- package/packages/types/build/TileJson.js +2 -5
- package/packages/types/build/VerticalPattern.d.ts +2 -3
- package/packages/types/build/VerticalPattern.js +5 -7
- package/packages/types/build/WordBonus.d.ts +3 -4
- package/packages/types/build/WordBonus.js +4 -6
- package/packages/types/build/WordDefinition.d.ts +3 -4
- package/packages/types/build/WordDefinition.js +13 -12
- package/packages/types/build/WordDefinitionJson.d.ts +1 -2
- package/packages/types/build/index.d.ts +31 -31
- package/packages/types/build/index.js +20 -23
- package/packages/types/build/isError.d.ts +1 -2
- package/packages/types/build/isError.js +4 -6
- package/packages/types/build/isObject.d.ts +1 -2
- package/packages/types/build/isObject.js +2 -1
- package/packages/types/package.json +2 -2
- package/packages/types/src/Board.ts +14 -13
- package/packages/types/src/BoardJson.ts +2 -4
- package/packages/types/src/Bonus.ts +5 -7
- package/packages/types/src/BonusJson.ts +1 -3
- package/packages/types/src/BonusValue.ts +1 -3
- package/packages/types/src/Cell.ts +5 -7
- package/packages/types/src/CellJson.ts +3 -5
- package/packages/types/src/CharacterBonus.ts +5 -7
- package/packages/types/src/Collision.ts +2 -4
- package/packages/types/src/CollisionJson.ts +2 -4
- package/packages/types/src/Config.ts +20 -18
- package/packages/types/src/ConfigJson.ts +7 -8
- package/packages/types/src/Dictionary.ts +2 -4
- package/packages/types/src/FinalPattern.ts +2 -4
- package/packages/types/src/Game.ts +2 -3
- package/packages/types/src/HorizontalPattern.ts +2 -4
- package/packages/types/src/Locale.ts +1 -3
- package/packages/types/src/Pattern.ts +5 -7
- package/packages/types/src/PatternJson.ts +2 -4
- package/packages/types/src/Result.ts +6 -8
- package/packages/types/src/ResultJson.ts +3 -5
- package/packages/types/src/ShowCoordinates.ts +1 -3
- package/packages/types/src/Tile.ts +4 -6
- package/packages/types/src/TileConfig.ts +1 -3
- package/packages/types/src/TileJson.ts +2 -4
- package/packages/types/src/VerticalPattern.ts +2 -4
- package/packages/types/src/WordBonus.ts +3 -5
- package/packages/types/src/WordDefinition.ts +4 -6
- package/packages/types/src/WordDefinitionJson.ts +1 -3
- package/packages/types/src/index.ts +31 -31
- package/packages/types/src/isError.ts +2 -4
- package/packages/types/src/isObject.ts +1 -3
- package/packages/word-definitions/build/languages/turkish.js +1 -1
- package/packages/word-definitions/build/lib/index.d.ts +3 -3
- package/packages/word-definitions/build/lib/index.js +7 -17
- package/packages/word-definitions/build/lib/request.js +2 -1
- package/packages/word-definitions/package.json +2 -2
- package/packages/word-definitions/src/languages/turkish.ts +3 -3
- package/packages/word-definitions/src/lib/index.ts +3 -3
- package/packages/word-definitions/src/lib/request.ts +2 -1
- package/packages/word-definitions/src/parse.test.ts +1 -1
- package/packages/word-lists/build/languages/polish.js +1 -1
- package/packages/word-lists/build/lib/downloadFile.d.ts +1 -2
- package/packages/word-lists/build/lib/downloadFile.js +4 -3
- package/packages/word-lists/build/lib/downloadHtml.d.ts +1 -2
- package/packages/word-lists/build/lib/downloadHtml.js +2 -1
- package/packages/word-lists/build/lib/extractWords.d.ts +1 -2
- package/packages/word-lists/build/lib/extractWords.js +4 -6
- package/packages/word-lists/build/lib/findFirstWordIndex.d.ts +1 -2
- package/packages/word-lists/build/lib/findFirstWordIndex.js +2 -1
- package/packages/word-lists/build/lib/getHash.d.ts +1 -2
- package/packages/word-lists/build/lib/getHash.js +2 -1
- package/packages/word-lists/build/lib/getTempFilepath.d.ts +1 -2
- package/packages/word-lists/build/lib/getTempFilepath.js +4 -3
- package/packages/word-lists/build/lib/getTxtWordList.d.ts +1 -2
- package/packages/word-lists/build/lib/getTxtWordList.js +6 -5
- package/packages/word-lists/build/lib/index.d.ts +10 -10
- package/packages/word-lists/build/lib/index.js +10 -13
- package/packages/word-lists/build/lib/transliterateDiacritics.d.ts +1 -2
- package/packages/word-lists/build/lib/transliterateDiacritics.js +4 -6
- package/packages/word-lists/build/lib/unique.d.ts +1 -2
- package/packages/word-lists/build/lib/unique.js +2 -1
- package/packages/word-lists/build/lib/unzip.d.ts +1 -2
- package/packages/word-lists/build/lib/unzip.js +2 -1
- package/packages/word-lists/package.json +2 -2
- package/packages/word-lists/src/languages/polish.ts +1 -1
- package/packages/word-lists/src/lib/downloadFile.ts +2 -4
- package/packages/word-lists/src/lib/downloadHtml.ts +1 -3
- package/packages/word-lists/src/lib/extractWords.ts +2 -4
- package/packages/word-lists/src/lib/findFirstWordIndex.ts +1 -3
- package/packages/word-lists/src/lib/getHash.ts +1 -3
- package/packages/word-lists/src/lib/getTempFilepath.ts +2 -4
- package/packages/word-lists/src/lib/getTxtWordList.ts +3 -5
- package/packages/word-lists/src/lib/index.ts +10 -10
- package/packages/word-lists/src/lib/transliterateDiacritics.ts +2 -4
- package/packages/word-lists/src/lib/unique.ts +1 -3
- package/packages/word-lists/src/lib/unzip.ts +3 -5
- package/tsconfig.jest.json +1 -2
- package/tsconfig.json +2 -1
- package/.eslintrc.js +0 -559
- package/packages/dictionaries/build/types/index.d.ts +0 -1
- package/packages/dictionaries/build/types/index.js +0 -2
- package/packages/dictionaries/src/types/index.ts +0 -1
- package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-735105409cfdb48f.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/index-d492616d9bc42176.js +0 -1
- package/packages/scrabble-solver/src/components/Keys/index.ts +0 -1
- package/packages/scrabble-solver/tsconfig.jest.json +0 -7
- /package/packages/dictionaries/build/{constants/index.d.ts → constants.d.ts} +0 -0
- /package/packages/dictionaries/build/{constants/index.js → constants.js} +0 -0
- /package/packages/dictionaries/build/{types/Cache.js → types.js} +0 -0
- /package/packages/dictionaries/src/{constants/index.ts → constants.ts} +0 -0
- /package/packages/scrabble-solver/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_ssgManifest.js +0 -0
|
@@ -18,7 +18,7 @@ interface Props {
|
|
|
18
18
|
style?: CSSProperties;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const HeaderButton = ({ className, Icon, id, translationKey, style }: Props): ReactElement => {
|
|
21
|
+
export const HeaderButton = ({ className, Icon, id, translationKey, style }: Props): ReactElement => {
|
|
22
22
|
const dispatch = useDispatch();
|
|
23
23
|
const translate = useTranslate();
|
|
24
24
|
const sort = useTypedSelector(selectResultsSort);
|
|
@@ -52,5 +52,3 @@ const HeaderButton = ({ className, Icon, id, translationKey, style }: Props): Re
|
|
|
52
52
|
</Tooltip>
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
export default HeaderButton;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from 'state';
|
|
15
15
|
import { ResultColumnId } from 'types';
|
|
16
16
|
|
|
17
|
-
import Cell from './Cell';
|
|
17
|
+
import { Cell } from './Cell';
|
|
18
18
|
import styles from './Results.module.scss';
|
|
19
19
|
import { ResultData } from './types';
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ interface Props {
|
|
|
24
24
|
style?: CSSProperties;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const Result = ({ data, index, style }: Props): ReactElement => {
|
|
27
|
+
export const Result = ({ data, index, style }: Props): ReactElement => {
|
|
28
28
|
const {
|
|
29
29
|
highlightedIndex,
|
|
30
30
|
results = [],
|
|
@@ -118,5 +118,3 @@ const Result = ({ data, index, style }: Props): ReactElement => {
|
|
|
118
118
|
</button>
|
|
119
119
|
);
|
|
120
120
|
};
|
|
121
|
-
|
|
122
|
-
export default Result;
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
useTypedSelector,
|
|
17
17
|
} from 'state';
|
|
18
18
|
|
|
19
|
-
import EmptyState from '../EmptyState';
|
|
20
|
-
import Loading from '../Loading';
|
|
21
|
-
import ResultsInput from '../ResultsInput';
|
|
19
|
+
import { EmptyState } from '../EmptyState';
|
|
20
|
+
import { Loading } from '../Loading';
|
|
21
|
+
import { ResultsInput } from '../ResultsInput';
|
|
22
22
|
|
|
23
|
-
import Header from './Header';
|
|
24
|
-
import Result from './Result';
|
|
23
|
+
import { Header } from './Header';
|
|
24
|
+
import { Result } from './Result';
|
|
25
25
|
import styles from './Results.module.scss';
|
|
26
|
-
import SolveButton from './SolveButton';
|
|
26
|
+
import { SolveButton } from './SolveButton';
|
|
27
27
|
import { ResultCallbacks, ResultData } from './types';
|
|
28
28
|
|
|
29
29
|
interface Props {
|
|
@@ -34,7 +34,7 @@ interface Props {
|
|
|
34
34
|
|
|
35
35
|
const IS_LOADING_DEBOUNCE = 100;
|
|
36
36
|
|
|
37
|
-
const Results: FunctionComponent<Props> = ({ callbacks, className, highlightedIndex }) => {
|
|
37
|
+
export const Results: FunctionComponent<Props> = ({ callbacks, className, highlightedIndex }) => {
|
|
38
38
|
const translate = useTranslate();
|
|
39
39
|
const { resultsHeight, resultsWidth } = useAppLayout();
|
|
40
40
|
const locale = useTypedSelector(selectLocale);
|
|
@@ -130,5 +130,3 @@ const Results: FunctionComponent<Props> = ({ callbacks, className, highlightedIn
|
|
|
130
130
|
</div>
|
|
131
131
|
);
|
|
132
132
|
};
|
|
133
|
-
|
|
134
|
-
export default Results;
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
useTypedSelector,
|
|
12
12
|
} from 'state';
|
|
13
13
|
|
|
14
|
-
import Button from '../Button';
|
|
14
|
+
import { Button } from '../Button';
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
17
|
className?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const SolveButton: FunctionComponent<Props> = ({ className }) => {
|
|
20
|
+
export const SolveButton: FunctionComponent<Props> = ({ className }) => {
|
|
21
21
|
const dispatch = useDispatch();
|
|
22
22
|
const translate = useTranslate();
|
|
23
23
|
const isLoading = useTypedSelector(selectIsLoading);
|
|
@@ -43,5 +43,3 @@ const SolveButton: FunctionComponent<Props> = ({ className }) => {
|
|
|
43
43
|
</Button>
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
export default SolveButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Results } from './Results';
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ResultsInput: FunctionComponent<Props> = ({ className }) => {
|
|
14
|
+
export const ResultsInput: FunctionComponent<Props> = ({ className }) => {
|
|
15
15
|
const dispatch = useDispatch();
|
|
16
16
|
const translate = useTranslate();
|
|
17
17
|
const value = useTypedSelector(selectResultsQuery);
|
|
@@ -43,5 +43,3 @@ const ResultsInput: FunctionComponent<Props> = ({ className }) => {
|
|
|
43
43
|
</form>
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
export default ResultsInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ResultsInput } from './ResultsInput';
|
|
@@ -8,12 +8,10 @@ const INVISIBLE_STYLE: CSSProperties = {
|
|
|
8
8
|
transform: 'translateY(-9999px)',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const SeoMessage: FunctionComponent = () => (
|
|
11
|
+
export const SeoMessage: FunctionComponent = () => (
|
|
12
12
|
<p style={INVISIBLE_STYLE}>
|
|
13
|
-
Scrabble Solver 2 is a free and open-source analysis tool for Scrabble, Super Scrabble
|
|
14
|
-
top scoring words using given letters and board state. Available in English, French, German,
|
|
15
|
-
Source code is available on GitHub - contributions are welcome!
|
|
13
|
+
Scrabble Solver 2 is a free and open-source analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Literaki, and
|
|
14
|
+
Kelimelik. Quickly find top scoring words using given letters and board state. Available in English, French, German,
|
|
15
|
+
Persian, Polish, Romanian, Spanish, and Turkish. Source code is available on GitHub - contributions are welcome!
|
|
16
16
|
</p>
|
|
17
17
|
);
|
|
18
|
-
|
|
19
|
-
export default SeoMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { SeoMessage } from './SeoMessage';
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
useTypedSelector,
|
|
16
16
|
} from 'state';
|
|
17
17
|
|
|
18
|
-
import Alert from '../Alert';
|
|
19
|
-
import Board from '../Board';
|
|
20
|
-
import Dictionary from '../Dictionary';
|
|
21
|
-
import DictionaryInput from '../DictionaryInput';
|
|
22
|
-
import Rack from '../Rack';
|
|
23
|
-
import Results from '../Results';
|
|
18
|
+
import { Alert } from '../Alert';
|
|
19
|
+
import { Board } from '../Board';
|
|
20
|
+
import { Dictionary } from '../Dictionary';
|
|
21
|
+
import { DictionaryInput } from '../DictionaryInput';
|
|
22
|
+
import { Rack } from '../Rack';
|
|
23
|
+
import { Results } from '../Results';
|
|
24
24
|
|
|
25
25
|
import { ResultCandidatePicker } from './components';
|
|
26
26
|
import styles from './Solver.module.scss';
|
|
@@ -30,7 +30,7 @@ interface Props {
|
|
|
30
30
|
onShowResults: () => void;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const SolverBase: FunctionComponent<Props> = ({ className, onShowResults }) => {
|
|
34
34
|
const dispatch = useDispatch();
|
|
35
35
|
const translate = useTranslate();
|
|
36
36
|
const isTouchDevice = useIsTouchDevice();
|
|
@@ -138,4 +138,4 @@ const Solver: FunctionComponent<Props> = ({ className, onShowResults }) => {
|
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
export
|
|
141
|
+
export const Solver = memo(SolverBase);
|
package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { useDispatch } from 'react-redux';
|
|
|
5
5
|
import { Check } from 'icons';
|
|
6
6
|
import { resultsSlice, selectAreResultsOutdated, selectResultCandidate, useTranslate, useTypedSelector } from 'state';
|
|
7
7
|
|
|
8
|
-
import Button from '../../../Button';
|
|
8
|
+
import { Button } from '../../../Button';
|
|
9
9
|
|
|
10
10
|
import styles from './InsertButton.module.scss';
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ interface Props {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const InsertButton: FunctionComponent<Props> = ({ className }) => {
|
|
16
|
+
export const InsertButton: FunctionComponent<Props> = ({ className }) => {
|
|
17
17
|
const dispatch = useDispatch();
|
|
18
18
|
const translate = useTranslate();
|
|
19
19
|
const resultCandidate = useTypedSelector(selectResultCandidate);
|
|
@@ -38,5 +38,3 @@ const InsertButton: FunctionComponent<Props> = ({ className }) => {
|
|
|
38
38
|
/>
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
export default InsertButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { InsertButton } from './InsertButton';
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
useTypedSelector,
|
|
15
15
|
} from 'state';
|
|
16
16
|
|
|
17
|
-
import Button from '../../../Button';
|
|
18
|
-
import Spinner from '../../../Spinner';
|
|
19
|
-
import InsertButton from '../InsertButton';
|
|
17
|
+
import { Button } from '../../../Button';
|
|
18
|
+
import { Spinner } from '../../../Spinner';
|
|
19
|
+
import { InsertButton } from '../InsertButton';
|
|
20
20
|
|
|
21
21
|
import styles from './ResultCandidatePicker.module.scss';
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ interface Props extends HTMLProps<HTMLDivElement> {
|
|
|
24
24
|
onResultClick: MouseEventHandler<HTMLButtonElement>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const ResultCandidatePicker: FunctionComponent<Props> = ({ className, onResultClick, ...props }) => {
|
|
27
|
+
export const ResultCandidatePicker: FunctionComponent<Props> = ({ className, onResultClick, ...props }) => {
|
|
28
28
|
const dispatch = useDispatch();
|
|
29
29
|
const translate = useTranslate();
|
|
30
30
|
const locale = useTypedSelector(selectLocale);
|
|
@@ -98,5 +98,3 @@ const ResultCandidatePicker: FunctionComponent<Props> = ({ className, onResultCl
|
|
|
98
98
|
</div>
|
|
99
99
|
);
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
export default ResultCandidatePicker;
|
package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ResultCandidatePicker } from './ResultCandidatePicker';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { InsertButton } from './InsertButton';
|
|
2
|
+
export { ResultCandidatePicker } from './ResultCandidatePicker';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Solver } from './Solver';
|
|
@@ -9,11 +9,9 @@ interface Props {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const Spinner: FunctionComponent<Props> = ({ className }) => {
|
|
12
|
+
export const Spinner: FunctionComponent<Props> = ({ className }) => {
|
|
13
13
|
const translate = useTranslate();
|
|
14
14
|
const translation = translate('common.loading');
|
|
15
15
|
|
|
16
16
|
return <div aria-label={translation} className={classNames(styles.spinner, className)} role="status" />;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
export default Spinner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Spinner } from './Spinner';
|
|
@@ -17,7 +17,7 @@ import { useAppLayout } from 'hooks';
|
|
|
17
17
|
import { getTileSizes, noop } from 'lib';
|
|
18
18
|
import { selectLocale, useTypedSelector } from 'state';
|
|
19
19
|
|
|
20
|
-
import TilePure from './TilePure';
|
|
20
|
+
import { TilePure } from './TilePure';
|
|
21
21
|
|
|
22
22
|
interface Props {
|
|
23
23
|
'aria-label': string;
|
|
@@ -41,7 +41,7 @@ interface Props {
|
|
|
41
41
|
onTouchStart?: TouchEventHandler<HTMLInputElement>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const Tile: FunctionComponent<Props> = ({
|
|
44
|
+
export const Tile: FunctionComponent<Props> = ({
|
|
45
45
|
'aria-label': ariaLabel,
|
|
46
46
|
autoFocus,
|
|
47
47
|
className,
|
|
@@ -108,5 +108,3 @@ const Tile: FunctionComponent<Props> = ({
|
|
|
108
108
|
/>
|
|
109
109
|
);
|
|
110
110
|
};
|
|
111
|
-
|
|
112
|
-
export default Tile;
|
|
@@ -40,7 +40,7 @@ interface Props {
|
|
|
40
40
|
onTouchStart?: TouchEventHandler<HTMLInputElement>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const TilePureBase: FunctionComponent<Props> = ({
|
|
44
44
|
'aria-label': ariaLabel,
|
|
45
45
|
autoFocus,
|
|
46
46
|
canShowPoints,
|
|
@@ -111,4 +111,4 @@ const TilePure: FunctionComponent<Props> = ({
|
|
|
111
111
|
</div>
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
-
export
|
|
114
|
+
export const TilePure = memo(TilePureBase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Tile } from './Tile';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMergeRefs } from '@floating-ui/react';
|
|
2
2
|
import { isObject } from '@scrabble-solver/types';
|
|
3
|
-
import { HTMLProps, cloneElement, forwardRef, isValidElement } from 'react';
|
|
3
|
+
import { HTMLProps, ReactElement, RefObject, cloneElement, forwardRef, isValidElement } from 'react';
|
|
4
4
|
|
|
5
5
|
import { useTooltipContext } from './context';
|
|
6
6
|
|
|
@@ -8,8 +8,10 @@ type Props = HTMLProps<HTMLElement>;
|
|
|
8
8
|
|
|
9
9
|
export const TooltipTrigger = forwardRef<HTMLElement, Props>(({ children, ...props }, ref) => {
|
|
10
10
|
const state = useTooltipContext();
|
|
11
|
-
const childrenElement = children as
|
|
12
|
-
|
|
11
|
+
const childrenElement = children as ReactElement<{
|
|
12
|
+
ref: RefObject<HTMLElement>;
|
|
13
|
+
}>;
|
|
14
|
+
const finalRef = useMergeRefs([state.refs.setReference, ref, childrenElement.props.ref]);
|
|
13
15
|
|
|
14
16
|
if (!isValidElement(children)) {
|
|
15
17
|
throw new Error("TooltipTrigger's children are not a valid element");
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export * from './keys';
|
|
1
|
+
export { Alert } from './Alert';
|
|
2
|
+
export { Badge } from './Badge';
|
|
3
|
+
export { Board } from './Board';
|
|
4
|
+
export { Button } from './Button';
|
|
5
|
+
export { Dictionary } from './Dictionary';
|
|
6
|
+
export { DictionaryInput } from './DictionaryInput';
|
|
7
|
+
export { EmptyState } from './EmptyState';
|
|
8
|
+
export { IconButton } from './IconButton';
|
|
9
|
+
export { Key } from './Key';
|
|
10
|
+
export { Loading } from './Loading';
|
|
11
|
+
export { Logo } from './Logo';
|
|
12
|
+
export { Modal } from './Modal';
|
|
13
|
+
export { NavButtons } from './NavButtons';
|
|
14
|
+
export { NotFound } from './NotFound';
|
|
15
|
+
export { PlainTiles } from './PlainTiles';
|
|
16
|
+
export { Progress } from './Progress';
|
|
17
|
+
export { Rack } from './Rack';
|
|
18
|
+
export { Radio } from './Radio';
|
|
19
|
+
export { Results } from './Results';
|
|
20
|
+
export { ResultsInput } from './ResultsInput';
|
|
21
|
+
export { SeoMessage } from './SeoMessage';
|
|
22
|
+
export { Solver } from './Solver';
|
|
23
|
+
export { Spinner } from './Spinner';
|
|
24
|
+
export { Tile } from './Tile';
|
|
26
25
|
export * from './Keys';
|
|
27
26
|
export * from './Tooltip';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
1
|
+
export { useAppLayout } from './useAppLayout';
|
|
2
|
+
export { useColumns } from './useColumns';
|
|
3
|
+
export { useDirection } from './useDirection';
|
|
4
|
+
export { useEffectOnce } from './useEffectOnce';
|
|
5
|
+
export { useIsTouchDevice } from './useIsTouchDevice';
|
|
6
|
+
export { useLanguage } from './useLanguage';
|
|
7
|
+
export { useLatest } from './useLatest';
|
|
8
|
+
export { useLocalStorage } from './useLocalStorage';
|
|
9
|
+
export { useMedia } from './useMedia';
|
|
10
|
+
export { useMediaQueries } from './useMediaQueries';
|
|
11
|
+
export { useMediaQuery } from './useMediaQuery';
|
|
12
|
+
export { useOnWindowResize } from './useOnWindowResize';
|
|
13
|
+
export { useViewportSize } from './useViewportSize';
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
import { selectConfig, selectShowCoordinates, useTypedSelector } from 'state';
|
|
23
23
|
import { ResultColumnId } from 'types';
|
|
24
24
|
|
|
25
|
-
import useColumns from './useColumns';
|
|
26
|
-
import useIsTouchDevice from './useIsTouchDevice';
|
|
27
|
-
import useMediaQueries from './useMediaQueries';
|
|
28
|
-
import useViewportSize from './useViewportSize';
|
|
25
|
+
import { useColumns } from './useColumns';
|
|
26
|
+
import { useIsTouchDevice } from './useIsTouchDevice';
|
|
27
|
+
import { useMediaQueries } from './useMediaQueries';
|
|
28
|
+
import { useViewportSize } from './useViewportSize';
|
|
29
29
|
|
|
30
|
-
const useAppLayout = () => {
|
|
30
|
+
export const useAppLayout = () => {
|
|
31
31
|
const { viewportHeight, viewportWidth } = useViewportSize();
|
|
32
32
|
const config = useTypedSelector(selectConfig);
|
|
33
33
|
const showCoordinates = useTypedSelector(selectShowCoordinates);
|
|
@@ -54,17 +54,22 @@ const useAppLayout = () => {
|
|
|
54
54
|
const coordinatesSizeRatio = showCoordinates === 'hidden' ? 0 : 0.5;
|
|
55
55
|
const coordinatesBorderWidth = showCoordinates === 'hidden' ? 0 : 1;
|
|
56
56
|
const cellWidth =
|
|
57
|
-
(maxBoardWidth - (config.
|
|
58
|
-
(config.
|
|
57
|
+
(maxBoardWidth - (config.boardWidth + 1 + coordinatesBorderWidth) * BORDER_WIDTH) /
|
|
58
|
+
(config.boardWidth + coordinatesSizeRatio);
|
|
59
59
|
const cellHeight =
|
|
60
|
-
(maxBoardHeight - (config.
|
|
61
|
-
(config.
|
|
60
|
+
(maxBoardHeight - (config.boardHeight + 1 + coordinatesBorderWidth) * BORDER_WIDTH) /
|
|
61
|
+
(config.boardHeight + coordinatesSizeRatio);
|
|
62
62
|
const cellSize = Math.min(Math.min(cellWidth, cellHeight), BOARD_TILE_SIZE_MAX);
|
|
63
63
|
const coordinatesSize = coordinatesSizeRatio * cellSize;
|
|
64
|
-
const
|
|
65
|
-
(cellSize + BORDER_WIDTH) * config.
|
|
64
|
+
const boardWidth =
|
|
65
|
+
(cellSize + BORDER_WIDTH) * config.boardWidth +
|
|
66
66
|
BORDER_WIDTH +
|
|
67
67
|
(showCoordinates === 'hidden' ? 0 : coordinatesSize + BORDER_WIDTH);
|
|
68
|
+
const boardHeight =
|
|
69
|
+
(cellSize + BORDER_WIDTH) * config.boardHeight +
|
|
70
|
+
BORDER_WIDTH +
|
|
71
|
+
(showCoordinates === 'hidden' ? 0 : coordinatesSize + BORDER_WIDTH);
|
|
72
|
+
|
|
68
73
|
const maxControlsWidth = tileSize * config.rackSize + 2 * BORDER_WIDTH;
|
|
69
74
|
const showResultsInModal = isLessThanL;
|
|
70
75
|
const dictionaryHeight = showResultsInModal ? DICTIONARY_HEIGHT_MOBILE : DICTIONARY_HEIGHT;
|
|
@@ -72,7 +77,7 @@ const useAppLayout = () => {
|
|
|
72
77
|
const modalWidth = isLessThanS ? viewportWidth : MODAL_WIDTH;
|
|
73
78
|
const resultsHeight = isLessThanL
|
|
74
79
|
? viewportHeight - dictionaryHeight - BUTTON_HEIGHT - MODAL_HEADER_HEIGHT - 5 * componentsSpacing
|
|
75
|
-
:
|
|
80
|
+
: boardHeight - componentsSpacing - dictionaryHeight;
|
|
76
81
|
const rackWidth = tileSize * config.rackSize;
|
|
77
82
|
const resultsWidth = isLessThanL ? modalWidth - 2 * componentsSpacing : SOLVER_COLUMN_WIDTH;
|
|
78
83
|
const columnsWidth = Object.keys(columns).reduce(
|
|
@@ -83,7 +88,8 @@ const useAppLayout = () => {
|
|
|
83
88
|
|
|
84
89
|
return {
|
|
85
90
|
actionsWidth: 2 * BUTTON_HEIGHT - BORDER_WIDTH,
|
|
86
|
-
|
|
91
|
+
boardHeight,
|
|
92
|
+
boardWidth,
|
|
87
93
|
cellSize,
|
|
88
94
|
coordinatesFontSize: coordinatesSize * 0.6,
|
|
89
95
|
coordinatesSize,
|
|
@@ -106,5 +112,3 @@ const useAppLayout = () => {
|
|
|
106
112
|
tileSize,
|
|
107
113
|
};
|
|
108
114
|
};
|
|
109
|
-
|
|
110
|
-
export default useAppLayout;
|
|
@@ -3,7 +3,7 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { selectColumns, useTypedSelector } from 'state';
|
|
4
4
|
import { ResultColumnId } from 'types';
|
|
5
5
|
|
|
6
|
-
import useMediaQueries from './useMediaQueries';
|
|
6
|
+
import { useMediaQueries } from './useMediaQueries';
|
|
7
7
|
|
|
8
8
|
const COLUMNS_XS = [ResultColumnId.Coordinates, ResultColumnId.Word, ResultColumnId.Points];
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ const COLUMNS_M = [...COLUMNS_XS];
|
|
|
13
13
|
|
|
14
14
|
const COLUMNS_L = [...COLUMNS_XS];
|
|
15
15
|
|
|
16
|
-
const useColumns = (): Partial<Record<ResultColumnId, boolean>> => {
|
|
16
|
+
export const useColumns = (): Partial<Record<ResultColumnId, boolean>> => {
|
|
17
17
|
const columns = useTypedSelector(selectColumns);
|
|
18
18
|
const { isLessThanXs, isLessThanS, isLessThanM, isLessThanL } = useMediaQueries();
|
|
19
19
|
|
|
@@ -43,5 +43,3 @@ const useColumns = (): Partial<Record<ResultColumnId, boolean>> => {
|
|
|
43
43
|
|
|
44
44
|
return columnsMap;
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
export default useColumns;
|
|
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { noop } from 'lib';
|
|
4
4
|
|
|
5
|
-
const useDirection = (direction: 'ltr' | 'rtl') => {
|
|
5
|
+
export const useDirection = (direction: 'ltr' | 'rtl') => {
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
const html = document.body.parentElement;
|
|
8
8
|
|
|
@@ -18,5 +18,3 @@ const useDirection = (direction: 'ltr' | 'rtl') => {
|
|
|
18
18
|
};
|
|
19
19
|
}, [direction]);
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
export default useDirection;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { EffectCallback, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import useLatest from './useLatest';
|
|
3
|
+
import { useLatest } from './useLatest';
|
|
4
4
|
|
|
5
|
-
const useEffectOnce = (effect: EffectCallback) => {
|
|
5
|
+
export const useEffectOnce = (effect: EffectCallback) => {
|
|
6
6
|
const effectRef = useLatest(effect);
|
|
7
7
|
|
|
8
8
|
return useEffect(() => {
|
|
9
9
|
effectRef.current();
|
|
10
10
|
}, [effectRef]);
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
export default useEffectOnce;
|
|
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { noop } from 'lib';
|
|
4
4
|
|
|
5
|
-
const useLanguage = (language: string) => {
|
|
5
|
+
export const useLanguage = (language: string) => {
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
const html = document.body.parentElement;
|
|
8
8
|
|
|
@@ -18,5 +18,3 @@ const useLanguage = (language: string) => {
|
|
|
18
18
|
};
|
|
19
19
|
}, [language]);
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
export default useLanguage;
|
|
@@ -4,10 +4,8 @@ interface Latest<T> {
|
|
|
4
4
|
readonly current: T;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
const useLatest = <T>(value: T): Latest<T> => {
|
|
7
|
+
export const useLatest = <T>(value: T): Latest<T> => {
|
|
8
8
|
const ref = useRef(value);
|
|
9
9
|
ref.current = value;
|
|
10
10
|
return ref;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
export default useLatest;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
useTypedSelector,
|
|
13
13
|
} from 'state';
|
|
14
14
|
|
|
15
|
-
const useLocalStorage = () => {
|
|
15
|
+
export const useLocalStorage = () => {
|
|
16
16
|
const autoGroupTiles = useTypedSelector(selectAutoGroupTiles);
|
|
17
17
|
const board = useTypedSelector(selectBoard);
|
|
18
18
|
const game = useTypedSelector(selectGame);
|
|
@@ -63,5 +63,3 @@ const useLocalStorage = () => {
|
|
|
63
63
|
}
|
|
64
64
|
}, [showCoordinates]);
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
export default useLocalStorage;
|
|
@@ -12,7 +12,7 @@ const getInitialState = (query: string, defaultState?: boolean) => {
|
|
|
12
12
|
return window.matchMedia(query).matches;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const useMedia = (query: string, defaultState?: boolean) => {
|
|
15
|
+
export const useMedia = (query: string, defaultState?: boolean) => {
|
|
16
16
|
const [state, setState] = useState(getInitialState(query, defaultState));
|
|
17
17
|
|
|
18
18
|
useEffect(() => {
|
|
@@ -32,5 +32,3 @@ const useMedia = (query: string, defaultState?: boolean) => {
|
|
|
32
32
|
|
|
33
33
|
return state;
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
export default useMedia;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import useMediaQuery from './useMediaQuery';
|
|
1
|
+
import { useMediaQuery } from './useMediaQuery';
|
|
2
2
|
|
|
3
|
-
const useMediaQueries = () => {
|
|
3
|
+
export const useMediaQueries = () => {
|
|
4
4
|
const isLessThanXs = useMediaQuery('<xs');
|
|
5
5
|
const isLessThanS = useMediaQuery('<s');
|
|
6
6
|
const isLessThanM = useMediaQuery('<m');
|
|
@@ -9,5 +9,3 @@ const useMediaQueries = () => {
|
|
|
9
9
|
|
|
10
10
|
return { isLessThanXs, isLessThanS, isLessThanM, isLessThanL, isLessThanXl };
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
export default useMediaQueries;
|
|
@@ -2,11 +2,9 @@ import { buildMediaQuery } from 'include-media-query-builder';
|
|
|
2
2
|
|
|
3
3
|
import { BREAKPOINTS } from 'parameters';
|
|
4
4
|
|
|
5
|
-
import useMedia from './useMedia';
|
|
5
|
+
import { useMedia } from './useMedia';
|
|
6
6
|
|
|
7
|
-
const useMediaQuery = (query: string | string[], defaultState?: boolean
|
|
7
|
+
export const useMediaQuery = (query: string | string[], defaultState?: boolean): boolean => {
|
|
8
8
|
const mediaQuery = buildMediaQuery(BREAKPOINTS, query);
|
|
9
9
|
return useMedia(mediaQuery, defaultState);
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export default useMediaQuery;
|