@jeremyckahn/farmhand 1.19.19 → 1.19.21
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/dist/assets/{index-BxA2fVaN.js → index-CG_lY1MJ.js} +9 -9
- package/dist/assets/{index-BxA2fVaN.js.map → index-CG_lY1MJ.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +3 -2
- package/src/common/services/{randomNumber.js → randomNumber.ts} +1 -0
- package/src/common/{utils.js → utils.ts} +1 -1
- package/src/components/AccountingView/{AccountingView.js → AccountingView.tsx} +1 -0
- package/src/components/AchievementsView/{AchievementsView.js → AchievementsView.tsx} +6 -4
- package/src/components/AnimatedNumber/{AnimatedNumber.js → AnimatedNumber.tsx} +9 -6
- package/src/components/AppBar/{AppBar.js → AppBar.tsx} +5 -2
- package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx} +2 -0
- package/src/components/Cellar/{CellarInventoryTabPanel.js → CellarInventoryTabPanel.tsx} +2 -0
- package/src/components/Cellar/{Keg.js → Keg.tsx} +0 -1
- package/src/components/ContextPane/{ContextPane.test.js → ContextPane.test.tsx} +3 -0
- package/src/components/ContextPane/{ContextPane.js → ContextPane.tsx} +2 -0
- package/src/components/CowCard/Bloodline/{Bloodline.test.js → Bloodline.test.tsx} +6 -3
- package/src/components/CowCard/{CowCard.js → CowCard.tsx} +6 -4
- package/src/components/CowCard/Subheader/{Subheader.js → Subheader.tsx} +1 -0
- package/src/components/CowPen/{Cow.js → Cow.tsx} +27 -13
- package/src/components/CowPen/{CowPen.test.js → CowPen.test.tsx} +15 -1
- package/src/components/CowPen/{Tumbleweeds.js → Tumbleweeds.tsx} +2 -1
- package/src/components/Farmhand/{Farmhand.context.js → Farmhand.context.tsx} +2 -2
- package/src/components/Farmhand/{Farmhand.js → Farmhand.tsx} +91 -24
- package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx} +4 -3
- package/src/components/FermentationRecipeList/{FermentationRecipeList.test.js → FermentationRecipeList.test.tsx} +5 -0
- package/src/components/FermentationRecipeList/{FermentationRecipeList.js → FermentationRecipeList.tsx} +3 -0
- package/src/components/Field/{Field.test.js → Field.test.tsx} +2 -3
- package/src/components/Field/{Field.js → Field.tsx} +23 -18
- package/src/components/Home/{Home.js → Home.tsx} +1 -0
- package/src/components/Home/{SnowBackground.js → SnowBackground.tsx} +2 -0
- package/src/components/Inventory/{Inventory.js → Inventory.tsx} +33 -25
- package/src/components/Item/{Item.js → Item.tsx} +2 -1
- package/src/components/LogView/{LogView.js → LogView.tsx} +23 -18
- package/src/components/Navigation/{Navigation.js → Navigation.tsx} +5 -6
- package/src/components/NotificationSystem/{NotificationSystem.js → NotificationSystem.tsx} +0 -1
- package/src/components/OnlinePeersView/{OnlinePeersView.js → OnlinePeersView.tsx} +7 -4
- package/src/components/Plot/{Plot.test.js → Plot.test.tsx} +8 -8
- package/src/components/Plot/{Plot.js → Plot.tsx} +5 -0
- package/src/components/PriceEventView/{PriceEventView.test.js → PriceEventView.test.tsx} +1 -0
- package/src/components/ProgressBar/{ProgressBar.js → ProgressBar.tsx} +2 -0
- package/src/components/QuantityInput/{QuantityInput.js → QuantityInput.tsx} +1 -0
- package/src/components/Recipe/{Recipe.js → Recipe.tsx} +1 -2
- package/src/components/SettingsView/{RandomSeedInput.js → RandomSeedInput.tsx} +1 -1
- package/src/components/Shop/{Shop.js → Shop.tsx} +2 -1
- package/src/components/Stage/{Stage.test.js → Stage.test.tsx} +1 -0
- package/src/components/Stage/{Stage.js → Stage.tsx} +6 -3
- package/src/components/TierPurchase/{TierPurchase.js → TierPurchase.tsx} +3 -3
- package/src/components/Toolbelt/{Toolbelt.js → Toolbelt.tsx} +3 -0
- package/src/components/UpgradePurchase/{UpgradePurchase.js → UpgradePurchase.tsx} +0 -1
- package/src/components/WineRecipeList/{WineRecipe.test.js → WineRecipe.test.tsx} +10 -1
- package/src/components/WineRecipeList/{WineRecipe.js → WineRecipe.tsx} +2 -1
- package/src/components/WineRecipeList/{WineRecipeList.js → WineRecipeList.tsx} +1 -0
- package/src/components/Workshop/{ForgeTabPanel.js → ForgeTabPanel.tsx} +1 -0
- package/src/components/Workshop/{Workshop.test.js → Workshop.test.tsx} +2 -2
- package/src/components/Workshop/{getUpgradesAvailable.test.js → getUpgradesAvailable.test.ts} +1 -0
- package/src/components/Workshop/{getUpgradesAvailable.js → getUpgradesAvailable.ts} +2 -0
- package/src/{constants.js → constants.ts} +2 -2
- package/src/data/{achievements.test.js → achievements.test.ts} +2 -1
- package/src/data/{achievements.js → achievements.ts} +9 -0
- package/src/data/{crop.js → crop.ts} +5 -4
- package/src/data/crops/{asparagus.js → asparagus.ts} +2 -0
- package/src/data/crops/{carrot.js → carrot.ts} +2 -0
- package/src/data/crops/{corn.js → corn.ts} +2 -0
- package/src/data/crops/{garlic.js → garlic.ts} +2 -0
- package/src/data/crops/{grape.js → grape.ts} +11 -7
- package/src/data/crops/{jalapeno.js → jalapeno.ts} +2 -0
- package/src/data/crops/{olive.js → olive.ts} +2 -0
- package/src/data/crops/{onion.js → onion.ts} +2 -0
- package/src/data/crops/{pea.js → pea.ts} +2 -0
- package/src/data/crops/{potato.js → potato.ts} +2 -0
- package/src/data/crops/{pumpkin.js → pumpkin.ts} +2 -0
- package/src/data/crops/{soybean.js → soybean.ts} +2 -0
- package/src/data/crops/{spinach.js → spinach.ts} +2 -0
- package/src/data/crops/{strawberry.js → strawberry.ts} +2 -0
- package/src/data/crops/{sunflower.js → sunflower.ts} +2 -0
- package/src/data/crops/{sweet-potato.js → sweet-potato.ts} +2 -0
- package/src/data/crops/{tomato.js → tomato.ts} +2 -0
- package/src/data/crops/{watermelon.js → watermelon.ts} +2 -0
- package/src/data/crops/{wheat.js → wheat.ts} +2 -0
- package/src/data/{items.js → items.ts} +12 -12
- package/src/data/{levels.js → levels.ts} +28 -0
- package/src/data/{maps.js → maps.ts} +2 -1
- package/src/data/ores/{bronzeOre.js → bronzeOre.ts} +1 -1
- package/src/data/ores/{coal.js → coal.ts} +1 -1
- package/src/data/ores/{goldOre.js → goldOre.ts} +1 -1
- package/src/data/ores/{ironOre.js → ironOre.ts} +1 -1
- package/src/data/ores/{saltRock.js → saltRock.ts} +1 -1
- package/src/data/ores/{silverOre.js → silverOre.ts} +1 -1
- package/src/data/ores/{stone.js → stone.ts} +1 -1
- package/src/data/{recipes.js → recipes.ts} +43 -43
- package/src/data/{upgrades.js → upgrades.ts} +4 -4
- package/src/{enums.js → enums.ts} +28 -28
- package/src/factories/{CoalFactory.js → CoalFactory.ts} +2 -0
- package/src/factories/{OreFactory.js → OreFactory.ts} +3 -0
- package/src/factories/{ResourceFactory.test.js → ResourceFactory.test.ts} +4 -0
- package/src/factories/{ResourceFactory.js → ResourceFactory.ts} +4 -0
- package/src/factories/{StoneFactory.js → StoneFactory.ts} +1 -0
- package/src/{fetch-utils.js → fetch-utils.ts} +2 -0
- package/src/game-logic/{field-purchase.test.js → field-purchase.test.ts} +4 -2
- package/src/game-logic/reducers/{applyCrows.js → applyCrows.ts} +3 -0
- package/src/game-logic/reducers/{applyLoanInterest.js → applyLoanInterest.ts} +1 -1
- package/src/game-logic/reducers/{applyPrecipitation.js → applyPrecipitation.ts} +6 -6
- package/src/game-logic/reducers/{changeCowAutomaticHugState.js → changeCowAutomaticHugState.ts} +2 -2
- package/src/game-logic/reducers/{computeStateForNextDay.js → computeStateForNextDay.ts} +2 -2
- package/src/game-logic/reducers/{consumeIngredients.js → consumeIngredients.ts} +2 -2
- package/src/game-logic/reducers/{harvestPlot.js → harvestPlot.ts} +4 -4
- package/src/game-logic/reducers/{makeFermentationRecipe.js → makeFermentationRecipe.ts} +1 -0
- package/src/game-logic/reducers/{makeRecipe.test.js → makeRecipe.test.ts} +11 -8
- package/src/game-logic/reducers/{makeWine.test.js → makeWine.test.ts} +0 -2
- package/src/game-logic/reducers/{makeWine.js → makeWine.ts} +1 -0
- package/src/game-logic/reducers/{minePlot.js → minePlot.ts} +1 -0
- package/src/game-logic/reducers/{processCellarSpoilage.test.js → processCellarSpoilage.test.ts} +0 -5
- package/src/game-logic/reducers/{processCellarSpoilage.js → processCellarSpoilage.ts} +0 -1
- package/src/game-logic/reducers/{processCowFertilizerProduction.js → processCowFertilizerProduction.ts} +1 -1
- package/src/game-logic/reducers/{processLevelUp.js → processLevelUp.ts} +3 -0
- package/src/game-logic/reducers/{purchaseField.test.js → purchaseField.test.ts} +2 -0
- package/src/game-logic/reducers/{purchaseField.js → purchaseField.ts} +3 -2
- package/src/game-logic/reducers/{purchaseForest.test.js → purchaseForest.test.tsx} +6 -2
- package/src/game-logic/reducers/{purchaseForest.js → purchaseForest.ts} +3 -2
- package/src/game-logic/reducers/{rotateNotificationLogs.js → rotateNotificationLogs.ts} +1 -1
- package/src/game-logic/reducers/{sellCow.test.js → sellCow.test.ts} +3 -3
- package/src/game-logic/reducers/{sellItem.test.js → sellItem.test.ts} +0 -3
- package/src/game-logic/reducers/{sellKeg.js → sellKeg.ts} +0 -1
- package/src/game-logic/reducers/{spawnWeeds.js → spawnWeeds.ts} +1 -0
- package/src/game-logic/reducers/{updateAchievements.js → updateAchievements.ts} +10 -9
- package/src/game-logic/reducers/{updatePeer.test.js → updatePeer.test.ts} +0 -4
- package/src/game-logic/reducers/{updatePeer.js → updatePeer.ts} +1 -0
- package/src/game-logic/reducers/{updatePlotShoveledState.test.js → updatePlotShoveledState.test.ts} +0 -1
- package/src/handlers/{peer-events.js → peer-events.ts} +9 -3
- package/src/handlers/{ui-events.test.js → ui-events.test.ts} +2 -0
- package/src/handlers/{ui-events.js → ui-events.tsx} +107 -25
- package/src/{index.js → index.tsx} +2 -0
- package/src/scripts/{generate-crop-table.js → generate-crop-table.ts} +5 -4
- package/src/services/{cellar.test.js → cellar.test.ts} +1 -1
- package/src/services/{wine.js → wine.ts} +1 -0
- package/src/shell/{notifications.test.js → notifications.test.ts} +19 -13
- package/src/{templates.js → templates.ts} +8 -0
- package/src/test-utils/{index.js → index.ts} +3 -3
- package/src/test-utils/stubs/{getKegStub.js → getKegStub.ts} +1 -0
- package/src/utils/{farmProductsSold.js → farmProductsSold.tsx} +2 -0
- package/src/utils/{getCropLifecycleDuration.js → getCropLifecycleDuration.ts} +1 -0
- package/src/utils/{getCropsAvailableToFerment.js → getCropsAvailableToFerment.ts} +1 -0
- package/src/utils/{getInventoryQuantityMap.js → getInventoryQuantityMap.ts} +1 -0
- package/src/utils/{getLevelEntitlements.js → getLevelEntitlements.ts} +4 -0
- package/src/utils/{getMaxYieldOfFermentationRecipe.js → getMaxYieldOfFermentationRecipe.ts} +1 -0
- package/src/utils/{getWineVarietiesAvailableToMake.js → getWineVarietiesAvailableToMake.ts} +2 -0
- package/src/utils/{index.test.js → index.test.ts} +0 -2
- package/src/utils/{index.js → index.tsx} +31 -18
- package/src/utils/{isItemAFarmProduct.js → isItemAFarmProduct.ts} +1 -1
- package/src/utils/{memoize.js → memoize.ts} +2 -0
- package/src/utils/{totalIngredientsInRecipe.js → totalIngredientsInRecipe.ts} +2 -0
- /package/src/common/{constants.js → constants.ts} +0 -0
- /package/src/common/services/{randomNumber.test.js → randomNumber.test.ts} +0 -0
- /package/src/common/{utils.test.js → utils.test.ts} +0 -0
- /package/src/components/AccountingView/{AccountingView.test.js → AccountingView.test.tsx} +0 -0
- /package/src/components/AccountingView/{index.js → index.ts} +0 -0
- /package/src/components/Achievement/{Achievement.test.js → Achievement.test.tsx} +0 -0
- /package/src/components/Achievement/{Achievement.js → Achievement.tsx} +0 -0
- /package/src/components/Achievement/{index.js → index.ts} +0 -0
- /package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx} +0 -0
- /package/src/components/AchievementsView/{index.js → index.ts} +0 -0
- /package/src/components/AnimatedNumber/{AnimatedNumber.test.js → AnimatedNumber.test.tsx} +0 -0
- /package/src/components/AnimatedNumber/{index.js → index.ts} +0 -0
- /package/src/components/AppBar/{AppBar.test.js → AppBar.test.tsx} +0 -0
- /package/src/components/AppBar/{index.js → index.ts} +0 -0
- /package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.test.js → BailOutErrorBoundary.test.tsx} +0 -0
- /package/src/components/BailOutErrorBoundary/{index.js → index.ts} +0 -0
- /package/src/components/Cellar/{Cellar.js → Cellar.tsx} +0 -0
- /package/src/components/Cellar/{FermentationTabPanel.js → FermentationTabPanel.tsx} +0 -0
- /package/src/components/Cellar/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Cellar/{WinemakingTabPanel.js → WinemakingTabPanel.tsx} +0 -0
- /package/src/components/Cellar/{index.js → index.ts} +0 -0
- /package/src/components/ChatRoom/{ChatRoom.js → ChatRoom.tsx} +0 -0
- /package/src/components/ChatRoom/{index.js → index.ts} +0 -0
- /package/src/components/ContextPane/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/Bloodline/{Bloodline.js → Bloodline.tsx} +0 -0
- /package/src/components/CowCard/Bloodline/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{CowCard.test.js → CowCard.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{Subheader.test.js → Subheader.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{index.js → index.ts} +0 -0
- /package/src/components/CowPen/{CowPen.js → CowPen.tsx} +0 -0
- /package/src/components/CowPen/{index.js → index.ts} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.js → CowPenContextMenu.tsx} +0 -0
- /package/src/components/CowPenContextMenu/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{index.js → index.ts} +0 -0
- /package/src/components/Elements/{index.js → index.ts} +0 -0
- /package/src/components/Farmhand/{Farmhand.test.js → Farmhand.test.ts} +0 -0
- /package/src/components/Farmhand/{FarmhandReducers.js → FarmhandReducers.tsx} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.test.js → getInventoryQuantities.test.ts} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts} +0 -0
- /package/src/components/Farmhand/{index.js → index.ts} +0 -0
- /package/src/components/Field/{index.js → index.ts} +0 -0
- /package/src/components/Forest/{Forest.js → Forest.tsx} +0 -0
- /package/src/components/Forest/{index.js → index.ts} +0 -0
- /package/src/components/Home/{Home.test.js → Home.test.tsx} +0 -0
- /package/src/components/Home/{index.js → index.ts} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.js → IngredientsList.tsx} +0 -0
- /package/src/components/IngredientsList/{index.js → index.ts} +0 -0
- /package/src/components/Inventory/{Inventory.test.js → Inventory.test.tsx} +0 -0
- /package/src/components/Inventory/{index.js → index.ts} +0 -0
- /package/src/components/Item/{Item.test.js → Item.test.tsx} +0 -0
- /package/src/components/Item/{index.js → index.ts} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.js → KeybindingsView.tsx} +0 -0
- /package/src/components/KeybindingsView/{index.js → index.ts} +0 -0
- /package/src/components/LogView/{LogView.test.js → LogView.test.tsx} +0 -0
- /package/src/components/LogView/{index.js → index.ts} +0 -0
- /package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx} +0 -0
- /package/src/components/Navigation/{Navigation.test.js → Navigation.test.tsx} +0 -0
- /package/src/components/Navigation/{index.js → index.ts} +0 -0
- /package/src/components/NotificationSystem/{NotificationSystem.test.js → NotificationSystem.test.tsx} +0 -0
- /package/src/components/NotificationSystem/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.js → OnlinePeer.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/{index.js → index.ts} +0 -0
- /package/src/components/Plot/{index.js → index.ts} +0 -0
- /package/src/components/PriceEventView/{PriceEventView.js → PriceEventView.tsx} +0 -0
- /package/src/components/PriceEventView/{index.js → index.ts} +0 -0
- /package/src/components/ProgressBar/{ProgressBar.test.js → ProgressBar.test.tsx} +0 -0
- /package/src/components/ProgressBar/{index.js → index.ts} +0 -0
- /package/src/components/QuantityInput/{QuantityInput.test.js → QuantityInput.test.tsx} +0 -0
- /package/src/components/QuantityInput/{index.js → index.ts} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.test.js → QuickSelect.test.tsx} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.js → QuickSelect.tsx} +0 -0
- /package/src/components/QuickSelect/{index.js → index.ts} +0 -0
- /package/src/components/Recipe/{Recipe.test.js → Recipe.test.tsx} +0 -0
- /package/src/components/Recipe/{index.js → index.ts} +0 -0
- /package/src/components/RecipeList/{RecipeList.js → RecipeList.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.test.js → SearchBar.test.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.js → SearchBar.tsx} +0 -0
- /package/src/components/SearchBar/{index.js → index.ts} +0 -0
- /package/src/components/SettingsView/{RandomSeedInput.test.js → RandomSeedInput.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.test.js → SettingsView.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.js → SettingsView.tsx} +0 -0
- /package/src/components/SettingsView/{index.js → index.ts} +0 -0
- /package/src/components/Shop/{Shop.test.js → Shop.test.tsx} +0 -0
- /package/src/components/Shop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Shop/{index.js → index.ts} +0 -0
- /package/src/components/Stage/{index.js → index.ts} +0 -0
- /package/src/components/StatsView/{StatsView.test.js → StatsView.test.tsx} +0 -0
- /package/src/components/StatsView/{StatsView.js → StatsView.tsx} +0 -0
- /package/src/components/StatsView/{index.js → index.ts} +0 -0
- /package/src/components/TierPurchase/{TierPurchase.test.js → TierPurchase.test.tsx} +0 -0
- /package/src/components/TierPurchase/{index.js → index.ts} +0 -0
- /package/src/components/Toolbelt/{Toolbelt.test.js → Toolbelt.test.tsx} +0 -0
- /package/src/components/Toolbelt/{index.js → index.ts} +0 -0
- /package/src/components/UpdateNotifier/{UpdateNotifier.js → UpdateNotifier.tsx} +0 -0
- /package/src/components/UpdateNotifier/{index.js → index.ts} +0 -0
- /package/src/components/UpgradePurchase/{UpgradePurchase.test.js → UpgradePurchase.test.tsx} +0 -0
- /package/src/components/UpgradePurchase/{index.js → index.ts} +0 -0
- /package/src/components/Workshop/{KitchenTabPanel.js → KitchenTabPanel.tsx} +0 -0
- /package/src/components/Workshop/{RecyclingTabPanel.js → RecyclingTabPanel.tsx} +0 -0
- /package/src/components/Workshop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Workshop/{Workshop.js → Workshop.tsx} +0 -0
- /package/src/components/Workshop/{index.js → index.ts} +0 -0
- /package/src/{config.js → config.ts} +0 -0
- /package/src/data/__mocks__/{items.js → items.ts} +0 -0
- /package/src/data/__mocks__/{maps.js → maps.ts} +0 -0
- /package/src/data/__mocks__/{recipes.js → recipes.ts} +0 -0
- /package/src/data/__mocks__/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/crops/{index.js → index.ts} +0 -0
- /package/src/data/{fruit-names.js → fruit-names.ts} +0 -0
- /package/src/data/{items-map.js → items-map.ts} +0 -0
- /package/src/data/ores/{index.js → index.ts} +0 -0
- /package/src/data/{shop-inventory-cow.js → shop-inventory-cow.ts} +0 -0
- /package/src/data/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/{tools.js → tools.ts} +0 -0
- /package/src/factories/{CoalFactory.test.js → CoalFactory.test.ts} +0 -0
- /package/src/factories/{OreFactory.test.js → OreFactory.test.ts} +0 -0
- /package/src/factories/{StoneFactory.test.js → StoneFactory.test.ts} +0 -0
- /package/src/factories/{index.js → index.ts} +0 -0
- /package/src/game-logic/cows/{cow-selection.test.js → cow-selection.test.ts} +0 -0
- /package/src/game-logic/{item-purchase.test.js → item-purchase.test.ts} +0 -0
- /package/src/game-logic/{item-sell.test.js → item-sell.test.ts} +0 -0
- /package/src/game-logic/reducers/{addCowToInventory.js → addCowToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.test.js → addExperience.test.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.js → addExperience.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.test.js → addItemToInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.js → addItemToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addKegToCellarInventory.js → addKegToCellarInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addPeer.js → addPeer.ts} +0 -0
- /package/src/game-logic/reducers/{addRevenue.js → addRevenue.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.test.js → adjustLoan.test.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.js → adjustLoan.ts} +0 -0
- /package/src/game-logic/reducers/{applyCrows.test.js → applyCrows.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyLoanInterest.test.js → applyLoanInterest.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyPrecipitation.test.js → applyPrecipitation.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowAutomaticHugState.test.js → changeCowAutomaticHugState.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.test.js → changeCowBreedingPenResident.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.js → changeCowBreedingPenResident.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.test.js → changeCowName.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.js → changeCowName.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.test.js → clearPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.js → clearPlot.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.test.js → computeCowInventoryForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.js → computeCowInventoryForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{computeStateForNextDay.test.js → computeStateForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{consumeIngredients.test.js → consumeIngredients.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.test.js → createPriceEvent.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.js → createPriceEvent.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.test.js → decrementItemFromInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.js → decrementItemFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.test.js → fertilizePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.js → fertilizePlot.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.test.js → forRange.test.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.js → forRange.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.test.js → generatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.js → generatePriceEvents.ts} +0 -0
- /package/src/game-logic/reducers/{harvestPlot.test.js → harvestPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{helpers.js → helpers.tsx} +0 -0
- /package/src/game-logic/reducers/{hugCow.test.js → hugCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{hugCow.js → hugCow.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.test.js → incrementPlotContentAge.test.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.js → incrementPlotContentAge.ts} +0 -0
- /package/src/game-logic/reducers/{index.js → index.ts} +0 -0
- /package/src/game-logic/reducers/{makeFermentationRecipe.test.js → makeFermentationRecipe.test.ts} +0 -0
- /package/src/game-logic/reducers/{makeRecipe.js → makeRecipe.ts} +0 -0
- /package/src/game-logic/reducers/{minePlot.test.js → minePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{modifyCow.js → modifyCow.ts} +0 -0
- /package/src/game-logic/reducers/{modifyFieldPlotAt.js → modifyFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.test.js → offerCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.js → offerCow.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.test.js → plantInPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.js → plantInPlot.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.test.js → prependPendingPeerMessage.test.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.js → prependPendingPeerMessage.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.test.js → processCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.js → processCellar.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.test.js → processCowAttrition.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.js → processCowAttrition.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.test.js → processCowBreeding.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.js → processCowBreeding.ts} +0 -0
- /package/src/game-logic/reducers/{processCowFertilizerProduction.test.js → processCowFertilizerProduction.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.test.js → processFeedingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.js → processFeedingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processField.js → processField.ts} +0 -0
- /package/src/game-logic/reducers/{processLevelUp.test.js → processLevelUp.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.test.js → processMilkingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.js → processMilkingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.test.js → processNerfs.test.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.js → processNerfs.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.test.js → processSprinklers.test.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.js → processSprinklers.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.test.js → processWeather.test.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.js → processWeather.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.test.js → purchaseCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.js → purchaseCellar.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.test.js → purchaseCombine.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.js → purchaseCombine.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.test.js → purchaseComposter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.js → purchaseComposter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.test.js → purchaseCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.js → purchaseCow.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.test.js → purchaseCowPen.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.js → purchaseCowPen.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.test.js → purchaseItem.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.js → purchaseItem.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.test.js → purchaseSmelter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.js → purchaseSmelter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.test.js → purchaseStorageExpansion.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.js → purchaseStorageExpansion.ts} +0 -0
- /package/src/game-logic/reducers/{removeCowFromInventory.js → removeCowFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{removeFieldPlotAt.js → removeFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{removeKegFromCellar.js → removeKegFromCellar.ts} +0 -0
- /package/src/game-logic/reducers/{removePeer.js → removePeer.ts} +0 -0
- /package/src/game-logic/reducers/{rotateNotificationLogs.test.js → rotateNotificationLogs.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.test.js → selectCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.js → selectCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellCow.js → sellCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellItem.js → sellItem.ts} +0 -0
- /package/src/game-logic/reducers/{sellKeg.test.js → sellKeg.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.test.js → setScarecrow.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.js → setScarecrow.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.test.js → setSprinkler.test.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.js → setSprinkler.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.test.js → showNotification.test.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.js → showNotification.ts} +0 -0
- /package/src/game-logic/reducers/{spawnWeeds.test.js → spawnWeeds.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.test.js → unlockTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.js → unlockTool.ts} +0 -0
- /package/src/game-logic/reducers/{updateAchievements.test.js → updateAchievements.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.test.js → updateFinancialRecords.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.js → updateFinancialRecords.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.test.js → updateInventoryRecordsForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.js → updateInventoryRecordsForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.test.js → updateLearnedRecipes.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.js → updateLearnedRecipes.ts} +0 -0
- /package/src/game-logic/reducers/{updatePlotShoveledState.js → updatePlotShoveledState.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.test.js → updatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.js → updatePriceEvents.tsx} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.test.js → upgradeTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.js → upgradeTool.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.test.js → waterAllPlots.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.js → waterAllPlots.ts} +0 -0
- /package/src/game-logic/reducers/{waterField.js → waterField.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.test.js → waterPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.js → waterPlot.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.test.js → withdrawCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.js → withdrawCow.ts} +0 -0
- /package/src/img/__mocks__/{index.js → index.ts} +0 -0
- /package/src/img/{index.js → index.ts} +0 -0
- /package/src/interfaces/{Factory.js → Factory.ts} +0 -0
- /package/src/{mui-theme.js → mui-theme.ts} +0 -0
- /package/src/{polyfills.js → polyfills.ts} +0 -0
- /package/src/services/{cellar.js → cellar.ts} +0 -0
- /package/src/services/{wine.test.js → wine.test.ts} +0 -0
- /package/src/{setupTests.js → setupTests.ts} +0 -0
- /package/src/shell/{bootup.test.js → bootup.test.ts} +0 -0
- /package/src/shell/{field.test.js → field.test.ts} +0 -0
- /package/src/shell/{game-saving.test.js → game-saving.test.ts} +0 -0
- /package/src/shell/{navigation.test.js → navigation.test.ts} +0 -0
- /package/src/shell/{pending-notifications.test.js → pending-notifications.test.ts} +0 -0
- /package/src/{strings.js → strings.ts} +0 -0
- /package/src/test-utils/stubs/{cowStub.js → cowStub.ts} +0 -0
- /package/src/test-utils/stubs/{farmhandStub.js → farmhandStub.tsx} +0 -0
- /package/src/test-utils/stubs/{itemStub.js → itemStub.ts} +0 -0
- /package/src/test-utils/stubs/{peerMetadataStub.js → peerMetadataStub.ts} +0 -0
- /package/src/test-utils/stubs/{saveDataStubFactory.js → saveDataStubFactory.ts} +0 -0
- /package/src/test-utils/{ui.js → ui.ts} +0 -0
- /package/src/utils/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
- /package/src/utils/{findInField.test.js → findInField.test.ts} +0 -0
- /package/src/utils/{findInField.js → findInField.ts} +0 -0
- /package/src/utils/{getCropLifecycleDuration.test.js → getCropLifecycleDuration.test.ts} +0 -0
- /package/src/utils/{getCropsAvailableToFerment.test.js → getCropsAvailableToFerment.test.ts} +0 -0
- /package/src/utils/{getItemBaseValue.js → getItemBaseValue.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.test.js → getKegSpoilageRate.test.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.js → getKegSpoilageRate.ts} +0 -0
- /package/src/utils/{getKegValue.test.js → getKegValue.test.ts} +0 -0
- /package/src/utils/{getKegValue.js → getKegValue.ts} +0 -0
- /package/src/utils/{getLevelEntitlements.test.js → getLevelEntitlements.test.ts} +0 -0
- /package/src/utils/{getMaxYieldOfFermentationRecipe.test.js → getMaxYieldOfFermentationRecipe.test.ts} +0 -0
- /package/src/utils/{getSaltRequirementsForFermentationRecipe.js → getSaltRequirementsForFermentationRecipe.ts} +0 -0
- /package/src/utils/{getWineVarietiesAvailableToMake.test.js → getWineVarietiesAvailableToMake.test.ts} +0 -0
- /package/src/utils/{getYeastRequiredForWine.js → getYeastRequiredForWine.ts} +0 -0
- /package/src/utils/{isItemAGrownCrop.js → isItemAGrownCrop.ts} +0 -0
- /package/src/utils/{levelAchieved.js → levelAchieved.ts} +0 -0
- /package/src/utils/{moneyString.test.js → moneyString.test.ts} +0 -0
- /package/src/utils/{moneyString.js → moneyString.ts} +0 -0
- /package/src/utils/{noop.js → noop.ts} +0 -0
- /package/src/utils/{totalIngredientsInRecipe.test.js → totalIngredientsInRecipe.test.ts} +0 -0
|
@@ -49,12 +49,13 @@ const fieldKeyMap = {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (tools.shovel) {
|
|
52
|
+
// @ts-expect-error
|
|
52
53
|
fieldKeyMap.selectShovel = tools.shovel.fieldKey
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
export const isInHoverRange = ({
|
|
56
57
|
experience,
|
|
57
|
-
fieldMode,
|
|
58
|
+
fieldMode: propsFieldMode,
|
|
58
59
|
hoveredPlotRangeSize,
|
|
59
60
|
hoveredPlot: { x: hoveredPlotX, y: hoveredPlotY },
|
|
60
61
|
x,
|
|
@@ -62,13 +63,13 @@ export const isInHoverRange = ({
|
|
|
62
63
|
}) => {
|
|
63
64
|
// If hoveredPlotX is null, assume that hoveredPlotY is as well.
|
|
64
65
|
// If fieldMode === OBSERVE, nothing is in hover range.
|
|
65
|
-
if (hoveredPlotX == null ||
|
|
66
|
+
if (hoveredPlotX == null || propsFieldMode === OBSERVE) {
|
|
66
67
|
return false
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
let hoveredPlotRangeSizeToRender = hoveredPlotRangeSize
|
|
70
71
|
|
|
71
|
-
switch (
|
|
72
|
+
switch (propsFieldMode) {
|
|
72
73
|
case SET_SPRINKLER:
|
|
73
74
|
hoveredPlotRangeSizeToRender = getLevelEntitlements(
|
|
74
75
|
levelAchieved(experience)
|
|
@@ -111,12 +112,14 @@ export const MemoPlot = memo(
|
|
|
111
112
|
* @param {number} props.y
|
|
112
113
|
*/
|
|
113
114
|
props => {
|
|
115
|
+
// @ts-expect-error
|
|
114
116
|
const { hoveredPlot, plotContent, setHoveredPlot, x, y } = props
|
|
115
117
|
|
|
116
118
|
return (
|
|
117
119
|
<Plot
|
|
118
120
|
{...{
|
|
119
121
|
hoveredPlot,
|
|
122
|
+
// @ts-expect-error
|
|
120
123
|
isInHoverRange: isInHoverRange(props),
|
|
121
124
|
plotContent,
|
|
122
125
|
setHoveredPlot,
|
|
@@ -127,12 +130,15 @@ export const MemoPlot = memo(
|
|
|
127
130
|
)
|
|
128
131
|
},
|
|
129
132
|
(prev, next) => {
|
|
133
|
+
// @ts-expect-error
|
|
130
134
|
if (isInHoverRange(prev) !== isInHoverRange(next)) {
|
|
131
135
|
return false
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
return (
|
|
139
|
+
// @ts-expect-error
|
|
135
140
|
prev.plotContent === next.plotContent &&
|
|
141
|
+
// @ts-expect-error
|
|
136
142
|
prev.hoveredPlotRangeSize === next.hoveredPlotRangeSize
|
|
137
143
|
)
|
|
138
144
|
}
|
|
@@ -225,7 +231,7 @@ export const FieldContent = ({
|
|
|
225
231
|
columns,
|
|
226
232
|
experience,
|
|
227
233
|
field,
|
|
228
|
-
fieldMode,
|
|
234
|
+
fieldMode: propsFieldMode,
|
|
229
235
|
handleCombineEnabledChange,
|
|
230
236
|
hoveredPlot,
|
|
231
237
|
hoveredPlotRangeSize,
|
|
@@ -241,15 +247,15 @@ export const FieldContent = ({
|
|
|
241
247
|
onMouseLeave: () => setHoveredPlot({ x: null, y: null }),
|
|
242
248
|
}}
|
|
243
249
|
>
|
|
244
|
-
{nullArray(rows).map((
|
|
250
|
+
{nullArray(rows).map((_rowIndex, y) => (
|
|
245
251
|
<div className="row" key={y}>
|
|
246
252
|
{nullArray(columns).map(
|
|
247
|
-
(
|
|
253
|
+
(_colIndex, x, arr, plotContent = field[y][x]) => (
|
|
248
254
|
<MemoPlot
|
|
249
255
|
key={x}
|
|
250
256
|
{...{
|
|
251
257
|
experience,
|
|
252
|
-
fieldMode,
|
|
258
|
+
fieldMode: propsFieldMode,
|
|
253
259
|
hoveredPlot,
|
|
254
260
|
hoveredPlotRangeSize,
|
|
255
261
|
plotContent,
|
|
@@ -325,7 +331,7 @@ const RangeSliderValueLabelComponent = ({ children, open, value }) => (
|
|
|
325
331
|
export const Field = props => {
|
|
326
332
|
const {
|
|
327
333
|
field,
|
|
328
|
-
fieldMode,
|
|
334
|
+
fieldMode: propsFieldMode,
|
|
329
335
|
handleFieldActionRangeChange,
|
|
330
336
|
hoveredPlotRangeSize,
|
|
331
337
|
inventory,
|
|
@@ -357,19 +363,18 @@ export const Field = props => {
|
|
|
357
363
|
<div
|
|
358
364
|
{...{
|
|
359
365
|
className: classNames('Field', {
|
|
360
|
-
'cleanup-mode':
|
|
361
|
-
'fertilize-mode':
|
|
362
|
-
'harvest-mode':
|
|
363
|
-
'mine-mode':
|
|
364
|
-
// @ts-expect-error - Unnecessary properties are omitted out of convenience
|
|
366
|
+
'cleanup-mode': propsFieldMode === CLEANUP,
|
|
367
|
+
'fertilize-mode': propsFieldMode === FERTILIZE,
|
|
368
|
+
'harvest-mode': propsFieldMode === HARVEST,
|
|
369
|
+
'mine-mode': propsFieldMode === MINE,
|
|
365
370
|
'is-inventory-full': !doesInventorySpaceRemain({
|
|
366
371
|
inventory,
|
|
367
372
|
inventoryLimit,
|
|
368
373
|
}),
|
|
369
|
-
'plant-mode':
|
|
370
|
-
'set-scarecrow-mode':
|
|
371
|
-
'set-sprinkler-mode':
|
|
372
|
-
'water-mode':
|
|
374
|
+
'plant-mode': propsFieldMode === PLANT,
|
|
375
|
+
'set-scarecrow-mode': propsFieldMode === SET_SCARECROW,
|
|
376
|
+
'set-sprinkler-mode': propsFieldMode === SET_SPRINKLER,
|
|
377
|
+
'water-mode': propsFieldMode === WATER,
|
|
373
378
|
}),
|
|
374
379
|
'data-purchased-field': purchasedField,
|
|
375
380
|
'data-testid': 'field',
|
|
@@ -420,7 +425,7 @@ export const Field = props => {
|
|
|
420
425
|
/>
|
|
421
426
|
)}
|
|
422
427
|
</TransformWrapper>
|
|
423
|
-
{adjustableRangeFieldModes.has(
|
|
428
|
+
{adjustableRangeFieldModes.has(propsFieldMode) && (
|
|
424
429
|
<div className="slider-wrapper">
|
|
425
430
|
<Slider
|
|
426
431
|
{...{
|
|
@@ -32,6 +32,7 @@ const onboardingAchievements = [
|
|
|
32
32
|
achievementsMap['purchase-cow-pen'],
|
|
33
33
|
]
|
|
34
34
|
|
|
35
|
+
// @ts-expect-error
|
|
35
36
|
const getRemainingOnboardingAchievements = memoize(completedAchievements =>
|
|
36
37
|
onboardingAchievements.filter(
|
|
37
38
|
achievement => achievement && !completedAchievements[achievement.id]
|
|
@@ -11,7 +11,9 @@ const randomInt = (min, max) => {
|
|
|
11
11
|
// Taken from:
|
|
12
12
|
// https://github.com/alampros/react-confetti/blob/484bad0a0aaddbcfcc2fb4c1a4a7eeceaa6d4879/stories/snow.story.jsx#L7-L24
|
|
13
13
|
const drawSnowflake = function(ctx) {
|
|
14
|
+
// @ts-expect-error
|
|
14
15
|
const numPoints = this.numPoints || randomInt(3, 4) * 2
|
|
16
|
+
// @ts-expect-error
|
|
15
17
|
this.numPoints = numPoints
|
|
16
18
|
// @ts-expect-error
|
|
17
19
|
const innerRadius = this.radius * 0.2
|
|
@@ -87,10 +87,12 @@ const Inventory = ({
|
|
|
87
87
|
}) => {
|
|
88
88
|
const [searchQuery, setSearchQuery] = useState('')
|
|
89
89
|
const [selectedCategories, setSelectedCategories] = useState(
|
|
90
|
-
/** @type {string[]} */
|
|
90
|
+
/** @type {string[]} */ []
|
|
91
91
|
)
|
|
92
92
|
const toggleCategory = category => {
|
|
93
|
+
// @ts-expect-error
|
|
93
94
|
setSelectedCategories(prev =>
|
|
95
|
+
// @ts-expect-error
|
|
94
96
|
prev.includes(category)
|
|
95
97
|
? prev.filter(c => c !== category)
|
|
96
98
|
: [...prev, category]
|
|
@@ -98,8 +100,9 @@ const Inventory = ({
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
const filteredCategories = Array.from(itemCategories.entries()).reduce(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
// @ts-expect-error
|
|
104
|
+
(filtered, [category, categoryItems]) => {
|
|
105
|
+
const matchingItems = categoryItems.filter(item => {
|
|
103
106
|
const mappedItem = itemsMap[item.id]
|
|
104
107
|
return (
|
|
105
108
|
mappedItem &&
|
|
@@ -110,8 +113,10 @@ const Inventory = ({
|
|
|
110
113
|
|
|
111
114
|
if (
|
|
112
115
|
matchingItems.length &&
|
|
116
|
+
// @ts-expect-error
|
|
113
117
|
(!selectedCategories.length || selectedCategories.includes(category))
|
|
114
118
|
) {
|
|
119
|
+
// @ts-expect-error
|
|
115
120
|
filtered.set(category, matchingItems)
|
|
116
121
|
}
|
|
117
122
|
return filtered
|
|
@@ -142,6 +147,7 @@ const Inventory = ({
|
|
|
142
147
|
control={
|
|
143
148
|
<Checkbox
|
|
144
149
|
disabled={isPurchaseView}
|
|
150
|
+
// @ts-expect-error
|
|
145
151
|
checked={selectedCategories.includes(key)}
|
|
146
152
|
onChange={() => toggleCategory(key)}
|
|
147
153
|
/>
|
|
@@ -153,28 +159,30 @@ const Inventory = ({
|
|
|
153
159
|
</AccordionDetails>
|
|
154
160
|
</Accordion>
|
|
155
161
|
)}
|
|
156
|
-
{Array.from(filteredCategories.entries()).map(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
162
|
+
{Array.from((filteredCategories as any).entries()).map(
|
|
163
|
+
// @ts-expect-error
|
|
164
|
+
([category, categoryItems]) =>
|
|
165
|
+
categoryItems.length ? (
|
|
166
|
+
<Fragment key={category}>
|
|
167
|
+
<section>
|
|
168
|
+
<h3>{formatCategoryName(category)}</h3>
|
|
169
|
+
<ul className="card-list">
|
|
170
|
+
{categoryItems.map(item => (
|
|
171
|
+
<li key={item.id}>
|
|
172
|
+
<Item
|
|
173
|
+
{...{
|
|
174
|
+
isPurchaseView,
|
|
175
|
+
isSellView,
|
|
176
|
+
item,
|
|
177
|
+
showQuantity: isPurchaseView,
|
|
178
|
+
}}
|
|
179
|
+
/>
|
|
180
|
+
</li>
|
|
181
|
+
))}
|
|
182
|
+
</ul>
|
|
183
|
+
</section>
|
|
184
|
+
</Fragment>
|
|
185
|
+
) : null
|
|
178
186
|
)}
|
|
179
187
|
</div>
|
|
180
188
|
)
|
|
@@ -289,7 +289,8 @@ export const Item = ({
|
|
|
289
289
|
</p>
|
|
290
290
|
)}
|
|
291
291
|
{isPurchaseView &&
|
|
292
|
-
|
|
292
|
+
// @ts-expect-error
|
|
293
|
+
/** @type {globalThis.farmhand.item} */ item.growsInto && (
|
|
293
294
|
<p>
|
|
294
295
|
Days to mature:{' '}
|
|
295
296
|
{getCropLifecycleDuration(
|
|
@@ -31,25 +31,30 @@ export const LogView = ({ notificationLog, todaysNotifications }) => (
|
|
|
31
31
|
</ul>
|
|
32
32
|
<Divider />
|
|
33
33
|
<ul>
|
|
34
|
-
{notificationLog.map(({ day, notifications },
|
|
35
|
-
<li key={`${
|
|
34
|
+
{notificationLog.map(({ day, notifications }, dayIndex) => (
|
|
35
|
+
<li key={`${dayIndex}_${notifications.info.join()}`}>
|
|
36
36
|
<h3>Day {day}</h3>
|
|
37
|
-
{['success', 'info', 'warning', 'error'].map(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
{['success', 'info', 'warning', 'error'].map(
|
|
38
|
+
(severityLevel, severityIndex) =>
|
|
39
|
+
notifications[severityLevel].length ? (
|
|
40
|
+
// @ts-expect-error
|
|
41
|
+
<Alert
|
|
42
|
+
{...{
|
|
43
|
+
elevation: 3,
|
|
44
|
+
key: `${severityLevel}_${severityIndex}`,
|
|
45
|
+
severity: /** @type {'success' | 'info' | 'warning' | 'error'} */ severityLevel,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{notifications[severityLevel].map((message, messageIndex) => (
|
|
49
|
+
<ReactMarkdown
|
|
50
|
+
{...{
|
|
51
|
+
key: `${messageIndex}_${message}`,
|
|
52
|
+
source: message,
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</Alert>
|
|
57
|
+
) : null
|
|
53
58
|
)}
|
|
54
59
|
</li>
|
|
55
60
|
))}
|
|
@@ -285,7 +285,6 @@ export const Navigation = ({
|
|
|
285
285
|
<h3
|
|
286
286
|
{...{
|
|
287
287
|
className: classNames('inventory-info', {
|
|
288
|
-
// @ts-expect-error
|
|
289
288
|
'is-inventory-full': !doesInventorySpaceRemain({
|
|
290
289
|
inventory,
|
|
291
290
|
inventoryLimit,
|
|
@@ -320,20 +319,20 @@ export const Navigation = ({
|
|
|
320
319
|
{ dialogView: ACHIEVEMENTS, Icon: BeenhereIcon },
|
|
321
320
|
{ dialogView: ACCOUNTING, Icon: AccountBalanceIcon },
|
|
322
321
|
{ dialogView: SETTINGS, Icon: SettingsIcon },
|
|
323
|
-
].map(({ dialogView, Icon }) => (
|
|
322
|
+
].map(({ dialogView: dialogViewType, Icon }) => (
|
|
324
323
|
<Tooltip
|
|
325
324
|
{...{
|
|
326
325
|
arrow: true,
|
|
327
|
-
key:
|
|
326
|
+
key: dialogViewType,
|
|
328
327
|
placement: 'top',
|
|
329
|
-
title: dialogTriggerTextMap[
|
|
328
|
+
title: dialogTriggerTextMap[dialogViewType],
|
|
330
329
|
}}
|
|
331
330
|
>
|
|
332
331
|
<Fab
|
|
333
332
|
{...{
|
|
334
|
-
'aria-label': dialogTriggerTextMap[
|
|
333
|
+
'aria-label': dialogTriggerTextMap[dialogViewType],
|
|
335
334
|
color: 'primary',
|
|
336
|
-
onClick: () => handleClickDialogViewButton(
|
|
335
|
+
onClick: () => handleClickDialogViewButton(dialogViewType),
|
|
337
336
|
}}
|
|
338
337
|
>
|
|
339
338
|
<Icon />
|
|
@@ -58,7 +58,6 @@ export default withSnackbar(function Consumer(props) {
|
|
|
58
58
|
<FarmhandContext.Consumer>
|
|
59
59
|
{({ gameState, handlers }) => {
|
|
60
60
|
return (
|
|
61
|
-
// @ts-expect-error - Complex prop spreading creates type mismatch with PropTypes
|
|
62
61
|
<NotificationSystem {...{ ...gameState, ...handlers, ...props }} />
|
|
63
62
|
)
|
|
64
63
|
}}
|
|
@@ -79,17 +79,20 @@ const OnlinePeersView = ({
|
|
|
79
79
|
<Divider />
|
|
80
80
|
<ul>
|
|
81
81
|
{latestPeerMessages.map(
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(
|
|
83
|
+
{ playerId: peerPlayerId, message, severity = 'info' },
|
|
84
|
+
messageIndex
|
|
85
|
+
) => (
|
|
86
|
+
<li {...{ key: messageIndex }}>
|
|
84
87
|
<Alert
|
|
85
88
|
{...{
|
|
86
89
|
elevation: 3,
|
|
87
|
-
severity:
|
|
90
|
+
severity: severity as any,
|
|
88
91
|
}}
|
|
89
92
|
>
|
|
90
93
|
<ReactMarkdown
|
|
91
94
|
{...{
|
|
92
|
-
source: `**${getPlayerName(
|
|
95
|
+
source: `**${getPlayerName(peerPlayerId)}** ${message}`,
|
|
93
96
|
}}
|
|
94
97
|
/>
|
|
95
98
|
</Alert>
|
|
@@ -363,9 +363,9 @@ describe('getBackgroundStyles', () => {
|
|
|
363
363
|
test('constructs style for fertilizerType === fertilizerType.STANDARD', () => {
|
|
364
364
|
expect(
|
|
365
365
|
getBackgroundStyles(
|
|
366
|
-
/** @type {globalThis.farmhand.plotContent} */
|
|
366
|
+
/** @type {globalThis.farmhand.plotContent} */ testCrop({
|
|
367
367
|
fertilizerType: fertilizerType.STANDARD,
|
|
368
|
-
})
|
|
368
|
+
})
|
|
369
369
|
)
|
|
370
370
|
).toBe(`url(${plotStates['fertilized-plot']})`)
|
|
371
371
|
})
|
|
@@ -373,9 +373,9 @@ describe('getBackgroundStyles', () => {
|
|
|
373
373
|
test('constructs style for fertilizerType === fertilizerType.RAINBOW', () => {
|
|
374
374
|
expect(
|
|
375
375
|
getBackgroundStyles(
|
|
376
|
-
/** @type {globalThis.farmhand.plotContent} */
|
|
376
|
+
/** @type {globalThis.farmhand.plotContent} */ testCrop({
|
|
377
377
|
fertilizerType: fertilizerType.RAINBOW,
|
|
378
|
-
})
|
|
378
|
+
})
|
|
379
379
|
)
|
|
380
380
|
).toBe(`url(${plotStates['rianbow-fertilized-plot']})`)
|
|
381
381
|
})
|
|
@@ -383,9 +383,9 @@ describe('getBackgroundStyles', () => {
|
|
|
383
383
|
test('constructs style for wasWateredToday', () => {
|
|
384
384
|
expect(
|
|
385
385
|
getBackgroundStyles(
|
|
386
|
-
/** @type {globalThis.farmhand.plotContent} */
|
|
386
|
+
/** @type {globalThis.farmhand.plotContent} */ testCrop({
|
|
387
387
|
wasWateredToday: true,
|
|
388
|
-
})
|
|
388
|
+
})
|
|
389
389
|
)
|
|
390
390
|
).toBe(`url(${plotStates['watered-plot']})`)
|
|
391
391
|
})
|
|
@@ -393,10 +393,10 @@ describe('getBackgroundStyles', () => {
|
|
|
393
393
|
test('constructs style for fertilizerType === fertilizerType.STANDARD and wasWateredToday', () => {
|
|
394
394
|
expect(
|
|
395
395
|
getBackgroundStyles(
|
|
396
|
-
/** @type {globalThis.farmhand.plotContent} */
|
|
396
|
+
/** @type {globalThis.farmhand.plotContent} */ testCrop({
|
|
397
397
|
fertilizerType: fertilizerType.STANDARD,
|
|
398
398
|
wasWateredToday: true,
|
|
399
|
-
})
|
|
399
|
+
})
|
|
400
400
|
)
|
|
401
401
|
).toBe(
|
|
402
402
|
`url(${plotStates['fertilized-plot']}), url(${plotStates['watered-plot']})`
|
|
@@ -33,14 +33,18 @@ export const getBackgroundStyles = plotContent => {
|
|
|
33
33
|
const backgroundImages = []
|
|
34
34
|
|
|
35
35
|
if (plotContent.fertilizerType === fertilizerType.STANDARD) {
|
|
36
|
+
// @ts-expect-error
|
|
36
37
|
backgroundImages.push(`url(${plotStates['fertilized-plot']})`)
|
|
37
38
|
} else if (plotContent.fertilizerType === fertilizerType.RAINBOW) {
|
|
39
|
+
// @ts-expect-error
|
|
38
40
|
backgroundImages.push(`url(${plotStates['rainbow-fertilized-plot']})`)
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
if ('wasWateredToday' in plotContent && plotContent.wasWateredToday) {
|
|
44
|
+
// @ts-expect-error
|
|
42
45
|
backgroundImages.push(`url(${plotStates['watered-plot']})`)
|
|
43
46
|
} else if ('isShoveled' in plotContent && plotContent.isShoveled) {
|
|
47
|
+
// @ts-expect-error
|
|
44
48
|
backgroundImages.push(`url(${plotStates['shoveled-plot']})`)
|
|
45
49
|
}
|
|
46
50
|
|
|
@@ -133,6 +137,7 @@ export const Plot = ({
|
|
|
133
137
|
} else if (wasJustShoveled || plotContent?.isShoveled) {
|
|
134
138
|
const oreItem = itemsMap[plotContent?.oreId]
|
|
135
139
|
|
|
140
|
+
// @ts-expect-error
|
|
136
141
|
plotLabelText = oreItem ? SHOVELED_PLOT('', oreItem) : SHOVELED
|
|
137
142
|
}
|
|
138
143
|
|
|
@@ -57,7 +57,6 @@ const Recipe = ({
|
|
|
57
57
|
const canBeMade =
|
|
58
58
|
quantity > 0 &&
|
|
59
59
|
canMakeRecipe(recipe, inventory, quantity) &&
|
|
60
|
-
// @ts-expect-error
|
|
61
60
|
doesInventorySpaceRemain({
|
|
62
61
|
inventory,
|
|
63
62
|
// Without the Infinity coercion, this would break recipes for unlimited
|
|
@@ -95,7 +94,7 @@ const Recipe = ({
|
|
|
95
94
|
<IngredientsList
|
|
96
95
|
{...{
|
|
97
96
|
playerInventoryQuantities,
|
|
98
|
-
recipe:
|
|
97
|
+
recipe: recipe as any,
|
|
99
98
|
}}
|
|
100
99
|
/>
|
|
101
100
|
</>
|
|
@@ -20,7 +20,7 @@ export const RandomSeedInput = ({ search = globalWindow.location.search }) => {
|
|
|
20
20
|
* @param {React.ChangeEvent<HTMLInputElement>} e
|
|
21
21
|
*/
|
|
22
22
|
const handleChange = e => {
|
|
23
|
-
setSeed(/** @type {HTMLInputElement} */
|
|
23
|
+
setSeed(/** @type {HTMLInputElement} */ e.target.value)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -42,6 +42,7 @@ import './Shop.sass'
|
|
|
42
42
|
* @param {Array.<farmhand.item>} shopInventory
|
|
43
43
|
* @returns {Object.<'seeds' | 'fieldTools', Array.<farmhand.item>>}
|
|
44
44
|
*/
|
|
45
|
+
// @ts-expect-error
|
|
45
46
|
const categorizeShopInventory = memoize(shopInventory =>
|
|
46
47
|
shopInventory.reduce(
|
|
47
48
|
(acc, inventoryItem) => {
|
|
@@ -204,7 +205,7 @@ export const Shop = ({
|
|
|
204
205
|
}}
|
|
205
206
|
/>
|
|
206
207
|
</li>
|
|
207
|
-
{features.FOREST && isForestUnlocked ? (
|
|
208
|
+
{(features as any).FOREST && isForestUnlocked ? (
|
|
208
209
|
<li>
|
|
209
210
|
<TierPurchase
|
|
210
211
|
{...{
|
|
@@ -16,19 +16,22 @@ import { isOctober, isDecember } from '../../utils/index.js'
|
|
|
16
16
|
import './Stage.sass'
|
|
17
17
|
|
|
18
18
|
export const Stage = ({ field, stageFocus, viewTitle }) => {
|
|
19
|
-
const ref = /** @type {React.MutableRefObject<HTMLDivElement | null>} */
|
|
19
|
+
const ref = /** @type {React.MutableRefObject<HTMLDivElement | null>} */ useRef(
|
|
20
20
|
null
|
|
21
|
-
)
|
|
21
|
+
)
|
|
22
22
|
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
if (ref.current) {
|
|
25
|
-
const current = /** @type {HTMLElement} */
|
|
25
|
+
const current = /** @type {HTMLElement} */ ref.current
|
|
26
26
|
const { style } = current
|
|
27
27
|
// Set scroll position to the top
|
|
28
|
+
// @ts-expect-error
|
|
28
29
|
current.scrollTop = 0
|
|
29
30
|
|
|
30
31
|
// Stop any intertial scrolling
|
|
32
|
+
// @ts-expect-error
|
|
31
33
|
style.overflow = 'hidden'
|
|
34
|
+
// @ts-expect-error
|
|
32
35
|
setTimeout(() => (style.overflow = ''), 0)
|
|
33
36
|
}
|
|
34
37
|
}, [stageFocus])
|
|
@@ -40,12 +40,12 @@ export function TierPurchase({
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const canPlayerBuySelectedTier = () => {
|
|
43
|
-
const
|
|
43
|
+
const tierToBuy = tiers.get(selectedTierNumber)
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
|
-
!!
|
|
46
|
+
!!tierToBuy &&
|
|
47
47
|
!hasPurchasedTier(selectedTierNumber) &&
|
|
48
|
-
money >=
|
|
48
|
+
money >= tierToBuy.price
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -17,15 +17,18 @@ import { tools as toolImages, craftedItems, pixel } from '../../img/index.js'
|
|
|
17
17
|
|
|
18
18
|
import './Toolbelt.sass'
|
|
19
19
|
|
|
20
|
+
// @ts-expect-error
|
|
20
21
|
const getTools = memoize(toolLevels => {
|
|
21
22
|
const tools = []
|
|
22
23
|
|
|
23
24
|
for (let tool of Object.values(toolsData)) {
|
|
24
25
|
if (toolLevels[tool.type] !== toolLevel.UNAVAILABLE) {
|
|
26
|
+
// @ts-expect-error
|
|
25
27
|
tools.push(tool)
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
// @ts-expect-error
|
|
29
32
|
return tools.sort((a, b) => a.order - b.order)
|
|
30
33
|
})
|
|
31
34
|
|