@gamepark/react-game 6.0.0-alpha.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 +8 -0
- package/dist/components/Avatar/Avatar.js +63 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/ChatSpeechBubble.d.ts +8 -0
- package/dist/components/Avatar/ChatSpeechBubble.js +62 -0
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -0
- package/dist/components/Avatar/SpeechBubble.d.ts +15 -0
- package/dist/components/Avatar/SpeechBubble.js +73 -0
- package/dist/components/Avatar/SpeechBubble.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/index.js +20 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Chat/Chat.d.ts +3 -0
- package/dist/components/Chat/Chat.js +81 -0
- package/dist/components/Chat/Chat.js.map +1 -0
- package/dist/components/Chat/ChatMessage.d.ts +7 -0
- package/dist/components/Chat/ChatMessage.js +30 -0
- package/dist/components/Chat/ChatMessage.js.map +1 -0
- package/dist/components/Chat/ChatMessageAuthor.d.ts +3 -0
- package/dist/components/Chat/ChatMessageAuthor.js +35 -0
- package/dist/components/Chat/ChatMessageAuthor.js.map +1 -0
- package/dist/components/Chat/ChatTextInput.d.ts +7 -0
- package/dist/components/Chat/ChatTextInput.js +45 -0
- package/dist/components/Chat/ChatTextInput.js.map +1 -0
- package/dist/components/Chat/SignInToChat.d.ts +1 -0
- package/dist/components/Chat/SignInToChat.js +36 -0
- package/dist/components/Chat/SignInToChat.js.map +1 -0
- package/dist/components/Chat/index.d.ts +5 -0
- package/dist/components/Chat/index.js +22 -0
- package/dist/components/Chat/index.js.map +1 -0
- package/dist/components/GamePoints/GamePointIcon.d.ts +2 -0
- package/dist/components/GamePoints/GamePointIcon.js +26 -0
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -0
- package/dist/components/GamePoints/GamePoints.d.ts +8 -0
- package/dist/components/GamePoints/GamePoints.js +58 -0
- package/dist/components/GamePoints/GamePoints.js.map +1 -0
- package/dist/components/GamePoints/index.d.ts +2 -0
- package/dist/components/GamePoints/index.js +19 -0
- package/dist/components/GamePoints/index.js.map +1 -0
- package/dist/components/GameProvider/GameContext.d.ts +20 -0
- package/dist/components/GameProvider/GameContext.js +20 -0
- package/dist/components/GameProvider/GameContext.js.map +1 -0
- package/dist/components/GameProvider/GameProvider.d.ts +5 -0
- package/dist/components/GameProvider/GameProvider.js +113 -0
- package/dist/components/GameProvider/GameProvider.js.map +1 -0
- package/dist/components/GameProvider/index.d.ts +2 -0
- package/dist/components/GameProvider/index.js +19 -0
- package/dist/components/GameProvider/index.js.map +1 -0
- package/dist/components/Header/Header.d.ts +7 -0
- package/dist/components/Header/Header.js +46 -0
- package/dist/components/Header/Header.js.map +1 -0
- package/dist/components/Header/MaterialHeader.d.ts +9 -0
- package/dist/components/Header/MaterialHeader.js +41 -0
- package/dist/components/Header/MaterialHeader.js.map +1 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Header/index.js +19 -0
- package/dist/components/Header/index.js.map +1 -0
- package/dist/components/ImagesLoader/ImagesLoader.d.ts +6 -0
- package/dist/components/ImagesLoader/ImagesLoader.js +24 -0
- package/dist/components/ImagesLoader/ImagesLoader.js.map +1 -0
- package/dist/components/ImagesLoader/index.d.ts +1 -0
- package/dist/components/ImagesLoader/index.js +18 -0
- package/dist/components/ImagesLoader/index.js.map +1 -0
- package/dist/components/Letterbox/Letterbox.d.ts +8 -0
- package/dist/components/Letterbox/Letterbox.js +43 -0
- package/dist/components/Letterbox/Letterbox.js.map +1 -0
- package/dist/components/Letterbox/index.d.ts +1 -0
- package/dist/components/Letterbox/index.js +18 -0
- package/dist/components/Letterbox/index.js.map +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.d.ts +10 -0
- package/dist/components/LoadingScreen/LoadingScreen.js +76 -0
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -0
- package/dist/components/LoadingScreen/index.d.ts +1 -0
- package/dist/components/LoadingScreen/index.js +18 -0
- package/dist/components/LoadingScreen/index.js.map +1 -0
- package/dist/components/Picture/Picture.d.ts +8 -0
- package/dist/components/Picture/Picture.js +34 -0
- package/dist/components/Picture/Picture.js.map +1 -0
- package/dist/components/Picture/index.d.ts +1 -0
- package/dist/components/Picture/index.js +18 -0
- package/dist/components/Picture/index.js.map +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.d.ts +7 -0
- package/dist/components/PlayerPanel/PlayerPanel.js +57 -0
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -0
- package/dist/components/PlayerPanel/index.d.ts +1 -0
- package/dist/components/PlayerPanel/index.js +18 -0
- package/dist/components/PlayerPanel/index.js.map +1 -0
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +8 -0
- package/dist/components/PlayerTimer/PlayerTimer.js +69 -0
- package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -0
- package/dist/components/PlayerTimer/index.d.ts +1 -0
- package/dist/components/PlayerTimer/index.js +18 -0
- package/dist/components/PlayerTimer/index.js.map +1 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.d.ts +13 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +66 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -0
- package/dist/components/buttons/PlayMoveButton/index.d.ts +1 -0
- package/dist/components/buttons/PlayMoveButton/index.js +18 -0
- package/dist/components/buttons/PlayMoveButton/index.js.map +1 -0
- package/dist/components/buttons/ThemeButton/ThemeButton.d.ts +3 -0
- package/dist/components/buttons/ThemeButton/ThemeButton.js +22 -0
- package/dist/components/buttons/ThemeButton/ThemeButton.js.map +1 -0
- package/dist/components/buttons/ThemeButton/index.d.ts +1 -0
- package/dist/components/buttons/ThemeButton/index.js +18 -0
- package/dist/components/buttons/ThemeButton/index.js.map +1 -0
- package/dist/components/buttons/index.d.ts +2 -0
- package/dist/components/buttons/index.js +19 -0
- package/dist/components/buttons/index.js.map +1 -0
- package/dist/components/dialogs/Dialog.d.ts +12 -0
- package/dist/components/dialogs/Dialog.js +63 -0
- package/dist/components/dialogs/Dialog.js.map +1 -0
- package/dist/components/dialogs/FailuresDialog.d.ts +2 -0
- package/dist/components/dialogs/FailuresDialog.js +69 -0
- package/dist/components/dialogs/FailuresDialog.js.map +1 -0
- package/dist/components/dialogs/ResultDialog/RematchDisplay.d.ts +6 -0
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +58 -0
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -0
- package/dist/components/dialogs/ResultDialog/RematchSection.d.ts +5 -0
- package/dist/components/dialogs/ResultDialog/RematchSection.js +42 -0
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -0
- package/dist/components/dialogs/ResultDialog/ResultDialog.d.ts +7 -0
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +107 -0
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -0
- package/dist/components/dialogs/ResultDialog/index.d.ts +1 -0
- package/dist/components/dialogs/ResultDialog/index.js +18 -0
- package/dist/components/dialogs/ResultDialog/index.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.d.ts +11 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +42 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.d.ts +4 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +42 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.d.ts +9 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +49 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/RulesDialog.d.ts +7 -0
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +44 -0
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/index.d.ts +2 -0
- package/dist/components/dialogs/RulesDialog/index.js +19 -0
- package/dist/components/dialogs/RulesDialog/index.js.map +1 -0
- package/dist/components/dialogs/index.d.ts +4 -0
- package/dist/components/dialogs/index.js +21 -0
- package/dist/components/dialogs/index.js.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +29 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/material/Board/Board.d.ts +17 -0
- package/dist/components/material/Board/Board.js +34 -0
- package/dist/components/material/Board/Board.js.map +1 -0
- package/dist/components/material/Board/index.d.ts +1 -0
- package/dist/components/material/Board/index.js +18 -0
- package/dist/components/material/Board/index.js.map +1 -0
- package/dist/components/material/Card/Card.d.ts +23 -0
- package/dist/components/material/Card/Card.js +49 -0
- package/dist/components/material/Card/Card.js.map +1 -0
- package/dist/components/material/Card/index.d.ts +1 -0
- package/dist/components/material/Card/index.js +18 -0
- package/dist/components/material/Card/index.js.map +1 -0
- package/dist/components/material/DraggableMaterial.d.ts +14 -0
- package/dist/components/material/DraggableMaterial.js +112 -0
- package/dist/components/material/DraggableMaterial.js.map +1 -0
- package/dist/components/material/DropAreas/SimpleDropArea.d.ts +12 -0
- package/dist/components/material/DropAreas/SimpleDropArea.js +121 -0
- package/dist/components/material/DropAreas/SimpleDropArea.js.map +1 -0
- package/dist/components/material/DropAreas/index.d.ts +1 -0
- package/dist/components/material/DropAreas/index.js +18 -0
- package/dist/components/material/DropAreas/index.js.map +1 -0
- package/dist/components/material/GameTable/GameMaterialDisplay.d.ts +1 -0
- package/dist/components/material/GameTable/GameMaterialDisplay.js +107 -0
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -0
- package/dist/components/material/GameTable/GameTable.d.ts +18 -0
- package/dist/components/material/GameTable/GameTable.js +53 -0
- package/dist/components/material/GameTable/GameTable.js.map +1 -0
- package/dist/components/material/GameTable/GameTableContent.d.ts +18 -0
- package/dist/components/material/GameTable/GameTableContent.js +48 -0
- package/dist/components/material/GameTable/GameTableContent.js.map +1 -0
- package/dist/components/material/GameTable/index.d.ts +1 -0
- package/dist/components/material/GameTable/index.js +18 -0
- package/dist/components/material/GameTable/index.js.map +1 -0
- package/dist/components/material/Items.d.ts +4 -0
- package/dist/components/material/Items.js +3 -0
- package/dist/components/material/Items.js.map +1 -0
- package/dist/components/material/MaterialAnimations.d.ts +28 -0
- package/dist/components/material/MaterialAnimations.js +172 -0
- package/dist/components/material/MaterialAnimations.js.map +1 -0
- package/dist/components/material/MaterialComponent.d.ts +20 -0
- package/dist/components/material/MaterialComponent.js +101 -0
- package/dist/components/material/MaterialComponent.js.map +1 -0
- package/dist/components/material/MaterialComponentType.d.ts +7 -0
- package/dist/components/material/MaterialComponentType.js +12 -0
- package/dist/components/material/MaterialComponentType.js.map +1 -0
- package/dist/components/material/MaterialDescription.d.ts +20 -0
- package/dist/components/material/MaterialDescription.js +3 -0
- package/dist/components/material/MaterialDescription.js.map +1 -0
- package/dist/components/material/MaterialGameAnimations.d.ts +10 -0
- package/dist/components/material/MaterialGameAnimations.js +47 -0
- package/dist/components/material/MaterialGameAnimations.js.map +1 -0
- package/dist/components/material/Token/Token.d.ts +18 -0
- package/dist/components/material/Token/Token.js +34 -0
- package/dist/components/material/Token/Token.js.map +1 -0
- package/dist/components/material/Token/index.d.ts +1 -0
- package/dist/components/material/Token/index.js +18 -0
- package/dist/components/material/Token/index.js.map +1 -0
- package/dist/components/material/index.d.ts +11 -0
- package/dist/components/material/index.js +28 -0
- package/dist/components/material/index.js.map +1 -0
- package/dist/components/material/utils/IsLocationSubset.d.ts +2 -0
- package/dist/components/material/utils/IsLocationSubset.js +12 -0
- package/dist/components/material/utils/IsLocationSubset.js.map +1 -0
- package/dist/components/material/utils/IsMoveOnItem.d.ts +2 -0
- package/dist/components/material/utils/IsMoveOnItem.js +13 -0
- package/dist/components/material/utils/IsMoveOnItem.js.map +1 -0
- package/dist/components/material/utils/IsMoveThisItem.d.ts +2 -0
- package/dist/components/material/utils/IsMoveThisItem.js +12 -0
- package/dist/components/material/utils/IsMoveThisItem.js.map +1 -0
- package/dist/components/material/utils/IsMoveThisItemToLocation.d.ts +3 -0
- package/dist/components/material/utils/IsMoveThisItemToLocation.js +11 -0
- package/dist/components/material/utils/IsMoveThisItemToLocation.js.map +1 -0
- package/dist/components/material/utils/IsMoveToLocation.d.ts +2 -0
- package/dist/components/material/utils/IsMoveToLocation.js +13 -0
- package/dist/components/material/utils/IsMoveToLocation.js.map +1 -0
- package/dist/components/material/utils/IsMoveToStock.d.ts +4 -0
- package/dist/components/material/utils/IsMoveToStock.js +18 -0
- package/dist/components/material/utils/IsMoveToStock.js.map +1 -0
- package/dist/components/material/utils/index.d.ts +5 -0
- package/dist/components/material/utils/index.js +22 -0
- package/dist/components/material/utils/index.js.map +1 -0
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.d.ts +4 -0
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js +27 -0
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js.map +1 -0
- package/dist/components/menus/ContrastThemeButton/index.d.ts +1 -0
- package/dist/components/menus/ContrastThemeButton/index.js +18 -0
- package/dist/components/menus/ContrastThemeButton/index.js.map +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.d.ts +2 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +35 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.d.ts +10 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +79 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.d.ts +2 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +37 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -0
- package/dist/components/menus/EjectPlayer/index.d.ts +3 -0
- package/dist/components/menus/EjectPlayer/index.js +20 -0
- package/dist/components/menus/EjectPlayer/index.js.map +1 -0
- package/dist/components/menus/Fullscreen/FullscreenButton.d.ts +1 -0
- package/dist/components/menus/Fullscreen/FullscreenButton.js +28 -0
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -0
- package/dist/components/menus/Fullscreen/FullscreenDialog.d.ts +2 -0
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +47 -0
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -0
- package/dist/components/menus/Fullscreen/FullscreenPopButton.d.ts +1 -0
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +40 -0
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -0
- package/dist/components/menus/Fullscreen/index.d.ts +3 -0
- package/dist/components/menus/Fullscreen/index.js +20 -0
- package/dist/components/menus/Fullscreen/index.js.map +1 -0
- package/dist/components/menus/GiveUpButton/GiveUpButton.d.ts +1 -0
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +47 -0
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -0
- package/dist/components/menus/GiveUpButton/index.d.ts +1 -0
- package/dist/components/menus/GiveUpButton/index.js +18 -0
- package/dist/components/menus/GiveUpButton/index.js.map +1 -0
- package/dist/components/menus/Menu/LogoIcon.d.ts +2 -0
- package/dist/components/menus/Menu/LogoIcon.js +18 -0
- package/dist/components/menus/Menu/LogoIcon.js.map +1 -0
- package/dist/components/menus/Menu/Menu.d.ts +3 -0
- package/dist/components/menus/Menu/Menu.js +103 -0
- package/dist/components/menus/Menu/Menu.js.map +1 -0
- package/dist/components/menus/Menu/MenuPopButton.d.ts +7 -0
- package/dist/components/menus/Menu/MenuPopButton.js +52 -0
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -0
- package/dist/components/menus/Menu/NavButton.d.ts +7 -0
- package/dist/components/menus/Menu/NavButton.js +33 -0
- package/dist/components/menus/Menu/NavButton.js.map +1 -0
- package/dist/components/menus/Menu/index.d.ts +1 -0
- package/dist/components/menus/Menu/index.js +18 -0
- package/dist/components/menus/Menu/index.js.map +1 -0
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.d.ts +1 -0
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +36 -0
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -0
- package/dist/components/menus/RestartTutorialButton/index.d.ts +1 -0
- package/dist/components/menus/RestartTutorialButton/index.js +18 -0
- package/dist/components/menus/RestartTutorialButton/index.js.map +1 -0
- package/dist/components/menus/Result/Medal.d.ts +4 -0
- package/dist/components/menus/Result/Medal.js +42 -0
- package/dist/components/menus/Result/Medal.js.map +1 -0
- package/dist/components/menus/Result/MedalBronze.d.ts +2 -0
- package/dist/components/menus/Result/MedalBronze.js +18 -0
- package/dist/components/menus/Result/MedalBronze.js.map +1 -0
- package/dist/components/menus/Result/MedalGold.d.ts +2 -0
- package/dist/components/menus/Result/MedalGold.js +18 -0
- package/dist/components/menus/Result/MedalGold.js.map +1 -0
- package/dist/components/menus/Result/MedalSilver.d.ts +2 -0
- package/dist/components/menus/Result/MedalSilver.js +18 -0
- package/dist/components/menus/Result/MedalSilver.js.map +1 -0
- package/dist/components/menus/Result/ResultButton.d.ts +2 -0
- package/dist/components/menus/Result/ResultButton.js +26 -0
- package/dist/components/menus/Result/ResultButton.js.map +1 -0
- package/dist/components/menus/Result/ResultPopButton.d.ts +2 -0
- package/dist/components/menus/Result/ResultPopButton.js +37 -0
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -0
- package/dist/components/menus/Result/index.d.ts +3 -0
- package/dist/components/menus/Result/index.js +20 -0
- package/dist/components/menus/Result/index.js.map +1 -0
- package/dist/components/menus/SoundButton/SoundButton.d.ts +1 -0
- package/dist/components/menus/SoundButton/SoundButton.js +34 -0
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -0
- package/dist/components/menus/SoundButton/index.d.ts +1 -0
- package/dist/components/menus/SoundButton/index.js +18 -0
- package/dist/components/menus/SoundButton/index.js.map +1 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.d.ts +1 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +76 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -0
- package/dist/components/menus/TimeStatsButton/index.d.ts +1 -0
- package/dist/components/menus/TimeStatsButton/index.js +18 -0
- package/dist/components/menus/TimeStatsButton/index.js.map +1 -0
- package/dist/components/menus/UndoButton/UndoButton.d.ts +1 -0
- package/dist/components/menus/UndoButton/UndoButton.js +29 -0
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -0
- package/dist/components/menus/UndoButton/UndoPopButton.d.ts +1 -0
- package/dist/components/menus/UndoButton/UndoPopButton.js +36 -0
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -0
- package/dist/components/menus/UndoButton/index.d.ts +2 -0
- package/dist/components/menus/UndoButton/index.js +19 -0
- package/dist/components/menus/UndoButton/index.js.map +1 -0
- package/dist/components/menus/index.d.ts +5 -0
- package/dist/components/menus/index.js +22 -0
- package/dist/components/menus/index.js.map +1 -0
- package/dist/components/menus/menuCss.d.ts +10 -0
- package/dist/components/menus/menuCss.js +28 -0
- package/dist/components/menus/menuCss.js.map +1 -0
- package/dist/css/backgroundCss.d.ts +1 -0
- package/dist/css/backgroundCss.js +12 -0
- package/dist/css/backgroundCss.js.map +1 -0
- package/dist/css/buttonCss.d.ts +3 -0
- package/dist/css/buttonCss.js +14 -0
- package/dist/css/buttonCss.js.map +1 -0
- package/dist/css/componentSizeCss.d.ts +9 -0
- package/dist/css/componentSizeCss.js +20 -0
- package/dist/css/componentSizeCss.js.map +1 -0
- package/dist/css/cursorCss.d.ts +3 -0
- package/dist/css/cursorCss.js +13 -0
- package/dist/css/cursorCss.js.map +1 -0
- package/dist/css/index.d.ts +6 -0
- package/dist/css/index.js +23 -0
- package/dist/css/index.js.map +1 -0
- package/dist/css/shineEffect.d.ts +1 -0
- package/dist/css/shineEffect.js +12 -0
- package/dist/css/shineEffect.js.map +1 -0
- package/dist/css/transformCss.d.ts +1 -0
- package/dist/css/transformCss.js +18 -0
- package/dist/css/transformCss.js.map +1 -0
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.js +41 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useActions.d.ts +2 -0
- package/dist/hooks/useActions.js +9 -0
- package/dist/hooks/useActions.js.map +1 -0
- package/dist/hooks/useAnimations.d.ts +4 -0
- package/dist/hooks/useAnimations.js +37 -0
- package/dist/hooks/useAnimations.js.map +1 -0
- package/dist/hooks/useContrastTheme.d.ts +7 -0
- package/dist/hooks/useContrastTheme.js +27 -0
- package/dist/hooks/useContrastTheme.js.map +1 -0
- package/dist/hooks/useFailures.d.ts +1 -0
- package/dist/hooks/useFailures.js +11 -0
- package/dist/hooks/useFailures.js.map +1 -0
- package/dist/hooks/useFullscreen.d.ts +5 -0
- package/dist/hooks/useFullscreen.js +36 -0
- package/dist/hooks/useFullscreen.js.map +1 -0
- package/dist/hooks/useGame.d.ts +1 -0
- package/dist/hooks/useGame.js +9 -0
- package/dist/hooks/useGame.js.map +1 -0
- package/dist/hooks/useGiveUp.d.ts +1 -0
- package/dist/hooks/useGiveUp.js +17 -0
- package/dist/hooks/useGiveUp.js.map +1 -0
- package/dist/hooks/useItemLocator.d.ts +2 -0
- package/dist/hooks/useItemLocator.js +11 -0
- package/dist/hooks/useItemLocator.js.map +1 -0
- package/dist/hooks/useKeyDown.d.ts +1 -0
- package/dist/hooks/useKeyDown.js +17 -0
- package/dist/hooks/useKeyDown.js.map +1 -0
- package/dist/hooks/useLegalMoves.d.ts +2 -0
- package/dist/hooks/useLegalMoves.js +23 -0
- package/dist/hooks/useLegalMoves.js.map +1 -0
- package/dist/hooks/useMaterialAnimations.d.ts +2 -0
- package/dist/hooks/useMaterialAnimations.js +17 -0
- package/dist/hooks/useMaterialAnimations.js.map +1 -0
- package/dist/hooks/useMaterialDescription.d.ts +2 -0
- package/dist/hooks/useMaterialDescription.js +11 -0
- package/dist/hooks/useMaterialDescription.js.map +1 -0
- package/dist/hooks/useNow.d.ts +6 -0
- package/dist/hooks/useNow.js +22 -0
- package/dist/hooks/useNow.js.map +1 -0
- package/dist/hooks/useNumberOfPlayers.d.ts +1 -0
- package/dist/hooks/useNumberOfPlayers.js +7 -0
- package/dist/hooks/useNumberOfPlayers.js.map +1 -0
- package/dist/hooks/useOpponentWithMaxTime.d.ts +5 -0
- package/dist/hooks/useOpponentWithMaxTime.js +41 -0
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -0
- package/dist/hooks/usePlay.d.ts +6 -0
- package/dist/hooks/usePlay.js +24 -0
- package/dist/hooks/usePlay.js.map +1 -0
- package/dist/hooks/usePlayerId.d.ts +1 -0
- package/dist/hooks/usePlayerId.js +7 -0
- package/dist/hooks/usePlayerId.js.map +1 -0
- package/dist/hooks/usePlayerName.d.ts +1 -0
- package/dist/hooks/usePlayerName.js +9 -0
- package/dist/hooks/usePlayerName.js.map +1 -0
- package/dist/hooks/usePlayerTime.d.ts +1 -0
- package/dist/hooks/usePlayerTime.js +37 -0
- package/dist/hooks/usePlayerTime.js.map +1 -0
- package/dist/hooks/usePlayers.d.ts +8 -0
- package/dist/hooks/usePlayers.js +65 -0
- package/dist/hooks/usePlayers.js.map +1 -0
- package/dist/hooks/useRules.d.ts +2 -0
- package/dist/hooks/useRules.js +17 -0
- package/dist/hooks/useRules.js.map +1 -0
- package/dist/hooks/useScale.d.ts +1 -0
- package/dist/hooks/useScale.js +16 -0
- package/dist/hooks/useScale.js.map +1 -0
- package/dist/hooks/useSound.d.ts +1 -0
- package/dist/hooks/useSound.js +20 -0
- package/dist/hooks/useSound.js.map +1 -0
- package/dist/hooks/useStocks.d.ts +2 -0
- package/dist/hooks/useStocks.js +12 -0
- package/dist/hooks/useStocks.js.map +1 -0
- package/dist/hooks/useUndo.d.ts +7 -0
- package/dist/hooks/useUndo.js +58 -0
- package/dist/hooks/useUndo.js.map +1 -0
- package/dist/hooks/useWebP.d.ts +1 -0
- package/dist/hooks/useWebP.js +64 -0
- package/dist/hooks/useWebP.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/locators/DeckLocator.d.ts +9 -0
- package/dist/locators/DeckLocator.js +49 -0
- package/dist/locators/DeckLocator.js.map +1 -0
- package/dist/locators/HandLocator.d.ts +14 -0
- package/dist/locators/HandLocator.js +70 -0
- package/dist/locators/HandLocator.js.map +1 -0
- package/dist/locators/ItemLocator.d.ts +67 -0
- package/dist/locators/ItemLocator.js +204 -0
- package/dist/locators/ItemLocator.js.map +1 -0
- package/dist/locators/LineLocator.d.ts +8 -0
- package/dist/locators/LineLocator.js +45 -0
- package/dist/locators/LineLocator.js.map +1 -0
- package/dist/locators/PileLocator.d.ts +13 -0
- package/dist/locators/PileLocator.js +69 -0
- package/dist/locators/PileLocator.js.map +1 -0
- package/dist/locators/index.d.ts +5 -0
- package/dist/locators/index.js +22 -0
- package/dist/locators/index.js.map +1 -0
- package/dist/translation/index.d.ts +1 -0
- package/dist/translation/index.js +18 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/setupTranslation.d.ts +5 -0
- package/dist/translation/setupTranslation.js +33 -0
- package/dist/translation/setupTranslation.js.map +1 -0
- package/dist/utilities/combineEventListeners.d.ts +1 -0
- package/dist/utilities/combineEventListeners.js +19 -0
- package/dist/utilities/combineEventListeners.js.map +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +18 -0
- package/dist/utilities/index.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
18
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
19
|
+
return cooked;
|
|
20
|
+
};
|
|
21
|
+
var __assign = (this && this.__assign) || function () {
|
|
22
|
+
__assign = Object.assign || function(t) {
|
|
23
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
24
|
+
s = arguments[i];
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
26
|
+
t[p] = s[p];
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
30
|
+
return __assign.apply(this, arguments);
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.MaterialAnimations = void 0;
|
|
45
|
+
var react_client_1 = require("@gamepark/react-client");
|
|
46
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
47
|
+
var react_1 = require("@emotion/react");
|
|
48
|
+
var MaterialAnimations = /** @class */ (function (_super) {
|
|
49
|
+
__extends(MaterialAnimations, _super);
|
|
50
|
+
function MaterialAnimations() {
|
|
51
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
52
|
+
}
|
|
53
|
+
MaterialAnimations.prototype.getPreDuration = function (move, context) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
switch (move.type) {
|
|
56
|
+
case rules_api_1.ItemMoveType.Move:
|
|
57
|
+
case rules_api_1.ItemMoveType.Delete:
|
|
58
|
+
if (((_a = context.state.droppedItem) === null || _a === void 0 ? void 0 : _a.type) === move.itemType && ((_b = context.state.droppedItem) === null || _b === void 0 ? void 0 : _b.index) === move.itemIndex) {
|
|
59
|
+
return 0.2;
|
|
60
|
+
}
|
|
61
|
+
return this.moveDuration(move, context);
|
|
62
|
+
default:
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
MaterialAnimations.prototype.getPostDuration = function (move, context) {
|
|
67
|
+
switch (move.type) {
|
|
68
|
+
case rules_api_1.ItemMoveType.Create:
|
|
69
|
+
return this.moveDuration(move, context);
|
|
70
|
+
default:
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
MaterialAnimations.prototype.moveDuration = function (_move, _context) {
|
|
75
|
+
return 1;
|
|
76
|
+
};
|
|
77
|
+
MaterialAnimations.prototype.getItemAnimation = function (item, animation, context) {
|
|
78
|
+
switch (animation.move.type) {
|
|
79
|
+
case rules_api_1.ItemMoveType.Create:
|
|
80
|
+
return this.getCreateItemAnimation(item, animation, context);
|
|
81
|
+
case rules_api_1.ItemMoveType.Move:
|
|
82
|
+
return this.getMoveItemAnimation(item, animation, context);
|
|
83
|
+
case rules_api_1.ItemMoveType.Delete:
|
|
84
|
+
return this.getDeleteItemAnimation(item, animation, context);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
MaterialAnimations.prototype.getCreateItemAnimation = function (item, animation, context) {
|
|
88
|
+
var stockLocation = this.getStockLocation(item.type, context);
|
|
89
|
+
if (stockLocation) {
|
|
90
|
+
var origin_1 = this.closestItemRotation(stockLocation, item, context);
|
|
91
|
+
var animationKeyframes = this.getKeyframesFromOrigin(origin_1, item, animation, context);
|
|
92
|
+
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["animation: ", " ", "s ease-in-out"], ["animation: ", " ", "s ease-in-out"])), animationKeyframes, animation.duration);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return this.fadein(animation.duration);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
MaterialAnimations.prototype.fadein = function (duration) {
|
|
99
|
+
var fadein = (0, react_1.keyframes)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n "], ["\n from {\n opacity: 0;\n }\n "])));
|
|
100
|
+
return (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["animation: ", " ", "s ease-in-out"], ["animation: ", " ", "s ease-in-out"])), fadein, duration);
|
|
101
|
+
};
|
|
102
|
+
MaterialAnimations.prototype.getStockLocation = function (itemType, _a) {
|
|
103
|
+
var _b, _c;
|
|
104
|
+
var rules = _a.rules, context = __rest(_a, ["rules"]);
|
|
105
|
+
var type = itemType;
|
|
106
|
+
var stock = context.material[type].stock;
|
|
107
|
+
if (!stock)
|
|
108
|
+
return;
|
|
109
|
+
var stockItem = (_c = (_b = context.material[type]).items) === null || _c === void 0 ? void 0 : _c.call(_b, rules.game, context.player).find(function (item) { return item.location.type === stock.location.type; });
|
|
110
|
+
var index = (stockItem === null || stockItem === void 0 ? void 0 : stockItem.quantity) ? stockItem.quantity - 1 : 0;
|
|
111
|
+
var stockLocator = context.locators[stock.location.type];
|
|
112
|
+
return stockLocator.transformItem(stockItem !== null && stockItem !== void 0 ? stockItem : stock, __assign(__assign({}, context), { game: rules.game, type: type, index: index })).join(' ');
|
|
113
|
+
};
|
|
114
|
+
MaterialAnimations.prototype.getKeyframesFromOrigin = function (origin, _item, _animation, _context) {
|
|
115
|
+
return (0, react_1.keyframes)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n from {\n transform: ", ";\n }\n "], ["\n from {\n transform: ", ";\n }\n "])), origin);
|
|
116
|
+
};
|
|
117
|
+
MaterialAnimations.prototype.getMoveItemAnimation = function (item, animation, context) {
|
|
118
|
+
var _a, _b, _c;
|
|
119
|
+
var rules = context.rules;
|
|
120
|
+
var type = item.type;
|
|
121
|
+
var gameCopy = JSON.parse(JSON.stringify(rules.game));
|
|
122
|
+
var mutator = new rules_api_1.MaterialMutator(type, (_a = gameCopy.items[type]) !== null && _a !== void 0 ? _a : [], rules.locationsStrategies[type]);
|
|
123
|
+
var futureIndex = mutator.move(animation.move);
|
|
124
|
+
var futureItem = mutator.items[futureIndex];
|
|
125
|
+
// TODO: if animation.move.quantity > 1, we will have to give a different target to each moving item. Formula bellow works only if 1 item moves
|
|
126
|
+
var indexAfter = ((_b = futureItem.quantity) !== null && _b !== void 0 ? _b : 1) - ((_c = animation.move.quantity) !== null && _c !== void 0 ? _c : 1);
|
|
127
|
+
var targetLocator = context.locators[futureItem.location.type];
|
|
128
|
+
var targetTransform = targetLocator.transformItem(futureItem, __assign(__assign({}, context), { game: gameCopy, type: type, index: indexAfter })).join(' ');
|
|
129
|
+
var destination = this.closestItemRotation(targetTransform, item, context);
|
|
130
|
+
var animationKeyframes = this.getKeyframesToDestination(destination, item, animation, context);
|
|
131
|
+
return (0, react_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["animation: ", " ", "s ease-in-out"], ["animation: ", " ", "s ease-in-out"])), animationKeyframes, animation.duration);
|
|
132
|
+
};
|
|
133
|
+
MaterialAnimations.prototype.closestItemRotation = function (transform, item, context) {
|
|
134
|
+
return this.closestRotation(transform, this.transformItem(item, context));
|
|
135
|
+
};
|
|
136
|
+
MaterialAnimations.prototype.transformItem = function (item, _a) {
|
|
137
|
+
var game = _a.rules.game, context = __rest(_a, ["rules"]);
|
|
138
|
+
var type = item.type;
|
|
139
|
+
var currentItem = game.items[type][item.index];
|
|
140
|
+
var sourceLocator = context.locators[currentItem.location.type];
|
|
141
|
+
return sourceLocator.transformItem(currentItem, __assign(__assign({}, context), { game: game, type: type, index: item.displayIndex })).join(' ');
|
|
142
|
+
};
|
|
143
|
+
MaterialAnimations.prototype.closestRotation = function (targetTransform, sourceTransform) {
|
|
144
|
+
var sourceRotation = this.getRotation(sourceTransform);
|
|
145
|
+
var targetRotation = this.getRotation(targetTransform);
|
|
146
|
+
var rotationAdjustment = Math.round((sourceRotation - targetRotation) / 360) * 360;
|
|
147
|
+
return rotationAdjustment ? targetTransform + " rotateZ(".concat(rotationAdjustment, "deg)") : targetTransform;
|
|
148
|
+
};
|
|
149
|
+
MaterialAnimations.prototype.getRotation = function (transform) {
|
|
150
|
+
return Array.from(transform.matchAll(/rotateZ\((\d+.?\d*)deg\)/gi)).reduce(function (sum, match) { return sum + parseFloat(match[1]); }, 0)
|
|
151
|
+
+ Array.from(transform.matchAll(/rotateZ\((\d+.?\d*)rad\)/gi)).reduce(function (sum, match) { return sum + parseFloat(match[1]) * 180 / Math.PI; }, 0);
|
|
152
|
+
};
|
|
153
|
+
MaterialAnimations.prototype.getKeyframesToDestination = function (destination, _item, _animation, _context) {
|
|
154
|
+
return (0, react_1.keyframes)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n to {\n transform: ", ";\n }\n "], ["\n to {\n transform: ", ";\n }\n "])), destination);
|
|
155
|
+
};
|
|
156
|
+
MaterialAnimations.prototype.getDeleteItemAnimation = function (item, animation, context) {
|
|
157
|
+
var stockLocation = this.getStockLocation(animation.move.itemType, context);
|
|
158
|
+
if (stockLocation) {
|
|
159
|
+
var destination = this.closestItemRotation(stockLocation, item, context);
|
|
160
|
+
var animationKeyframes = this.getKeyframesToDestination(destination, item, animation, context);
|
|
161
|
+
return (0, react_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["animation: ", " ", "s ease-in-out"], ["animation: ", " ", "s ease-in-out"])), animationKeyframes, animation.duration);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
var fadeout = (0, react_1.keyframes)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n to {\n opacity: 0;\n }\n "], ["\n to {\n opacity: 0;\n }\n "])));
|
|
165
|
+
return (0, react_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["animation: ", " ", "s ease-in-out"], ["animation: ", " ", "s ease-in-out"])), fadeout, animation.duration);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return MaterialAnimations;
|
|
169
|
+
}(react_client_1.Animations));
|
|
170
|
+
exports.MaterialAnimations = MaterialAnimations;
|
|
171
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
172
|
+
//# sourceMappingURL=MaterialAnimations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialAnimations.js","sourceRoot":"","sources":["../../../src/components/material/MaterialAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAgF;AAChF,iDAW4B;AAC5B,wCAAqE;AAIrE;IACU,sCAAuD;IADjE;;IAsJA,CAAC;IAnJU,2CAAc,GAAvB,UAAwB,IAAuB,EAAE,OAA0E;;QACzH,QAAQ,IAAI,CAAC,IAAI,EAAE;YACjB,KAAK,wBAAY,CAAC,IAAI,CAAC;YACvB,KAAK,wBAAY,CAAC,MAAM;gBACtB,IAAI,CAAA,M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AAsB,GAAhC,UACE,IAAsB,EAAE,SAAmC,EAAE,OAAsC;QAEnG,IAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC7E,IAAI,aAAa,EAAE;YACjB,IAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;YAC1E,IAAM,kBAAkB,GAAG,IAAI,CAAC,yBAAyB,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;YAChG,WAAO,WAAG,uGAAA,aAAc,EAAkB,GAAI,EAAkB,eAAe,KAAvD,kBAAkB,EAAI,SAAS,CAAC,QAAQ,EAAe;SAChF;aAAM;YACL,IAAM,OAAO,OAAG,iBAAS,8HAAA,0DAIxB,IAAA,CAAA;YACD,WAAO,WAAG,uGAAA,aAAc,EAAO,GAAI,EAAkB,eAAe,KAA5C,OAAO,EAAI,SAAS,CAAC,QAAQ,EAAe;SACrE;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AAtJD,CACU,yBAAU,GAqJnB;AAtJY,gDAAkB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { MaterialMove } from '@gamepark/rules-api';
|
|
4
|
+
export type MaterialComponentProps<ItemId extends number = number, P extends number = number, M extends number = number, L extends number = number> = {
|
|
5
|
+
type: M;
|
|
6
|
+
itemId?: ItemId;
|
|
7
|
+
withLocations?: boolean;
|
|
8
|
+
legalMovesTo?: MaterialMove<P, M, L>[];
|
|
9
|
+
onShortClick?: () => void;
|
|
10
|
+
onLongClick?: () => void;
|
|
11
|
+
} & HTMLAttributes<HTMLElement>;
|
|
12
|
+
export declare const MaterialComponent: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
type: number;
|
|
14
|
+
itemId?: number;
|
|
15
|
+
withLocations?: boolean;
|
|
16
|
+
legalMovesTo?: MaterialMove<number, number, number>[];
|
|
17
|
+
onShortClick?: () => void;
|
|
18
|
+
onLongClick?: () => void;
|
|
19
|
+
} & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare const getPropForItem: <Id extends number = number>(prop: any, itemId?: Id) => any;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.getPropForItem = exports.MaterialComponent = void 0;
|
|
29
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
+
/** @jsxImportSource @emotion/react */
|
|
31
|
+
var react_1 = require("react");
|
|
32
|
+
var MaterialComponentType_1 = require("./MaterialComponentType");
|
|
33
|
+
var Board_1 = require("./Board");
|
|
34
|
+
var Card_1 = require("./Card");
|
|
35
|
+
var Token_1 = require("./Token");
|
|
36
|
+
var mapValues_1 = __importDefault(require("lodash/mapValues"));
|
|
37
|
+
var use_long_press_1 = require("use-long-press");
|
|
38
|
+
var utilities_1 = require("../../utilities");
|
|
39
|
+
var pickBy_1 = __importDefault(require("lodash/pickBy"));
|
|
40
|
+
var hooks_1 = require("../../hooks");
|
|
41
|
+
var GameProvider_1 = require("../GameProvider");
|
|
42
|
+
exports.MaterialComponent = (0, react_1.forwardRef)(function (_a, ref) {
|
|
43
|
+
var type = _a.type, itemId = _a.itemId, withLocations = _a.withLocations, legalMovesTo = _a.legalMovesTo, onShortClick = _a.onShortClick, _b = _a.onLongClick, onLongClick = _b === void 0 ? onShortClick : _b, props = __rest(_a, ["type", "itemId", "withLocations", "legalMovesTo", "onShortClick", "onLongClick"]);
|
|
44
|
+
var description = (0, hooks_1.useMaterialDescription)(type);
|
|
45
|
+
var locators = (0, react_1.useContext)(GameProvider_1.gameContext).locators;
|
|
46
|
+
var rules = (0, hooks_1.useRules)();
|
|
47
|
+
var innerLocators = (0, pickBy_1.default)(locators, function (locator) { return (locator === null || locator === void 0 ? void 0 : locator.parentItemType) === type; });
|
|
48
|
+
var listeners = (0, use_long_press_1.useLongPress)(function () { return onLongClick && onLongClick(); }, {
|
|
49
|
+
detect: use_long_press_1.LongPressEventType.Pointer,
|
|
50
|
+
cancelOnMovement: 5,
|
|
51
|
+
threshold: 600,
|
|
52
|
+
onCancel: function (_, _a) {
|
|
53
|
+
var reason = _a.reason;
|
|
54
|
+
if (reason === use_long_press_1.LongPressCallbackReason.CancelledByRelease) {
|
|
55
|
+
setTimeout(function () { return onShortClick && onShortClick(); });
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
filterEvents: function (event) { return !event.button; } // Ignore clicks on mouse buttons > 0
|
|
59
|
+
})();
|
|
60
|
+
if (!description || !locators || !rules)
|
|
61
|
+
return null;
|
|
62
|
+
var itemProps = (0, exports.getPropForItem)(description.props, itemId);
|
|
63
|
+
switch (description.type) {
|
|
64
|
+
case MaterialComponentType_1.MaterialComponentType.Board:
|
|
65
|
+
return (0, jsx_runtime_1.jsx)(Board_1.Board, __assign({ ref: ref }, itemProps, props, (0, utilities_1.combineEventListeners)(listeners, props), { children: withLocations && (description.getLocations ? description.getLocations(itemId, legalMovesTo) : createLocations(rules, innerLocators, itemId, legalMovesTo)) }));
|
|
66
|
+
case MaterialComponentType_1.MaterialComponentType.Card:
|
|
67
|
+
return (0, jsx_runtime_1.jsx)(Card_1.Card, __assign({ ref: ref }, itemProps, props, (0, utilities_1.combineEventListeners)(listeners, props)));
|
|
68
|
+
case MaterialComponentType_1.MaterialComponentType.Token:
|
|
69
|
+
return (0, jsx_runtime_1.jsx)(Token_1.Token, __assign({ ref: ref }, itemProps, props, (0, utilities_1.combineEventListeners)(listeners, props)));
|
|
70
|
+
default:
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var getPropForItem = function (prop, itemId) {
|
|
75
|
+
if (typeof prop === 'object') {
|
|
76
|
+
if (isIdRecord(prop)) {
|
|
77
|
+
return itemId !== undefined ? prop[itemId] : undefined;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return (0, mapValues_1.default)(prop, function (p) { return (0, exports.getPropForItem)(p, itemId); });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (typeof prop === 'function') {
|
|
84
|
+
return prop(itemId);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return prop;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.getPropForItem = getPropForItem;
|
|
91
|
+
var isIdRecord = function (prop) {
|
|
92
|
+
return !isNaN(parseInt(Object.keys(prop)[0]));
|
|
93
|
+
};
|
|
94
|
+
var createLocations = function (rules, locators, itemId, moves) {
|
|
95
|
+
if (moves === void 0) { moves = []; }
|
|
96
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.entries(locators).map(function (_a) {
|
|
97
|
+
var locator = _a[1];
|
|
98
|
+
return locator && locator.createLocationsOnItem(itemId, moves, rules);
|
|
99
|
+
}) });
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=MaterialComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialComponent.js","sourceRoot":"","sources":["../../../src/components/material/MaterialComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,+BAA0E;AAC1E,iEAA+D;AAC/D,iCAA+B;AAC/B,+BAA6B;AAC7B,iCAA+B;AAC/B,+DAAwC;AAExC,iDAA0F;AAE1F,6CAAuD;AACvD,yDAAkC;AAClC,qCAA8D;AAC9D,gDAA6C;AAWhC,QAAA,iBAAiB,GAAG,IAAA,kBAAU,EAAyC,UAClF,EAAiG,EAAE,GAAG;IAApG,IAAA,IAAI,UAAA,EAAE,MAAM,YAAA,EAAE,aAAa,mBAAA,EAAE,YAAY,kBAAA,EAAE,YAAY,kBAAA,EAAE,mBAA0B,EAA1B,WAAW,mBAAG,YAAY,KAAA,EAAK,KAAK,cAA/F,kFAAiG,CAAF;IAE/F,IAAM,WAAW,GAAG,IAAA,8BAAsB,EAAC,IAAI,CAAC,CAAA;IAChD,IAAM,QAAQ,GAAG,IAAA,kBAAU,EAAC,0BAAW,CAAC,CAAC,QAAQ,CAAA;IACjD,IAAM,KAAK,GAAG,IAAA,gBAAQ,GAAiB,CAAA;IAEvC,IAAM,aAAa,GAAG,IAAA,gBAAM,EAAC,QAAQ,EAAE,UAAA,OAAO,IAAI,OAAA,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,MAAK,IAAI,EAAhC,CAAgC,CA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AAO,IAAI,OAAO,CAAC,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;QAA9D,CAA8D,CAC/D,GACA,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaterialComponentType = void 0;
|
|
4
|
+
var MaterialComponentType;
|
|
5
|
+
(function (MaterialComponentType) {
|
|
6
|
+
MaterialComponentType[MaterialComponentType["Board"] = 1] = "Board";
|
|
7
|
+
MaterialComponentType[MaterialComponentType["Card"] = 2] = "Card";
|
|
8
|
+
MaterialComponentType[MaterialComponentType["Token"] = 3] = "Token";
|
|
9
|
+
MaterialComponentType[MaterialComponentType["Meeple"] = 4] = "Meeple";
|
|
10
|
+
MaterialComponentType[MaterialComponentType["Cube"] = 5] = "Cube";
|
|
11
|
+
})(MaterialComponentType = exports.MaterialComponentType || (exports.MaterialComponentType = {}));
|
|
12
|
+
//# sourceMappingURL=MaterialComponentType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialComponentType.js","sourceRoot":"","sources":["../../../src/components/material/MaterialComponentType.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,mEAAS,CAAA;IAAE,iEAAI,CAAA;IAAE,mEAAK,CAAA;IAAE,qEAAM,CAAA;IAAE,iEAAI,CAAA;AACtC,CAAC,EAFW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAEhC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BoardMaterialDescription } from './Board';
|
|
2
|
+
import { CardMaterialDescription } from './Card';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { ItemMove, Location, MaterialGame, MaterialItem, MaterialMove } from '@gamepark/rules-api';
|
|
5
|
+
import { TokenMaterialDescription } from './Token';
|
|
6
|
+
export type MaterialDescription<P extends number = number, M extends number = number, L extends number = number> = BoardMaterialDescription<P, M, L> | CardMaterialDescription<P, M, L> | TokenMaterialDescription<P, M, L>;
|
|
7
|
+
export type StockDescription<P extends number = number, L extends number = number> = {
|
|
8
|
+
location: Location<P, L>;
|
|
9
|
+
};
|
|
10
|
+
export type CommonMaterialDescription<P extends number = number, M extends number = number, L extends number = number> = {
|
|
11
|
+
rules: (props: MaterialRulesProps<P, M, L>) => ReactNode;
|
|
12
|
+
items?: (game: MaterialGame<P, M, L>, player?: P) => MaterialItem<P, L>[];
|
|
13
|
+
stock?: StockDescription<P, L>;
|
|
14
|
+
};
|
|
15
|
+
export type MaterialRulesProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
16
|
+
item: Partial<MaterialItem<P, L>>;
|
|
17
|
+
legalMoves: ItemMove<P, M, L>[];
|
|
18
|
+
close: () => void;
|
|
19
|
+
};
|
|
20
|
+
export type MaterialLocationsFunction<ItemId = number> = (itemId?: ItemId, legalMoves?: MaterialMove[]) => ReactNode | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialDescription.js","sourceRoot":"","sources":["../../../src/components/material/MaterialDescription.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnimationContext, Animations } from '@gamepark/react-client';
|
|
2
|
+
import { MaterialGame, MaterialMove } from '@gamepark/rules-api';
|
|
3
|
+
import { MaterialAnimations } from './MaterialAnimations';
|
|
4
|
+
export declare class MaterialGameAnimations<P extends number = number, M extends number = number, L extends number = number> extends Animations<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P> {
|
|
5
|
+
readonly itemsAnimations: Partial<Record<M, MaterialAnimations<P, M, L>>>;
|
|
6
|
+
constructor(itemsAnimations?: Partial<Record<M, MaterialAnimations<P, M, L>>>);
|
|
7
|
+
getMaterialAnimations(materialType: M): MaterialAnimations<P, M, L>;
|
|
8
|
+
getPreDuration(move: MaterialMove<P, M, L>, context: AnimationContext<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P>): number;
|
|
9
|
+
getPostDuration(move: MaterialMove<P, M, L>, context: AnimationContext<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P>): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MaterialGameAnimations = void 0;
|
|
19
|
+
var react_client_1 = require("@gamepark/react-client");
|
|
20
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
21
|
+
var MaterialAnimations_1 = require("./MaterialAnimations");
|
|
22
|
+
var MaterialGameAnimations = /** @class */ (function (_super) {
|
|
23
|
+
__extends(MaterialGameAnimations, _super);
|
|
24
|
+
function MaterialGameAnimations(itemsAnimations) {
|
|
25
|
+
if (itemsAnimations === void 0) { itemsAnimations = {}; }
|
|
26
|
+
var _this = _super.call(this) || this;
|
|
27
|
+
_this.itemsAnimations = itemsAnimations;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
MaterialGameAnimations.prototype.getMaterialAnimations = function (materialType) {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = this.itemsAnimations[materialType]) !== null && _a !== void 0 ? _a : new MaterialAnimations_1.MaterialAnimations();
|
|
33
|
+
};
|
|
34
|
+
MaterialGameAnimations.prototype.getPreDuration = function (move, context) {
|
|
35
|
+
if (move.kind !== rules_api_1.MoveKind.ItemMove)
|
|
36
|
+
return 0;
|
|
37
|
+
return this.getMaterialAnimations(move.itemType).getPreDuration(move, context);
|
|
38
|
+
};
|
|
39
|
+
MaterialGameAnimations.prototype.getPostDuration = function (move, context) {
|
|
40
|
+
if (move.kind !== rules_api_1.MoveKind.ItemMove)
|
|
41
|
+
return 0;
|
|
42
|
+
return this.getMaterialAnimations(move.itemType).getPostDuration(move, context);
|
|
43
|
+
};
|
|
44
|
+
return MaterialGameAnimations;
|
|
45
|
+
}(react_client_1.Animations));
|
|
46
|
+
exports.MaterialGameAnimations = MaterialGameAnimations;
|
|
47
|
+
//# sourceMappingURL=MaterialGameAnimations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialGameAnimations.js","sourceRoot":"","sources":["../../../src/components/material/MaterialGameAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uDAAqE;AACrE,iDAA0E;AAC1E,2DAAyD;AAEzD;IACU,0CAA2D;IAInE,gCAAY,eAAqE;QAArE,gCAAA,EAAA,oBAAqE;QAAjF,YACE,iBAAO,SAER;QADC,KAAI,CAAC,eAAe,GAAG,eAAe,CAAA;;IACxC,CAAC;IAED,sDAAqB,GAArB,UAAsB,YAAe;;QACnC,OAAO,MAAA,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,mCAAI,IAAI,uCAAkB,EAAE,CAAA;IACvE,CAAC;IAEQ,+CAAc,GAAvB,UAAwB,IAA2B,EAAE,OAA0E;QAC7H,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAQ,CAAC,QAAQ;YAAE,OAAO,CAAC,CAAA;QAC7C,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAChF,CAAC;IAEQ,gDAAe,GAAxB,UAAyB,IAA2B,EAAE,OAA0E;QAC9H,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAQ,CAAC,QAAQ;YAAE,OAAO,CAAC,CAAA;QAC7C,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACjF,CAAC;IACH,6BAAC;AAAD,CAAC,AAvBD,CACU,yBAAU,GAsBnB;AAvBY,wDAAsB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { ComponentSize } from '../../../css';
|
|
4
|
+
import { MaterialComponentType } from '../MaterialComponentType';
|
|
5
|
+
import { CommonMaterialDescription } from '../MaterialDescription';
|
|
6
|
+
import { ItemCustomization } from '../Items';
|
|
7
|
+
export type TokenProps = {
|
|
8
|
+
image: string;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
} & ComponentSize;
|
|
11
|
+
export declare const Token: import("react").ForwardRefExoticComponent<{
|
|
12
|
+
image: string;
|
|
13
|
+
borderRadius?: number;
|
|
14
|
+
} & ComponentSize & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export type TokenMaterialDescription<P extends number = number, M extends number = number, L extends number = number, ItemId extends number = number> = CommonMaterialDescription<P, M, L> & {
|
|
16
|
+
type: typeof MaterialComponentType.Token;
|
|
17
|
+
props: ItemCustomization<TokenProps, ItemId>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Token = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
+
/** @jsxImportSource @emotion/react */
|
|
28
|
+
var react_1 = require("react");
|
|
29
|
+
var css_1 = require("../../../css");
|
|
30
|
+
exports.Token = (0, react_1.forwardRef)(function (_a, ref) {
|
|
31
|
+
var image = _a.image, height = _a.height, ratio = _a.ratio, borderRadius = _a.borderRadius, props = __rest(_a, ["image", "height", "ratio", "borderRadius"]);
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("div", __assign({ ref: ref, css: [(0, css_1.shadowCss)(image), (0, css_1.sizeCss)({ height: height, ratio: ratio }), (0, css_1.backgroundCss)(image), borderRadius && (0, css_1.borderRadiusCss)(borderRadius)] }, props));
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=Token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Token.js","sourceRoot":"","sources":["../../../../src/components/material/Token/Token.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,+BAAkD;AAClD,oCAAgG;AAUnF,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,UAAC,EAAgD,EAAE,GAAG;IAAnD,IAAA,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,YAAY,kBAAA,EAAK,KAAK,cAA9C,4CAAgD,CAAF;IAC7C,OAAA,yCAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAA,eAAS,EAAC,KAAK,CAAC,EAAE,IAAA,aAAO,EAAC,EAAE,MAAM,QAAA,EAAE,KAAK,OAAA,EAAE,CAAC,EAAE,IAAA,mBAAa,EAAC,KAAK,CAAC,EAAE,YAAY,IAAI,IAAA,qBAAe,EAAC,YAAY,CAAC,CAAC,IAAM,KAAK,EAAG,CAAA;CAAA,CACxJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Token';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Token"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/material/Token/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './Board';
|
|
2
|
+
export * from './Card';
|
|
3
|
+
export * from './DropAreas';
|
|
4
|
+
export * from './GameTable';
|
|
5
|
+
export * from './Token';
|
|
6
|
+
export * from './Items';
|
|
7
|
+
export * from './MaterialAnimations';
|
|
8
|
+
export * from './MaterialComponent';
|
|
9
|
+
export * from './MaterialComponentType';
|
|
10
|
+
export * from './MaterialDescription';
|
|
11
|
+
export * from './MaterialGameAnimations';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Board"), exports);
|
|
18
|
+
__exportStar(require("./Card"), exports);
|
|
19
|
+
__exportStar(require("./DropAreas"), exports);
|
|
20
|
+
__exportStar(require("./GameTable"), exports);
|
|
21
|
+
__exportStar(require("./Token"), exports);
|
|
22
|
+
__exportStar(require("./Items"), exports);
|
|
23
|
+
__exportStar(require("./MaterialAnimations"), exports);
|
|
24
|
+
__exportStar(require("./MaterialComponent"), exports);
|
|
25
|
+
__exportStar(require("./MaterialComponentType"), exports);
|
|
26
|
+
__exportStar(require("./MaterialDescription"), exports);
|
|
27
|
+
__exportStar(require("./MaterialGameAnimations"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/material/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B;AAC3B,8CAA2B;AAC3B,0CAAuB;AACvB,0CAAuB;AACvB,uDAAoC;AACpC,sDAAmC;AACnC,0DAAuC;AACvC,wDAAqC;AACrC,2DAAwC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isLocationSubset = void 0;
|
|
7
|
+
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
+
var isLocationSubset = function (testLocation, parentLocation) {
|
|
9
|
+
return Object.keys(parentLocation).every(function (key) { return parentLocation[key] === undefined || (0, fast_deep_equal_1.default)(parentLocation[key], testLocation[key]); });
|
|
10
|
+
};
|
|
11
|
+
exports.isLocationSubset = isLocationSubset;
|
|
12
|
+
//# sourceMappingURL=IsLocationSubset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsLocationSubset.js","sourceRoot":"","sources":["../../../../src/components/material/utils/IsLocationSubset.ts"],"names":[],"mappings":";;;;;;AACA,oEAAmC;AAE5B,IAAM,gBAAgB,GAAG,UAAC,YAAsB,EAAE,cAAwB;IAC/E,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,cAAc,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,IAAA,yBAAK,EAAC,cAAc,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,EAAlF,CAAkF,CAAC,CAAA;AACrI,CAAC,CAAA;AAFY,QAAA,gBAAgB,oBAE5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMoveOnItem = void 0;
|
|
4
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
5
|
+
function isMoveOnItem(move, itemIndex, itemInnerLocationTypes) {
|
|
6
|
+
return move.kind === rules_api_1.MoveKind.ItemMove
|
|
7
|
+
&& move.type === rules_api_1.ItemMoveType.Move
|
|
8
|
+
&& move.position.location !== undefined
|
|
9
|
+
&& itemInnerLocationTypes.includes(move.position.location.type)
|
|
10
|
+
&& move.position.location.parent === itemIndex;
|
|
11
|
+
}
|
|
12
|
+
exports.isMoveOnItem = isMoveOnItem;
|
|
13
|
+
//# sourceMappingURL=IsMoveOnItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsMoveOnItem.js","sourceRoot":"","sources":["../../../../src/components/material/utils/IsMoveOnItem.ts"],"names":[],"mappings":";;;AAAA,iDAA0E;AAE1E,SAAgB,YAAY,CAC1B,IAA2B,EAAE,SAA6B,EAAE,sBAA2B;IAEvF,OAAO,IAAI,CAAC,IAAI,KAAK,oBAAQ,CAAC,QAAQ;WACjC,IAAI,CAAC,IAAI,KAAK,wBAAY,CAAC,IAAI;WAC/B,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS;WACpC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;WAC5D,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAA;AAClD,CAAC;AARD,oCAQC"}
|