@gamepark/react-game 6.38.7 → 7.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/Avatar.d.ts +6 -6
- package/dist/components/Avatar/Avatar.js +40 -63
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/ChatSpeechBubble.d.ts +8 -8
- package/dist/components/Avatar/ChatSpeechBubble.js +38 -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 +109 -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 +3 -19
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/GamePoints/GamePointIcon.d.ts +2 -2
- package/dist/components/GamePoints/GamePointIcon.js +8 -25
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -1
- package/dist/components/GamePoints/GamePoints.d.ts +8 -8
- package/dist/components/GamePoints/GamePoints.js +30 -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 +2 -18
- package/dist/components/GamePoints/index.js.map +1 -1
- package/dist/components/GameProvider/GameContext.d.ts +28 -28
- package/dist/components/GameProvider/GameContext.js +12 -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 +106 -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 +2 -18
- package/dist/components/GameProvider/index.js.map +1 -1
- package/dist/components/Header/Header.d.ts +7 -7
- package/dist/components/Header/Header.js +35 -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 +23 -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 +64 -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 +3 -19
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/ImagesLoader/ImagesLoader.d.ts +5 -5
- package/dist/components/ImagesLoader/ImagesLoader.js +21 -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 +1 -17
- package/dist/components/ImagesLoader/index.js.map +1 -1
- package/dist/components/JournalTabs/Chat/Chat.d.ts +8 -8
- package/dist/components/JournalTabs/Chat/Chat.js +10 -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 +13 -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 +21 -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 +74 -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 +52 -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 +13 -64
- package/dist/components/JournalTabs/Chat/LocalChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/RemoteChat.d.ts +7 -7
- package/dist/components/JournalTabs/Chat/RemoteChat.js +17 -45
- package/dist/components/JournalTabs/Chat/RemoteChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.d.ts +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +38 -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 +5 -21
- package/dist/components/JournalTabs/Chat/index.js.map +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.d.ts +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.js +18 -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 +67 -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 +39 -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 +14 -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 +2 -18
- package/dist/components/JournalTabs/History/index.js.map +1 -1
- package/dist/components/JournalTabs/JournalTabs.d.ts +6 -6
- package/dist/components/JournalTabs/JournalTabs.js +136 -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 +1 -17
- package/dist/components/JournalTabs/index.js.map +1 -1
- package/dist/components/Letterbox/Letterbox.d.ts +8 -8
- package/dist/components/Letterbox/Letterbox.js +30 -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 +1 -17
- package/dist/components/Letterbox/index.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.d.ts +12 -12
- package/dist/components/LoadingScreen/LoadingScreen.js +96 -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 +1 -17
- package/dist/components/LoadingScreen/index.js.map +1 -1
- package/dist/components/Log/InternalLiveLogContainer.d.ts +6 -6
- package/dist/components/Log/InternalLiveLogContainer.js +107 -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 +18 -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 +10 -25
- package/dist/components/Log/LiveLogContainer.js.map +1 -1
- package/dist/components/Log/LogDescription.d.ts +24 -24
- package/dist/components/Log/LogDescription.js +1 -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 +3 -19
- package/dist/components/Log/index.js.map +1 -1
- package/dist/components/Picture/Picture.d.ts +8 -8
- package/dist/components/Picture/Picture.js +8 -34
- package/dist/components/Picture/Picture.js.map +1 -1
- package/dist/components/Picture/index.d.ts +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 +15 -15
- package/dist/components/PlayerPanel/Counters.js +93 -53
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.d.ts +8 -8
- package/dist/components/PlayerPanel/PlayerPanel.js +85 -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 +158 -93
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/index.d.ts +3 -3
- package/dist/components/PlayerPanel/index.js +3 -19
- package/dist/components/PlayerPanel/index.js.map +1 -1
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +13 -13
- package/dist/components/PlayerTimer/PlayerTimer.js +44 -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 +1 -17
- package/dist/components/PlayerTimer/index.js.map +1 -1
- package/dist/components/Scoring/ScoringDescription.d.ts +8 -8
- package/dist/components/Scoring/ScoringDescription.js +1 -2
- package/dist/components/Scoring/index.d.ts +1 -1
- package/dist/components/Scoring/index.js +1 -17
- package/dist/components/Scoring/index.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.d.ts +14 -14
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +114 -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 +1 -17
- package/dist/components/buttons/PlayMoveButton/index.js.map +1 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.d.ts +3 -3
- package/dist/components/buttons/ThemeButton/ThemeButton.js +6 -21
- package/dist/components/buttons/ThemeButton/ThemeButton.js.map +1 -1
- package/dist/components/buttons/ThemeButton/index.d.ts +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 +7 -7
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.js +30 -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 +1 -17
- package/dist/components/buttons/UndoMovesButton/index.js.map +1 -1
- package/dist/components/buttons/index.d.ts +3 -3
- package/dist/components/buttons/index.js +3 -19
- package/dist/components/buttons/index.js.map +1 -1
- package/dist/components/dialogs/Dialog.d.ts +11 -11
- package/dist/components/dialogs/Dialog.js +74 -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 +50 -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 +68 -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 +20 -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 +134 -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 +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 +35 -42
- package/dist/components/dialogs/ResultDialog/useScoringTable.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.d.ts +5 -5
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +36 -46
- 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 +25 -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 +143 -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 +25 -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 +38 -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 +2 -18
- package/dist/components/dialogs/RulesDialog/index.js.map +1 -1
- package/dist/components/dialogs/index.d.ts +4 -4
- package/dist/components/dialogs/index.js +4 -20
- package/dist/components/dialogs/index.js.map +1 -1
- package/dist/components/index.d.ts +17 -17
- package/dist/components/index.js +17 -33
- package/dist/components/index.js.map +1 -1
- package/dist/components/material/ComponentDescription.d.ts +52 -52
- package/dist/components/material/ComponentDescription.js +54 -40
- package/dist/components/material/ComponentDescription.js.map +1 -1
- package/dist/components/material/Dices/CubicDiceDescription.d.ts +21 -21
- package/dist/components/material/Dices/CubicDiceDescription.js +85 -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 +1 -17
- package/dist/components/material/Dices/index.js.map +1 -1
- package/dist/components/material/DraggableMaterial.d.ts +9 -9
- package/dist/components/material/DraggableMaterial.js +179 -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 +3 -27
- package/dist/components/material/FlatMaterial/BoardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.d.ts +6 -6
- package/dist/components/material/FlatMaterial/CardDescription.js +6 -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 +114 -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 +11 -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 +22 -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 +12 -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 +6 -22
- package/dist/components/material/FlatMaterial/index.js.map +1 -1
- package/dist/components/material/GameTable/DropPreview.d.ts +2 -2
- package/dist/components/material/GameTable/DropPreview.js +40 -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 +29 -88
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.d.ts +7 -7
- package/dist/components/material/GameTable/GameMaterialDisplay.js +28 -33
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.d.ts +20 -20
- package/dist/components/material/GameTable/GameTable.js +95 -142
- 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 +61 -70
- 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 +114 -182
- 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 +33 -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 +15 -32
- package/dist/components/material/GameTable/StaticLocationsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/focus/FocusProvider.d.ts +12 -10
- package/dist/components/material/GameTable/focus/FocusProvider.js +59 -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 +1 -2
- package/dist/components/material/GameTable/focus/index.d.ts +2 -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.d.ts +3 -3
- 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.d.ts +5 -5
- package/dist/components/material/ImageLoader/MaterialImageLoader.js +21 -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 +1 -17
- package/dist/components/material/ImageLoader/index.js.map +1 -1
- package/dist/components/material/ItemMenuButton.d.ts +14 -14
- package/dist/components/material/ItemMenuButton.js +46 -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 +18 -68
- package/dist/components/material/ItemMenuWrapper.js.map +1 -1
- package/dist/components/material/MaterialComponent.d.ts +17 -17
- package/dist/components/material/MaterialComponent.js +26 -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 +8 -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 +253 -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 +30 -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 +37 -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 +66 -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 +54 -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 +1 -17
- package/dist/components/material/Wheel/index.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.d.ts +12 -12
- package/dist/components/material/Writing/WritingDescription.js +59 -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 +1 -17
- package/dist/components/material/Writing/index.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.d.ts +20 -15
- package/dist/components/material/animations/CreateItemAnimations.js +56 -80
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.d.ts +19 -14
- package/dist/components/material/animations/DeleteItemAnimations.js +52 -71
- 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 +38 -61
- package/dist/components/material/animations/DeleteItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +16 -11
- package/dist/components/material/animations/ItemAnimations.js +23 -57
- package/dist/components/material/animations/ItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialAnimations.d.ts +19 -19
- package/dist/components/material/animations/MaterialAnimations.js +32 -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 +74 -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 +83 -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 +40 -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 +73 -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 +11 -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 +12 -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 +8 -26
- package/dist/components/material/animations/index.js.map +1 -1
- package/dist/components/material/animations/rotations.utils.d.ts +3 -3
- package/dist/components/material/animations/rotations.utils.js +93 -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 +7 -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 +15 -31
- package/dist/components/material/index.js.map +1 -1
- package/dist/components/material/locations/DropAreaDescription.d.ts +12 -12
- package/dist/components/material/locations/DropAreaDescription.js +23 -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 +52 -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 +70 -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 +83 -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 +30 -84
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/LocationsMask.d.ts +6 -6
- package/dist/components/material/locations/LocationsMask.js +18 -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 +58 -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 +5 -21
- package/dist/components/material/locations/index.js.map +1 -1
- package/dist/components/material/sound/AudioLoader.d.ts +20 -20
- package/dist/components/material/sound/AudioLoader.js +70 -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 +88 -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 +13 -10
- package/dist/components/material/sound/MaterialSoundConfig.js.map +1 -1
- package/dist/components/material/sound/MaterialSoundLoader.d.ts +8 -8
- package/dist/components/material/sound/MaterialSoundLoader.js +23 -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 +2 -18
- package/dist/components/material/sound/index.js.map +1 -1
- package/dist/components/material/sound/sound.utils.d.ts +2 -2
- package/dist/components/material/sound/sound.utils.js +10 -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 +10 -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 +18 -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 +1 -17
- package/dist/components/material/utils/index.js.map +1 -1
- package/dist/components/material/utils/isDroppedItem.d.ts +4 -4
- package/dist/components/material/utils/isDroppedItem.js +10 -27
- package/dist/components/material/utils/isDroppedItem.js.map +1 -1
- package/dist/components/material/utils/isPlacedOnItem.d.ts +3 -3
- package/dist/components/material/utils/isPlacedOnItem.js +9 -13
- package/dist/components/material/utils/isPlacedOnItem.js.map +1 -1
- package/dist/components/material/utils/isRotationMove.d.ts +3 -3
- package/dist/components/material/utils/isRotationMove.js +6 -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 +8 -14
- package/dist/components/material/utils/useIsAnimatingPlayerAction.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.d.ts +2 -2
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +32 -34
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.d.ts +4 -10
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +55 -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 +27 -52
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/index.d.ts +3 -3
- 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.d.ts +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +13 -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 +38 -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 +31 -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 +3 -19
- package/dist/components/menus/Fullscreen/index.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.d.ts +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +67 -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 +1 -17
- package/dist/components/menus/GiveUpButton/index.js.map +1 -1
- package/dist/components/menus/Menu/LogoIcon.d.ts +2 -2
- 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 +3 -3
- package/dist/components/menus/Menu/Menu.js +130 -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 +29 -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 +3 -32
- package/dist/components/menus/Menu/NavButton.js.map +1 -1
- package/dist/components/menus/Menu/index.d.ts +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.d.ts +1 -1
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +30 -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 +1 -17
- package/dist/components/menus/PlayerQuit/index.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.d.ts +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +19 -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 +1 -17
- package/dist/components/menus/RestartTutorialButton/index.js.map +1 -1
- package/dist/components/menus/Result/Medal.d.ts +4 -4
- package/dist/components/menus/Result/Medal.js +14 -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 +2 -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 +2 -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 +2 -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 +10 -25
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.d.ts +2 -2
- package/dist/components/menus/Result/ResultPopButton.js +48 -37
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -1
- package/dist/components/menus/Result/index.d.ts +3 -3
- 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.d.ts +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +13 -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 +1 -17
- package/dist/components/menus/SoundButton/index.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.d.ts +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +80 -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 +1 -17
- package/dist/components/menus/TimeStatsButton/index.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.d.ts +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +13 -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 +26 -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 +2 -18
- package/dist/components/menus/UndoButton/index.js.map +1 -1
- package/dist/components/menus/index.d.ts +6 -6
- 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.d.ts +43 -43
- package/dist/components/tutorial/MaterialTutorial.js +32 -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 +97 -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 +133 -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 +1 -17
- package/dist/components/tutorial/index.js.map +1 -1
- package/dist/css/GameTheme.d.ts +23 -23
- package/dist/css/GameTheme.js +18 -21
- package/dist/css/GameTheme.js.map +1 -1
- package/dist/css/addStylesheetUrl.d.ts +1 -1
- package/dist/css/addStylesheetUrl.js +6 -10
- 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.d.ts +10 -10
- 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 +26 -27
- package/dist/hooks/index.js +26 -43
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useActions.d.ts +2 -2
- package/dist/hooks/useActions.js +2 -8
- package/dist/hooks/useActions.js.map +1 -1
- package/dist/hooks/useAnimations.d.ts +4 -4
- package/dist/hooks/useAnimations.js +24 -58
- package/dist/hooks/useAnimations.js.map +1 -1
- package/dist/hooks/useDraggedItem.d.ts +2 -2
- package/dist/hooks/useDraggedItem.js +14 -34
- package/dist/hooks/useDraggedItem.js.map +1 -1
- package/dist/hooks/useFlatHistory.d.ts +13 -13
- package/dist/hooks/useFlatHistory.js +91 -162
- package/dist/hooks/useFlatHistory.js.map +1 -1
- package/dist/hooks/useFullscreen.d.ts +5 -5
- package/dist/hooks/useFullscreen.js +28 -51
- package/dist/hooks/useFullscreen.js.map +1 -1
- package/dist/hooks/useGame.d.ts +1 -1
- package/dist/hooks/useGame.js +4 -8
- package/dist/hooks/useGame.js.map +1 -1
- package/dist/hooks/useGiveUp.d.ts +1 -1
- package/dist/hooks/useGiveUp.js +11 -16
- package/dist/hooks/useGiveUp.js.map +1 -1
- package/dist/hooks/useItemLocations.d.ts +8 -8
- package/dist/hooks/useItemLocations.js +51 -126
- package/dist/hooks/useItemLocations.js.map +1 -1
- package/dist/hooks/useItemLocator.d.ts +2 -2
- package/dist/hooks/useItemLocator.js +4 -9
- package/dist/hooks/useItemLocator.js.map +1 -1
- package/dist/hooks/useKeyDown.d.ts +1 -1
- package/dist/hooks/useKeyDown.js +12 -16
- package/dist/hooks/useKeyDown.js.map +1 -1
- package/dist/hooks/useLegalMoves.d.ts +2 -2
- package/dist/hooks/useLegalMoves.js +14 -19
- package/dist/hooks/useLegalMoves.js.map +1 -1
- package/dist/hooks/useLocators.d.ts +1 -1
- package/dist/hooks/useLocators.js +3 -7
- package/dist/hooks/useLocators.js.map +1 -1
- package/dist/hooks/useMaterialContext.d.ts +2 -2
- package/dist/hooks/useMaterialContext.js +12 -17
- package/dist/hooks/useMaterialContext.js.map +1 -1
- package/dist/hooks/useMaterialDescription.d.ts +2 -2
- package/dist/hooks/useMaterialDescription.js +5 -10
- package/dist/hooks/useMaterialDescription.js.map +1 -1
- package/dist/hooks/useNow.d.ts +6 -6
- package/dist/hooks/useNow.js +16 -37
- package/dist/hooks/useNow.js.map +1 -1
- package/dist/hooks/useNumberOfPlayers.d.ts +1 -1
- package/dist/hooks/useNumberOfPlayers.js +2 -6
- package/dist/hooks/useNumberOfPlayers.js.map +1 -1
- package/dist/hooks/useOpponentWithMaxTime.d.ts +5 -5
- package/dist/hooks/useOpponentWithMaxTime.js +38 -60
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -1
- package/dist/hooks/usePlay.d.ts +2 -2
- package/dist/hooks/usePlay.js +7 -23
- package/dist/hooks/usePlay.js.map +1 -1
- package/dist/hooks/usePlayerId.d.ts +2 -2
- package/dist/hooks/usePlayerId.js +4 -10
- package/dist/hooks/usePlayerId.js.map +1 -1
- package/dist/hooks/usePlayerName.d.ts +1 -1
- package/dist/hooks/usePlayerName.js +20 -26
- package/dist/hooks/usePlayerName.js.map +1 -1
- package/dist/hooks/usePlayerTime.d.ts +1 -1
- package/dist/hooks/usePlayerTime.js +29 -50
- package/dist/hooks/usePlayerTime.js.map +1 -1
- package/dist/hooks/usePlayers.d.ts +8 -8
- package/dist/hooks/usePlayers.js +61 -95
- package/dist/hooks/usePlayers.js.map +1 -1
- package/dist/hooks/useRankedPlayers.d.ts +5 -5
- package/dist/hooks/useRankedPlayers.js +32 -37
- package/dist/hooks/useRankedPlayers.js.map +1 -1
- package/dist/hooks/useResultText.d.ts +1 -1
- package/dist/hooks/useResultText.js +67 -71
- package/dist/hooks/useResultText.js.map +1 -1
- package/dist/hooks/useRules.d.ts +2 -2
- package/dist/hooks/useRules.js +14 -18
- package/dist/hooks/useRules.js.map +1 -1
- package/dist/hooks/useSound.d.ts +1 -1
- package/dist/hooks/useSound.js +15 -35
- package/dist/hooks/useSound.js.map +1 -1
- package/dist/hooks/useStaticLocations.d.ts +2 -2
- package/dist/hooks/useStaticLocations.js +35 -102
- package/dist/hooks/useStaticLocations.js.map +1 -1
- package/dist/hooks/useTutorialStep.d.ts +2 -2
- package/dist/hooks/useTutorialStep.js +10 -14
- package/dist/hooks/useTutorialStep.js.map +1 -1
- package/dist/hooks/useUndo.d.ts +7 -7
- package/dist/hooks/useUndo.js +64 -102
- package/dist/hooks/useUndo.js.map +1 -1
- package/dist/hooks/useWebP.d.ts +1 -1
- package/dist/hooks/useWebP.js +12 -79
- package/dist/hooks/useWebP.js.map +1 -1
- package/dist/hooks/useZoomToElements.d.ts +13 -13
- package/dist/hooks/useZoomToElements.js +59 -92
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -23
- package/dist/index.js.map +1 -1
- package/dist/locators/DeckLocator.d.ts +10 -10
- package/dist/locators/DeckLocator.js +12 -34
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.d.ts +57 -57
- package/dist/locators/FlexLocator.js +104 -117
- package/dist/locators/FlexLocator.js.map +1 -1
- package/dist/locators/HandLocator.d.ts +96 -96
- package/dist/locators/HandLocator.js +151 -176
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/HexagonalGridLocator.d.ts +95 -95
- package/dist/locators/HexagonalGridLocator.js +250 -308
- package/dist/locators/HexagonalGridLocator.js.map +1 -1
- package/dist/locators/ListLocator.d.ts +54 -54
- package/dist/locators/ListLocator.js +109 -123
- package/dist/locators/ListLocator.js.map +1 -1
- package/dist/locators/Locator.d.ts +275 -275
- package/dist/locators/Locator.js +375 -421
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +53 -53
- package/dist/locators/PileLocator.js +123 -184
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/locators/index.d.ts +8 -8
- package/dist/locators/index.js +8 -24
- package/dist/locators/index.js.map +1 -1
- package/dist/locators/utils/getRelativePlayerIndex.util.d.ts +2 -2
- package/dist/locators/utils/getRelativePlayerIndex.util.js +8 -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 +1 -17
- package/dist/locators/utils/index.js.map +1 -1
- package/dist/utilities/DeepPartial.d.ts +6 -6
- package/dist/utilities/DeepPartial.js +1 -2
- package/dist/utilities/combineEventListeners.d.ts +7 -7
- package/dist/utilities/combineEventListeners.js +15 -49
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.d.ts +7 -7
- package/dist/utilities/findIfUnique.util.js +18 -22
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/index.d.ts +4 -4
- package/dist/utilities/index.js +4 -20
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/translation.util.d.ts +10 -10
- package/dist/utilities/translation.util.js +27 -37
- package/dist/utilities/translation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.constants.d.ts +16 -16
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +78 -81
- package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.util.d.ts +8 -8
- package/dist/utilities/zoom-pan-pinch/animations.util.js +71 -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 +75 -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 +18 -23
- package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/index.d.ts +9 -9
- package/dist/utilities/zoom-pan-pinch/index.js +9 -25
- package/dist/utilities/zoom-pan-pinch/index.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +4 -4
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +12 -16
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -1
- package/package.json +83 -77
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
+
import { MaterialItem } from '@gamepark/rules-api';
|
|
4
|
+
export declare const ItemDisplay: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
type: number;
|
|
6
|
+
itemId?: any;
|
|
7
|
+
itemIndex?: number;
|
|
8
|
+
highlight?: boolean;
|
|
9
|
+
playDown?: boolean;
|
|
10
|
+
preview?: boolean;
|
|
11
|
+
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
12
|
+
index: number;
|
|
13
|
+
displayIndex: number;
|
|
14
|
+
item: MaterialItem;
|
|
15
|
+
dragTransform?: string;
|
|
16
|
+
animation?: Interpolation<Theme>;
|
|
17
|
+
isFocused?: boolean;
|
|
18
|
+
onShortClick?: () => void;
|
|
19
|
+
onLongClick?: () => void;
|
|
20
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,184 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { isEqual } from 'es-toolkit';
|
|
5
|
+
import { partition } from 'es-toolkit/compat';
|
|
6
|
+
import { forwardRef, useMemo, useRef } from 'react';
|
|
7
|
+
import { mergeRefs } from 'react-merge-refs';
|
|
8
|
+
import { LongPressCallbackReason, LongPressEventType, useLongPress } from 'use-long-press';
|
|
9
|
+
import { pointerCursorCss } from '../../../css';
|
|
10
|
+
import { useDraggedItem, useMaterialContext, usePlay } from '../../../hooks';
|
|
11
|
+
import { useExpectedDropLocations, useItemLocations } from '../../../hooks/useItemLocations';
|
|
12
|
+
import { combineEventListeners } from '../../../utilities';
|
|
13
|
+
import { LocationsMask } from '../locations';
|
|
14
|
+
import { MaterialComponent } from '../MaterialComponent';
|
|
15
|
+
import { isLocationSubset } from '../utils';
|
|
16
|
+
import { useFocusContext } from './focus';
|
|
17
|
+
export const ItemDisplay = forwardRef(({ type, index, displayIndex, item, dragTransform, animation, isFocused, onShortClick, onLongClick, highlight, playDown, ...props }, ref) => {
|
|
18
|
+
const context = useMaterialContext();
|
|
19
|
+
const { focus, focusRef } = useFocusContext();
|
|
20
|
+
const itemContext = useMemo(() => ({ ...context, type, index, displayIndex, dragTransform }), [context, type, index, displayIndex, dragTransform]);
|
|
21
|
+
const locations = useItemLocations(item, itemContext);
|
|
22
|
+
const [focusedLocations, otherLocations] = useMemo(() => partition(locations, l => l.focusRef), [locations]);
|
|
23
|
+
const description = context.material[type];
|
|
24
|
+
const itemTransform = useMemo(() => description.getItemTransform(item, itemContext), [description, item, itemContext]);
|
|
25
|
+
const transformStyle = (dragTransform ? [dragTransform, ...itemTransform] : itemTransform).join(' ');
|
|
26
|
+
const hoverTransform = useMemo(() => description.getHoverTransform(item, itemContext).join(' '), [description, item, itemContext]);
|
|
27
|
+
const play = usePlay();
|
|
28
|
+
const displayHelpMove = description.displayHelp(item, itemContext);
|
|
29
|
+
const displayHelp = displayHelpMove ? () => play(displayHelpMove, { transient: true }) : undefined;
|
|
30
|
+
onLongClick = onLongClick ?? (onShortClick ? displayHelp : undefined);
|
|
31
|
+
onShortClick = onShortClick ?? displayHelp;
|
|
32
|
+
const lastShortClick = useRef(new Date().getTime());
|
|
33
|
+
const listeners = useLongPress(() => onLongClick && onLongClick(), {
|
|
34
|
+
detect: LongPressEventType.Pointer,
|
|
35
|
+
cancelOnMovement: 5,
|
|
36
|
+
threshold: 600,
|
|
37
|
+
onCancel: (_, { reason }) => {
|
|
38
|
+
if (reason === LongPressCallbackReason.CancelledByRelease) {
|
|
39
|
+
const time = new Date().getTime();
|
|
40
|
+
if (time - lastShortClick.current < 300)
|
|
41
|
+
return;
|
|
42
|
+
lastShortClick.current = time;
|
|
43
|
+
if (onShortClick) {
|
|
44
|
+
setTimeout(onShortClick);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
filterEvents: event => !event.button // Ignore clicks on mouse buttons > 0
|
|
49
|
+
})();
|
|
50
|
+
const canHaveChildren = useMemo(() => Object.values(context.locators).some(locator => locator?.parentItemType === type), [context, type]);
|
|
51
|
+
return _jsx(_Fragment, { children: _jsx("div", { css: [
|
|
52
|
+
itemCss, animation,
|
|
53
|
+
hoverTransform && hoverCss(itemTransform.join(' '), description.getSize(item.id), hoverTransform, !!animation || !!dragTransform),
|
|
54
|
+
(onShortClick || onLongClick) && pointerCursorCss
|
|
55
|
+
], ...props, ...combineEventListeners(listeners, props), children: _jsxs(MaterialComponent, { ref: isFocused ? mergeRefs([ref, focusRef]) : ref, itemIndex: index, type: type, itemId: item.id, highlight: highlight, playDown: playDown ?? (focus?.highlight && !isFocused && !focusedLocations.length), style: { transform: transformStyle }, css: description.getItemExtraCss(item, itemContext), children: [canHaveChildren ? _jsx(ItemDropLocations, { locations: otherLocations, item: item, type: type }) : _jsx(ItemLocations, { locations: otherLocations }), focusedLocations.length > 0 && _jsx(LocationsMask, { locations: focusedLocations.map(l => l.location), borderRadius: description.getBorderRadius(item.id) }), _jsx(ItemLocations, { locations: focusedLocations })] }) }) });
|
|
56
|
+
});
|
|
57
|
+
const itemCss = css `
|
|
58
|
+
> * {
|
|
59
|
+
position: absolute;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
const hoverCss = (itemTransform, itemSize, hoverTransform, disable) => css `
|
|
63
|
+
@media (hover) {
|
|
64
|
+
&:hover > * > * {
|
|
65
|
+
transition: transform 50ms ease-in-out;
|
|
66
|
+
transform: ${disable ? '' : hoverTransform};
|
|
34
67
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var utils_1 = require("../utils");
|
|
84
|
-
var focus_1 = require("./focus");
|
|
85
|
-
exports.ItemDisplay = (0, react_2.forwardRef)(function (_a, ref) {
|
|
86
|
-
var type = _a.type, index = _a.index, displayIndex = _a.displayIndex, item = _a.item, dragTransform = _a.dragTransform, animation = _a.animation, isFocused = _a.isFocused, onShortClick = _a.onShortClick, onLongClick = _a.onLongClick, highlight = _a.highlight, playDown = _a.playDown, props = __rest(_a, ["type", "index", "displayIndex", "item", "dragTransform", "animation", "isFocused", "onShortClick", "onLongClick", "highlight", "playDown"]);
|
|
87
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
88
|
-
var _b = (0, focus_1.useFocusContext)(), focus = _b.focus, focusRef = _b.focusRef;
|
|
89
|
-
var itemContext = (0, react_2.useMemo)(function () { return (__assign(__assign({}, context), { type: type, index: index, displayIndex: displayIndex, dragTransform: dragTransform })); }, [context, type, index, displayIndex, dragTransform]);
|
|
90
|
-
var locations = (0, useItemLocations_1.useItemLocations)(item, itemContext);
|
|
91
|
-
var _c = __read((0, react_2.useMemo)(function () { return (0, partition_1.default)(locations, function (l) { return l.focusRef; }); }, [locations]), 2), focusedLocations = _c[0], otherLocations = _c[1];
|
|
92
|
-
var description = context.material[type];
|
|
93
|
-
var itemTransform = (0, react_2.useMemo)(function () { return description.getItemTransform(item, itemContext); }, [description, item, itemContext]);
|
|
94
|
-
var transformStyle = (dragTransform ? __spreadArray([dragTransform], __read(itemTransform), false) : itemTransform).join(' ');
|
|
95
|
-
var hoverTransform = (0, react_2.useMemo)(function () { return description.getHoverTransform(item, itemContext).join(' '); }, [description, item, itemContext]);
|
|
96
|
-
var play = (0, hooks_1.usePlay)();
|
|
97
|
-
var displayHelpMove = description.displayHelp(item, itemContext);
|
|
98
|
-
var displayHelp = displayHelpMove ? function () { return play(displayHelpMove, { transient: true }); } : undefined;
|
|
99
|
-
onLongClick = onLongClick !== null && onLongClick !== void 0 ? onLongClick : (onShortClick ? displayHelp : undefined);
|
|
100
|
-
onShortClick = onShortClick !== null && onShortClick !== void 0 ? onShortClick : displayHelp;
|
|
101
|
-
var lastShortClick = (0, react_2.useRef)(new Date().getTime());
|
|
102
|
-
var listeners = (0, use_long_press_1.useLongPress)(function () { return onLongClick && onLongClick(); }, {
|
|
103
|
-
detect: use_long_press_1.LongPressEventType.Pointer,
|
|
104
|
-
cancelOnMovement: 5,
|
|
105
|
-
threshold: 600,
|
|
106
|
-
onCancel: function (_, _a) {
|
|
107
|
-
var reason = _a.reason;
|
|
108
|
-
if (reason === use_long_press_1.LongPressCallbackReason.CancelledByRelease) {
|
|
109
|
-
var time = new Date().getTime();
|
|
110
|
-
if (time - lastShortClick.current < 300)
|
|
111
|
-
return;
|
|
112
|
-
lastShortClick.current = time;
|
|
113
|
-
if (onShortClick) {
|
|
114
|
-
setTimeout(onShortClick);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
filterEvents: function (event) { return !event.button; } // Ignore clicks on mouse buttons > 0
|
|
119
|
-
})();
|
|
120
|
-
var canHaveChildren = (0, react_2.useMemo)(function () { return Object.values(context.locators).some(function (locator) { return (locator === null || locator === void 0 ? void 0 : locator.parentItemType) === type; }); }, [context, type]);
|
|
121
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", __assign({ css: [
|
|
122
|
-
itemCss, animation,
|
|
123
|
-
hoverTransform && hoverCss(itemTransform.join(' '), description.getSize(item.id), hoverTransform, !!animation || !!dragTransform),
|
|
124
|
-
(onShortClick || onLongClick) && css_1.pointerCursorCss
|
|
125
|
-
] }, props, (0, utilities_1.combineEventListeners)(listeners, props), { children: (0, jsx_runtime_1.jsxs)(MaterialComponent_1.MaterialComponent, __assign({ ref: isFocused ? (0, react_merge_refs_1.mergeRefs)([ref, focusRef]) : ref, itemIndex: index, type: type, itemId: item.id, highlight: highlight, playDown: playDown !== null && playDown !== void 0 ? playDown : ((focus === null || focus === void 0 ? void 0 : focus.highlight) && !isFocused && !focusedLocations.length), style: { transform: transformStyle }, css: description.getItemExtraCss(item, itemContext) }, { children: [canHaveChildren ? (0, jsx_runtime_1.jsx)(ItemDropLocations, { locations: otherLocations, item: item, type: type }) : (0, jsx_runtime_1.jsx)(ItemLocations, { locations: otherLocations }), focusedLocations.length > 0 && (0, jsx_runtime_1.jsx)(locations_1.LocationsMask, { locations: focusedLocations.map(function (l) { return l.location; }), borderRadius: description.getBorderRadius(item.id) }), (0, jsx_runtime_1.jsx)(ItemLocations, { locations: focusedLocations })] })) })) });
|
|
126
|
-
});
|
|
127
|
-
var itemCss = (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > * {\n position: absolute;\n }\n"], ["\n > * {\n position: absolute;\n }\n"])));
|
|
128
|
-
var hoverCss = function (itemTransform, itemSize, hoverTransform, disable) { return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (hover) {\n &:hover > * > * {\n transition: transform 50ms ease-in-out;\n transform: ", ";\n }\n }\n\n > * {\n pointer-events: ", ";\n }\n\n &:before {\n content: \" \";\n position: absolute;\n width: ", "em;\n height: ", "em;\n transform: ", ";\n }\n"], ["\n @media (hover) {\n &:hover > * > * {\n transition: transform 50ms ease-in-out;\n transform: ", ";\n }\n }\n\n > * {\n pointer-events: ", ";\n }\n\n &:before {\n content: \" \";\n position: absolute;\n width: ", "em;\n height: ", "em;\n transform: ", ";\n }\n"])), disable ? '' : hoverTransform, disable ? 'auto' : 'none', itemSize.width, itemSize.height, itemTransform); };
|
|
129
|
-
exports.ItemDisplay.displayName = 'ItemDisplay';
|
|
130
|
-
var ItemLocations = function (_a) {
|
|
131
|
-
var locations = _a.locations;
|
|
132
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
133
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: locations.map(function (_a) {
|
|
134
|
-
var _b;
|
|
135
|
-
var location = _a.location, focusRef = _a.focusRef;
|
|
136
|
-
var description = (_b = context.locators[location.type]) === null || _b === void 0 ? void 0 : _b.getLocationDescription(location, context);
|
|
137
|
-
var LocationComponent = description === null || description === void 0 ? void 0 : description.Component;
|
|
138
|
-
if (!LocationComponent)
|
|
139
|
-
return null;
|
|
140
|
-
return (0, jsx_runtime_1.jsx)(LocationComponent, { location: location, description: description, ref: focusRef }, JSON.stringify(location));
|
|
141
|
-
}) });
|
|
142
|
-
};
|
|
143
|
-
var ItemDropLocations = function (_a) {
|
|
144
|
-
var locations = _a.locations, item = _a.item, type = _a.type;
|
|
145
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
146
|
-
var draggedItem = (0, hooks_1.useDraggedItem)();
|
|
147
|
-
var draggedItemContext = __assign(__assign({}, context), draggedItem);
|
|
148
|
-
var expectedDropLocations = (0, useItemLocations_1.useExpectedDropLocations)();
|
|
149
|
-
var allLocations = (0, react_2.useMemo)(function () {
|
|
150
|
-
var e_1, _a;
|
|
151
|
-
var result = __spreadArray([], __read(locations), false);
|
|
152
|
-
var _loop_1 = function (location_1) {
|
|
153
|
-
var locator = context.locators[location_1.type];
|
|
154
|
-
if ((locator === null || locator === void 0 ? void 0 : locator.parentItemType) === type && (0, isEqual_1.default)(locator.getParentItem(location_1, context), item) && !result.some(function (r) { return (0, utils_1.isLocationSubset)(location_1, r.location); })) {
|
|
155
|
-
result.push({ location: location_1 });
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
try {
|
|
159
|
-
for (var expectedDropLocations_1 = __values(expectedDropLocations), expectedDropLocations_1_1 = expectedDropLocations_1.next(); !expectedDropLocations_1_1.done; expectedDropLocations_1_1 = expectedDropLocations_1.next()) {
|
|
160
|
-
var location_1 = expectedDropLocations_1_1.value;
|
|
161
|
-
_loop_1(location_1);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
165
|
-
finally {
|
|
166
|
-
try {
|
|
167
|
-
if (expectedDropLocations_1_1 && !expectedDropLocations_1_1.done && (_a = expectedDropLocations_1.return)) _a.call(expectedDropLocations_1);
|
|
168
|
-
}
|
|
169
|
-
finally { if (e_1) throw e_1.error; }
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
}, [locations, expectedDropLocations]);
|
|
173
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: allLocations.map(function (_a) {
|
|
174
|
-
var _b;
|
|
175
|
-
var location = _a.location, focusRef = _a.focusRef;
|
|
176
|
-
var description = (_b = context.locators[location.type]) === null || _b === void 0 ? void 0 : _b.getLocationDescription(location, draggedItemContext);
|
|
177
|
-
var LocationComponent = description === null || description === void 0 ? void 0 : description.Component;
|
|
178
|
-
if (!LocationComponent)
|
|
179
|
-
return null;
|
|
180
|
-
return (0, jsx_runtime_1.jsx)(LocationComponent, { location: location, description: description, ref: focusRef }, JSON.stringify(location));
|
|
181
|
-
}) });
|
|
182
|
-
};
|
|
183
|
-
var templateObject_1, templateObject_2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
> * {
|
|
71
|
+
pointer-events: ${disable ? 'auto' : 'none'};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:before {
|
|
75
|
+
content: " ";
|
|
76
|
+
position: absolute;
|
|
77
|
+
width: ${itemSize.width}em;
|
|
78
|
+
height: ${itemSize.height}em;
|
|
79
|
+
transform: ${itemTransform};
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
ItemDisplay.displayName = 'ItemDisplay';
|
|
83
|
+
const ItemLocations = ({ locations }) => {
|
|
84
|
+
const context = useMaterialContext();
|
|
85
|
+
return _jsx(_Fragment, { children: locations.map(({ location, focusRef }) => {
|
|
86
|
+
const description = context.locators[location.type]?.getLocationDescription(location, context);
|
|
87
|
+
const LocationComponent = description?.Component;
|
|
88
|
+
if (!LocationComponent)
|
|
89
|
+
return null;
|
|
90
|
+
return _jsx(LocationComponent, { location: location, description: description, ref: focusRef }, JSON.stringify(location));
|
|
91
|
+
}) });
|
|
92
|
+
};
|
|
93
|
+
const ItemDropLocations = ({ locations, item, type }) => {
|
|
94
|
+
const context = useMaterialContext();
|
|
95
|
+
const draggedItem = useDraggedItem();
|
|
96
|
+
const draggedItemContext = { ...context, ...draggedItem };
|
|
97
|
+
const expectedDropLocations = useExpectedDropLocations();
|
|
98
|
+
const allLocations = useMemo(() => {
|
|
99
|
+
const result = [...locations];
|
|
100
|
+
for (const location of expectedDropLocations) {
|
|
101
|
+
const locator = context.locators[location.type];
|
|
102
|
+
if (locator?.parentItemType === type && isEqual(locator.getParentItem(location, context), item) && !result.some(r => isLocationSubset(location, r.location))) {
|
|
103
|
+
result.push({ location });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}, [locations, expectedDropLocations]);
|
|
108
|
+
return _jsx(_Fragment, { children: allLocations.map(({ location, focusRef }) => {
|
|
109
|
+
const description = context.locators[location.type]?.getLocationDescription(location, draggedItemContext);
|
|
110
|
+
const LocationComponent = description?.Component;
|
|
111
|
+
if (!LocationComponent)
|
|
112
|
+
return null;
|
|
113
|
+
return _jsx(LocationComponent, { location: location, description: description, ref: focusRef }, JSON.stringify(location));
|
|
114
|
+
}) });
|
|
115
|
+
};
|
|
184
116
|
//# sourceMappingURL=ItemDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/ItemDisplay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ItemDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/ItemDisplay.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAwB,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAc,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAoB,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAA0B,MAAM,sBAAsB,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAazC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAmC,CACtE,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE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AE,EAAE,EAAE;YAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;YACzG,MAAM,iBAAiB,GAAG,WAAW,EAAE,SAAS,CAAA;YAChD,IAAI,CAAC,iBAAiB;gBAAE,OAAO,IAAI,CAAA;YACnC,OAAO,KAAC,iBAAiB,IAAgC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,IAArF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAgE,CAAA;QACzH,CAAC,CAAC,GACD,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
-
export declare const StaticItemsDisplay: (props: {
|
|
4
|
-
css?: Interpolation<Theme>;
|
|
5
|
-
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
+
export declare const StaticItemsDisplay: (props: {
|
|
4
|
+
css?: Interpolation<Theme>;
|
|
5
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,97 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e) throw e.error; }
|
|
37
|
-
}
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
-
if (ar || !(i in from)) {
|
|
43
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
-
ar[i] = from[i];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.StaticItemsDisplay = void 0;
|
|
54
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
55
|
-
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
56
|
-
var hooks_1 = require("../../../hooks");
|
|
57
|
-
var ItemMenuWrapper_1 = require("../ItemMenuWrapper");
|
|
58
|
-
var focus_1 = require("./focus");
|
|
59
|
-
var ItemDisplay_1 = require("./ItemDisplay");
|
|
60
|
-
var StaticItemsDisplay = function (props) {
|
|
61
|
-
var material = (0, hooks_1.useMaterialContext)().material;
|
|
62
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.entries(material).map(function (_a) {
|
|
63
|
-
var _b = __read(_a, 2), stringType = _b[0], description = _b[1];
|
|
64
|
-
return description && (0, jsx_runtime_1.jsx)(StaticItemsTypeDisplay, __assign({ type: parseInt(stringType), description: description }, props), stringType);
|
|
65
|
-
}) });
|
|
66
|
-
};
|
|
67
|
-
exports.StaticItemsDisplay = StaticItemsDisplay;
|
|
68
|
-
var StaticItemsTypeDisplay = function (_a) {
|
|
69
|
-
var description = _a.description, props = __rest(_a, ["description"]);
|
|
70
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
71
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: description.getStaticItems(context).map(function (item, index) {
|
|
72
|
-
var _a;
|
|
73
|
-
return __spreadArray([], __read(Array((_a = item.quantity) !== null && _a !== void 0 ? _a : 1)), false).map(function (_, displayIndex) {
|
|
74
|
-
return (0, jsx_runtime_1.jsx)(StaticItemDisplay, __assign({ description: description, index: index, displayIndex: displayIndex, item: item }, props), "".concat(index, "_").concat(displayIndex));
|
|
75
|
-
});
|
|
76
|
-
}) });
|
|
77
|
-
};
|
|
78
|
-
var StaticItemDisplay = function (_a) {
|
|
79
|
-
var type = _a.type, description = _a.description, index = _a.index, displayIndex = _a.displayIndex, item = _a.item, props = __rest(_a, ["type", "description", "index", "displayIndex", "item"]);
|
|
80
|
-
var context = (0, hooks_1.useMaterialContext)();
|
|
81
|
-
var focus = (0, focus_1.useFocusContext)().focus;
|
|
82
|
-
var isFocused = focus && getStaticItemsOfType(focus.staticItems, type).some(function (focusedItem) { return (0, isEqual_1.default)(focusedItem, item); });
|
|
83
|
-
var legalMoves = (0, hooks_1.useLegalMoves)();
|
|
84
|
-
var itemContext = __assign(__assign({}, context), { type: type, index: index, displayIndex: displayIndex });
|
|
85
|
-
var menu = description.getItemMenu(item, itemContext, legalMoves);
|
|
86
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ItemDisplay_1.ItemDisplay, __assign({ type: type, index: index, displayIndex: displayIndex, item: item, isFocused: isFocused, highlight: description.highlight(item, itemContext) }, props)), menu && (0, jsx_runtime_1.jsx)(ItemMenuWrapper_1.ItemMenuWrapper, __assign({ item: item, itemContext: itemContext, description: description }, props, { children: menu }))] });
|
|
87
|
-
};
|
|
88
|
-
function getStaticItemsOfType(staticItems, type) {
|
|
89
|
-
var _a;
|
|
90
|
-
if (Array.isArray(staticItems)) {
|
|
91
|
-
return staticItems.filter(function (s) { return s.type === type; }).map(function (s) { return s.item; });
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return (_a = staticItems[type]) !== null && _a !== void 0 ? _a : [];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { isEqual } from 'es-toolkit';
|
|
3
|
+
import { useLegalMoves, useMaterialContext } from '../../../hooks';
|
|
4
|
+
import { ItemMenuWrapper } from '../ItemMenuWrapper';
|
|
5
|
+
import { useFocusContext } from './focus';
|
|
6
|
+
import { ItemDisplay } from './ItemDisplay';
|
|
7
|
+
export const StaticItemsDisplay = (props) => {
|
|
8
|
+
const material = useMaterialContext().material;
|
|
9
|
+
return _jsx(_Fragment, { children: Object.entries(material).map(([stringType, description]) => description && _jsx(StaticItemsTypeDisplay, { type: parseInt(stringType), description: description, ...props }, stringType)) });
|
|
10
|
+
};
|
|
11
|
+
const StaticItemsTypeDisplay = ({ description, ...props }) => {
|
|
12
|
+
const context = useMaterialContext();
|
|
13
|
+
return _jsx(_Fragment, { children: description.getStaticItems(context).map((item, index) => {
|
|
14
|
+
return [...Array(item.quantity ?? 1)].map((_, displayIndex) => _jsx(StaticItemDisplay, { description: description, index: index, displayIndex: displayIndex, item: item, ...props }, `${index}_${displayIndex}`));
|
|
15
|
+
}) });
|
|
16
|
+
};
|
|
17
|
+
const StaticItemDisplay = ({ type, description, index, displayIndex, item, ...props }) => {
|
|
18
|
+
const context = useMaterialContext();
|
|
19
|
+
const { focus } = useFocusContext();
|
|
20
|
+
const isFocused = focus && getStaticItemsOfType(focus.staticItems, type).some(focusedItem => isEqual(focusedItem, item));
|
|
21
|
+
const legalMoves = useLegalMoves();
|
|
22
|
+
const itemContext = { ...context, type, index, displayIndex };
|
|
23
|
+
const menu = description.getItemMenu(item, itemContext, legalMoves);
|
|
24
|
+
return _jsxs(_Fragment, { children: [_jsx(ItemDisplay, { type: type, index: index, displayIndex: displayIndex, item: item, isFocused: isFocused, highlight: description.highlight(item, itemContext), ...props }), menu && _jsx(ItemMenuWrapper, { item: item, itemContext: itemContext, description: description, ...props, children: menu })] });
|
|
25
|
+
};
|
|
26
|
+
function getStaticItemsOfType(staticItems, type) {
|
|
27
|
+
if (Array.isArray(staticItems)) {
|
|
28
|
+
return staticItems.filter(s => s.type === type).map(s => s.item);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return staticItems[type] ?? [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
97
34
|
//# sourceMappingURL=StaticItemsDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticItemsDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/StaticItemsDisplay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StaticItemsDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/StaticItemsDisplay.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,EAAc,eAAe,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAqC,EAAE,EAAE;IAC1E,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC,QAAQ,CAAA;IAC9C,OAAO,4BACJ,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,CAC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AAW,GAAG,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;IAC7D,MAAM,IAAI,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;IACnE,OAAO,8BACL,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAChE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,KACrE,KAAK,GAAG,EACxB,IAAI,IAAI,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,KAAM,KAAK,YAAG,IAAI,GAAmB,IAC5H,CAAA;AACL,CAAC,CAAA;AAED,SAAS,oBAAoB,CAC3B,WAA6E,EAAE,IAAO;IAEtF,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAClE,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
-
export declare const StaticLocationsDisplay: (props: {
|
|
4
|
-
css?: Interpolation<Theme>;
|
|
5
|
-
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
+
export declare const StaticLocationsDisplay: (props: {
|
|
4
|
+
css?: Interpolation<Theme>;
|
|
5
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|