@gamepark/react-game 6.38.4 → 7.0.0-beta.0
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.d.ts +6 -6
- package/dist/components/Avatar/Avatar.js +63 -63
- package/dist/components/Avatar/ChatSpeechBubble.d.ts +8 -8
- package/dist/components/Avatar/ChatSpeechBubble.js +80 -77
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -1
- package/dist/components/Avatar/SpeechBubble.d.ts +15 -15
- package/dist/components/Avatar/SpeechBubble.js +72 -72
- package/dist/components/Avatar/SpeechBubble.js.map +1 -1
- package/dist/components/Avatar/index.d.ts +3 -3
- package/dist/components/Avatar/index.js +19 -19
- package/dist/components/GamePoints/GamePointIcon.d.ts +2 -2
- package/dist/components/GamePoints/GamePointIcon.js +25 -25
- package/dist/components/GamePoints/GamePoints.d.ts +8 -8
- package/dist/components/GamePoints/GamePoints.js +73 -73
- package/dist/components/GamePoints/GamePoints.js.map +1 -1
- package/dist/components/GamePoints/index.d.ts +2 -2
- package/dist/components/GamePoints/index.js +18 -18
- package/dist/components/GameProvider/GameContext.d.ts +28 -28
- package/dist/components/GameProvider/GameContext.js +19 -19
- package/dist/components/GameProvider/GameContext.js.map +1 -1
- package/dist/components/GameProvider/GameProvider.d.ts +9 -9
- package/dist/components/GameProvider/GameProvider.js +151 -151
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/GameProvider/index.d.ts +2 -2
- package/dist/components/GameProvider/index.js +18 -18
- package/dist/components/Header/Header.d.ts +7 -7
- package/dist/components/Header/Header.js +44 -44
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderText.d.ts +11 -11
- package/dist/components/Header/HeaderText.js +39 -39
- package/dist/components/Header/HeaderText.js.map +1 -1
- package/dist/components/Header/MaterialHeader.d.ts +11 -11
- package/dist/components/Header/MaterialHeader.js +112 -112
- package/dist/components/Header/MaterialHeader.js.map +1 -1
- package/dist/components/Header/index.d.ts +3 -3
- package/dist/components/Header/index.js +19 -19
- package/dist/components/ImagesLoader/ImagesLoader.d.ts +5 -5
- package/dist/components/ImagesLoader/ImagesLoader.js +26 -26
- package/dist/components/ImagesLoader/ImagesLoader.js.map +1 -1
- package/dist/components/ImagesLoader/index.d.ts +1 -1
- package/dist/components/ImagesLoader/index.js +17 -17
- package/dist/components/JournalTabs/Chat/Chat.d.ts +8 -8
- package/dist/components/JournalTabs/Chat/Chat.js +36 -36
- package/dist/components/JournalTabs/Chat/Chat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessage.d.ts +7 -7
- package/dist/components/JournalTabs/Chat/ChatMessage.js +18 -29
- package/dist/components/JournalTabs/Chat/ChatMessage.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.d.ts +3 -3
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js +37 -37
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.d.ts +19 -19
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +76 -87
- package/dist/components/JournalTabs/Chat/ChatTextInput.js.map +1 -1
- package/dist/components/JournalTabs/Chat/CommonChat.d.ts +13 -12
- package/dist/components/JournalTabs/Chat/CommonChat.js +57 -58
- package/dist/components/JournalTabs/Chat/CommonChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/LocalChat.d.ts +6 -6
- package/dist/components/JournalTabs/Chat/LocalChat.js +64 -64
- package/dist/components/JournalTabs/Chat/RemoteChat.d.ts +7 -7
- package/dist/components/JournalTabs/Chat/RemoteChat.js +45 -45
- package/dist/components/JournalTabs/Chat/SignInToChat.d.ts +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +24 -35
- package/dist/components/JournalTabs/Chat/SignInToChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/index.d.ts +5 -5
- package/dist/components/JournalTabs/Chat/index.js +21 -21
- package/dist/components/JournalTabs/History/GameOverHistory.d.ts +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.js +24 -35
- package/dist/components/JournalTabs/History/GameOverHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/History.d.ts +7 -7
- package/dist/components/JournalTabs/History/History.js +62 -62
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/HistoryEntry.d.ts +9 -9
- package/dist/components/JournalTabs/History/HistoryEntry.js +45 -45
- package/dist/components/JournalTabs/History/HistoryEntry.js.map +1 -1
- package/dist/components/JournalTabs/History/StartGameHistory.d.ts +2 -2
- package/dist/components/JournalTabs/History/StartGameHistory.js +19 -30
- package/dist/components/JournalTabs/History/StartGameHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/index.d.ts +2 -2
- package/dist/components/JournalTabs/History/index.js +18 -18
- package/dist/components/JournalTabs/JournalTabs.d.ts +6 -6
- package/dist/components/JournalTabs/JournalTabs.js +82 -93
- package/dist/components/JournalTabs/JournalTabs.js.map +1 -1
- package/dist/components/JournalTabs/index.d.ts +1 -1
- package/dist/components/JournalTabs/index.js +17 -17
- package/dist/components/Letterbox/Letterbox.d.ts +8 -8
- package/dist/components/Letterbox/Letterbox.js +42 -42
- package/dist/components/Letterbox/Letterbox.js.map +1 -1
- package/dist/components/Letterbox/index.d.ts +1 -1
- package/dist/components/Letterbox/index.js +17 -17
- package/dist/components/LoadingScreen/LoadingScreen.d.ts +12 -12
- package/dist/components/LoadingScreen/LoadingScreen.js +102 -102
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/components/LoadingScreen/index.d.ts +1 -1
- package/dist/components/LoadingScreen/index.js +17 -17
- package/dist/components/Log/InternalLiveLogContainer.d.ts +6 -6
- package/dist/components/Log/InternalLiveLogContainer.js +117 -117
- package/dist/components/Log/InternalLiveLogContainer.js.map +1 -1
- package/dist/components/Log/LiveLogButton.d.ts +1 -1
- package/dist/components/Log/LiveLogButton.js +23 -34
- package/dist/components/Log/LiveLogButton.js.map +1 -1
- package/dist/components/Log/LiveLogContainer.d.ts +3 -3
- package/dist/components/Log/LiveLogContainer.js +25 -25
- package/dist/components/Log/LogDescription.d.ts +24 -24
- package/dist/components/Log/LogDescription.js +2 -2
- package/dist/components/Log/LogItem.d.ts +11 -11
- package/dist/components/Log/LogItem.js +44 -44
- package/dist/components/Log/LogItem.js.map +1 -1
- package/dist/components/Log/index.d.ts +3 -3
- package/dist/components/Log/index.js +19 -19
- package/dist/components/Picture/Picture.d.ts +8 -8
- package/dist/components/Picture/Picture.js +34 -34
- package/dist/components/Picture/index.d.ts +1 -1
- package/dist/components/Picture/index.js +17 -17
- package/dist/components/PlayerPanel/Counters.d.ts +14 -14
- package/dist/components/PlayerPanel/Counters.js +50 -44
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.d.ts +8 -8
- package/dist/components/PlayerPanel/PlayerPanel.js +55 -55
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +24 -24
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +93 -117
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/index.d.ts +3 -3
- package/dist/components/PlayerPanel/index.js +19 -19
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +13 -13
- package/dist/components/PlayerTimer/PlayerTimer.js +73 -73
- package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -1
- package/dist/components/PlayerTimer/index.d.ts +1 -1
- package/dist/components/PlayerTimer/index.js +17 -17
- package/dist/components/Scoring/ScoringDescription.d.ts +8 -8
- package/dist/components/Scoring/ScoringDescription.js +2 -2
- package/dist/components/Scoring/index.d.ts +1 -1
- package/dist/components/Scoring/index.js +17 -17
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.d.ts +14 -14
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +137 -137
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/index.d.ts +1 -1
- package/dist/components/buttons/PlayMoveButton/index.js +17 -17
- package/dist/components/buttons/ThemeButton/ThemeButton.d.ts +3 -3
- package/dist/components/buttons/ThemeButton/ThemeButton.js +21 -21
- package/dist/components/buttons/ThemeButton/index.d.ts +1 -1
- package/dist/components/buttons/ThemeButton/index.js +17 -17
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.d.ts +7 -7
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.js +72 -72
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.js.map +1 -1
- package/dist/components/buttons/UndoMovesButton/index.d.ts +1 -1
- package/dist/components/buttons/UndoMovesButton/index.js +17 -17
- package/dist/components/buttons/index.d.ts +3 -3
- package/dist/components/buttons/index.js +19 -19
- package/dist/components/dialogs/Dialog.d.ts +11 -11
- package/dist/components/dialogs/Dialog.js +84 -84
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.d.ts +2 -2
- package/dist/components/dialogs/FailuresDialog.js +84 -84
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.d.ts +6 -6
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +65 -73
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.d.ts +5 -5
- package/dist/components/dialogs/ResultDialog/RematchSection.js +30 -41
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.d.ts +7 -7
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +103 -103
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/index.d.ts +2 -2
- package/dist/components/dialogs/ResultDialog/index.js +18 -18
- package/dist/components/dialogs/ResultDialog/useScoringTable.d.ts +2 -2
- package/dist/components/dialogs/ResultDialog/useScoringTable.js +42 -42
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.d.ts +5 -5
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +35 -44
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.d.ts +3 -3
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +39 -39
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.d.ts +5 -5
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +139 -139
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.d.ts +6 -6
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +44 -44
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.d.ts +6 -6
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +29 -40
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/index.d.ts +2 -2
- package/dist/components/dialogs/RulesDialog/index.js +18 -18
- package/dist/components/dialogs/index.d.ts +4 -4
- package/dist/components/dialogs/index.js +20 -20
- package/dist/components/index.d.ts +17 -17
- package/dist/components/index.js +33 -33
- package/dist/components/material/ComponentDescription.d.ts +52 -52
- package/dist/components/material/ComponentDescription.js +40 -40
- package/dist/components/material/Dices/CubicDiceDescription.d.ts +21 -21
- package/dist/components/material/Dices/CubicDiceDescription.js +129 -132
- package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
- package/dist/components/material/Dices/index.d.ts +1 -1
- package/dist/components/material/Dices/index.js +17 -17
- package/dist/components/material/DraggableMaterial.d.ts +9 -9
- package/dist/components/material/DraggableMaterial.js +256 -259
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/BoardDescription.d.ts +3 -3
- package/dist/components/material/FlatMaterial/BoardDescription.js +27 -27
- package/dist/components/material/FlatMaterial/CardDescription.d.ts +6 -6
- package/dist/components/material/FlatMaterial/CardDescription.js +56 -31
- package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +31 -38
- package/dist/components/material/FlatMaterial/FlatMaterial.js +159 -170
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/MoneyDescription.d.ts +7 -7
- package/dist/components/material/FlatMaterial/MoneyDescription.js +35 -38
- package/dist/components/material/FlatMaterial/MoneyDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/PolyhexDescription.d.ts +20 -20
- package/dist/components/material/FlatMaterial/PolyhexDescription.js +73 -48
- package/dist/components/material/FlatMaterial/PolyhexDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/TokenDescription.d.ts +10 -10
- package/dist/components/material/FlatMaterial/TokenDescription.js +68 -43
- package/dist/components/material/FlatMaterial/TokenDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/index.d.ts +6 -6
- package/dist/components/material/FlatMaterial/index.js +22 -22
- package/dist/components/material/GameTable/DropPreview.d.ts +2 -2
- package/dist/components/material/GameTable/DropPreview.js +75 -75
- package/dist/components/material/GameTable/DropPreview.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.d.ts +4 -4
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +88 -88
- package/dist/components/material/GameTable/GameMaterialDisplay.d.ts +7 -7
- package/dist/components/material/GameTable/GameMaterialDisplay.js +33 -33
- package/dist/components/material/GameTable/GameTable.d.ts +20 -20
- package/dist/components/material/GameTable/GameTable.js +143 -143
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.d.ts +6 -6
- package/dist/components/material/GameTable/GameTableNavigation.js +72 -72
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.d.ts +20 -21
- package/dist/components/material/GameTable/ItemDisplay.js +180 -183
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.d.ts +5 -5
- package/dist/components/material/GameTable/StaticItemsDisplay.js +93 -96
- package/dist/components/material/GameTable/StaticItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticLocationsDisplay.d.ts +5 -5
- package/dist/components/material/GameTable/StaticLocationsDisplay.js +32 -32
- package/dist/components/material/GameTable/focus/FocusProvider.d.ts +12 -10
- package/dist/components/material/GameTable/focus/FocusProvider.js +84 -99
- package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
- package/dist/components/material/GameTable/focus/MaterialFocus.d.ts +20 -20
- package/dist/components/material/GameTable/focus/MaterialFocus.js +2 -2
- package/dist/components/material/GameTable/focus/index.d.ts +2 -2
- package/dist/components/material/GameTable/focus/index.js +18 -18
- package/dist/components/material/GameTable/index.d.ts +3 -3
- package/dist/components/material/GameTable/index.js +19 -19
- package/dist/components/material/ImageLoader/MaterialImageLoader.d.ts +5 -5
- package/dist/components/material/ImageLoader/MaterialImageLoader.js +93 -93
- package/dist/components/material/ImageLoader/MaterialImageLoader.js.map +1 -1
- package/dist/components/material/ImageLoader/index.d.ts +1 -1
- package/dist/components/material/ImageLoader/index.js +17 -17
- package/dist/components/material/ItemMenuButton.d.ts +14 -14
- package/dist/components/material/ItemMenuButton.js +74 -74
- package/dist/components/material/ItemMenuButton.js.map +1 -1
- package/dist/components/material/ItemMenuWrapper.d.ts +11 -11
- package/dist/components/material/ItemMenuWrapper.js +68 -68
- package/dist/components/material/MaterialComponent.d.ts +17 -17
- package/dist/components/material/MaterialComponent.js +48 -48
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialComponentType.d.ts +7 -7
- package/dist/components/material/MaterialComponentType.js +11 -11
- package/dist/components/material/MaterialComponentType.js.map +1 -1
- package/dist/components/material/MaterialDescription.d.ts +176 -176
- package/dist/components/material/MaterialDescription.js +292 -295
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/MobileMaterialDescription.d.ts +10 -10
- package/dist/components/material/MobileMaterialDescription.js +92 -70
- package/dist/components/material/MobileMaterialDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelContent.d.ts +14 -14
- package/dist/components/material/Wheel/WheelContent.js +40 -51
- package/dist/components/material/Wheel/WheelContent.js.map +1 -1
- package/dist/components/material/Wheel/WheelDescription.d.ts +20 -20
- package/dist/components/material/Wheel/WheelDescription.js +125 -125
- package/dist/components/material/Wheel/WheelDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelItem.d.ts +15 -15
- package/dist/components/material/Wheel/WheelItem.js +53 -53
- package/dist/components/material/Wheel/WheelItem.js.map +1 -1
- package/dist/components/material/Wheel/index.d.ts +1 -1
- package/dist/components/material/Wheel/index.js +17 -17
- package/dist/components/material/Writing/WritingDescription.d.ts +12 -12
- package/dist/components/material/Writing/WritingDescription.js +106 -117
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/Writing/index.d.ts +1 -1
- package/dist/components/material/Writing/index.js +17 -17
- package/dist/components/material/animations/CreateItemAnimations.d.ts +15 -15
- package/dist/components/material/animations/CreateItemAnimations.js +80 -80
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.d.ts +14 -14
- package/dist/components/material/animations/DeleteItemAnimations.js +72 -72
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.d.ts +12 -12
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.js +62 -62
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +11 -11
- package/dist/components/material/animations/ItemAnimations.js +57 -57
- package/dist/components/material/animations/MaterialAnimations.d.ts +19 -19
- package/dist/components/material/animations/MaterialAnimations.js +58 -58
- package/dist/components/material/animations/MaterialAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialGameAnimations.d.ts +33 -33
- package/dist/components/material/animations/MaterialGameAnimations.js +152 -130
- package/dist/components/material/animations/MaterialGameAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAnimations.d.ts +16 -16
- package/dist/components/material/animations/MoveItemAnimations.js +121 -124
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.d.ts +14 -14
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +75 -75
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.d.ts +13 -13
- package/dist/components/material/animations/RollItemAnimations.js +121 -121
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.d.ts +8 -8
- package/dist/components/material/animations/ShuffleAnimations.js +33 -33
- package/dist/components/material/animations/ShuffleAnimations.js.map +1 -1
- package/dist/components/material/animations/getFirstStockItemTransforms.util.d.ts +2 -2
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js +27 -30
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js.map +1 -1
- package/dist/components/material/animations/index.d.ts +8 -8
- package/dist/components/material/animations/index.js +26 -26
- package/dist/components/material/animations/rotations.utils.d.ts +3 -3
- package/dist/components/material/animations/rotations.utils.js +126 -126
- package/dist/components/material/animations/rotations.utils.js.map +1 -1
- package/dist/components/material/animations/transformItem.util.d.ts +2 -2
- package/dist/components/material/animations/transformItem.util.js +36 -37
- package/dist/components/material/animations/transformItem.util.js.map +1 -1
- package/dist/components/material/index.d.ts +15 -15
- package/dist/components/material/index.js +31 -31
- package/dist/components/material/locations/DropAreaDescription.d.ts +12 -12
- package/dist/components/material/locations/DropAreaDescription.js +83 -61
- package/dist/components/material/locations/DropAreaDescription.js.map +1 -1
- package/dist/components/material/locations/HexGridDropAreaDescription.d.ts +13 -13
- package/dist/components/material/locations/HexGridDropAreaDescription.js +119 -97
- package/dist/components/material/locations/HexGridDropAreaDescription.js.map +1 -1
- package/dist/components/material/locations/LocationComponent.d.ts +15 -16
- package/dist/components/material/locations/LocationComponent.js +105 -105
- package/dist/components/material/locations/LocationComponent.js.map +1 -1
- package/dist/components/material/locations/LocationDescription.d.ts +45 -45
- package/dist/components/material/locations/LocationDescription.js +138 -141
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/LocationDisplay.d.ts +13 -13
- package/dist/components/material/locations/LocationDisplay.js +84 -84
- package/dist/components/material/locations/LocationsMask.d.ts +6 -6
- package/dist/components/material/locations/LocationsMask.js +25 -39
- package/dist/components/material/locations/LocationsMask.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.d.ts +11 -11
- package/dist/components/material/locations/SimpleDropArea.js +106 -106
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/material/locations/index.d.ts +5 -5
- package/dist/components/material/locations/index.js +21 -21
- package/dist/components/material/sound/AudioLoader.d.ts +20 -20
- package/dist/components/material/sound/AudioLoader.js +119 -119
- package/dist/components/material/sound/AudioLoader.js.map +1 -1
- package/dist/components/material/sound/MaterialGameSounds.d.ts +8 -8
- package/dist/components/material/sound/MaterialGameSounds.js +122 -122
- package/dist/components/material/sound/MaterialGameSounds.js.map +1 -1
- package/dist/components/material/sound/MaterialSoundConfig.d.ts +11 -11
- package/dist/components/material/sound/MaterialSoundConfig.js +10 -10
- package/dist/components/material/sound/MaterialSoundLoader.d.ts +8 -8
- package/dist/components/material/sound/MaterialSoundLoader.js +76 -79
- package/dist/components/material/sound/MaterialSoundLoader.js.map +1 -1
- package/dist/components/material/sound/index.d.ts +2 -2
- package/dist/components/material/sound/index.js +18 -18
- package/dist/components/material/sound/sound.utils.d.ts +2 -2
- package/dist/components/material/sound/sound.utils.js +14 -14
- package/dist/components/material/sound/sound.utils.js.map +1 -1
- package/dist/components/material/utils/IsLocationSubset.d.ts +2 -2
- package/dist/components/material/utils/IsLocationSubset.js +14 -17
- package/dist/components/material/utils/IsLocationSubset.js.map +1 -1
- package/dist/components/material/utils/getBestDropMove.d.ts +4 -4
- package/dist/components/material/utils/getBestDropMove.js +32 -33
- package/dist/components/material/utils/getBestDropMove.js.map +1 -1
- package/dist/components/material/utils/index.d.ts +1 -1
- package/dist/components/material/utils/index.js +17 -17
- package/dist/components/material/utils/isDroppedItem.d.ts +4 -4
- package/dist/components/material/utils/isDroppedItem.js +27 -27
- package/dist/components/material/utils/isPlacedOnItem.d.ts +3 -3
- package/dist/components/material/utils/isPlacedOnItem.js +13 -13
- package/dist/components/material/utils/isRotationMove.d.ts +3 -3
- package/dist/components/material/utils/isRotationMove.js +21 -24
- package/dist/components/material/utils/isRotationMove.js.map +1 -1
- package/dist/components/material/utils/useIsAnimatingPlayerAction.d.ts +1 -1
- package/dist/components/material/utils/useIsAnimatingPlayerAction.js +14 -14
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.d.ts +2 -2
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +34 -34
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.d.ts +4 -10
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +74 -74
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.d.ts +2 -2
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +52 -52
- package/dist/components/menus/EjectPlayer/index.d.ts +3 -3
- package/dist/components/menus/EjectPlayer/index.js +19 -19
- package/dist/components/menus/Fullscreen/FullscreenButton.d.ts +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +17 -28
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.d.ts +2 -2
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +62 -62
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.d.ts +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +45 -56
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/index.d.ts +3 -3
- package/dist/components/menus/Fullscreen/index.js +19 -19
- package/dist/components/menus/GiveUpButton/GiveUpButton.d.ts +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +78 -89
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/GiveUpButton/index.d.ts +1 -1
- package/dist/components/menus/GiveUpButton/index.js +17 -17
- package/dist/components/menus/Menu/LogoIcon.d.ts +2 -2
- package/dist/components/menus/Menu/LogoIcon.js +17 -17
- package/dist/components/menus/Menu/LogoIcon.js.map +1 -1
- package/dist/components/menus/Menu/Menu.d.ts +3 -3
- package/dist/components/menus/Menu/Menu.js +106 -117
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.d.ts +7 -7
- package/dist/components/menus/Menu/MenuPopButton.js +68 -68
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.d.ts +7 -7
- package/dist/components/menus/Menu/NavButton.js +32 -32
- package/dist/components/menus/Menu/index.d.ts +1 -1
- package/dist/components/menus/Menu/index.js +17 -17
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.d.ts +1 -1
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +52 -63
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js.map +1 -1
- package/dist/components/menus/PlayerQuit/index.d.ts +1 -1
- package/dist/components/menus/PlayerQuit/index.js +17 -17
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.d.ts +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +24 -35
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/index.d.ts +1 -1
- package/dist/components/menus/RestartTutorialButton/index.js +17 -17
- package/dist/components/menus/Result/Medal.d.ts +4 -4
- package/dist/components/menus/Result/Medal.js +41 -41
- package/dist/components/menus/Result/Medal.js.map +1 -1
- package/dist/components/menus/Result/MedalBronze.d.ts +2 -2
- package/dist/components/menus/Result/MedalBronze.js +17 -17
- package/dist/components/menus/Result/MedalBronze.js.map +1 -1
- package/dist/components/menus/Result/MedalGold.d.ts +2 -2
- package/dist/components/menus/Result/MedalGold.js +17 -17
- package/dist/components/menus/Result/MedalGold.js.map +1 -1
- package/dist/components/menus/Result/MedalSilver.d.ts +2 -2
- package/dist/components/menus/Result/MedalSilver.js +17 -17
- package/dist/components/menus/Result/MedalSilver.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.d.ts +2 -2
- package/dist/components/menus/Result/ResultButton.js +25 -25
- package/dist/components/menus/Result/ResultPopButton.d.ts +2 -2
- package/dist/components/menus/Result/ResultPopButton.js +37 -37
- package/dist/components/menus/Result/index.d.ts +3 -3
- package/dist/components/menus/Result/index.js +19 -19
- package/dist/components/menus/SoundButton/SoundButton.d.ts +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +17 -28
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/SoundButton/index.d.ts +1 -1
- package/dist/components/menus/SoundButton/index.js +17 -17
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.d.ts +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +82 -93
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/index.d.ts +1 -1
- package/dist/components/menus/TimeStatsButton/index.js +17 -17
- package/dist/components/menus/UndoButton/UndoButton.d.ts +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +33 -44
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.d.ts +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +40 -51
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -1
- package/dist/components/menus/UndoButton/index.d.ts +2 -2
- package/dist/components/menus/UndoButton/index.js +18 -18
- package/dist/components/menus/index.d.ts +6 -6
- package/dist/components/menus/index.js +22 -22
- package/dist/components/menus/menuCss.d.ts +9 -9
- package/dist/components/menus/menuCss.js +19 -19
- package/dist/components/tutorial/MaterialTutorial.d.ts +43 -43
- package/dist/components/tutorial/MaterialTutorial.js +40 -40
- package/dist/components/tutorial/MaterialTutorial.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.d.ts +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +108 -112
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/components/tutorial/TutorialRulesWrapper.d.ts +3 -3
- package/dist/components/tutorial/TutorialRulesWrapper.js +142 -146
- package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
- package/dist/components/tutorial/index.d.ts +1 -1
- package/dist/components/tutorial/index.js +17 -17
- package/dist/css/GameTheme.d.ts +23 -23
- package/dist/css/GameTheme.js +21 -21
- package/dist/css/addStylesheetUrl.d.ts +1 -1
- package/dist/css/addStylesheetUrl.js +10 -10
- package/dist/css/backgroundCss.d.ts +1 -1
- package/dist/css/backgroundCss.js +11 -11
- package/dist/css/buttonCss.d.ts +3 -3
- package/dist/css/buttonCss.js +13 -13
- package/dist/css/componentSizeCss.d.ts +5 -5
- package/dist/css/componentSizeCss.js +22 -22
- package/dist/css/cursorCss.d.ts +3 -3
- package/dist/css/cursorCss.js +12 -12
- package/dist/css/fadeIn.d.ts +1 -1
- package/dist/css/fadeIn.js +12 -12
- package/dist/css/index.d.ts +10 -10
- package/dist/css/index.js +26 -26
- package/dist/css/shadowEffect.d.ts +1 -1
- package/dist/css/shadowEffect.js +10 -10
- package/dist/css/shineEffect.d.ts +1 -1
- package/dist/css/shineEffect.js +11 -11
- package/dist/css/transformCss.d.ts +2 -2
- package/dist/css/transformCss.js +18 -18
- package/dist/hooks/index.d.ts +27 -27
- package/dist/hooks/index.js +43 -43
- package/dist/hooks/useActions.d.ts +2 -2
- package/dist/hooks/useActions.js +8 -8
- package/dist/hooks/useAnimations.d.ts +4 -4
- package/dist/hooks/useAnimations.js +58 -58
- package/dist/hooks/useAnimations.js.map +1 -1
- package/dist/hooks/useDraggedItem.d.ts +2 -2
- package/dist/hooks/useDraggedItem.js +33 -34
- 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.d.ts +13 -13
- package/dist/hooks/useFlatHistory.js +159 -162
- package/dist/hooks/useFlatHistory.js.map +1 -1
- package/dist/hooks/useFullscreen.d.ts +5 -5
- package/dist/hooks/useFullscreen.js +51 -51
- package/dist/hooks/useFullscreen.js.map +1 -1
- package/dist/hooks/useGame.d.ts +1 -1
- package/dist/hooks/useGame.js +7 -8
- package/dist/hooks/useGame.js.map +1 -1
- package/dist/hooks/useGiveUp.d.ts +1 -1
- package/dist/hooks/useGiveUp.js +16 -16
- package/dist/hooks/useGiveUp.js.map +1 -1
- package/dist/hooks/useItemLocations.d.ts +8 -8
- package/dist/hooks/useItemLocations.js +122 -126
- package/dist/hooks/useItemLocations.js.map +1 -1
- package/dist/hooks/useItemLocator.d.ts +2 -2
- package/dist/hooks/useItemLocator.js +8 -9
- package/dist/hooks/useItemLocator.js.map +1 -1
- package/dist/hooks/useKeyDown.d.ts +1 -1
- package/dist/hooks/useKeyDown.js +16 -16
- package/dist/hooks/useKeyDown.js.map +1 -1
- package/dist/hooks/useLegalMoves.d.ts +2 -2
- package/dist/hooks/useLegalMoves.js +18 -19
- package/dist/hooks/useLegalMoves.js.map +1 -1
- package/dist/hooks/useLocators.d.ts +1 -1
- package/dist/hooks/useLocators.js +7 -7
- package/dist/hooks/useMaterialContext.d.ts +2 -2
- package/dist/hooks/useMaterialContext.js +16 -17
- package/dist/hooks/useMaterialContext.js.map +1 -1
- package/dist/hooks/useMaterialDescription.d.ts +2 -2
- package/dist/hooks/useMaterialDescription.js +9 -10
- package/dist/hooks/useMaterialDescription.js.map +1 -1
- package/dist/hooks/useNow.d.ts +6 -6
- package/dist/hooks/useNow.js +37 -37
- package/dist/hooks/useNow.js.map +1 -1
- package/dist/hooks/useNumberOfPlayers.d.ts +1 -1
- package/dist/hooks/useNumberOfPlayers.js +6 -6
- package/dist/hooks/useOpponentWithMaxTime.d.ts +5 -5
- package/dist/hooks/useOpponentWithMaxTime.js +60 -60
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -1
- package/dist/hooks/usePlay.d.ts +2 -2
- package/dist/hooks/usePlay.js +23 -23
- package/dist/hooks/usePlay.js.map +1 -1
- package/dist/hooks/usePlayerId.d.ts +2 -2
- package/dist/hooks/usePlayerId.js +10 -10
- package/dist/hooks/usePlayerName.d.ts +1 -1
- package/dist/hooks/usePlayerName.js +25 -26
- package/dist/hooks/usePlayerName.js.map +1 -1
- package/dist/hooks/usePlayerTime.d.ts +1 -1
- package/dist/hooks/usePlayerTime.js +50 -50
- package/dist/hooks/usePlayerTime.js.map +1 -1
- package/dist/hooks/usePlayers.d.ts +8 -8
- package/dist/hooks/usePlayers.js +95 -95
- package/dist/hooks/usePlayers.js.map +1 -1
- package/dist/hooks/useRankedPlayers.d.ts +5 -5
- package/dist/hooks/useRankedPlayers.js +37 -37
- package/dist/hooks/useRankedPlayers.js.map +1 -1
- package/dist/hooks/useResultText.d.ts +1 -1
- package/dist/hooks/useResultText.js +71 -71
- package/dist/hooks/useResultText.js.map +1 -1
- package/dist/hooks/useRules.d.ts +2 -2
- package/dist/hooks/useRules.js +17 -18
- package/dist/hooks/useRules.js.map +1 -1
- package/dist/hooks/useSound.d.ts +1 -1
- package/dist/hooks/useSound.js +35 -35
- package/dist/hooks/useSound.js.map +1 -1
- package/dist/hooks/useStaticLocations.d.ts +2 -2
- package/dist/hooks/useStaticLocations.js +98 -102
- package/dist/hooks/useStaticLocations.js.map +1 -1
- package/dist/hooks/useTutorialStep.d.ts +2 -2
- package/dist/hooks/useTutorialStep.js +13 -14
- package/dist/hooks/useTutorialStep.js.map +1 -1
- package/dist/hooks/useUndo.d.ts +7 -7
- package/dist/hooks/useUndo.js +99 -102
- package/dist/hooks/useUndo.js.map +1 -1
- package/dist/hooks/useWebP.d.ts +1 -1
- package/dist/hooks/useWebP.js +79 -79
- package/dist/hooks/useZoomToElements.d.ts +13 -13
- package/dist/hooks/useZoomToElements.js +91 -92
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +23 -23
- package/dist/locators/DeckLocator.d.ts +10 -10
- package/dist/locators/DeckLocator.js +34 -34
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.d.ts +57 -57
- package/dist/locators/FlexLocator.js +117 -117
- package/dist/locators/FlexLocator.js.map +1 -1
- package/dist/locators/HandLocator.d.ts +96 -96
- package/dist/locators/HandLocator.js +176 -176
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/HexagonalGridLocator.d.ts +95 -95
- package/dist/locators/HexagonalGridLocator.js +303 -308
- package/dist/locators/HexagonalGridLocator.js.map +1 -1
- package/dist/locators/ListLocator.d.ts +54 -54
- package/dist/locators/ListLocator.js +123 -123
- package/dist/locators/ListLocator.js.map +1 -1
- package/dist/locators/Locator.d.ts +275 -273
- package/dist/locators/Locator.js +416 -421
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +53 -53
- package/dist/locators/PileLocator.js +184 -184
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/locators/index.d.ts +8 -8
- package/dist/locators/index.js +24 -24
- package/dist/locators/utils/getRelativePlayerIndex.util.d.ts +2 -2
- package/dist/locators/utils/getRelativePlayerIndex.util.js +13 -14
- package/dist/locators/utils/getRelativePlayerIndex.util.js.map +1 -1
- package/dist/locators/utils/index.d.ts +1 -1
- package/dist/locators/utils/index.js +17 -17
- package/dist/utilities/DeepPartial.d.ts +6 -6
- package/dist/utilities/DeepPartial.js +2 -2
- package/dist/utilities/combineEventListeners.d.ts +7 -7
- package/dist/utilities/combineEventListeners.js +48 -49
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.d.ts +7 -7
- package/dist/utilities/findIfUnique.util.js +21 -22
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/index.d.ts +4 -4
- package/dist/utilities/index.js +20 -20
- package/dist/utilities/pusher.d.ts +2 -0
- package/dist/utilities/pusher.js +16 -0
- package/dist/utilities/pusher.js.map +1 -0
- package/dist/utilities/translation.util.d.ts +10 -10
- package/dist/utilities/translation.util.js +37 -37
- package/dist/utilities/zoom-pan-pinch/animations.constants.d.ts +16 -16
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +81 -81
- package/dist/utilities/zoom-pan-pinch/animations.util.d.ts +8 -8
- package/dist/utilities/zoom-pan-pinch/animations.util.js +77 -77
- package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/bounds.util.d.ts +17 -17
- package/dist/utilities/zoom-pan-pinch/bounds.util.js +84 -84
- package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/calculation.util.d.ts +14 -14
- package/dist/utilities/zoom-pan-pinch/calculation.util.js +23 -23
- package/dist/utilities/zoom-pan-pinch/index.d.ts +9 -9
- package/dist/utilities/zoom-pan-pinch/index.js +25 -25
- package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +4 -4
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +15 -16
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -1
- package/package.json +21 -21
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.animations = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.constants.ts
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Functions should return denominator of the target value, which is the next animation step.
|
|
9
|
-
* t is a value from 0 to 1, reflecting the percentage of animation status.
|
|
10
|
-
*/
|
|
11
|
-
var easeOut = function (t) {
|
|
12
|
-
return -Math.cos(t * Math.PI) / 2 + 0.5;
|
|
13
|
-
};
|
|
14
|
-
// linear
|
|
15
|
-
var linear = function (t) {
|
|
16
|
-
return t;
|
|
17
|
-
};
|
|
18
|
-
// accelerating from zero velocity
|
|
19
|
-
var easeInQuad = function (t) {
|
|
20
|
-
return t * t;
|
|
21
|
-
};
|
|
22
|
-
// decelerating to zero velocity
|
|
23
|
-
var easeOutQuad = function (t) {
|
|
24
|
-
return t * (2 - t);
|
|
25
|
-
};
|
|
26
|
-
// acceleration until halfway, then deceleration
|
|
27
|
-
var easeInOutQuad = function (t) {
|
|
28
|
-
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
29
|
-
};
|
|
30
|
-
// accelerating from zero velocity
|
|
31
|
-
var easeInCubic = function (t) {
|
|
32
|
-
return t * t * t;
|
|
33
|
-
};
|
|
34
|
-
// decelerating to zero velocity
|
|
35
|
-
var easeOutCubic = function (t) {
|
|
36
|
-
return --t * t * t + 1;
|
|
37
|
-
};
|
|
38
|
-
// acceleration until halfway, then deceleration
|
|
39
|
-
var easeInOutCubic = function (t) {
|
|
40
|
-
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
41
|
-
};
|
|
42
|
-
// accelerating from zero velocity
|
|
43
|
-
var easeInQuart = function (t) {
|
|
44
|
-
return t * t * t * t;
|
|
45
|
-
};
|
|
46
|
-
// decelerating to zero velocity
|
|
47
|
-
var easeOutQuart = function (t) {
|
|
48
|
-
return 1 - --t * t * t * t;
|
|
49
|
-
};
|
|
50
|
-
// acceleration until halfway, then deceleration
|
|
51
|
-
var easeInOutQuart = function (t) {
|
|
52
|
-
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
53
|
-
};
|
|
54
|
-
// accelerating from zero velocity
|
|
55
|
-
var easeInQuint = function (t) {
|
|
56
|
-
return t * t * t * t * t;
|
|
57
|
-
};
|
|
58
|
-
// decelerating to zero velocity
|
|
59
|
-
var easeOutQuint = function (t) {
|
|
60
|
-
return 1 + --t * t * t * t * t;
|
|
61
|
-
};
|
|
62
|
-
// acceleration until halfway, then deceleration
|
|
63
|
-
var easeInOutQuint = function (t) {
|
|
64
|
-
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
65
|
-
};
|
|
66
|
-
exports.animations = {
|
|
67
|
-
easeOut: easeOut,
|
|
68
|
-
linear: linear,
|
|
69
|
-
easeInQuad: easeInQuad,
|
|
70
|
-
easeOutQuad: easeOutQuad,
|
|
71
|
-
easeInOutQuad: easeInOutQuad,
|
|
72
|
-
easeInCubic: easeInCubic,
|
|
73
|
-
easeOutCubic: easeOutCubic,
|
|
74
|
-
easeInOutCubic: easeInOutCubic,
|
|
75
|
-
easeInQuart: easeInQuart,
|
|
76
|
-
easeOutQuart: easeOutQuart,
|
|
77
|
-
easeInOutQuart: easeInOutQuart,
|
|
78
|
-
easeInQuint: easeInQuint,
|
|
79
|
-
easeOutQuint: easeOutQuint,
|
|
80
|
-
easeInOutQuint: easeInOutQuint
|
|
81
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.animations = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.constants.ts
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Functions should return denominator of the target value, which is the next animation step.
|
|
9
|
+
* t is a value from 0 to 1, reflecting the percentage of animation status.
|
|
10
|
+
*/
|
|
11
|
+
var easeOut = function (t) {
|
|
12
|
+
return -Math.cos(t * Math.PI) / 2 + 0.5;
|
|
13
|
+
};
|
|
14
|
+
// linear
|
|
15
|
+
var linear = function (t) {
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
// accelerating from zero velocity
|
|
19
|
+
var easeInQuad = function (t) {
|
|
20
|
+
return t * t;
|
|
21
|
+
};
|
|
22
|
+
// decelerating to zero velocity
|
|
23
|
+
var easeOutQuad = function (t) {
|
|
24
|
+
return t * (2 - t);
|
|
25
|
+
};
|
|
26
|
+
// acceleration until halfway, then deceleration
|
|
27
|
+
var easeInOutQuad = function (t) {
|
|
28
|
+
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
29
|
+
};
|
|
30
|
+
// accelerating from zero velocity
|
|
31
|
+
var easeInCubic = function (t) {
|
|
32
|
+
return t * t * t;
|
|
33
|
+
};
|
|
34
|
+
// decelerating to zero velocity
|
|
35
|
+
var easeOutCubic = function (t) {
|
|
36
|
+
return --t * t * t + 1;
|
|
37
|
+
};
|
|
38
|
+
// acceleration until halfway, then deceleration
|
|
39
|
+
var easeInOutCubic = function (t) {
|
|
40
|
+
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
41
|
+
};
|
|
42
|
+
// accelerating from zero velocity
|
|
43
|
+
var easeInQuart = function (t) {
|
|
44
|
+
return t * t * t * t;
|
|
45
|
+
};
|
|
46
|
+
// decelerating to zero velocity
|
|
47
|
+
var easeOutQuart = function (t) {
|
|
48
|
+
return 1 - --t * t * t * t;
|
|
49
|
+
};
|
|
50
|
+
// acceleration until halfway, then deceleration
|
|
51
|
+
var easeInOutQuart = function (t) {
|
|
52
|
+
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
53
|
+
};
|
|
54
|
+
// accelerating from zero velocity
|
|
55
|
+
var easeInQuint = function (t) {
|
|
56
|
+
return t * t * t * t * t;
|
|
57
|
+
};
|
|
58
|
+
// decelerating to zero velocity
|
|
59
|
+
var easeOutQuint = function (t) {
|
|
60
|
+
return 1 + --t * t * t * t * t;
|
|
61
|
+
};
|
|
62
|
+
// acceleration until halfway, then deceleration
|
|
63
|
+
var easeInOutQuint = function (t) {
|
|
64
|
+
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
65
|
+
};
|
|
66
|
+
exports.animations = {
|
|
67
|
+
easeOut: easeOut,
|
|
68
|
+
linear: linear,
|
|
69
|
+
easeInQuad: easeInQuad,
|
|
70
|
+
easeOutQuad: easeOutQuad,
|
|
71
|
+
easeInOutQuad: easeInOutQuad,
|
|
72
|
+
easeInCubic: easeInCubic,
|
|
73
|
+
easeOutCubic: easeOutCubic,
|
|
74
|
+
easeInOutCubic: easeInOutCubic,
|
|
75
|
+
easeInQuart: easeInQuart,
|
|
76
|
+
easeOutQuart: easeOutQuart,
|
|
77
|
+
easeInOutQuart: easeInOutQuart,
|
|
78
|
+
easeInQuint: easeInQuint,
|
|
79
|
+
easeOutQuint: easeOutQuint,
|
|
80
|
+
easeInOutQuint: easeInOutQuint
|
|
81
|
+
};
|
|
82
82
|
//# sourceMappingURL=animations.constants.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.utils.ts
|
|
3
|
-
*/
|
|
4
|
-
import { animations } from './animations.constants';
|
|
5
|
-
import { ReactZoomPanPinchContext, StateType } from 'react-zoom-pan-pinch';
|
|
6
|
-
export declare const handleCancelAnimation: (contextInstance: ReactZoomPanPinchContext) => void;
|
|
7
|
-
export declare function handleSetupAnimation(contextInstance: ReactZoomPanPinchContext, animationName: keyof typeof animations, animationTime: number, callback: (step: number) => void): void;
|
|
8
|
-
export declare function animate(contextInstance: ReactZoomPanPinchContext, targetState: StateType, animationTime: number, animationName: keyof typeof animations): void;
|
|
1
|
+
/**
|
|
2
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.utils.ts
|
|
3
|
+
*/
|
|
4
|
+
import { animations } from './animations.constants';
|
|
5
|
+
import { ReactZoomPanPinchContext, StateType } from 'react-zoom-pan-pinch';
|
|
6
|
+
export declare const handleCancelAnimation: (contextInstance: ReactZoomPanPinchContext) => void;
|
|
7
|
+
export declare function handleSetupAnimation(contextInstance: ReactZoomPanPinchContext, animationName: keyof typeof animations, animationTime: number, callback: (step: number) => void): void;
|
|
8
|
+
export declare function animate(contextInstance: ReactZoomPanPinchContext, targetState: StateType, animationTime: number, animationName: keyof typeof animations): void;
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
contextInstance.
|
|
19
|
-
|
|
20
|
-
contextInstance.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleCancelAnimation = void 0;
|
|
4
|
+
exports.handleSetupAnimation = handleSetupAnimation;
|
|
5
|
+
exports.animate = animate;
|
|
6
|
+
/**
|
|
7
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.utils.ts
|
|
8
|
+
*/
|
|
9
|
+
var animations_constants_1 = require("./animations.constants");
|
|
10
|
+
var handleCancelAnimationFrame = function (animation) {
|
|
11
|
+
if (typeof animation === 'number') {
|
|
12
|
+
cancelAnimationFrame(animation);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var handleCancelAnimation = function (contextInstance) {
|
|
16
|
+
if (!contextInstance.mounted)
|
|
17
|
+
return;
|
|
18
|
+
handleCancelAnimationFrame(contextInstance.animation);
|
|
19
|
+
// Clear animation state
|
|
20
|
+
contextInstance.animate = false;
|
|
21
|
+
contextInstance.animation = null;
|
|
22
|
+
contextInstance.velocity = null;
|
|
23
|
+
};
|
|
24
|
+
exports.handleCancelAnimation = handleCancelAnimation;
|
|
25
|
+
function handleSetupAnimation(contextInstance, animationName, animationTime, callback) {
|
|
26
|
+
if (!contextInstance.mounted)
|
|
27
|
+
return;
|
|
28
|
+
var startTime = new Date().getTime();
|
|
29
|
+
var lastStep = 1;
|
|
30
|
+
// if another animation is active
|
|
31
|
+
(0, exports.handleCancelAnimation)(contextInstance);
|
|
32
|
+
// new animation
|
|
33
|
+
contextInstance.animation = function () {
|
|
34
|
+
if (!contextInstance.mounted) {
|
|
35
|
+
return handleCancelAnimationFrame(contextInstance.animation);
|
|
36
|
+
}
|
|
37
|
+
var frameTime = new Date().getTime() - startTime;
|
|
38
|
+
var animationProgress = frameTime / animationTime;
|
|
39
|
+
var animationType = animations_constants_1.animations[animationName];
|
|
40
|
+
var step = animationType(animationProgress);
|
|
41
|
+
if (frameTime >= animationTime) {
|
|
42
|
+
callback(lastStep);
|
|
43
|
+
contextInstance.animation = null;
|
|
44
|
+
}
|
|
45
|
+
else if (contextInstance.animation) {
|
|
46
|
+
callback(step);
|
|
47
|
+
requestAnimationFrame(contextInstance.animation);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
requestAnimationFrame(contextInstance.animation);
|
|
51
|
+
}
|
|
52
|
+
function isValidTargetState(targetState) {
|
|
53
|
+
var scale = targetState.scale, positionX = targetState.positionX, positionY = targetState.positionY;
|
|
54
|
+
return !(Number.isNaN(scale) || Number.isNaN(positionX) || Number.isNaN(positionY));
|
|
55
|
+
}
|
|
56
|
+
function animate(contextInstance, targetState, animationTime, animationName) {
|
|
57
|
+
var isValid = isValidTargetState(targetState);
|
|
58
|
+
if (!contextInstance.mounted || !isValid)
|
|
59
|
+
return;
|
|
60
|
+
var setTransformState = contextInstance.setTransformState;
|
|
61
|
+
var _a = contextInstance.transformState, scale = _a.scale, positionX = _a.positionX, positionY = _a.positionY;
|
|
62
|
+
var scaleDiff = targetState.scale - scale;
|
|
63
|
+
var positionXDiff = targetState.positionX - positionX;
|
|
64
|
+
var positionYDiff = targetState.positionY - positionY;
|
|
65
|
+
if (animationTime === 0) {
|
|
66
|
+
setTransformState(targetState.scale, targetState.positionX, targetState.positionY);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// animation start timestamp
|
|
70
|
+
handleSetupAnimation(contextInstance, animationName, animationTime, function (step) {
|
|
71
|
+
var newScale = scale + scaleDiff * step;
|
|
72
|
+
var newPositionX = positionX + positionXDiff * step;
|
|
73
|
+
var newPositionY = positionY + positionYDiff * step;
|
|
74
|
+
setTransformState(newScale, newPositionX, newPositionY);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
78
|
//# sourceMappingURL=animations.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"animations.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.util.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/bounds.util.ts
|
|
3
|
-
*/
|
|
4
|
-
import { BoundsType, PositionType, ReactZoomPanPinchContext } from 'react-zoom-pan-pinch';
|
|
5
|
-
export declare function getComponentsSizes(wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement, newScale: number): any;
|
|
6
|
-
export declare const getBounds: (wrapperWidth: number, newContentWidth: number, diffWidth: number, wrapperHeight: number, newContentHeight: number, diffHeight: number, centerZoomedOut: boolean) => BoundsType;
|
|
7
|
-
export declare const calculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
8
|
-
/**
|
|
9
|
-
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
10
|
-
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
11
|
-
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
12
|
-
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
13
|
-
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
14
|
-
*/
|
|
15
|
-
export declare const boundLimiter: (value: number, minBound: number, maxBound: number, isActive: boolean) => number;
|
|
16
|
-
export declare const handleCalculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
17
|
-
export declare function getMouseBoundedPosition(positionX: number, positionY: number, bounds: BoundsType, limitToBounds: boolean, paddingValueX: number, paddingValueY: number, wrapperComponent: HTMLDivElement | null): PositionType;
|
|
1
|
+
/**
|
|
2
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/bounds.util.ts
|
|
3
|
+
*/
|
|
4
|
+
import { BoundsType, PositionType, ReactZoomPanPinchContext } from 'react-zoom-pan-pinch';
|
|
5
|
+
export declare function getComponentsSizes(wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement, newScale: number): any;
|
|
6
|
+
export declare const getBounds: (wrapperWidth: number, newContentWidth: number, diffWidth: number, wrapperHeight: number, newContentHeight: number, diffHeight: number, centerZoomedOut: boolean) => BoundsType;
|
|
7
|
+
export declare const calculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
8
|
+
/**
|
|
9
|
+
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
10
|
+
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
11
|
+
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
12
|
+
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
13
|
+
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
14
|
+
*/
|
|
15
|
+
export declare const boundLimiter: (value: number, minBound: number, maxBound: number, isActive: boolean) => number;
|
|
16
|
+
export declare const handleCalculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
17
|
+
export declare function getMouseBoundedPosition(positionX: number, positionY: number, bounds: BoundsType, limitToBounds: boolean, paddingValueX: number, paddingValueY: number, wrapperComponent: HTMLDivElement | null): PositionType;
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
: 0
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
: 0
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleCalculateBounds = exports.boundLimiter = exports.calculateBounds = exports.getBounds = void 0;
|
|
4
|
+
exports.getComponentsSizes = getComponentsSizes;
|
|
5
|
+
exports.getMouseBoundedPosition = getMouseBoundedPosition;
|
|
6
|
+
var calculation_util_1 = require("./calculation.util");
|
|
7
|
+
function getComponentsSizes(wrapperComponent, contentComponent, newScale) {
|
|
8
|
+
var wrapperWidth = wrapperComponent.offsetWidth;
|
|
9
|
+
var wrapperHeight = wrapperComponent.offsetHeight;
|
|
10
|
+
var contentWidth = contentComponent.offsetWidth;
|
|
11
|
+
var contentHeight = contentComponent.offsetHeight;
|
|
12
|
+
var newContentWidth = contentWidth * newScale;
|
|
13
|
+
var newContentHeight = contentHeight * newScale;
|
|
14
|
+
var newDiffWidth = wrapperWidth - newContentWidth;
|
|
15
|
+
var newDiffHeight = wrapperHeight - newContentHeight;
|
|
16
|
+
return {
|
|
17
|
+
wrapperWidth: wrapperWidth,
|
|
18
|
+
wrapperHeight: wrapperHeight,
|
|
19
|
+
newContentWidth: newContentWidth,
|
|
20
|
+
newDiffWidth: newDiffWidth,
|
|
21
|
+
newContentHeight: newContentHeight,
|
|
22
|
+
newDiffHeight: newDiffHeight
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var getBounds = function (wrapperWidth, newContentWidth, diffWidth, wrapperHeight, newContentHeight, diffHeight, centerZoomedOut) {
|
|
26
|
+
var scaleWidthFactor = wrapperWidth > newContentWidth
|
|
27
|
+
? diffWidth * (centerZoomedOut ? 1 : 0.5)
|
|
28
|
+
: 0;
|
|
29
|
+
var scaleHeightFactor = wrapperHeight > newContentHeight
|
|
30
|
+
? diffHeight * (centerZoomedOut ? 1 : 0.5)
|
|
31
|
+
: 0;
|
|
32
|
+
var minPositionX = wrapperWidth - newContentWidth - scaleWidthFactor;
|
|
33
|
+
var maxPositionX = scaleWidthFactor;
|
|
34
|
+
var minPositionY = wrapperHeight - newContentHeight - scaleHeightFactor;
|
|
35
|
+
var maxPositionY = scaleHeightFactor;
|
|
36
|
+
return { minPositionX: minPositionX, maxPositionX: maxPositionX, minPositionY: minPositionY, maxPositionY: maxPositionY };
|
|
37
|
+
};
|
|
38
|
+
exports.getBounds = getBounds;
|
|
39
|
+
var calculateBounds = function (contextInstance, newScale) {
|
|
40
|
+
var wrapperComponent = contextInstance.wrapperComponent, contentComponent = contextInstance.contentComponent;
|
|
41
|
+
var centerZoomedOut = contextInstance.setup.centerZoomedOut;
|
|
42
|
+
if (!wrapperComponent || !contentComponent) {
|
|
43
|
+
throw new Error('Components are not mounted');
|
|
44
|
+
}
|
|
45
|
+
var _a = getComponentsSizes(wrapperComponent, contentComponent, newScale), wrapperWidth = _a.wrapperWidth, wrapperHeight = _a.wrapperHeight, newContentWidth = _a.newContentWidth, newDiffWidth = _a.newDiffWidth, newContentHeight = _a.newContentHeight, newDiffHeight = _a.newDiffHeight;
|
|
46
|
+
return (0, exports.getBounds)(wrapperWidth, newContentWidth, newDiffWidth, wrapperHeight, newContentHeight, newDiffHeight, Boolean(centerZoomedOut));
|
|
47
|
+
};
|
|
48
|
+
exports.calculateBounds = calculateBounds;
|
|
49
|
+
/**
|
|
50
|
+
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
51
|
+
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
52
|
+
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
53
|
+
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
54
|
+
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
55
|
+
*/
|
|
56
|
+
var boundLimiter = function (value, minBound, maxBound, isActive) {
|
|
57
|
+
if (!isActive)
|
|
58
|
+
return (0, calculation_util_1.roundNumber)(value, 2);
|
|
59
|
+
if (value < minBound)
|
|
60
|
+
return (0, calculation_util_1.roundNumber)(minBound, 2);
|
|
61
|
+
if (value > maxBound)
|
|
62
|
+
return (0, calculation_util_1.roundNumber)(maxBound, 2);
|
|
63
|
+
return (0, calculation_util_1.roundNumber)(value, 2);
|
|
64
|
+
};
|
|
65
|
+
exports.boundLimiter = boundLimiter;
|
|
66
|
+
var handleCalculateBounds = function (contextInstance, newScale) {
|
|
67
|
+
var bounds = (0, exports.calculateBounds)(contextInstance, newScale);
|
|
68
|
+
// Save bounds
|
|
69
|
+
contextInstance.bounds = bounds;
|
|
70
|
+
return bounds;
|
|
71
|
+
};
|
|
72
|
+
exports.handleCalculateBounds = handleCalculateBounds;
|
|
73
|
+
function getMouseBoundedPosition(positionX, positionY, bounds, limitToBounds, paddingValueX, paddingValueY, wrapperComponent) {
|
|
74
|
+
var minPositionX = bounds.minPositionX, minPositionY = bounds.minPositionY, maxPositionX = bounds.maxPositionX, maxPositionY = bounds.maxPositionY;
|
|
75
|
+
var paddingX = 0;
|
|
76
|
+
var paddingY = 0;
|
|
77
|
+
if (wrapperComponent) {
|
|
78
|
+
paddingX = paddingValueX;
|
|
79
|
+
paddingY = paddingValueY;
|
|
80
|
+
}
|
|
81
|
+
var x = (0, exports.boundLimiter)(positionX, minPositionX - paddingX, maxPositionX + paddingX, limitToBounds);
|
|
82
|
+
var y = (0, exports.boundLimiter)(positionY, minPositionY - paddingY, maxPositionY + paddingY, limitToBounds);
|
|
83
|
+
return { x: x, y: y };
|
|
84
|
+
}
|
|
85
85
|
//# sourceMappingURL=bounds.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/bounds.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"bounds.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/bounds.util.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/calculations.utils.ts
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Rounds number to given decimal
|
|
6
|
-
* eg. roundNumber(2.34343, 1) => 2.3
|
|
7
|
-
*/
|
|
8
|
-
export declare const roundNumber: (num: number, decimal: number) => number;
|
|
9
|
-
/**
|
|
10
|
-
* Checks if value is number, if not it returns default value
|
|
11
|
-
* 1# eg. checkIsNumber(2, 30) => 2
|
|
12
|
-
* 2# eg. checkIsNumber(null, 30) => 30
|
|
13
|
-
*/
|
|
14
|
-
export declare const checkIsNumber: (num: any, defaultValue: number) => number;
|
|
1
|
+
/**
|
|
2
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/calculations.utils.ts
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Rounds number to given decimal
|
|
6
|
+
* eg. roundNumber(2.34343, 1) => 2.3
|
|
7
|
+
*/
|
|
8
|
+
export declare const roundNumber: (num: number, decimal: number) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if value is number, if not it returns default value
|
|
11
|
+
* 1# eg. checkIsNumber(2, 30) => 2
|
|
12
|
+
* 2# eg. checkIsNumber(null, 30) => 30
|
|
13
|
+
*/
|
|
14
|
+
export declare const checkIsNumber: (num: any, defaultValue: number) => number;
|