@gamepark/react-game 7.0.0-beta.0 → 7.0.0-beta.3
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/components/Avatar/Avatar.js +37 -60
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/ChatSpeechBubble.js +25 -67
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -1
- package/dist/components/Avatar/SpeechBubble.js +86 -49
- package/dist/components/Avatar/SpeechBubble.js.map +1 -1
- package/dist/components/Avatar/index.js +3 -19
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/GamePoints/GamePointIcon.js +7 -24
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -1
- package/dist/components/GamePoints/GamePoints.js +20 -63
- package/dist/components/GamePoints/GamePoints.js.map +1 -1
- package/dist/components/GamePoints/index.js +2 -18
- package/dist/components/GamePoints/index.js.map +1 -1
- package/dist/components/GameProvider/GameContext.js +7 -14
- package/dist/components/GameProvider/GameContext.js.map +1 -1
- package/dist/components/GameProvider/GameProvider.js +91 -136
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/GameProvider/index.js +2 -18
- package/dist/components/GameProvider/index.js.map +1 -1
- package/dist/components/Header/Header.js +34 -43
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderText.js +15 -31
- package/dist/components/Header/HeaderText.js.map +1 -1
- package/dist/components/Header/MaterialHeader.js +42 -90
- package/dist/components/Header/MaterialHeader.js.map +1 -1
- package/dist/components/Header/index.js +3 -19
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/ImagesLoader/ImagesLoader.js +9 -14
- package/dist/components/ImagesLoader/ImagesLoader.js.map +1 -1
- package/dist/components/ImagesLoader/index.js +1 -17
- package/dist/components/ImagesLoader/index.js.map +1 -1
- package/dist/components/JournalTabs/Chat/Chat.js +7 -33
- package/dist/components/JournalTabs/Chat/Chat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessage.js +12 -17
- package/dist/components/JournalTabs/Chat/ChatMessage.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js +19 -35
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +58 -60
- package/dist/components/JournalTabs/Chat/ChatTextInput.js.map +1 -1
- package/dist/components/JournalTabs/Chat/CommonChat.d.ts +1 -1
- package/dist/components/JournalTabs/Chat/CommonChat.js +43 -48
- package/dist/components/JournalTabs/Chat/CommonChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/LocalChat.js +10 -61
- package/dist/components/JournalTabs/Chat/LocalChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/RemoteChat.js +15 -43
- package/dist/components/JournalTabs/Chat/RemoteChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +36 -22
- package/dist/components/JournalTabs/Chat/SignInToChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/index.js +5 -21
- package/dist/components/JournalTabs/Chat/index.js.map +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.js +14 -20
- package/dist/components/JournalTabs/History/GameOverHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/History.d.ts +1 -1
- package/dist/components/JournalTabs/History/History.js +59 -54
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/HistoryEntry.js +37 -43
- package/dist/components/JournalTabs/History/HistoryEntry.js.map +1 -1
- package/dist/components/JournalTabs/History/StartGameHistory.js +12 -17
- package/dist/components/JournalTabs/History/StartGameHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/index.js +2 -18
- package/dist/components/JournalTabs/History/index.js.map +1 -1
- package/dist/components/JournalTabs/JournalTabs.js +122 -68
- package/dist/components/JournalTabs/JournalTabs.js.map +1 -1
- package/dist/components/JournalTabs/index.js +1 -17
- package/dist/components/JournalTabs/index.js.map +1 -1
- package/dist/components/Letterbox/Letterbox.js +29 -41
- package/dist/components/Letterbox/Letterbox.js.map +1 -1
- package/dist/components/Letterbox/index.js +1 -17
- package/dist/components/Letterbox/index.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +83 -89
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/components/LoadingScreen/index.js +1 -17
- package/dist/components/LoadingScreen/index.js.map +1 -1
- package/dist/components/Log/InternalLiveLogContainer.js +73 -83
- package/dist/components/Log/InternalLiveLogContainer.js.map +1 -1
- package/dist/components/Log/LiveLogButton.js +14 -19
- package/dist/components/Log/LiveLogButton.js.map +1 -1
- package/dist/components/Log/LiveLogContainer.js +6 -21
- package/dist/components/Log/LiveLogContainer.js.map +1 -1
- package/dist/components/Log/LogDescription.js +1 -2
- package/dist/components/Log/LogItem.js +42 -42
- package/dist/components/Log/LogItem.js.map +1 -1
- package/dist/components/Log/index.js +3 -19
- package/dist/components/Log/index.js.map +1 -1
- package/dist/components/Picture/Picture.js +6 -32
- package/dist/components/Picture/Picture.js.map +1 -1
- package/dist/components/Picture/index.js +1 -17
- package/dist/components/Picture/index.js.map +1 -1
- package/dist/components/PlayerPanel/Counters.d.ts +2 -1
- package/dist/components/PlayerPanel/Counters.js +82 -39
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.js +83 -53
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +145 -80
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/index.js +3 -19
- package/dist/components/PlayerPanel/index.js.map +1 -1
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +1 -1
- package/dist/components/PlayerTimer/PlayerTimer.js +32 -61
- package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -1
- package/dist/components/PlayerTimer/index.js +1 -17
- package/dist/components/PlayerTimer/index.js.map +1 -1
- package/dist/components/Scoring/ScoringDescription.js +1 -2
- package/dist/components/Scoring/index.js +1 -17
- package/dist/components/Scoring/index.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +82 -105
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/index.js +1 -17
- package/dist/components/buttons/PlayMoveButton/index.js.map +1 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.js +5 -20
- package/dist/components/buttons/ThemeButton/ThemeButton.js.map +1 -1
- package/dist/components/buttons/ThemeButton/index.js +1 -17
- package/dist/components/buttons/ThemeButton/index.js.map +1 -1
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.js +17 -59
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.js.map +1 -1
- package/dist/components/buttons/UndoMovesButton/index.js +1 -17
- package/dist/components/buttons/UndoMovesButton/index.js.map +1 -1
- package/dist/components/buttons/index.js +3 -19
- package/dist/components/buttons/index.js.map +1 -1
- package/dist/components/dialogs/Dialog.js +57 -67
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.js +39 -73
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +55 -52
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.js +17 -27
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +130 -99
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/index.js +2 -18
- package/dist/components/dialogs/ResultDialog/index.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/useScoringTable.js +20 -27
- package/dist/components/dialogs/ResultDialog/useScoringTable.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +32 -31
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +22 -36
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +121 -117
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +23 -42
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.d.ts +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +36 -27
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/index.js +2 -18
- package/dist/components/dialogs/RulesDialog/index.js.map +1 -1
- package/dist/components/dialogs/index.js +4 -20
- package/dist/components/dialogs/index.js.map +1 -1
- package/dist/components/index.js +17 -33
- package/dist/components/index.js.map +1 -1
- package/dist/components/material/ComponentDescription.js +32 -18
- package/dist/components/material/ComponentDescription.js.map +1 -1
- package/dist/components/material/Dices/CubicDiceDescription.js +58 -102
- package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
- package/dist/components/material/Dices/index.js +1 -17
- package/dist/components/material/Dices/index.js.map +1 -1
- package/dist/components/material/DraggableMaterial.js +121 -198
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/BoardDescription.js +3 -27
- package/dist/components/material/FlatMaterial/BoardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.js +6 -56
- package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.js +88 -133
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/MoneyDescription.js +10 -34
- package/dist/components/material/FlatMaterial/MoneyDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/PolyhexDescription.js +12 -63
- package/dist/components/material/FlatMaterial/PolyhexDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/TokenDescription.js +10 -66
- package/dist/components/material/FlatMaterial/TokenDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/index.js +6 -22
- package/dist/components/material/FlatMaterial/index.js.map +1 -1
- package/dist/components/material/GameTable/DropPreview.js +31 -66
- package/dist/components/material/GameTable/DropPreview.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +22 -81
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js +25 -30
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.js +78 -125
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +58 -67
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.js +88 -153
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.js +23 -83
- package/dist/components/material/GameTable/StaticItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticLocationsDisplay.js +11 -28
- package/dist/components/material/GameTable/StaticLocationsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/focus/FocusProvider.js +28 -53
- package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
- package/dist/components/material/GameTable/focus/MaterialFocus.js +1 -2
- package/dist/components/material/GameTable/focus/index.js +2 -18
- package/dist/components/material/GameTable/focus/index.js.map +1 -1
- package/dist/components/material/GameTable/index.js +3 -19
- package/dist/components/material/GameTable/index.js.map +1 -1
- package/dist/components/material/ImageLoader/MaterialImageLoader.js +17 -89
- package/dist/components/material/ImageLoader/MaterialImageLoader.js.map +1 -1
- package/dist/components/material/ImageLoader/index.js +1 -17
- package/dist/components/material/ImageLoader/index.js.map +1 -1
- package/dist/components/material/ItemMenuButton.js +41 -69
- package/dist/components/material/ItemMenuButton.js.map +1 -1
- package/dist/components/material/ItemMenuWrapper.js +16 -66
- package/dist/components/material/ItemMenuWrapper.js.map +1 -1
- package/dist/components/material/MaterialComponent.d.ts +2 -2
- package/dist/components/material/MaterialComponent.js +22 -44
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialComponentType.js +2 -5
- package/dist/components/material/MaterialComponentType.js.map +1 -1
- package/dist/components/material/MaterialDescription.d.ts +2 -2
- package/dist/components/material/MaterialDescription.js +125 -164
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/MobileMaterialDescription.js +21 -83
- package/dist/components/material/MobileMaterialDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelContent.js +26 -29
- package/dist/components/material/Wheel/WheelContent.js.map +1 -1
- package/dist/components/material/Wheel/WheelDescription.js +46 -105
- package/dist/components/material/Wheel/WheelDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelItem.js +43 -42
- package/dist/components/material/Wheel/WheelItem.js.map +1 -1
- package/dist/components/material/Wheel/index.js +1 -17
- package/dist/components/material/Wheel/index.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.js +44 -91
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/Writing/index.js +1 -17
- package/dist/components/material/Writing/index.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.d.ts +6 -1
- package/dist/components/material/animations/CreateItemAnimations.js +43 -67
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.d.ts +6 -1
- package/dist/components/material/animations/DeleteItemAnimations.js +44 -63
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.js +30 -53
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +6 -1
- package/dist/components/material/animations/ItemAnimations.js +21 -55
- package/dist/components/material/animations/ItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialAnimations.js +30 -56
- package/dist/components/material/animations/MaterialAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialGameAnimations.js +53 -131
- package/dist/components/material/animations/MaterialGameAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAnimations.js +62 -100
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +31 -66
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.js +28 -76
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.js +9 -31
- package/dist/components/material/animations/ShuffleAnimations.js.map +1 -1
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js +9 -24
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js.map +1 -1
- package/dist/components/material/animations/index.js +8 -26
- package/dist/components/material/animations/index.js.map +1 -1
- package/dist/components/material/animations/rotations.utils.js +50 -83
- package/dist/components/material/animations/rotations.utils.js.map +1 -1
- package/dist/components/material/animations/transformItem.util.js +6 -35
- package/dist/components/material/animations/transformItem.util.js.map +1 -1
- package/dist/components/material/index.js +15 -31
- package/dist/components/material/index.js.map +1 -1
- package/dist/components/material/locations/DropAreaDescription.js +20 -80
- package/dist/components/material/locations/DropAreaDescription.js.map +1 -1
- package/dist/components/material/locations/HexGridDropAreaDescription.js +34 -101
- package/dist/components/material/locations/HexGridDropAreaDescription.js.map +1 -1
- package/dist/components/material/locations/LocationComponent.js +53 -88
- package/dist/components/material/locations/LocationComponent.js.map +1 -1
- package/dist/components/material/locations/LocationDescription.js +58 -113
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/LocationDisplay.js +25 -79
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/LocationsMask.js +16 -23
- package/dist/components/material/locations/LocationsMask.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.js +42 -90
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/material/locations/index.js +5 -21
- package/dist/components/material/locations/index.js.map +1 -1
- package/dist/components/material/sound/AudioLoader.js +43 -92
- package/dist/components/material/sound/AudioLoader.js.map +1 -1
- package/dist/components/material/sound/MaterialGameSounds.js +42 -76
- package/dist/components/material/sound/MaterialGameSounds.js.map +1 -1
- package/dist/components/material/sound/MaterialSoundConfig.js +11 -8
- package/dist/components/material/sound/MaterialSoundConfig.js.map +1 -1
- package/dist/components/material/sound/MaterialSoundLoader.js +16 -69
- package/dist/components/material/sound/MaterialSoundLoader.js.map +1 -1
- package/dist/components/material/sound/index.js +2 -18
- package/dist/components/material/sound/index.js.map +1 -1
- package/dist/components/material/sound/sound.utils.js +1 -5
- package/dist/components/material/sound/sound.utils.js.map +1 -1
- package/dist/components/material/utils/IsLocationSubset.js +4 -8
- package/dist/components/material/utils/IsLocationSubset.js.map +1 -1
- package/dist/components/material/utils/getBestDropMove.d.ts +1 -1
- package/dist/components/material/utils/getBestDropMove.js +12 -26
- package/dist/components/material/utils/getBestDropMove.js.map +1 -1
- package/dist/components/material/utils/index.js +1 -17
- package/dist/components/material/utils/index.js.map +1 -1
- package/dist/components/material/utils/isDroppedItem.js +7 -24
- package/dist/components/material/utils/isDroppedItem.js.map +1 -1
- package/dist/components/material/utils/isPlacedOnItem.js +5 -9
- package/dist/components/material/utils/isPlacedOnItem.js.map +1 -1
- package/dist/components/material/utils/isRotationMove.js +5 -20
- package/dist/components/material/utils/isRotationMove.js.map +1 -1
- package/dist/components/material/utils/useIsAnimatingPlayerAction.js +4 -10
- package/dist/components/material/utils/useIsAnimatingPlayerAction.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +30 -32
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +47 -66
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +25 -50
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/index.js +3 -19
- package/dist/components/menus/EjectPlayer/index.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +11 -15
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +36 -60
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +28 -42
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/index.js +3 -19
- package/dist/components/menus/Fullscreen/index.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +49 -60
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/GiveUpButton/index.js +1 -17
- package/dist/components/menus/GiveUpButton/index.js.map +1 -1
- package/dist/components/menus/Menu/LogoIcon.js +2 -17
- package/dist/components/menus/Menu/LogoIcon.js.map +1 -1
- package/dist/components/menus/Menu/Menu.d.ts +2 -2
- package/dist/components/menus/Menu/Menu.js +117 -93
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.js +21 -60
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.js +3 -32
- package/dist/components/menus/Menu/NavButton.js.map +1 -1
- package/dist/components/menus/Menu/index.js +1 -17
- package/dist/components/menus/Menu/index.js.map +1 -1
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +20 -42
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js.map +1 -1
- package/dist/components/menus/PlayerQuit/index.js +1 -17
- package/dist/components/menus/PlayerQuit/index.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +12 -17
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/index.js +1 -17
- package/dist/components/menus/RestartTutorialButton/index.js.map +1 -1
- package/dist/components/menus/Result/Medal.js +8 -35
- package/dist/components/menus/Result/Medal.js.map +1 -1
- package/dist/components/menus/Result/MedalBronze.js +2 -17
- package/dist/components/menus/Result/MedalBronze.js.map +1 -1
- package/dist/components/menus/Result/MedalGold.js +2 -17
- package/dist/components/menus/Result/MedalGold.js.map +1 -1
- package/dist/components/menus/Result/MedalSilver.js +2 -17
- package/dist/components/menus/Result/MedalSilver.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.js +8 -23
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.js +46 -35
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -1
- package/dist/components/menus/Result/index.js +3 -19
- package/dist/components/menus/Result/index.js.map +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +11 -15
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/SoundButton/index.js +1 -17
- package/dist/components/menus/SoundButton/index.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +68 -70
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/index.js +1 -17
- package/dist/components/menus/TimeStatsButton/index.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +11 -31
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +24 -38
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -1
- package/dist/components/menus/UndoButton/index.js +2 -18
- package/dist/components/menus/UndoButton/index.js.map +1 -1
- package/dist/components/menus/index.js +6 -22
- package/dist/components/menus/index.js.map +1 -1
- package/dist/components/menus/menuCss.d.ts +9 -9
- package/dist/components/menus/menuCss.js +102 -19
- package/dist/components/menus/menuCss.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorial.js +19 -27
- package/dist/components/tutorial/MaterialTutorial.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +84 -95
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/components/tutorial/TutorialRulesWrapper.js +54 -63
- package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
- package/dist/components/tutorial/index.js +1 -17
- package/dist/components/tutorial/index.js.map +1 -1
- package/dist/css/GameTheme.js +4 -7
- package/dist/css/GameTheme.js.map +1 -1
- package/dist/css/addStylesheetUrl.js +2 -6
- package/dist/css/addStylesheetUrl.js.map +1 -1
- package/dist/css/backgroundCss.d.ts +1 -1
- package/dist/css/backgroundCss.js +5 -11
- package/dist/css/backgroundCss.js.map +1 -1
- package/dist/css/buttonCss.d.ts +3 -3
- package/dist/css/buttonCss.js +45 -13
- package/dist/css/buttonCss.js.map +1 -1
- package/dist/css/componentSizeCss.d.ts +5 -5
- package/dist/css/componentSizeCss.js +17 -22
- package/dist/css/componentSizeCss.js.map +1 -1
- package/dist/css/cursorCss.d.ts +3 -3
- package/dist/css/cursorCss.js +10 -12
- package/dist/css/cursorCss.js.map +1 -1
- package/dist/css/fadeIn.d.ts +1 -1
- package/dist/css/fadeIn.js +9 -12
- package/dist/css/fadeIn.js.map +1 -1
- package/dist/css/index.js +10 -26
- package/dist/css/index.js.map +1 -1
- package/dist/css/shadowEffect.d.ts +1 -1
- package/dist/css/shadowEffect.js +15 -10
- package/dist/css/shadowEffect.js.map +1 -1
- package/dist/css/shineEffect.d.ts +1 -1
- package/dist/css/shineEffect.js +31 -11
- package/dist/css/shineEffect.js.map +1 -1
- package/dist/css/transformCss.d.ts +2 -2
- package/dist/css/transformCss.js +7 -18
- package/dist/css/transformCss.js.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +26 -43
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useActions.js +2 -8
- package/dist/hooks/useActions.js.map +1 -1
- package/dist/hooks/useAnimations.js +18 -52
- package/dist/hooks/useAnimations.js.map +1 -1
- package/dist/hooks/useDraggedItem.js +9 -28
- package/dist/hooks/useDraggedItem.js.map +1 -1
- package/dist/hooks/useFailures.d.ts +1 -1
- package/dist/hooks/useFailures.js +10 -10
- package/dist/hooks/useFailures.js.map +1 -1
- package/dist/hooks/useFlatHistory.js +60 -128
- package/dist/hooks/useFlatHistory.js.map +1 -1
- package/dist/hooks/useFullscreen.js +19 -42
- package/dist/hooks/useFullscreen.js.map +1 -1
- package/dist/hooks/useGame.js +3 -6
- package/dist/hooks/useGame.js.map +1 -1
- package/dist/hooks/useGiveUp.js +10 -15
- package/dist/hooks/useGiveUp.js.map +1 -1
- package/dist/hooks/useItemLocations.js +31 -102
- package/dist/hooks/useItemLocations.js.map +1 -1
- package/dist/hooks/useItemLocator.js +3 -7
- package/dist/hooks/useItemLocator.js.map +1 -1
- package/dist/hooks/useKeyDown.js +5 -9
- package/dist/hooks/useKeyDown.js.map +1 -1
- package/dist/hooks/useLegalMoves.js +8 -12
- package/dist/hooks/useLegalMoves.js.map +1 -1
- package/dist/hooks/useLocators.js +3 -7
- package/dist/hooks/useLocators.js.map +1 -1
- package/dist/hooks/useMaterialContext.js +11 -15
- package/dist/hooks/useMaterialContext.js.map +1 -1
- package/dist/hooks/useMaterialDescription.js +4 -8
- package/dist/hooks/useMaterialDescription.js.map +1 -1
- package/dist/hooks/useNow.js +9 -30
- package/dist/hooks/useNow.js.map +1 -1
- package/dist/hooks/useNumberOfPlayers.js +2 -6
- package/dist/hooks/useNumberOfPlayers.js.map +1 -1
- package/dist/hooks/useOpponentWithMaxTime.js +17 -39
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -1
- package/dist/hooks/usePlay.js +5 -21
- package/dist/hooks/usePlay.js.map +1 -1
- package/dist/hooks/usePlayerId.js +4 -10
- package/dist/hooks/usePlayerId.js.map +1 -1
- package/dist/hooks/usePlayerName.js +14 -19
- package/dist/hooks/usePlayerName.js.map +1 -1
- package/dist/hooks/usePlayerTime.js +16 -37
- package/dist/hooks/usePlayerTime.js.map +1 -1
- package/dist/hooks/usePlayers.js +35 -69
- package/dist/hooks/usePlayers.js.map +1 -1
- package/dist/hooks/useRankedPlayers.js +15 -20
- package/dist/hooks/useRankedPlayers.js.map +1 -1
- package/dist/hooks/useResultText.js +23 -27
- package/dist/hooks/useResultText.js.map +1 -1
- package/dist/hooks/useRules.js +10 -13
- package/dist/hooks/useRules.js.map +1 -1
- package/dist/hooks/useSound.js +8 -28
- package/dist/hooks/useSound.js.map +1 -1
- package/dist/hooks/useStaticLocations.js +21 -84
- package/dist/hooks/useStaticLocations.js.map +1 -1
- package/dist/hooks/useTutorialStep.js +7 -10
- package/dist/hooks/useTutorialStep.js.map +1 -1
- package/dist/hooks/useUndo.d.ts +1 -1
- package/dist/hooks/useUndo.js +29 -64
- package/dist/hooks/useUndo.js.map +1 -1
- package/dist/hooks/useWebP.js +10 -77
- package/dist/hooks/useWebP.js.map +1 -1
- package/dist/hooks/useZoomToElements.js +43 -75
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/index.js +5 -23
- package/dist/index.js.map +1 -1
- package/dist/locators/DeckLocator.js +8 -30
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.js +57 -70
- package/dist/locators/FlexLocator.js.map +1 -1
- package/dist/locators/HandLocator.js +74 -99
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/HexagonalGridLocator.js +105 -158
- package/dist/locators/HexagonalGridLocator.js.map +1 -1
- package/dist/locators/ListLocator.js +59 -73
- package/dist/locators/ListLocator.js.map +1 -1
- package/dist/locators/Locator.js +149 -190
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.js +65 -126
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/locators/index.js +8 -24
- package/dist/locators/index.js.map +1 -1
- package/dist/locators/utils/getRelativePlayerIndex.util.js +2 -7
- package/dist/locators/utils/getRelativePlayerIndex.util.js.map +1 -1
- package/dist/locators/utils/index.js +1 -17
- package/dist/locators/utils/index.js.map +1 -1
- package/dist/utilities/DeepPartial.js +1 -2
- package/dist/utilities/combineEventListeners.js +5 -38
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.js +4 -7
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/index.js +4 -20
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/translation.util.js +21 -31
- package/dist/utilities/translation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +29 -32
- package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.util.js +24 -30
- package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/bounds.util.js +43 -52
- package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/calculation.util.js +2 -7
- package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/index.js +5 -21
- package/dist/utilities/zoom-pan-pinch/index.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +3 -6
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -1
- package/package.json +83 -77
- package/dist/components/Chat/Chat.d.ts +0 -3
- package/dist/components/Chat/Chat.js +0 -80
- package/dist/components/Chat/Chat.js.map +0 -1
- package/dist/components/Chat/ChatMessage.d.ts +0 -7
- package/dist/components/Chat/ChatMessage.js +0 -29
- package/dist/components/Chat/ChatMessage.js.map +0 -1
- package/dist/components/Chat/ChatMessageAuthor.d.ts +0 -3
- package/dist/components/Chat/ChatMessageAuthor.js +0 -34
- package/dist/components/Chat/ChatMessageAuthor.js.map +0 -1
- package/dist/components/Chat/ChatTextInput.d.ts +0 -7
- package/dist/components/Chat/ChatTextInput.js +0 -44
- package/dist/components/Chat/ChatTextInput.js.map +0 -1
- package/dist/components/Chat/SignInToChat.d.ts +0 -1
- package/dist/components/Chat/SignInToChat.js +0 -35
- package/dist/components/Chat/SignInToChat.js.map +0 -1
- package/dist/components/Chat/index.d.ts +0 -5
- package/dist/components/Chat/index.js +0 -22
- package/dist/components/Chat/index.js.map +0 -1
- package/dist/components/Header/PlayerTurnHeader.d.ts +0 -11
- package/dist/components/Header/PlayerTurnHeader.js +0 -37
- package/dist/components/Header/PlayerTurnHeader.js.map +0 -1
- package/dist/components/Header/SimultaneousHeader.d.ts +0 -8
- package/dist/components/Header/SimultaneousHeader.js +0 -35
- package/dist/components/Header/SimultaneousHeader.js.map +0 -1
- package/dist/components/JournalTabs/History/ActionHistoryEntry.d.ts +0 -12
- package/dist/components/JournalTabs/History/ActionHistoryEntry.js +0 -62
- package/dist/components/JournalTabs/History/ActionHistoryEntry.js.map +0 -1
- package/dist/components/JournalTabs/History/MaterialHistory.d.ts +0 -10
- package/dist/components/JournalTabs/History/MaterialHistory.js +0 -3
- package/dist/components/JournalTabs/History/MaterialHistory.js.map +0 -1
- package/dist/components/JournalTabs/History/PlayerActionHistory.d.ts +0 -8
- package/dist/components/JournalTabs/History/PlayerActionHistory.js +0 -42
- package/dist/components/JournalTabs/History/PlayerActionHistory.js.map +0 -1
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.d.ts +0 -8
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.js +0 -44
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.js.map +0 -1
- package/dist/components/JournalTabs/History/StartHistory.d.ts +0 -2
- package/dist/components/JournalTabs/History/StartHistory.js +0 -30
- package/dist/components/JournalTabs/History/StartHistory.js.map +0 -1
- package/dist/components/material/Dices/DiceDescription.d.ts +0 -10
- package/dist/components/material/Dices/DiceDescription.js +0 -56
- package/dist/components/material/Dices/DiceDescription.js.map +0 -1
- package/dist/components/material/GameTable/DraggableStockItem.d.ts +0 -4
- package/dist/components/material/GameTable/DraggableStockItem.js +0 -82
- package/dist/components/material/GameTable/DraggableStockItem.js.map +0 -1
- package/dist/components/material/GameTable/FocusableElement.d.ts +0 -13
- package/dist/components/material/GameTable/FocusableElement.js +0 -63
- package/dist/components/material/GameTable/FocusableElement.js.map +0 -1
- package/dist/components/material/GameTable/FocusableLocation.d.ts +0 -8
- package/dist/components/material/GameTable/FocusableLocation.js +0 -37
- package/dist/components/material/GameTable/FocusableLocation.js.map +0 -1
- package/dist/components/material/GameTable/FocusableLocations.d.ts +0 -0
- package/dist/components/material/GameTable/FocusableLocations.js +0 -2
- package/dist/components/material/GameTable/FocusableLocations.js.map +0 -1
- package/dist/components/material/GameTable/GameTableContent.d.ts +0 -18
- package/dist/components/material/GameTable/GameTableContent.js +0 -63
- package/dist/components/material/GameTable/GameTableContent.js.map +0 -1
- package/dist/components/material/GameTable/focus/FocusableElement.d.ts +0 -13
- package/dist/components/material/GameTable/focus/FocusableElement.js +0 -63
- package/dist/components/material/GameTable/focus/FocusableElement.js.map +0 -1
- package/dist/components/material/GameTable/focus/FocusableLocation.d.ts +0 -8
- package/dist/components/material/GameTable/focus/FocusableLocation.js +0 -38
- package/dist/components/material/GameTable/focus/FocusableLocation.js.map +0 -1
- package/dist/components/material/GameTable/focus/LocationsWithFocus.d.ts +0 -9
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js +0 -45
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js.map +0 -1
- package/dist/components/material/GameTable/locations.utils.d.ts +0 -0
- package/dist/components/material/GameTable/locations.utils.js +0 -2
- package/dist/components/material/GameTable/locations.utils.js.map +0 -1
- package/dist/components/material/ItemMenu.js.map +0 -1
- package/dist/components/material/MaterialAnimations.d.ts +0 -25
- package/dist/components/material/MaterialAnimations.js +0 -219
- package/dist/components/material/MaterialAnimations.js.map +0 -1
- package/dist/components/material/MaterialGameAnimations.d.ts +0 -10
- package/dist/components/material/MaterialGameAnimations.js +0 -47
- package/dist/components/material/MaterialGameAnimations.js.map +0 -1
- package/dist/components/material/animations/adjustRotation.d.ts +0 -1
- package/dist/components/material/animations/adjustRotation.js +0 -67
- package/dist/components/material/animations/adjustRotation.js.map +0 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.d.ts +0 -3
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js +0 -26
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js.map +0 -1
- package/dist/components/material/animations/itemMovementCss.util.d.ts +0 -2
- package/dist/components/material/animations/itemMovementCss.util.js +0 -13
- package/dist/components/material/animations/itemMovementCss.util.js.map +0 -1
- package/dist/components/material/locations/HexGridDropArea.d.ts +0 -11
- package/dist/components/material/locations/HexGridDropArea.js +0 -74
- package/dist/components/material/locations/HexGridDropArea.js.map +0 -1
- package/dist/components/material/utils/IsMoveOnItem.d.ts +0 -2
- package/dist/components/material/utils/IsMoveOnItem.js +0 -12
- package/dist/components/material/utils/IsMoveOnItem.js.map +0 -1
- package/dist/components/material/utils/getItemFromContext.d.ts +0 -3
- package/dist/components/material/utils/getItemFromContext.js +0 -10
- package/dist/components/material/utils/getItemFromContext.js.map +0 -1
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.d.ts +0 -4
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js +0 -27
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js.map +0 -1
- package/dist/components/menus/ContrastThemeButton/index.d.ts +0 -1
- package/dist/components/menus/ContrastThemeButton/index.js +0 -18
- package/dist/components/menus/ContrastThemeButton/index.js.map +0 -1
- package/dist/components/tutorial/FocusableElement.d.ts +0 -0
- package/dist/components/tutorial/FocusableElement.js +0 -2
- package/dist/components/tutorial/FocusableElement.js.map +0 -1
- package/dist/hooks/useCloseHelpDialog.d.ts +0 -1
- package/dist/hooks/useCloseHelpDialog.js +0 -14
- package/dist/hooks/useCloseHelpDialog.js.map +0 -1
- package/dist/hooks/useContrastTheme.d.ts +0 -7
- package/dist/hooks/useContrastTheme.js +0 -27
- package/dist/hooks/useContrastTheme.js.map +0 -1
- package/dist/hooks/useGameHistory.d.ts +0 -1
- package/dist/hooks/useGameHistory.js +0 -13
- package/dist/hooks/useGameHistory.js.map +0 -1
- package/dist/hooks/useHistory.d.ts +0 -6
- package/dist/hooks/useHistory.js +0 -85
- package/dist/hooks/useHistory.js.map +0 -1
- package/dist/hooks/useMaterialAnimations.d.ts +0 -2
- package/dist/hooks/useMaterialAnimations.js +0 -17
- package/dist/hooks/useMaterialAnimations.js.map +0 -1
- package/dist/hooks/useMaterials.d.ts +0 -2
- package/dist/hooks/useMaterials.js +0 -10
- package/dist/hooks/useMaterials.js.map +0 -1
- package/dist/hooks/useRulesStep.d.ts +0 -2
- package/dist/hooks/useRulesStep.js +0 -10
- package/dist/hooks/useRulesStep.js.map +0 -1
- package/dist/hooks/useScale.d.ts +0 -1
- package/dist/hooks/useScale.js +0 -16
- package/dist/hooks/useScale.js.map +0 -1
- package/dist/locators/GridLocator.d.ts +0 -13
- package/dist/locators/GridLocator.js +0 -59
- package/dist/locators/GridLocator.js.map +0 -1
- package/dist/locators/ItemLocator.d.ts +0 -49
- package/dist/locators/ItemLocator.js +0 -144
- package/dist/locators/ItemLocator.js.map +0 -1
- package/dist/locators/LineLocator.d.ts +0 -12
- package/dist/locators/LineLocator.js +0 -77
- package/dist/locators/LineLocator.js.map +0 -1
- package/dist/translation/index.d.ts +0 -1
- package/dist/translation/index.js +0 -18
- package/dist/translation/index.js.map +0 -1
- package/dist/translation/setupTranslation.d.ts +0 -5
- package/dist/translation/setupTranslation.js +0 -33
- package/dist/translation/setupTranslation.js.map +0 -1
- package/dist/utilities/animations.constants.d.ts +0 -16
- package/dist/utilities/animations.constants.js +0 -62
- package/dist/utilities/animations.constants.js.map +0 -1
- package/dist/utilities/animations.util.d.ts +0 -4
- package/dist/utilities/animations.util.js +0 -71
- package/dist/utilities/animations.util.js.map +0 -1
- package/dist/utilities/bounds.util.d.ts +0 -7
- package/dist/utilities/bounds.util.js +0 -77
- package/dist/utilities/bounds.util.js.map +0 -1
- package/dist/utilities/calculation.util.d.ts +0 -2
- package/dist/utilities/calculation.util.js +0 -12
- package/dist/utilities/calculation.util.js.map +0 -1
- package/dist/utilities/pusher.d.ts +0 -2
- package/dist/utilities/pusher.js +0 -16
- package/dist/utilities/pusher.js.map +0 -1
- package/dist/utilities/zoom.util.d.ts +0 -1
- package/dist/utilities/zoom.util.js +0 -14
- package/dist/utilities/zoom.util.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const adjustRotation: (transforms: string[], _sourceTransforms?: string[]) => string[];
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.adjustRotation = void 0;
|
|
5
|
-
var adjustRotation = function (transforms, _sourceTransforms) {
|
|
6
|
-
var result = [];
|
|
7
|
-
var rotateZ = 0;
|
|
8
|
-
for (var _i = 0, transforms_1 = transforms; _i < transforms_1.length; _i++) {
|
|
9
|
-
var transform = transforms_1[_i];
|
|
10
|
-
var rotateZMatch = transform.match(/rotateZ?\((-?\d+\.?\d*)([^)]*)\)/);
|
|
11
|
-
if (rotateZMatch) {
|
|
12
|
-
rotateZ += convertAngle(parseFloat(rotateZMatch[1]), rotateZMatch[2]);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
if (Math.abs(rotateZ) % 360 === 0 || !transform.startsWith('translate')) {
|
|
16
|
-
result.push(transform);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
var values = getTranslateValues(transform);
|
|
20
|
-
if (!values)
|
|
21
|
-
result.push(transform);
|
|
22
|
-
else {
|
|
23
|
-
var x = values.x, y = values.y, z = values.z;
|
|
24
|
-
var cos = Math.cos(rotateZ);
|
|
25
|
-
var sin = Math.sin(rotateZ);
|
|
26
|
-
result.push("translate3d(".concat(cos * x - sin * y, "em, ").concat(cos * y + sin * x, "em, ").concat(z, "em)"));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
var radTurn = 2 * Math.PI;
|
|
32
|
-
var finalRotate = ((rotateZ % radTurn) + radTurn) % radTurn;
|
|
33
|
-
if (finalRotate)
|
|
34
|
-
result.push("rotateZ(".concat(finalRotate, "rad)"));
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
exports.adjustRotation = adjustRotation;
|
|
38
|
-
function getTranslateValues(transform) {
|
|
39
|
-
var translate3d = transform.match(/translate3d\((-?\d+\.?\d*)em, (-?\d+\.?\d*)em, (-?\d+\.?\d*)em\)/);
|
|
40
|
-
if (translate3d) {
|
|
41
|
-
return { x: parseFloat(translate3d[1]), y: parseFloat(translate3d[2]), z: parseFloat(translate3d[3]) };
|
|
42
|
-
}
|
|
43
|
-
var translate = transform.match(/translate\((-?\d+\.?\d*)em, (-?\d+\.?\d*)em\)/);
|
|
44
|
-
if (translate) {
|
|
45
|
-
return { x: parseFloat(translate[1]), y: parseFloat(translate[2]), z: 0 };
|
|
46
|
-
}
|
|
47
|
-
var translateX = transform.match(/translateX?\((-?\d+\.?\d*)em\)/);
|
|
48
|
-
if (translateX) {
|
|
49
|
-
return { x: parseFloat(translateX[1]), y: 0, z: 0 };
|
|
50
|
-
}
|
|
51
|
-
var translateY = transform.match(/translateY\((-?\d+\.?\d*)em\)/);
|
|
52
|
-
if (translateY) {
|
|
53
|
-
return { x: 0, y: parseFloat(translateY[1]), z: 0 };
|
|
54
|
-
}
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
var angleUnitValue = (_a = {},
|
|
58
|
-
_a['deg'] = 360,
|
|
59
|
-
_a['grad'] = 400,
|
|
60
|
-
_a['rad'] = 2 * Math.PI,
|
|
61
|
-
_a['turn'] = 1,
|
|
62
|
-
_a);
|
|
63
|
-
var convertAngle = function (value, unit, targetUnit) {
|
|
64
|
-
if (targetUnit === void 0) { targetUnit = 'rad'; }
|
|
65
|
-
return unit === targetUnit ? value : value * angleUnitValue[targetUnit] / angleUnitValue[unit];
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=adjustRotation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adjustRotation.js","sourceRoot":"","sources":["../../../../src/components/material/animations/adjustRotation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { DeleteItem, MoveItem } from '@gamepark/rules-api';
|
|
2
|
-
import { ItemContext } from '../../../locators';
|
|
3
|
-
export declare const isMovedOrDeletedItem: <P extends number = number, M extends number = number, L extends number = number>({ rules, type, index, displayIndex }: ItemContext<P, M, L>, move: MoveItem<P, M, L> | DeleteItem<M>) => boolean;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMovedOrDeletedItem = void 0;
|
|
4
|
-
var isMovedOrDeletedItem = function (_a, move) {
|
|
5
|
-
var _b, _c;
|
|
6
|
-
var rules = _a.rules, type = _a.type, index = _a.index, displayIndex = _a.displayIndex;
|
|
7
|
-
if (move.itemType !== type || move.itemIndex !== index)
|
|
8
|
-
return false;
|
|
9
|
-
var item = rules.material(type).getItem(index);
|
|
10
|
-
var quantity = (_b = item.quantity) !== null && _b !== void 0 ? _b : 1;
|
|
11
|
-
if (quantity === 1)
|
|
12
|
-
return true;
|
|
13
|
-
var movedQuantity = (_c = move.quantity) !== null && _c !== void 0 ? _c : 1;
|
|
14
|
-
var droppedItem = rules.game.droppedItem;
|
|
15
|
-
if ((droppedItem === null || droppedItem === void 0 ? void 0 : droppedItem.type) === type && droppedItem.index === index) {
|
|
16
|
-
var droppedIndex = droppedItem.displayIndex;
|
|
17
|
-
if (displayIndex === droppedIndex)
|
|
18
|
-
return true;
|
|
19
|
-
if (droppedIndex < quantity - movedQuantity) {
|
|
20
|
-
return displayIndex > quantity - movedQuantity;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return displayIndex >= quantity - movedQuantity;
|
|
24
|
-
};
|
|
25
|
-
exports.isMovedOrDeletedItem = isMovedOrDeletedItem;
|
|
26
|
-
//# sourceMappingURL=isMovedOrDeletedItem.util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isMovedOrDeletedItem.util.js","sourceRoot":"","sources":["../../../../src/components/material/animations/isMovedOrDeletedItem.util.ts"],"names":[],"mappings":";;;AAGO,IAAM,oBAAoB,GAAG,UAClC,EAA0D,EAAE,IAAuC;;QAAjG,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,YAAY,kBAAA;IAElC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACpE,IAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAE,CAAA;IACjD,IAAI,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAA;IACjC,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/B,IAAM,aAAa,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAA;IACxC,IAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAA;IAC1C,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,IAAI,IAAI,WAAW,CAAC,KAAK,KAAK,KAAK,EAAE;QAC7D,IAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;QAC7C,IAAI,YAAY,KAAK,YAAY;YAAE,OAAO,IAAI,CAAA;QAC9C,IAAI,YAAY,GAAG,QAAQ,GAAG,aAAa,EAAE;YAC3C,OAAO,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAA;SAC/C;KACF;IACD,OAAO,YAAY,IAAI,QAAQ,GAAG,aAAa,CAAA;AACjD,CAAC,CAAA;AAjBY,QAAA,oBAAoB,wBAiBhC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.movementAnimationCss = void 0;
|
|
8
|
-
var react_1 = require("@emotion/react");
|
|
9
|
-
var movementAnimationCss = function (keyframes, duration) { return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation: ", " ", "s linear infinite;\n\n > * {\n animation: ", " ", "s ease-in-out forwards;\n }\n"], ["\n animation: ", " ", "s linear infinite;\n\n > * {\n animation: ", " ", "s ease-in-out forwards;\n }\n"])), upAndDown, duration, keyframes, duration); };
|
|
10
|
-
exports.movementAnimationCss = movementAnimationCss;
|
|
11
|
-
var upAndDown = (0, react_1.keyframes)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from, to {\n transform: none;\n }\n 50% {\n transform: translateZ(10em);\n }\n"], ["\n from, to {\n transform: none;\n }\n 50% {\n transform: translateZ(10em);\n }\n"])));
|
|
12
|
-
var templateObject_1, templateObject_2;
|
|
13
|
-
//# sourceMappingURL=itemMovementCss.util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"itemMovementCss.util.js","sourceRoot":"","sources":["../../../../src/components/material/animations/itemMovementCss.util.ts"],"names":[],"mappings":";;;;;;;AAAA,wCAA0D;AAEnD,IAAM,oBAAoB,GAAG,UAAC,SAAoB,EAAE,QAAgB,IAAK,WAAA,WAAG,mLAAA,iBACpE,EAAS,GAAI,EAAQ,gDAGnB,EAAS,GAAI,EAAQ,gCAErC,KALc,SAAS,EAAI,QAAQ,EAGnB,SAAS,EAAI,QAAQ,GAJ0C,CAM/E,CAAA;AANY,QAAA,oBAAoB,wBAMhC;AAED,IAAM,SAAS,OAAG,iBAAS,iKAAA,6FAO1B,IAAA,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Location } from '@gamepark/rules-api';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
import { HexGridDropAreaDescription } from './HexGridDropAreaDescription';
|
|
4
|
-
export type HexGridDropAreaProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
5
|
-
location: Location<P, L>;
|
|
6
|
-
description: HexGridDropAreaDescription<P, M, L>;
|
|
7
|
-
} & HTMLAttributes<HTMLDivElement>;
|
|
8
|
-
export declare const HexGridDropArea: import("react").ForwardRefExoticComponent<{
|
|
9
|
-
location: Location<number, number, any, any>;
|
|
10
|
-
description: HexGridDropAreaDescription<number, number, number, any>;
|
|
11
|
-
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
-
var t = {};
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
-
t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.HexGridDropArea = void 0;
|
|
30
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
31
|
-
/** @jsxImportSource @emotion/react */
|
|
32
|
-
var core_1 = require("@dnd-kit/core");
|
|
33
|
-
var react_1 = require("@emotion/react");
|
|
34
|
-
var react_2 = require("react");
|
|
35
|
-
var react_merge_refs_1 = require("react-merge-refs");
|
|
36
|
-
var hooks_1 = require("../../../hooks");
|
|
37
|
-
var DraggableMaterial_1 = require("../DraggableMaterial");
|
|
38
|
-
var LocationComponent_1 = require("./LocationComponent");
|
|
39
|
-
exports.HexGridDropArea = (0, react_2.forwardRef)(function (_a, ref) {
|
|
40
|
-
var location = _a.location, description = _a.description, props = __rest(_a, ["location", "description"]);
|
|
41
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
42
|
-
var material = context.material;
|
|
43
|
-
var legalMoves = (0, hooks_1.useLegalMoves)();
|
|
44
|
-
var dropMoves = (0, react_2.useMemo)(function () { return legalMoves.filter(function (move) { return description === null || description === void 0 ? void 0 : description.isMoveToLocation(move, location, context); }); }, [legalMoves, context]);
|
|
45
|
-
var _b = (0, core_1.useDroppable)({
|
|
46
|
-
id: JSON.stringify(location),
|
|
47
|
-
disabled: !dropMoves.length,
|
|
48
|
-
data: location
|
|
49
|
-
}), isOver = _b.isOver, active = _b.active, setNodeRef = _b.setNodeRef;
|
|
50
|
-
var draggedItem = (0, DraggableMaterial_1.dataIsDisplayedItem)(active === null || active === void 0 ? void 0 : active.data.current) ? active === null || active === void 0 ? void 0 : active.data.current : undefined;
|
|
51
|
-
var draggedItemContext = (0, react_2.useMemo)(function () { return draggedItem ? __assign(__assign({}, context), draggedItem) : undefined; }, [draggedItem, context]);
|
|
52
|
-
var canDrop = (0, react_2.useMemo)(function () { return !!draggedItemContext && !!description && !!material && dropMoves.some(function (move) { var _a; return ((_a = material[draggedItemContext.type]) === null || _a === void 0 ? void 0 : _a.canDrag(move, draggedItemContext)) && description.canDrop(move, location, draggedItemContext); }); }, [draggedItemContext, dropMoves]);
|
|
53
|
-
//const [draggedItemTransform, setDraggedItemTransform] = useState<XYCoordinates>()
|
|
54
|
-
/*useDndMonitor({
|
|
55
|
-
onDragMove(event) {
|
|
56
|
-
const { over, active } = event
|
|
57
|
-
|
|
58
|
-
if (over && active.rect.current.translated) {
|
|
59
|
-
const x = active.rect.current.translated.left - over.rect.left
|
|
60
|
-
const y = active.rect.current.translated.top - over.rect.top
|
|
61
|
-
|
|
62
|
-
console.log(x, y)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
})*/
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(LocationComponent_1.LocationComponent, __assign({ ref: (0, react_merge_refs_1.mergeRefs)([ref, setNodeRef]), location: location, description: description, canDrop: canDrop, highlight: canDrop && !isOver, css: canDrop && isOver && dropHighlight }, props)));
|
|
67
|
-
});
|
|
68
|
-
exports.HexGridDropArea.displayName = 'HexGridDropArea';
|
|
69
|
-
var dropHighlight = function (theme) {
|
|
70
|
-
var _a;
|
|
71
|
-
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), (_a = theme.dropArea) === null || _a === void 0 ? void 0 : _a.backgroundColor);
|
|
72
|
-
};
|
|
73
|
-
var templateObject_1;
|
|
74
|
-
//# sourceMappingURL=HexGridDropArea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HexGridDropArea.js","sourceRoot":"","sources":["../../../../src/components/material/locations/HexGridDropArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,sCAA4C;AAC5C,wCAA2C;AAE3C,+BAA2D;AAC3D,qDAA4C;AAC5C,wCAAkE;AAClE,0DAA0D;AAE1D,yDAAuD;AAO1C,QAAA,eAAe,GAAG,IAAA,kBAAU,EAAuC,UAC9E,EAAmC,EAAE,GAAG;IAAtC,IAAA,QAAQ,cAAA,EAAE,WAAW,iBAAA,EAAK,KAAK,cAAjC,2BAAmC,CAAF;IAEjC,IAAM,OAAO,GAAG,IAAA,0BAAkB,GAAE,CAAA;IACpC,IAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IACjC,IAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAA;IAClC,IAAM,SAAS,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,UAAU,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAtD,CAAsD,CAAC,EAAjF,CAAiF,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;IAEnI,IAAA,KAAiC,IAAA,mBAAY,EAAC;QAClD,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC5B,QAAQ,EAAE,CAAC,SAAS,CAAC,MAAM;QAC3B,IAAI,EAAE,QAAQ;KACf,CAAC,EAJM,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,UAAU,gBAIhC,CAAA;IAEF,IAAM,WAAW,GAAG,IAAA,uCAAmB,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;IAChG,IAAM,kBAAkB,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,WAAW,CAAC,CAAC,uBAAM,OAAO,GAAK,WAAW,EAAG,CAAC,CAAC,SAAS,EAAxD,CAAwD,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;IAC1H,IAAM,OAAO,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,CAAC,CAAC,kBAAkB,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,UAAA,IAAI,YACpG,OAAA,CAAA,MAAA,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,0CAAE,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,KAAI,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAA,EAAA,CAChI,EAF2B,CAE3B,EACC,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAA;IAEpC,mFAAmF;IAEnF;;;;;;;;;;;QAWI;IAEJ,OAAO,CACL,uBAAC,qCAAiB,aAAC,GAAG,EAAE,IAAA,4BAAS,EAAC,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EACjG,SAAS,EAAE,OAAO,IAAI,CAAC,MAAM,EAC7B,GAAG,EAAE,OAAO,IAAI,MAAM,IAAI,aAAa,IAAM,KAAK,EAAG,CACzE,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAE/C,IAAM,aAAa,GAAG,UAAC,KAAY;;IAAK,WAAA,WAAG,mGAAA,wBACrB,EAA+B,KACpD,KADqB,MAAA,KAAK,CAAC,QAAQ,0CAAE,eAAe,EACpD;CAAA,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMoveOnItem = void 0;
|
|
4
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
5
|
-
function isMoveOnItem(move, itemIndex, itemInnerLocationTypes) {
|
|
6
|
-
return move.kind === rules_api_1.MoveKind.ItemMove
|
|
7
|
-
&& move.type === rules_api_1.ItemMoveType.Move
|
|
8
|
-
&& itemInnerLocationTypes.includes(move.location.type)
|
|
9
|
-
&& move.location.parent === itemIndex;
|
|
10
|
-
}
|
|
11
|
-
exports.isMoveOnItem = isMoveOnItem;
|
|
12
|
-
//# sourceMappingURL=IsMoveOnItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsMoveOnItem.js","sourceRoot":"","sources":["../../../../src/components/material/utils/IsMoveOnItem.ts"],"names":[],"mappings":";;;AAAA,iDAA0E;AAE1E,SAAgB,YAAY,CAC1B,IAA2B,EAAE,SAA6B,EAAE,sBAA2B;IAEvF,OAAO,IAAI,CAAC,IAAI,KAAK,oBAAQ,CAAC,QAAQ;WACjC,IAAI,CAAC,IAAI,KAAK,wBAAY,CAAC,IAAI;WAC/B,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;WACnD,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAA;AACzC,CAAC;AAPD,oCAOC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
import { MaterialContext } from '../../../locators';
|
|
3
|
-
export declare const getItemFromContext: <P extends number = number, M extends number = number, L extends number = number>(context: MaterialContext<P, M, L>, type?: M, index?: number) => MaterialItem<P, L, any>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getItemFromContext = void 0;
|
|
4
|
-
var getItemFromContext = function (context, type, index) {
|
|
5
|
-
if (type === void 0) { type = context.type; }
|
|
6
|
-
if (index === void 0) { index = context.index; }
|
|
7
|
-
return context.rules.material(type).getItem(index);
|
|
8
|
-
};
|
|
9
|
-
exports.getItemFromContext = getItemFromContext;
|
|
10
|
-
//# sourceMappingURL=getItemFromContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getItemFromContext.js","sourceRoot":"","sources":["../../../../src/components/material/utils/getItemFromContext.ts"],"names":[],"mappings":";;;AAGO,IAAM,kBAAkB,GAAG,UAChC,OAAiC,EAAE,IAA6C,EAAE,KAA+C;IAA9F,qBAAA,EAAA,OAAQ,OAAgC,CAAC,IAAI;IAAE,sBAAA,EAAA,QAAS,OAAgC,CAAC,KAAK;IAEjI,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAE,CAAA;AACrD,CAAC,CAAA;AAJY,QAAA,kBAAkB,sBAI9B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ContrastThemeButton = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
/** @jsxImportSource @emotion/react */
|
|
17
|
-
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
18
|
-
var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
|
|
19
|
-
var react_i18next_1 = require("react-i18next");
|
|
20
|
-
var menuCss_1 = require("../menuCss");
|
|
21
|
-
var ContrastThemeButton = function (_a) {
|
|
22
|
-
var theme = _a.theme;
|
|
23
|
-
var t = (0, react_i18next_1.useTranslation)().t;
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)("button", __assign({ css: menuCss_1.menuButtonCss, onClick: theme.toggleContrast }, { children: [(0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: theme.light ? free_solid_svg_icons_1.faMoon : free_solid_svg_icons_1.faSun }), theme.light ? t('Dark mode') : t('Light mode')] })));
|
|
25
|
-
};
|
|
26
|
-
exports.ContrastThemeButton = ContrastThemeButton;
|
|
27
|
-
//# sourceMappingURL=ContrastThemeButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContrastThemeButton.js","sourceRoot":"","sources":["../../../../src/components/menus/ContrastThemeButton/ContrastThemeButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,0EAAiE;AACjE,oEAAgE;AAChE,+CAA8C;AAE9C,sCAA0C;AAEnC,IAAM,mBAAmB,GAAG,UAAC,EAAmC;QAAjC,KAAK,WAAA;IACjC,IAAA,CAAC,GAAK,IAAA,8BAAc,GAAE,EAArB,CAAqB;IAC9B,OAAO,CACL,6CAAQ,GAAG,EAAE,uBAAa,EAAE,OAAO,EAAE,KAAK,CAAC,cAAc,iBACvD,uBAAC,mCAAe,IAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,6BAAM,CAAC,CAAC,CAAC,4BAAK,GAAG,EACrD,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KACxC,CACV,CAAA;AACH,CAAC,CAAA;AARY,QAAA,mBAAmB,uBAQ/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ContrastThemeButton';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ContrastThemeButton"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/menus/ContrastThemeButton/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableElement.js","sourceRoot":"","sources":["../../../src/components/tutorial/FocusableElement.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useCloseHelpDialog: () => () => void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCloseHelpDialog = void 0;
|
|
4
|
-
var rules_api_1 = require("../../../rules-api");
|
|
5
|
-
var usePlay_1 = require("./usePlay");
|
|
6
|
-
var displayHelp = rules_api_1.MaterialMoveBuilder.displayHelp;
|
|
7
|
-
var useCloseHelpDialog = function () {
|
|
8
|
-
var play = (0, usePlay_1.usePlay)();
|
|
9
|
-
return function () {
|
|
10
|
-
play(displayHelp());
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.useCloseHelpDialog = useCloseHelpDialog;
|
|
14
|
-
//# sourceMappingURL=useCloseHelpDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCloseHelpDialog.js","sourceRoot":"","sources":["../../src/hooks/useCloseHelpDialog.ts"],"names":[],"mappings":";;;AAAA,gDAAwD;AACxD,qCAAmC;AACnC,IAAO,WAAW,GAAG,+BAAmB,CAAC,WAAW,CAAA;AAE7C,IAAM,kBAAkB,GAAG;IAChC,IAAM,IAAI,GAAG,IAAA,iBAAO,GAAE,CAAA;IACtB,OAAO;QACL,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACrB,CAAC,CAAA;AACH,CAAC,CAAA;AALY,QAAA,kBAAkB,sBAK9B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@emotion/react';
|
|
2
|
-
export interface ContrastTheme {
|
|
3
|
-
light: boolean;
|
|
4
|
-
toggleContrast: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const useContrastTheme: (defaultLight?: boolean) => ContrastTheme;
|
|
7
|
-
export declare const isContrastTheme: (theme: Theme) => theme is ContrastTheme;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isContrastTheme = exports.useContrastTheme = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var THEME_STORAGE = 'light-theme';
|
|
6
|
-
var useContrastTheme = function (defaultLight) {
|
|
7
|
-
if (defaultLight === void 0) { defaultLight = false; }
|
|
8
|
-
var _a = (0, react_1.useState)(function () { var _a; return (_a = getStoredTheme()) !== null && _a !== void 0 ? _a : defaultLight; }), light = _a[0], setLight = _a[1];
|
|
9
|
-
var toggleContrast = (0, react_1.useCallback)(function () { return setLight(function (light) {
|
|
10
|
-
localStorage.setItem(THEME_STORAGE, JSON.stringify(!light));
|
|
11
|
-
return !light;
|
|
12
|
-
}); }, []);
|
|
13
|
-
return { light: light, toggleContrast: toggleContrast };
|
|
14
|
-
};
|
|
15
|
-
exports.useContrastTheme = useContrastTheme;
|
|
16
|
-
var getStoredTheme = function () {
|
|
17
|
-
var item = localStorage.getItem(THEME_STORAGE);
|
|
18
|
-
if (!item)
|
|
19
|
-
return;
|
|
20
|
-
var theme = JSON.parse(item);
|
|
21
|
-
if (typeof theme !== 'boolean')
|
|
22
|
-
return;
|
|
23
|
-
return theme;
|
|
24
|
-
};
|
|
25
|
-
var isContrastTheme = function (theme) { return typeof theme.toggleContrast === 'function'; };
|
|
26
|
-
exports.isContrastTheme = isContrastTheme;
|
|
27
|
-
//# sourceMappingURL=useContrastTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useContrastTheme.js","sourceRoot":"","sources":["../../src/hooks/useContrastTheme.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAQ7C,IAAM,aAAa,GAAG,aAAa,CAAA;AAE5B,IAAM,gBAAgB,GAAG,UAAC,YAAoB;IAApB,6BAAA,EAAA,oBAAoB;IAC7C,IAAA,KAAoB,IAAA,gBAAQ,EAAC,sBAAM,OAAA,MAAA,cAAc,EAAE,mCAAI,YAAY,CAAA,EAAA,CAAC,EAAnE,KAAK,QAAA,EAAE,QAAQ,QAAoD,CAAA;IAC1E,IAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,cAAM,OAAA,QAAQ,CAAC,UAAA,KAAK;QACrD,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;QAC3D,OAAO,CAAC,KAAK,CAAA;IACf,CAAC,CAAC,EAHuC,CAGvC,EAAE,EAAE,CAAC,CAAA;IACP,OAAO,EAAE,KAAK,OAAA,EAAE,cAAc,gBAAA,EAAE,CAAA;AAClC,CAAC,CAAA;AAPY,QAAA,gBAAgB,oBAO5B;AAED,IAAM,cAAc,GAAG;IACrB,IAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IAChD,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAM;IACtC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAEM,IAAM,eAAe,GAAG,UAAC,KAAY,IAA6B,OAAA,OAAQ,KAAuB,CAAC,cAAc,KAAK,UAAU,EAA7D,CAA6D,CAAA;AAAzH,QAAA,eAAe,mBAA0G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGameHistory<Game>(_actionId: string, _consequenceIndex?: number): Game;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGameHistory = void 0;
|
|
4
|
-
var react_redux_1 = require("react-redux");
|
|
5
|
-
function useGameHistory(_actionId, _consequenceIndex) {
|
|
6
|
-
var actions = (0, react_redux_1.useSelector)(function (state) { return state.actions; });
|
|
7
|
-
var setup = (0, react_redux_1.useSelector)(function (state) { return state.setup; });
|
|
8
|
-
if (!actions || !setup)
|
|
9
|
-
throw new Error('useGameHistory hook cannot be called before the game setup and actions are loaded');
|
|
10
|
-
return setup;
|
|
11
|
-
}
|
|
12
|
-
exports.useGameHistory = useGameHistory;
|
|
13
|
-
//# sourceMappingURL=useGameHistory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGameHistory.js","sourceRoot":"","sources":["../../src/hooks/useGameHistory.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AAEzC,SAAgB,cAAc,CAAO,SAAiB,EAAE,iBAA0B;IAChF,IAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,UAAC,KAA0B,IAAK,OAAA,KAAK,CAAC,OAAO,EAAb,CAAa,CAAC,CAAA;IAC1E,IAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,UAAC,KAA0B,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC,CAAA;IACtE,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAA;IAC5H,OAAO,KAAK,CAAA;AACd,CAAC;AALD,wCAKC"}
|
package/dist/hooks/useHistory.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useHistory = void 0;
|
|
7
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
9
|
-
var keyBy_1 = __importDefault(require("lodash/keyBy"));
|
|
10
|
-
var react_1 = require("react");
|
|
11
|
-
var react_redux_1 = require("react-redux");
|
|
12
|
-
var components_1 = require("../components");
|
|
13
|
-
var useActions_1 = require("./useActions");
|
|
14
|
-
var usePlayerId_1 = require("./usePlayerId");
|
|
15
|
-
var useHistory = function () {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
var context = (0, react_1.useContext)(components_1.gameContext);
|
|
18
|
-
var player = (0, usePlayerId_1.usePlayerId)();
|
|
19
|
-
var setup = (_a = (0, react_redux_1.useSelector)(function (state) { return state.setup; })) !== null && _a !== void 0 ? _a : {};
|
|
20
|
-
var gameOver = (0, react_redux_1.useSelector)(function (state) { return state.gameOver; });
|
|
21
|
-
var actions = (_b = (0, useActions_1.useActions)()) !== null && _b !== void 0 ? _b : [];
|
|
22
|
-
var filteredActions = (0, react_1.useMemo)(function () { return (actions !== null && actions !== void 0 ? actions : []).filter(function (a) { return !a.local && !a.pending && a.id !== undefined; }); }, [actions]);
|
|
23
|
-
var historyRef = (0, react_1.useRef)(new Map());
|
|
24
|
-
var _c = (0, react_1.useState)(0), historySize = _c[0], setHistorySize = _c[1];
|
|
25
|
-
var rules = (0, react_1.useRef)();
|
|
26
|
-
(0, react_1.useEffect)(function () {
|
|
27
|
-
if (!rules.current && setup) {
|
|
28
|
-
rules.current = new context.Rules(JSON.parse(JSON.stringify(setup)), gameOver ? undefined : { player: player });
|
|
29
|
-
}
|
|
30
|
-
}, [setup, gameOver]);
|
|
31
|
-
var MaterialHistory = context.MaterialHistory;
|
|
32
|
-
var getMoveEntry = (0, react_1.useCallback)(function (action, move, consequenceIndex, rules) {
|
|
33
|
-
var historyContext = {
|
|
34
|
-
consequenceIndex: consequenceIndex,
|
|
35
|
-
action: action,
|
|
36
|
-
game: JSON.parse(JSON.stringify(rules.game))
|
|
37
|
-
};
|
|
38
|
-
return (0, jsx_runtime_1.jsx)(MaterialHistory, { move: move, context: historyContext });
|
|
39
|
-
}, [context]);
|
|
40
|
-
var addActionEntries = (0, react_1.useCallback)(function (histories, action) {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
histories.set(action.id, []);
|
|
43
|
-
var actionEntry = getMoveEntry(action, action.move, undefined, rules.current);
|
|
44
|
-
(_a = rules.current) === null || _a === void 0 ? void 0 : _a.play(action.move);
|
|
45
|
-
histories.get(action.id).push(actionEntry);
|
|
46
|
-
for (var index = 0; index < action.consequences.length; index++) {
|
|
47
|
-
var consequence = action.consequences[index];
|
|
48
|
-
var consequenceEntry = getMoveEntry(action, consequence, index, rules.current);
|
|
49
|
-
(_b = rules.current) === null || _b === void 0 ? void 0 : _b.play(consequence);
|
|
50
|
-
histories.get(action.id).push(consequenceEntry);
|
|
51
|
-
}
|
|
52
|
-
}, []);
|
|
53
|
-
(0, react_1.useEffect)(function () {
|
|
54
|
-
var histories = historyRef.current;
|
|
55
|
-
var actualSize = histories.size;
|
|
56
|
-
if (actualSize < filteredActions.length) {
|
|
57
|
-
for (var _i = 0, filteredActions_1 = filteredActions; _i < filteredActions_1.length; _i++) {
|
|
58
|
-
var action = filteredActions_1[_i];
|
|
59
|
-
if (histories.has(action.id))
|
|
60
|
-
continue;
|
|
61
|
-
addActionEntries(histories, action);
|
|
62
|
-
}
|
|
63
|
-
setHistorySize(histories.size);
|
|
64
|
-
historyRef.current = histories;
|
|
65
|
-
}
|
|
66
|
-
else if (actualSize > filteredActions.length) {
|
|
67
|
-
var actionsById = (0, keyBy_1.default)(filteredActions, function (a) { return a.id; });
|
|
68
|
-
for (var _a = 0, _b = Array.from(histories.keys()); _a < _b.length; _a++) {
|
|
69
|
-
var key = _b[_a];
|
|
70
|
-
if (!(key in actionsById))
|
|
71
|
-
histories.delete(key);
|
|
72
|
-
}
|
|
73
|
-
rules.current = new context.Rules(JSON.parse(JSON.stringify(setup)));
|
|
74
|
-
(0, rules_api_1.replayActions)(rules.current, filteredActions);
|
|
75
|
-
setHistorySize(histories.size);
|
|
76
|
-
historyRef.current = histories;
|
|
77
|
-
}
|
|
78
|
-
}, [filteredActions.length]);
|
|
79
|
-
return {
|
|
80
|
-
histories: historyRef.current,
|
|
81
|
-
size: historySize
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
exports.useHistory = useHistory;
|
|
85
|
-
//# sourceMappingURL=useHistory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHistory.js","sourceRoot":"","sources":["../../src/hooks/useHistory.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMaterialAnimations = void 0;
|
|
4
|
-
var components_1 = require("../components");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
function useMaterialAnimations(type) {
|
|
7
|
-
var animations = (0, react_1.useContext)(components_1.gameContext).animations;
|
|
8
|
-
if (animations && isMaterialGameAnimations(animations)) {
|
|
9
|
-
return animations.getMaterialAnimations(type);
|
|
10
|
-
}
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
exports.useMaterialAnimations = useMaterialAnimations;
|
|
14
|
-
function isMaterialGameAnimations(animations) {
|
|
15
|
-
return typeof animations.getMaterialAnimations === 'function';
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=useMaterialAnimations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMaterialAnimations.js","sourceRoot":"","sources":["../../src/hooks/useMaterialAnimations.ts"],"names":[],"mappings":";;;AAAA,4CAAuF;AACvF,+BAAkC;AAGlC,SAAgB,qBAAqB,CACnC,IAAO;IAEP,IAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,wBAAW,CAAC,CAAC,UAAU,CAAA;IACrD,IAAI,UAAU,IAAI,wBAAwB,CAAU,UAAU,CAAC,EAAE;QAC/D,OAAO,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;KAC9C;IACD,OAAM;AACR,CAAC;AARD,sDAQC;AAED,SAAS,wBAAwB,CAC/B,UAAsB;IAEtB,OAAO,OAAQ,UAAqC,CAAC,qBAAqB,KAAK,UAAU,CAAA;AAC3F,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMaterials = void 0;
|
|
4
|
-
var components_1 = require("../components");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
function useMaterials() {
|
|
7
|
-
return (0, react_1.useContext)(components_1.gameContext).material;
|
|
8
|
-
}
|
|
9
|
-
exports.useMaterials = useMaterials;
|
|
10
|
-
//# sourceMappingURL=useMaterials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMaterials.js","sourceRoot":"","sources":["../../src/hooks/useMaterials.ts"],"names":[],"mappings":";;;AAAA,4CAAgE;AAChE,+BAAkC;AAElC,SAAgB,YAAY;IAC1B,OAAO,IAAA,kBAAU,EAAC,wBAAW,CAAC,CAAC,QAA+D,CAAA;AAChG,CAAC;AAFD,oCAEC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useRulesStep = void 0;
|
|
4
|
-
var useRules_1 = require("./useRules");
|
|
5
|
-
function useRulesStep() {
|
|
6
|
-
var rules = (0, useRules_1.useRules)();
|
|
7
|
-
return rules === null || rules === void 0 ? void 0 : rules.rulesStep;
|
|
8
|
-
}
|
|
9
|
-
exports.useRulesStep = useRulesStep;
|
|
10
|
-
//# sourceMappingURL=useRulesStep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRulesStep.js","sourceRoot":"","sources":["../../src/hooks/useRulesStep.ts"],"names":[],"mappings":";;;AACA,uCAAqC;AAErC,SAAgB,YAAY;IAC1B,IAAM,KAAK,GAAG,IAAA,mBAAQ,GAAiB,CAAA;IACvC,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAA0B,CAAA;AAC1C,CAAC;AAHD,oCAGC"}
|
package/dist/hooks/useScale.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useScale(): number;
|