@gamepark/react-game 7.0.0-beta.0 → 7.0.0-beta.4
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 -61
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/ChatSpeechBubble.js +25 -68
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -1
- package/dist/components/Avatar/SpeechBubble.d.ts +0 -1
- package/dist/components/Avatar/SpeechBubble.js +86 -50
- 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 -25
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -1
- package/dist/components/GamePoints/GamePoints.js +20 -64
- 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 -137
- 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.d.ts +0 -1
- package/dist/components/Header/Header.js +34 -44
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderText.d.ts +0 -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 -91
- 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 -15
- 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.d.ts +0 -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 -18
- package/dist/components/JournalTabs/Chat/ChatMessage.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js +19 -36
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +58 -61
- 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 -49
- 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 -23
- 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 -21
- 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 -55
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/HistoryEntry.js +37 -44
- package/dist/components/JournalTabs/History/HistoryEntry.js.map +1 -1
- package/dist/components/JournalTabs/History/StartGameHistory.js +12 -18
- 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.d.ts +0 -1
- package/dist/components/JournalTabs/JournalTabs.js +122 -69
- 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 -42
- 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 -90
- 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 -84
- package/dist/components/Log/InternalLiveLogContainer.js.map +1 -1
- package/dist/components/Log/LiveLogButton.js +14 -20
- package/dist/components/Log/LiveLogButton.js.map +1 -1
- package/dist/components/Log/LiveLogContainer.js +6 -22
- package/dist/components/Log/LiveLogContainer.js.map +1 -1
- package/dist/components/Log/LogDescription.js +1 -2
- package/dist/components/Log/LogItem.d.ts +0 -1
- package/dist/components/Log/LogItem.js +42 -43
- 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.d.ts +0 -1
- package/dist/components/Picture/Picture.js +6 -33
- 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 -2
- package/dist/components/PlayerPanel/Counters.js +82 -40
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.js +83 -54
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +0 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +145 -81
- 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 -2
- package/dist/components/PlayerTimer/PlayerTimer.js +32 -62
- 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 -106
- 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.d.ts +0 -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.d.ts +0 -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.d.ts +0 -1
- package/dist/components/dialogs/Dialog.js +57 -68
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.js +39 -74
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +55 -53
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.js +17 -28
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +130 -100
- 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.d.ts +2 -2
- 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 -32
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +22 -37
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +121 -118
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +23 -43
- 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 -28
- 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.d.ts +0 -1
- package/dist/components/material/Dices/CubicDiceDescription.js +58 -103
- 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 -199
- 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.d.ts +0 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.js +88 -134
- 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 -67
- package/dist/components/material/GameTable/DropPreview.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.d.ts +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 -31
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.d.ts +0 -1
- package/dist/components/material/GameTable/GameTable.js +78 -126
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +58 -68
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.d.ts +0 -1
- package/dist/components/material/GameTable/ItemDisplay.js +88 -154
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.d.ts +0 -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.d.ts +0 -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 -70
- package/dist/components/material/ItemMenuButton.js.map +1 -1
- package/dist/components/material/ItemMenuWrapper.js +16 -67
- 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 -45
- 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 -3
- package/dist/components/material/MaterialDescription.js +125 -165
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/MobileMaterialDescription.d.ts +0 -1
- package/dist/components/material/MobileMaterialDescription.js +21 -84
- package/dist/components/material/MobileMaterialDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelContent.d.ts +0 -1
- package/dist/components/material/Wheel/WheelContent.js +26 -30
- package/dist/components/material/Wheel/WheelContent.js.map +1 -1
- package/dist/components/material/Wheel/WheelDescription.d.ts +0 -1
- package/dist/components/material/Wheel/WheelDescription.js +45 -105
- package/dist/components/material/Wheel/WheelDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelItem.d.ts +0 -1
- package/dist/components/material/Wheel/WheelItem.js +43 -43
- 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 -92
- 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 -89
- 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 -80
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/LocationsMask.d.ts +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 -91
- 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 -33
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +47 -67
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +25 -51
- 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 -16
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +36 -61
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +28 -43
- 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 -61
- 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.d.ts +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 -94
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.js +21 -61
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.d.ts +0 -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 -43
- 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 -18
- 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.d.ts +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.d.ts +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.d.ts +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 -24
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.js +46 -36
- 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 -16
- 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 -71
- 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 -32
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +24 -39
- 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 -96
- 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 -28
- 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.d.ts +0 -1
- package/dist/locators/Locator.js +149 -191
- 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
package/dist/hooks/useUndo.js
CHANGED
|
@@ -1,94 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.useUndo = void 0;
|
|
15
|
-
var react_client_1 = require("@gamepark/react-client");
|
|
16
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
17
|
-
var compat_1 = require("es-toolkit/compat");
|
|
18
|
-
var react_1 = require("react");
|
|
19
|
-
var react_redux_1 = require("react-redux");
|
|
20
|
-
var components_1 = require("../components");
|
|
21
|
-
var useUndo = function () {
|
|
22
|
-
var _a;
|
|
23
|
-
var actions = (0, react_redux_1.useSelector)(function (state) { return state.actions; });
|
|
24
|
-
var game = (0, react_redux_1.useSelector)(function (state) { return state.state; });
|
|
25
|
-
var playerId = (0, react_redux_1.useSelector)(function (state) { return state.playerId; });
|
|
26
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
27
|
-
var Rules = (_a = (0, react_1.useContext)(components_1.gameContext)) === null || _a === void 0 ? void 0 : _a.Rules;
|
|
1
|
+
import { isActionToAnimate, undoMove, useGameDispatch, useGameSelector } from '@gamepark/react-client';
|
|
2
|
+
import { hasUndo } from '@gamepark/rules-api';
|
|
3
|
+
import { findLastIndex } from 'es-toolkit/compat';
|
|
4
|
+
import { useCallback, useContext } from 'react';
|
|
5
|
+
import { gameContext } from '../components';
|
|
6
|
+
export const useUndo = () => {
|
|
7
|
+
const actions = useGameSelector((state) => state.actions);
|
|
8
|
+
const game = useGameSelector((state) => state.state);
|
|
9
|
+
const playerId = useGameSelector((state) => state.playerId);
|
|
10
|
+
const dispatch = useGameDispatch();
|
|
11
|
+
const Rules = useContext(gameContext)?.Rules;
|
|
28
12
|
if (!Rules)
|
|
29
13
|
throw new Error('Cannot useUndo outside a GameProvider');
|
|
30
|
-
|
|
31
|
-
var e_1, _a;
|
|
14
|
+
const undo = useCallback((arg, options) => {
|
|
32
15
|
if (typeof arg === 'string') {
|
|
33
|
-
dispatch((
|
|
16
|
+
dispatch(undoMove({ actionId: arg, delayed: options?.delayed }));
|
|
34
17
|
}
|
|
35
18
|
else {
|
|
36
19
|
if (!actions)
|
|
37
20
|
return console.error('Cannot undo before actions history is loaded');
|
|
38
|
-
|
|
39
|
-
return action.playerId === playerId && !action.cancelled && (typeof arg !== 'function' || arg(action.move));
|
|
40
|
-
}, typeof arg === 'number' ? arg : 1);
|
|
21
|
+
const actionToUndo = findLastN(actions, action => action.playerId === playerId && !action.cancelled && (typeof arg !== 'function' || arg(action.move)), typeof arg === 'number' ? arg : 1);
|
|
41
22
|
if (!actionToUndo.length)
|
|
42
23
|
return console.error('This action does not exist, it cannot be undone');
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (action.id) {
|
|
48
|
-
dispatch((0, react_client_1.moveUndone)(action.id, delayed));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
53
|
-
finally {
|
|
54
|
-
try {
|
|
55
|
-
if (actionToUndo_1_1 && !actionToUndo_1_1.done && (_a = actionToUndo_1.return)) _a.call(actionToUndo_1);
|
|
24
|
+
const delayed = typeof arg === 'object' ? arg?.delayed : options?.delayed;
|
|
25
|
+
for (const action of actionToUndo) {
|
|
26
|
+
if (action.id) {
|
|
27
|
+
dispatch(undoMove({ actionId: action.id, delayed }));
|
|
56
28
|
}
|
|
57
|
-
finally { if (e_1) throw e_1.error; }
|
|
58
29
|
}
|
|
59
30
|
}
|
|
60
31
|
}, [actions, playerId, dispatch]);
|
|
61
|
-
|
|
32
|
+
const canUndo = useCallback((movePredicate) => {
|
|
62
33
|
if (!game || !actions)
|
|
63
34
|
return false;
|
|
64
|
-
if (actions.some(
|
|
65
|
-
return action.playerId === playerId && ((0, react_client_1.isActionToAnimate)(action) || action.animation !== undefined);
|
|
66
|
-
}))
|
|
35
|
+
if (actions.some(action => action.playerId === playerId && (isActionToAnimate(action) || action.animation !== undefined)))
|
|
67
36
|
return false;
|
|
68
|
-
|
|
69
|
-
return action.playerId === playerId && !action.cancelled && (!movePredicate || movePredicate(action.move));
|
|
70
|
-
});
|
|
37
|
+
const index = findLastIndex(actions, action => action.playerId === playerId && !action.cancelled && (!movePredicate || movePredicate(action.move)));
|
|
71
38
|
if (index === -1)
|
|
72
39
|
return false;
|
|
73
|
-
|
|
40
|
+
const action = actions[index];
|
|
74
41
|
if (action.pending)
|
|
75
42
|
return false;
|
|
76
43
|
if (action.local)
|
|
77
44
|
return true;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!
|
|
45
|
+
const consecutiveActions = actions.slice(index + 1).filter(action => !action.cancelled);
|
|
46
|
+
const rules = new Rules(game, { player: playerId });
|
|
47
|
+
if (!hasUndo(rules))
|
|
81
48
|
return false;
|
|
82
49
|
return rules.canUndo(action, consecutiveActions);
|
|
83
50
|
}, [game, actions, playerId, Rules]);
|
|
84
51
|
return [undo, canUndo];
|
|
85
52
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
for (var i = array.length - 1; i >= 0; i--) {
|
|
91
|
-
var item = array[i];
|
|
53
|
+
function findLastN(array, predicate, n = 1) {
|
|
54
|
+
const result = [];
|
|
55
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
56
|
+
const item = array[i];
|
|
92
57
|
if (predicate(item)) {
|
|
93
58
|
result.push(item);
|
|
94
59
|
if (result.length >= n)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUndo.js","sourceRoot":"","sources":["../../src/hooks/useUndo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUndo.js","sourceRoot":"","sources":["../../src/hooks/useUndo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAO3C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAoD,EAAE;IAC3E,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzD,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC3D,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAA;IAClC,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,EAAE,KAAK,CAAA;IAC5C,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAEpE,MAAM,IAAI,GAAuB,WAAW,CAAC,CAAC,GAAyD,EAAE,OAAqB,EAAE,EAAE;QAChI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,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,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACjB,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;gBAAE,OAAO,MAAM,CAAA;QACvC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/hooks/useWebP.js
CHANGED
|
@@ -1,80 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
-
if (!m) return o;
|
|
41
|
-
var i = m.call(o), r, ar = [], e;
|
|
42
|
-
try {
|
|
43
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
-
}
|
|
45
|
-
catch (error) { e = { error: error }; }
|
|
46
|
-
finally {
|
|
47
|
-
try {
|
|
48
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
-
}
|
|
50
|
-
finally { if (e) throw e.error; }
|
|
51
|
-
}
|
|
52
|
-
return ar;
|
|
53
|
-
};
|
|
54
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
55
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
|
-
};
|
|
57
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.useWebP = void 0;
|
|
59
|
-
var react_1 = require("react");
|
|
60
|
-
var supports_webp_1 = __importDefault(require("supports-webp"));
|
|
61
|
-
var useWebP = function () {
|
|
62
|
-
var _a = __read((0, react_1.useState)(), 2), webP = _a[0], setWebP = _a[1];
|
|
63
|
-
(0, react_1.useEffect)(function () {
|
|
64
|
-
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
-
var webP;
|
|
66
|
-
return __generator(this, function (_a) {
|
|
67
|
-
switch (_a.label) {
|
|
68
|
-
case 0: return [4 /*yield*/, supports_webp_1.default];
|
|
69
|
-
case 1:
|
|
70
|
-
webP = _a.sent();
|
|
71
|
-
setWebP(webP);
|
|
72
|
-
return [2 /*return*/];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); })();
|
|
76
|
-
}, [supports_webp_1.default, setWebP]);
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import webPCheck from 'supports-webp';
|
|
3
|
+
export const useWebP = () => {
|
|
4
|
+
const [webP, setWebP] = useState();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
(async () => {
|
|
7
|
+
const webP = await webPCheck;
|
|
8
|
+
setWebP(webP);
|
|
9
|
+
})();
|
|
10
|
+
}, [webPCheck, setWebP]);
|
|
77
11
|
return webP;
|
|
78
12
|
};
|
|
79
|
-
exports.useWebP = useWebP;
|
|
80
13
|
//# sourceMappingURL=useWebP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebP.js","sourceRoot":"","sources":["../../src/hooks/useWebP.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWebP.js","sourceRoot":"","sources":["../../src/hooks/useWebP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,SAAS,MAAM,eAAe,CAAA;AAErC,MAAM,CAAC,MAAM,OAAO,GAAG,GAAwB,EAAE;IAC/C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAW,CAAA;IAE3C,SAAS,CAAC,GAAG,EAAE;QACb,CAAC,KAAK,IAAI,EAAE;YACV,MAAM,IAAI,GAAG,MAAM,SAAS,CAAA;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CAAC,EAAE,CAAA;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;IAExB,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
|
@@ -1,89 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
-
if (ar || !(i in from)) {
|
|
21
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
-
ar[i] = from[i];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.useZoomToElements = useZoomToElements;
|
|
29
|
-
var react_zoom_pan_pinch_1 = require("react-zoom-pan-pinch");
|
|
30
|
-
var zoom_pan_pinch_1 = require("../utilities/zoom-pan-pinch");
|
|
31
|
-
var zoom_pan_pinch_2 = require("../utilities/zoom-pan-pinch");
|
|
32
|
-
var zoom_pan_pinch_3 = require("../utilities/zoom-pan-pinch");
|
|
1
|
+
import { useTransformContext } from 'react-zoom-pan-pinch';
|
|
2
|
+
import { animate, handleCancelAnimation } from '../utilities/zoom-pan-pinch';
|
|
3
|
+
import { calculateBounds, getMouseBoundedPosition } from '../utilities/zoom-pan-pinch';
|
|
4
|
+
import { checkZoomBounds } from '../utilities/zoom-pan-pinch';
|
|
33
5
|
/**
|
|
34
6
|
* react-zoom-pan-pinch only has "zoomToElement". This code is the equivalent to zoom to display multiple elements at once.
|
|
35
7
|
*/
|
|
36
|
-
function useZoomToElements() {
|
|
37
|
-
|
|
8
|
+
export function useZoomToElements() {
|
|
9
|
+
const libraryContext = useTransformContext();
|
|
38
10
|
return zoomToElements(libraryContext);
|
|
39
11
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (wrapperComponent && targets.length && targets.every(function (target) { return wrapperComponent.contains(target); })) {
|
|
49
|
-
var targetState = calculateZoomToNodes(contextInstance, targets, { customZoom: scale, margin: margin });
|
|
50
|
-
(0, zoom_pan_pinch_1.animate)(contextInstance, targetState, animationTime, animationType);
|
|
12
|
+
const zoomToElements = (contextInstance) => (nodes, options = {}) => {
|
|
13
|
+
handleCancelAnimation(contextInstance);
|
|
14
|
+
const { wrapperComponent } = contextInstance;
|
|
15
|
+
const { scale, animationTime = 600, animationType = 'easeOut', margin } = options;
|
|
16
|
+
const targets = nodes.map(node => typeof node === 'string' ? document.getElementById(node) : node);
|
|
17
|
+
if (wrapperComponent && targets.length && targets.every(target => wrapperComponent.contains(target))) {
|
|
18
|
+
const targetState = calculateZoomToNodes(contextInstance, targets, { customZoom: scale, margin });
|
|
19
|
+
animate(contextInstance, targetState, animationTime, animationType);
|
|
51
20
|
}
|
|
52
|
-
};
|
|
53
|
-
function calculateZoomToNodes(contextInstance, nodes, options) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _a = contextInstance.setup, limitToBounds = _a.limitToBounds, minScale = _a.minScale, maxScale = _a.maxScale;
|
|
21
|
+
};
|
|
22
|
+
function calculateZoomToNodes(contextInstance, nodes, options = {}) {
|
|
23
|
+
const { wrapperComponent, contentComponent, transformState } = contextInstance;
|
|
24
|
+
const { limitToBounds, minScale, maxScale } = contextInstance.setup;
|
|
57
25
|
if (!wrapperComponent || !contentComponent)
|
|
58
26
|
return transformState;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
27
|
+
const { customZoom, margin: { bottom = 0, left = 0, right = 0, top = 0 } = {} } = options;
|
|
28
|
+
const wrapperRect = wrapperComponent.getBoundingClientRect();
|
|
29
|
+
const fontSize = parseFloat(window.getComputedStyle(contentComponent.firstElementChild, null).getPropertyValue('font-size'));
|
|
30
|
+
const nodesRect = nodes.map(node => node.getBoundingClientRect());
|
|
31
|
+
const nodesWidth = Math.max(...nodesRect.map(rect => rect.x + rect.width)) - Math.min(...nodesRect.map(rect => rect.x));
|
|
32
|
+
const nodesHeight = Math.max(...nodesRect.map(rect => rect.y + rect.height)) - Math.min(...nodesRect.map(rect => rect.y));
|
|
33
|
+
const nodesOffset = nodes.map(node => getOffset(node, wrapperComponent, contentComponent, transformState));
|
|
34
|
+
const focusLeft = Math.min(...nodesOffset.map(offset => offset.x)) - left * fontSize;
|
|
35
|
+
const focusTop = Math.min(...nodesOffset.map(offset => offset.y)) - top * fontSize;
|
|
36
|
+
const focusWidth = nodesWidth / transformState.scale + (left + right) * fontSize;
|
|
37
|
+
const focusHeight = nodesHeight / transformState.scale + (top + bottom) * fontSize;
|
|
38
|
+
const scaleX = wrapperComponent.offsetWidth / focusWidth;
|
|
39
|
+
const scaleY = wrapperComponent.offsetHeight / focusHeight;
|
|
40
|
+
const newScale = checkZoomBounds(customZoom || Math.min(scaleX, scaleY), minScale, maxScale, 0, false);
|
|
41
|
+
const offsetX = (wrapperRect.width - focusWidth * newScale) / 2;
|
|
42
|
+
const offsetY = (wrapperRect.height - focusHeight * newScale) / 2;
|
|
43
|
+
const newPositionX = (wrapperRect.left - focusLeft) * newScale + offsetX;
|
|
44
|
+
const newPositionY = (wrapperRect.top - focusTop) * newScale + offsetY;
|
|
45
|
+
const bounds = calculateBounds(contextInstance, newScale);
|
|
46
|
+
const { x, y } = getMouseBoundedPosition(newPositionX, newPositionY, bounds, limitToBounds, 0, 0, wrapperComponent);
|
|
79
47
|
return { positionX: x, positionY: y, scale: newScale };
|
|
80
48
|
}
|
|
81
49
|
function getOffset(element, wrapper, content, state) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
50
|
+
const offset = element.getBoundingClientRect();
|
|
51
|
+
const wrapperOffset = wrapper.getBoundingClientRect();
|
|
52
|
+
const contentOffset = content.getBoundingClientRect();
|
|
53
|
+
const xOff = wrapperOffset.x * state.scale;
|
|
54
|
+
const yOff = wrapperOffset.y * state.scale;
|
|
87
55
|
return {
|
|
88
56
|
x: (offset.x - contentOffset.x + xOff) / state.scale,
|
|
89
57
|
y: (offset.y - contentOffset.y + yOff) / state.scale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useZoomToElements.js","sourceRoot":"","sources":["../../src/hooks/useZoomToElements.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useZoomToElements.js","sourceRoot":"","sources":["../../src/hooks/useZoomToElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG5G,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,C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
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
|
-
exports.setupTranslation = void 0;
|
|
18
|
-
__exportStar(require("./components"), exports);
|
|
19
|
-
__exportStar(require("./css"), exports);
|
|
20
|
-
__exportStar(require("./hooks"), exports);
|
|
21
|
-
__exportStar(require("./locators"), exports);
|
|
22
|
-
var utilities_1 = require("./utilities");
|
|
23
|
-
Object.defineProperty(exports, "setupTranslation", { enumerable: true, get: function () { return utilities_1.setupTranslation; } });
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './css';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './locators';
|
|
5
|
+
export { setupTranslation } from './utilities';
|
|
24
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1,35 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.DeckLocator = void 0;
|
|
19
|
-
var ListLocator_1 = require("./ListLocator");
|
|
1
|
+
import { ListLocator } from './ListLocator';
|
|
20
2
|
/**
|
|
21
3
|
* This Locator places items to form a deck of cards. A specific use-case for the {@link ListLocator}.
|
|
22
4
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_this.limit = 20;
|
|
28
|
-
_this.gap = { x: -0.05, y: -0.05 };
|
|
29
|
-
Object.assign(_this, clone);
|
|
30
|
-
return _this;
|
|
5
|
+
export class DeckLocator extends ListLocator {
|
|
6
|
+
constructor(clone) {
|
|
7
|
+
super();
|
|
8
|
+
Object.assign(this, clone);
|
|
31
9
|
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
10
|
+
limit = 20;
|
|
11
|
+
gap = { x: -0.05, y: -0.05 };
|
|
12
|
+
}
|
|
35
13
|
//# sourceMappingURL=DeckLocator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckLocator.js","sourceRoot":"","sources":["../../src/locators/DeckLocator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeckLocator.js","sourceRoot":"","sources":["../../src/locators/DeckLocator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,WAA6F,SAAQ,WAAoB;IAEpI,YAAY,KAA4B;QACtC,KAAK,EAAE,CAAA;QACP,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK,GAAI,EAAE,CAAA;IACX,GAAG,GAAyB,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;CACnD"}
|