@gamepark/react-game 6.24.2 → 6.24.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 +4 -6
- package/dist/components/Avatar/Avatar.js +5 -4
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/ChatSpeechBubble.js +3 -2
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -1
- package/dist/components/Avatar/SpeechBubble.d.ts +1 -0
- package/dist/components/Avatar/SpeechBubble.js +2 -1
- package/dist/components/Avatar/SpeechBubble.js.map +1 -1
- package/dist/components/GamePoints/GamePointIcon.js +1 -0
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -1
- package/dist/components/GamePoints/GamePoints.js +1 -0
- package/dist/components/GamePoints/GamePoints.js.map +1 -1
- package/dist/components/GameProvider/GameContext.js +2 -1
- package/dist/components/GameProvider/GameContext.js.map +1 -1
- package/dist/components/GameProvider/GameProvider.js +3 -0
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/Header/Header.d.ts +1 -0
- package/dist/components/Header/Header.js +3 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/MaterialHeader.js +1 -0
- package/dist/components/Header/MaterialHeader.js.map +1 -1
- package/dist/components/ImagesLoader/ImagesLoader.js +1 -0
- package/dist/components/ImagesLoader/ImagesLoader.js.map +1 -1
- package/dist/components/JournalTabs/Chat/Chat.d.ts +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessage.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessage.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatTextInput.js.map +1 -1
- package/dist/components/JournalTabs/Chat/CommonChat.js +1 -0
- package/dist/components/JournalTabs/Chat/CommonChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +1 -0
- package/dist/components/JournalTabs/Chat/SignInToChat.js.map +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.js +1 -0
- package/dist/components/JournalTabs/History/GameOverHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/History.js +2 -0
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/HistoryEntry.js +1 -0
- package/dist/components/JournalTabs/History/HistoryEntry.js.map +1 -1
- package/dist/components/JournalTabs/History/StartGameHistory.js +1 -0
- package/dist/components/JournalTabs/History/StartGameHistory.js.map +1 -1
- package/dist/components/JournalTabs/JournalTabs.d.ts +1 -0
- package/dist/components/JournalTabs/JournalTabs.js +5 -1
- package/dist/components/JournalTabs/JournalTabs.js.map +1 -1
- package/dist/components/Letterbox/Letterbox.js +1 -0
- package/dist/components/Letterbox/Letterbox.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/components/Picture/Picture.d.ts +1 -0
- package/dist/components/Picture/Picture.js +1 -0
- package/dist/components/Picture/Picture.js.map +1 -1
- package/dist/components/PlayerPanel/Counters.d.ts +1 -0
- package/dist/components/PlayerPanel/Counters.js +1 -0
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.js +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +1 -0
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +44 -16
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +1 -0
- package/dist/components/PlayerTimer/PlayerTimer.js +1 -0
- package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +1 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.d.ts +1 -0
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.d.ts +1 -0
- package/dist/components/dialogs/Dialog.d.ts +1 -0
- package/dist/components/dialogs/Dialog.js +3 -0
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.js +1 -0
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +1 -0
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.js +1 -0
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +1 -0
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +1 -0
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/material/ComponentDescription.d.ts +32 -0
- package/dist/components/material/ComponentDescription.js +15 -1
- package/dist/components/material/ComponentDescription.js.map +1 -1
- package/dist/components/material/Dices/CubicDiceDescription.d.ts +4 -4
- package/dist/components/material/Dices/CubicDiceDescription.js +6 -7
- package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
- package/dist/components/material/DraggableMaterial.js +4 -0
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/BoardDescription.js +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.js +3 -3
- package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +1 -0
- package/dist/components/material/FlatMaterial/FlatMaterial.js +2 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/MoneyDescription.d.ts +7 -0
- package/dist/components/material/FlatMaterial/MoneyDescription.js +39 -0
- package/dist/components/material/FlatMaterial/MoneyDescription.js.map +1 -0
- package/dist/components/material/FlatMaterial/TokenDescription.js +2 -2
- package/dist/components/material/FlatMaterial/index.d.ts +1 -0
- package/dist/components/material/FlatMaterial/index.js +1 -0
- package/dist/components/material/FlatMaterial/index.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +2 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js +1 -0
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.d.ts +1 -0
- package/dist/components/material/GameTable/GameTable.js +1 -0
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +1 -0
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.js +2 -1
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.d.ts +1 -0
- package/dist/components/material/GameTable/StaticLocationsDisplay.d.ts +1 -0
- package/dist/components/material/GameTable/focus/FocusProvider.js +1 -0
- package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
- package/dist/components/material/MaterialComponent.js +1 -0
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialDescription.d.ts +119 -0
- package/dist/components/material/MaterialDescription.js +107 -1
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/MobileMaterialDescription.d.ts +1 -0
- package/dist/components/material/MobileMaterialDescription.js +2 -1
- package/dist/components/material/MobileMaterialDescription.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.js +2 -1
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.js +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.js +5 -3
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.js +1 -1
- package/dist/components/material/animations/MaterialAnimations.js +1 -1
- package/dist/components/material/animations/MaterialGameAnimations.js +2 -2
- package/dist/components/material/animations/MoveItemAnimations.js +7 -5
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +2 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.js +4 -1
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.js +1 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.d.ts +1 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js +1 -4
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js.map +1 -1
- package/dist/components/material/animations/rotations.utils.js +23 -12
- package/dist/components/material/animations/rotations.utils.js.map +1 -1
- package/dist/components/material/locations/DropAreaDescription.js +1 -1
- package/dist/components/material/locations/LocationComponent.js +2 -1
- package/dist/components/material/locations/LocationComponent.js.map +1 -1
- package/dist/components/material/locations/LocationDescription.d.ts +7 -0
- package/dist/components/material/locations/LocationDescription.js +8 -1
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/LocationDisplay.js +1 -0
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.js +1 -0
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +1 -0
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/Menu/Menu.js +1 -0
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.js +1 -0
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.d.ts +1 -0
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +1 -0
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +1 -0
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.js +1 -0
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.js +1 -0
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +1 -0
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +1 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +1 -0
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +1 -0
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorial.js +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +1 -0
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/components/tutorial/TutorialRulesWrapper.js +1 -0
- package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
- package/dist/hooks/useFullscreen.js +1 -0
- package/dist/hooks/useFullscreen.js.map +1 -1
- package/dist/hooks/useOpponentWithMaxTime.d.ts +3 -0
- package/dist/hooks/useOpponentWithMaxTime.js +3 -0
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -1
- package/dist/hooks/usePlayerTime.js +1 -1
- package/dist/hooks/usePlayerTime.js.map +1 -1
- package/dist/hooks/useResultText.js +1 -0
- package/dist/hooks/useResultText.js.map +1 -1
- package/dist/hooks/useSound.js +1 -0
- package/dist/hooks/useSound.js.map +1 -1
- package/dist/hooks/useWebP.js +2 -2
- package/dist/hooks/useWebP.js.map +1 -1
- package/dist/hooks/useZoomToElements.d.ts +3 -0
- package/dist/hooks/useZoomToElements.js +3 -0
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/locators/DeckLocator.d.ts +3 -0
- package/dist/locators/DeckLocator.js +4 -1
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.d.ts +39 -0
- package/dist/locators/FlexLocator.js +31 -1
- package/dist/locators/FlexLocator.js.map +1 -1
- package/dist/locators/HandLocator.d.ts +72 -0
- package/dist/locators/HandLocator.js +73 -1
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/ListLocator.d.ts +36 -0
- package/dist/locators/ListLocator.js +28 -1
- package/dist/locators/ListLocator.js.map +1 -1
- package/dist/locators/Locator.d.ts +199 -1
- package/dist/locators/Locator.js +189 -1
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +30 -0
- package/dist/locators/PileLocator.js +31 -1
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/utilities/DeepPartial.d.ts +3 -0
- package/dist/utilities/combineEventListeners.d.ts +6 -0
- package/dist/utilities/combineEventListeners.js +6 -0
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.d.ts +6 -0
- package/dist/utilities/findIfUnique.util.js +6 -0
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/translation.util.d.ts +5 -0
- package/dist/utilities/translation.util.js +5 -0
- package/dist/utilities/translation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +20 -0
- package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.util.js +7 -0
- package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/bounds.util.d.ts +10 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js +8 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/calculation.util.d.ts +12 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js +12 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/index.d.ts +4 -0
- package/dist/utilities/zoom-pan-pinch/index.js +4 -0
- package/dist/utilities/zoom-pan-pinch/index.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +3 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +3 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -1
- package/package.json +3 -3
|
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.FocusProvider = exports.useFocusContext = exports.FocusContext = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
+
/** @jsxImportSource @emotion/react */
|
|
19
20
|
var sumBy_1 = __importDefault(require("lodash/sumBy"));
|
|
20
21
|
var react_1 = require("react");
|
|
21
22
|
var react_zoom_pan_pinch_1 = require("react-zoom-pan-pinch");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusProvider.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/FocusProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FocusProvider.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/FocusProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,uDAAgC;AAChC,+BAAoF;AACpF,6DAAkD;AAClD,2CAAqD;AACrD,6DAA2D;AAU9C,QAAA,YAAY,GAAG,IAAA,qBAAa,EAA0B,IAAI,CAAC,CAAA;AAEjE,IAAM,eAAe,GAAG;IAC7B,IAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,oBAAY,CAAyC,CAAA;IACrF,IAAI,YAAY,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;KACnF;IACD,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AANY,QAAA,eAAe,mBAM3B;AAEM,IAAM,aAAa,GAAO,UAAC,EAAY;QAAV,QAAQ,cAAA;IAC1C,IAAM,cAAc,GAAG,IAAA,yBAAiB,GAAE,CAAA;IAClC,IAAA,cAAc,GAAK,IAAA,kCAAW,GAAE,eAAlB,CAAkB;IACxC,IAAM,QAAQ,GAAG,IAAA,yBAA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AAQ,CAAC,CAAA;SAAA,CAChF;UACC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAA;AAC5B,CAAC"}
|
|
@@ -28,6 +28,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.MaterialComponent = void 0;
|
|
30
30
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
31
|
+
/** @jsxImportSource @emotion/react */
|
|
31
32
|
var react_1 = require("@emotion/react");
|
|
32
33
|
var react_2 = require("react");
|
|
33
34
|
var css_1 = require("../../css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialComponent.js","sourceRoot":"","sources":["../../../src/components/material/MaterialComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MaterialComponent.js","sourceRoot":"","sources":["../../../src/components/material/MaterialComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAAoC;AACpC,+BAAiE;AACjE,iCAAmC;AACnC,qCAAoD;AASvC,QAAA,iBAAiB,GAAG,IAAA,YAAI,EAAC,IAAA,kBAAU,EAAyC,UACvF,EAA+C,EAAE,GAAG;IAAlD,IAAA,IAAI,UAAA,EAAE,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAK,KAAK,cAA7C,2CAA+C,CAAF;IAE7C,IAAM,WAAW,GAAG,IAAA,8BAAsB,EAAC,IAAI,CAAC,CAAA;IAEhD,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAA;IAEvB,IAAA,KAAoB,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAA7C,KAAK,WAAA,EAAE,MAAM,YAAgC,CAAA;IAErD,IAAM,YAAY,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,CAAC,WAAW,EAAE,IAAA,aAAO,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAArC,CAAqC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAE1F,OAAO,CACL,yCAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,IAAM,KAAK,cACzC,yCAAK,GAAG,EAAE,YAAY,gBACnB,WAAW,CAAC,OAAO,YAAG,MAAM,QAAA,EAAE,SAAS,WAAA,EAAE,QAAQ,UAAA,IAAK,KAAK,EAAG,IAC3D,IACF,CACP,CAAA;AACH,CAAC,CAAC,CAAC,CAAA;AAEH,IAAM,YAAY,OAAG,WAAG,oNAAA,gJAMvB,IAAA,CAAA;AAED,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,IAAM,WAAW,OAAG,WAAG,sJAAA,kFAGtB,IAAA,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
1
2
|
import { Interpolation, Theme } from '@emotion/react';
|
|
2
3
|
import { Location, MaterialHelpDisplay, MaterialItem, MaterialMove } from '@gamepark/rules-api';
|
|
4
|
+
import { TFunction } from 'i18next';
|
|
3
5
|
import { ComponentType, FC, HTMLAttributes } from 'react';
|
|
4
6
|
import { ItemContext, MaterialContext } from '../../locators';
|
|
5
7
|
import { ComponentDescription } from './ComponentDescription';
|
|
@@ -11,30 +13,147 @@ export type MaterialContentProps<ItemId = any> = {
|
|
|
11
13
|
highlight?: boolean;
|
|
12
14
|
playDown?: boolean;
|
|
13
15
|
} & HTMLAttributes<HTMLElement>;
|
|
16
|
+
/**
|
|
17
|
+
* Base class to describe the material in a game
|
|
18
|
+
*/
|
|
14
19
|
export declare abstract class MaterialDescription<P extends number = number, M extends number = number, L extends number = number, ItemId = any> extends ComponentDescription<ItemId> {
|
|
20
|
+
/**
|
|
21
|
+
* Content of the help dialog opened when an item is clicked
|
|
22
|
+
*/
|
|
15
23
|
help?: ComponentType<MaterialHelpProps<P, M, L>>;
|
|
24
|
+
/**
|
|
25
|
+
* The React component to display
|
|
26
|
+
*/
|
|
16
27
|
abstract content: FC<MaterialContentProps<ItemId>>;
|
|
28
|
+
/**
|
|
29
|
+
* If the component can be moved (token, cards...) or not (writing)
|
|
30
|
+
*/
|
|
17
31
|
isMobile: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* See {@link getStaticItems}
|
|
34
|
+
*/
|
|
18
35
|
staticItem?: MaterialItem<P, L>;
|
|
36
|
+
/**
|
|
37
|
+
* See {@link getStaticItems}
|
|
38
|
+
*/
|
|
19
39
|
staticItems: MaterialItem<P, L>[];
|
|
40
|
+
/**
|
|
41
|
+
* Return any items to display that are not part of the game state because they never move (board or unlimited stockpiles for instance).
|
|
42
|
+
* Default value: {@link staticItem} if defined, otherwise {@link staticItems}. Override if the static items depends on the context.
|
|
43
|
+
*
|
|
44
|
+
* @param {MaterialContext} _context Context of the game
|
|
45
|
+
* @returns {MaterialItem[]} the extra items to display
|
|
46
|
+
*/
|
|
20
47
|
getStaticItems(_context: MaterialContext<P, M, L>): MaterialItem<P, L>[];
|
|
48
|
+
/**
|
|
49
|
+
* See {@link getStockLocation}
|
|
50
|
+
*/
|
|
21
51
|
stockLocation?: Location<P, L>;
|
|
52
|
+
/**
|
|
53
|
+
* If items are created of deleted, by default the animation will fade in or fade out the item quickly.
|
|
54
|
+
* If you want to animate from/to a location (a stockpile for instance), implement this function or simply {@link stockLocation}.
|
|
55
|
+
* @param _item Item that is getting created or deleted.
|
|
56
|
+
* @param _context Context of the game
|
|
57
|
+
* @returns The location to animate from/to
|
|
58
|
+
*/
|
|
22
59
|
getStockLocation(_item: MaterialItem<P, L>, _context: MaterialContext<P, M, L>): Location<P, L> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* See {@link getLocations}
|
|
62
|
+
*/
|
|
23
63
|
location?: Location<P, L>;
|
|
64
|
+
/**
|
|
65
|
+
* See {@link getLocations}
|
|
66
|
+
*/
|
|
24
67
|
locations: Location<P, L>[];
|
|
68
|
+
/**
|
|
69
|
+
* The internal locations of the item, for instance the spots to put material on a board.
|
|
70
|
+
* Will return {@link location} by default if defined, {@link locations} otherwise.
|
|
71
|
+
*
|
|
72
|
+
* @param _item The item that contains the locations
|
|
73
|
+
* @param _context Context of the game
|
|
74
|
+
*/
|
|
25
75
|
getLocations(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Location<P, L>[];
|
|
76
|
+
/**
|
|
77
|
+
* This function determines if an item can currently be dragged by the user to perform a given move.
|
|
78
|
+
*
|
|
79
|
+
* @param _move The move to consider
|
|
80
|
+
* @param _context Context of the item
|
|
81
|
+
*/
|
|
26
82
|
canDrag(_move: MaterialMove<P, M, L>, _context: ItemContext<P, M, L>): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* This function determines if a move can be played by clicking for 1 second on an item
|
|
85
|
+
*
|
|
86
|
+
* @param move The move to consider
|
|
87
|
+
* @param context Context of the item
|
|
88
|
+
*/
|
|
27
89
|
canLongClick(move: MaterialMove<P, M, L>, { type, index }: ItemContext<P, M, L>): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* This function determines if a move can be played by clicking on an item
|
|
92
|
+
*
|
|
93
|
+
* @param move The move to consider
|
|
94
|
+
* @param context Context of the item
|
|
95
|
+
*/
|
|
28
96
|
canShortClick(move: MaterialMove<P, M, L>, { type, index }: ItemContext<P, M, L>): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* This function returns the move that should be played when clicking on an item, if any
|
|
99
|
+
*
|
|
100
|
+
* @param _context Context of the item
|
|
101
|
+
*/
|
|
29
102
|
getShortClickMove(_context: ItemContext<P, M, L>): MaterialMove<P, M, L> | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* This function returns the local move that should be played when clicking on an item, if any
|
|
105
|
+
*
|
|
106
|
+
* @param _context Context of the item
|
|
107
|
+
*/
|
|
30
108
|
getShortClickLocalMove(_context: ItemContext<P, M, L>): MaterialMove<P, M, L> | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Thickness of the item
|
|
111
|
+
*/
|
|
31
112
|
thickness: number;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the thickness of the item. Default to {@link thickness}
|
|
115
|
+
* @param _item the item
|
|
116
|
+
* @param _context Context of the item
|
|
117
|
+
* @returns {number} The thickness
|
|
118
|
+
*/
|
|
32
119
|
getThickness(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number;
|
|
120
|
+
/**
|
|
121
|
+
* Any extra css to add on the item
|
|
122
|
+
* @param _item The item
|
|
123
|
+
* @param _context Context of the item
|
|
124
|
+
* @returns The css, using Emotion framework
|
|
125
|
+
*/
|
|
33
126
|
getItemExtraCss(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Interpolation<Theme>;
|
|
127
|
+
/**
|
|
128
|
+
* Whether the item should be highlighted
|
|
129
|
+
* @param _item The item
|
|
130
|
+
* @param _context Context of the item
|
|
131
|
+
* @return true if the item should be highlighted
|
|
132
|
+
*/
|
|
34
133
|
highlight(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): boolean | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* The move to execute in order to display the help dialog about this item.
|
|
136
|
+
* By default, open the help about this specific item, but it can be the help about the location of the item sometimes.
|
|
137
|
+
* @param item The item
|
|
138
|
+
* @param context Context of the item
|
|
139
|
+
* @return The move to play to open the help dialog
|
|
140
|
+
*/
|
|
35
141
|
displayHelp(item: MaterialItem<P, L>, { type, index, displayIndex }: ItemContext<P, M, L>): import("@gamepark/rules-api").DisplayHelp<P, M, L>;
|
|
142
|
+
/**
|
|
143
|
+
* Builds the CSS transform that will be applied to the item.
|
|
144
|
+
* @param item Item to position
|
|
145
|
+
* @param context Context of the item
|
|
146
|
+
* @returns {string[]} a list of CSS transformations
|
|
147
|
+
*/
|
|
36
148
|
getItemTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
149
|
+
/**
|
|
150
|
+
* Builds the CSS transform that will be applied to the item when hovered.
|
|
151
|
+
* @param _item Item to position
|
|
152
|
+
* @param _context Context of the item
|
|
153
|
+
* @returns {string[]} a list of CSS transformations
|
|
154
|
+
*/
|
|
37
155
|
getHoverTransform(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): string[];
|
|
38
156
|
getDropLocations(item: MaterialItem<P, L>, move: MaterialMove<P, M, L>, context: ItemContext<P, M, L>): Location<P, L>[];
|
|
157
|
+
getTooltip(item: MaterialItem<P, L>, t: TFunction, _context: ItemContext<P, M, L>): string | null | undefined;
|
|
39
158
|
}
|
|
40
159
|
export type MaterialDescriptionRecord<P extends number = number, M extends number = number, L extends number = number> = Record<M, MaterialDescription<P, M, L>>;
|
|
@@ -19,55 +19,150 @@ exports.MaterialDescription = void 0;
|
|
|
19
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
20
|
var ComponentDescription_1 = require("./ComponentDescription");
|
|
21
21
|
var displayMaterialHelp = rules_api_1.MaterialMoveBuilder.displayMaterialHelp;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Base class to describe the material in a game
|
|
24
|
+
*/
|
|
25
|
+
var MaterialDescription = /** @class */ (function (_super) {
|
|
23
26
|
__extends(MaterialDescription, _super);
|
|
24
27
|
function MaterialDescription() {
|
|
25
28
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
/**
|
|
30
|
+
* If the component can be moved (token, cards...) or not (writing)
|
|
31
|
+
*/
|
|
26
32
|
_this.isMobile = false;
|
|
33
|
+
/**
|
|
34
|
+
* See {@link getStaticItems}
|
|
35
|
+
*/
|
|
27
36
|
_this.staticItems = [];
|
|
37
|
+
/**
|
|
38
|
+
* See {@link getLocations}
|
|
39
|
+
*/
|
|
28
40
|
_this.locations = [];
|
|
41
|
+
/**
|
|
42
|
+
* Thickness of the item
|
|
43
|
+
*/
|
|
29
44
|
_this.thickness = 0.05;
|
|
30
45
|
return _this;
|
|
31
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Return any items to display that are not part of the game state because they never move (board or unlimited stockpiles for instance).
|
|
49
|
+
* Default value: {@link staticItem} if defined, otherwise {@link staticItems}. Override if the static items depends on the context.
|
|
50
|
+
*
|
|
51
|
+
* @param {MaterialContext} _context Context of the game
|
|
52
|
+
* @returns {MaterialItem[]} the extra items to display
|
|
53
|
+
*/
|
|
32
54
|
MaterialDescription.prototype.getStaticItems = function (_context) {
|
|
33
55
|
return this.staticItem ? [this.staticItem] : this.staticItems;
|
|
34
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* If items are created of deleted, by default the animation will fade in or fade out the item quickly.
|
|
59
|
+
* If you want to animate from/to a location (a stockpile for instance), implement this function or simply {@link stockLocation}.
|
|
60
|
+
* @param _item Item that is getting created or deleted.
|
|
61
|
+
* @param _context Context of the game
|
|
62
|
+
* @returns The location to animate from/to
|
|
63
|
+
*/
|
|
35
64
|
MaterialDescription.prototype.getStockLocation = function (_item, _context) {
|
|
36
65
|
return this.stockLocation;
|
|
37
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* The internal locations of the item, for instance the spots to put material on a board.
|
|
69
|
+
* Will return {@link location} by default if defined, {@link locations} otherwise.
|
|
70
|
+
*
|
|
71
|
+
* @param _item The item that contains the locations
|
|
72
|
+
* @param _context Context of the game
|
|
73
|
+
*/
|
|
38
74
|
MaterialDescription.prototype.getLocations = function (_item, _context) {
|
|
39
75
|
return this.location ? [this.location] : this.locations;
|
|
40
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* This function determines if an item can currently be dragged by the user to perform a given move.
|
|
79
|
+
*
|
|
80
|
+
* @param _move The move to consider
|
|
81
|
+
* @param _context Context of the item
|
|
82
|
+
*/
|
|
41
83
|
MaterialDescription.prototype.canDrag = function (_move, _context) {
|
|
42
84
|
return false;
|
|
43
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* This function determines if a move can be played by clicking for 1 second on an item
|
|
88
|
+
*
|
|
89
|
+
* @param move The move to consider
|
|
90
|
+
* @param context Context of the item
|
|
91
|
+
*/
|
|
44
92
|
MaterialDescription.prototype.canLongClick = function (move, _a) {
|
|
45
93
|
var type = _a.type, index = _a.index;
|
|
46
94
|
return ((0, rules_api_1.isMoveItem)(move) || (0, rules_api_1.isDeleteItem)(move) || (0, rules_api_1.isRoll)(move)) && move.itemType === type && move.itemIndex === index;
|
|
47
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* This function determines if a move can be played by clicking on an item
|
|
98
|
+
*
|
|
99
|
+
* @param move The move to consider
|
|
100
|
+
* @param context Context of the item
|
|
101
|
+
*/
|
|
48
102
|
MaterialDescription.prototype.canShortClick = function (move, _a) {
|
|
49
103
|
var type = _a.type, index = _a.index;
|
|
50
104
|
return (0, rules_api_1.isSelectItem)(move) && move.itemType === type && move.itemIndex === index;
|
|
51
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* This function returns the move that should be played when clicking on an item, if any
|
|
108
|
+
*
|
|
109
|
+
* @param _context Context of the item
|
|
110
|
+
*/
|
|
52
111
|
MaterialDescription.prototype.getShortClickMove = function (_context) {
|
|
53
112
|
return undefined;
|
|
54
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* This function returns the local move that should be played when clicking on an item, if any
|
|
116
|
+
*
|
|
117
|
+
* @param _context Context of the item
|
|
118
|
+
*/
|
|
55
119
|
MaterialDescription.prototype.getShortClickLocalMove = function (_context) {
|
|
56
120
|
return undefined;
|
|
57
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Returns the thickness of the item. Default to {@link thickness}
|
|
124
|
+
* @param _item the item
|
|
125
|
+
* @param _context Context of the item
|
|
126
|
+
* @returns {number} The thickness
|
|
127
|
+
*/
|
|
58
128
|
MaterialDescription.prototype.getThickness = function (_item, _context) {
|
|
59
129
|
return this.thickness;
|
|
60
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* Any extra css to add on the item
|
|
133
|
+
* @param _item The item
|
|
134
|
+
* @param _context Context of the item
|
|
135
|
+
* @returns The css, using Emotion framework
|
|
136
|
+
*/
|
|
61
137
|
MaterialDescription.prototype.getItemExtraCss = function (_item, _context) {
|
|
62
138
|
return;
|
|
63
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Whether the item should be highlighted
|
|
142
|
+
* @param _item The item
|
|
143
|
+
* @param _context Context of the item
|
|
144
|
+
* @return true if the item should be highlighted
|
|
145
|
+
*/
|
|
64
146
|
MaterialDescription.prototype.highlight = function (_item, _context) {
|
|
65
147
|
return;
|
|
66
148
|
};
|
|
149
|
+
/**
|
|
150
|
+
* The move to execute in order to display the help dialog about this item.
|
|
151
|
+
* By default, open the help about this specific item, but it can be the help about the location of the item sometimes.
|
|
152
|
+
* @param item The item
|
|
153
|
+
* @param context Context of the item
|
|
154
|
+
* @return The move to play to open the help dialog
|
|
155
|
+
*/
|
|
67
156
|
MaterialDescription.prototype.displayHelp = function (item, _a) {
|
|
68
157
|
var type = _a.type, index = _a.index, displayIndex = _a.displayIndex;
|
|
69
158
|
return displayMaterialHelp(type, item, index, displayIndex);
|
|
70
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Builds the CSS transform that will be applied to the item.
|
|
162
|
+
* @param item Item to position
|
|
163
|
+
* @param context Context of the item
|
|
164
|
+
* @returns {string[]} a list of CSS transformations
|
|
165
|
+
*/
|
|
71
166
|
MaterialDescription.prototype.getItemTransform = function (item, context) {
|
|
72
167
|
var transform = ['translate(-50%, -50%)'];
|
|
73
168
|
var locator = context.locators[item.location.type];
|
|
@@ -75,6 +170,12 @@ var MaterialDescription = (function (_super) {
|
|
|
75
170
|
transform.push.apply(transform, locator.placeItem(item, context));
|
|
76
171
|
return transform;
|
|
77
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
* Builds the CSS transform that will be applied to the item when hovered.
|
|
175
|
+
* @param _item Item to position
|
|
176
|
+
* @param _context Context of the item
|
|
177
|
+
* @returns {string[]} a list of CSS transformations
|
|
178
|
+
*/
|
|
78
179
|
MaterialDescription.prototype.getHoverTransform = function (_item, _context) {
|
|
79
180
|
return [];
|
|
80
181
|
};
|
|
@@ -89,6 +190,11 @@ var MaterialDescription = (function (_super) {
|
|
|
89
190
|
}
|
|
90
191
|
return [];
|
|
91
192
|
};
|
|
193
|
+
MaterialDescription.prototype.getTooltip = function (item, t, _context) {
|
|
194
|
+
if (item.quantity)
|
|
195
|
+
return t('quantity.tooltip', { n: item.quantity });
|
|
196
|
+
return;
|
|
197
|
+
};
|
|
92
198
|
return MaterialDescription;
|
|
93
199
|
}(ComponentDescription_1.ComponentDescription));
|
|
94
200
|
exports.MaterialDescription = MaterialDescription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialDescription.js","sourceRoot":"","sources":["../../../src/components/material/MaterialDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,iDAU4B;
|
|
1
|
+
{"version":3,"file":"MaterialDescription.js","sourceRoot":"","sources":["../../../src/components/material/MaterialDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,iDAU4B;AAI5B,+DAA6D;AAC7D,IAAO,mBAAmB,GAAG,+BAAmB,CAAC,mBAAmB,CAAA;AAYpE;;GAEG;AACH;IACU,uCAA4B;IADtC;QAAA,qEA8MC;QAlMC;;WAEG;QACH,cAAQ,GAAG,KAAK,CAAA;QAOhB;;WAEG;QACH,iBAAW,GAAyB,EAAE,CAAA;QAkCtC;;WAEG;QACH,eAAS,GAAqB,EAAE,CAAA;QA6DhC;;WAEG;QACH,eAAS,GAAG,IAAI,CAAA;;IAgFlB,CAAC;IAnLC;;;;;;OAMG;IACH,4CAAc,GAAd,UAAe,QAAkC;QAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAA;IAC/D,CAAC;IAOD;;;;;;OAMG;IACH,8CAAgB,GAAhB,UAAiB,KAAyB,EAAE,QAAkC;QAC5E,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAYD;;;;;;OA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;IACX,CAAC;IAED,wCAAU,GAAV,UAAW,IAAwB,EAAE,CAAY,EAAE,QAA8B;QAC/E,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;QACrE,OAAM;IACR,CAAC;IACH,0BAAC;AAAD,CAAC,AA9MD,CACU,2CAAoB,GA6M7B;AA9MqB,kDAAmB"}
|
|
@@ -30,10 +30,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.MobileMaterialDescription = void 0;
|
|
33
|
+
/** @jsxImportSource @emotion/react */
|
|
33
34
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
34
35
|
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
35
36
|
var MaterialDescription_1 = require("./MaterialDescription");
|
|
36
|
-
var MobileMaterialDescription = (function (_super) {
|
|
37
|
+
var MobileMaterialDescription = /** @class */ (function (_super) {
|
|
37
38
|
__extends(MobileMaterialDescription, _super);
|
|
38
39
|
function MobileMaterialDescription() {
|
|
39
40
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileMaterialDescription.js","sourceRoot":"","sources":["../../../src/components/material/MobileMaterialDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MobileMaterialDescription.js","sourceRoot":"","sources":["../../../src/components/material/MobileMaterialDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,iDAAkG;AAClG,2DAAoC;AAEpC,6DAA2D;AAE3D;IACU,6CAAoC;IAD9C;QAAA,qEAuBC;QArBC,cAAQ,GAAG,IAAI,CAAA;;IAqBjB,CAAC;IAnB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10 +32,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.isWritingDescription = exports.WritingDescription = void 0;
|
|
34
34
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
35
|
+
/** @jsxImportSource @emotion/react */
|
|
35
36
|
var react_1 = require("@emotion/react");
|
|
36
37
|
var css_1 = require("../../../css");
|
|
37
38
|
var MaterialDescription_1 = require("../MaterialDescription");
|
|
38
|
-
var WritingDescription = (function (_super) {
|
|
39
|
+
var WritingDescription = /** @class */ (function (_super) {
|
|
39
40
|
__extends(WritingDescription, _super);
|
|
40
41
|
function WritingDescription() {
|
|
41
42
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WritingDescription.js","sourceRoot":"","sources":["../../../../src/components/material/Writing/WritingDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"WritingDescription.js","sourceRoot":"","sources":["../../../../src/components/material/Writing/WritingDescription.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAAoC;AAEpC,oCAA4G;AAC5G,8DAAkF;AAElF;IACU,sCAAoC;IAD9C;QAAA,qEAuCC;QAdC,aAAO,GAAG,UAAC,EAA6D;gBAA3D,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA;YACtC,IAAM,KAAK,GAAG,KAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACnC,IAAM,IAAI,GAAG,KAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACjC,IAAM,YAAY,GAAG,KAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;YACjD,OAAO,yCAAK,GAAG,EAAE;oBACf,OAAO;oBACP,IAAA,aAAO,EAAC,IAAI,CAAC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AC,CAAA;AAFY,QAAA,oBAAoB,wBAEhC;AAED,IAAM,OAAO,OAAG,WAAG,sOAAA,kKAOlB,IAAA,CAAA;AAED,IAAM,WAAW,GAAG,UAAC,KAAc;IACjC,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,kBAAY,CAAA;KACpB;SAAM;QACL,WAAO,WAAG,4GAAA,wCAET,KAAA;KACF;AACH,CAAC,CAAA"}
|
|
@@ -28,7 +28,7 @@ var itemMovementCss_util_1 = require("./itemMovementCss.util");
|
|
|
28
28
|
var rotations_utils_1 = require("./rotations.utils");
|
|
29
29
|
var transformItem_util_1 = require("./transformItem.util");
|
|
30
30
|
var lastCreatedItemsIndexes = {};
|
|
31
|
-
var CreateItemAnimations = (function (_super) {
|
|
31
|
+
var CreateItemAnimations = /** @class */ (function (_super) {
|
|
32
32
|
__extends(CreateItemAnimations, _super);
|
|
33
33
|
function CreateItemAnimations(duration) {
|
|
34
34
|
if (duration === void 0) { duration = 1; }
|
|
@@ -23,12 +23,11 @@ exports.DeleteItemAnimations = void 0;
|
|
|
23
23
|
var react_1 = require("@emotion/react");
|
|
24
24
|
var isDroppedItem_1 = require("../utils/isDroppedItem");
|
|
25
25
|
var getFirstStockItemTransforms_util_1 = require("./getFirstStockItemTransforms.util");
|
|
26
|
-
var isMovedOrDeletedItem_util_1 = require("./isMovedOrDeletedItem.util");
|
|
27
26
|
var ItemAnimations_1 = require("./ItemAnimations");
|
|
28
27
|
var itemMovementCss_util_1 = require("./itemMovementCss.util");
|
|
29
28
|
var rotations_utils_1 = require("./rotations.utils");
|
|
30
29
|
var transformItem_util_1 = require("./transformItem.util");
|
|
31
|
-
var DeleteItemAnimations = (function (_super) {
|
|
30
|
+
var DeleteItemAnimations = /** @class */ (function (_super) {
|
|
32
31
|
__extends(DeleteItemAnimations, _super);
|
|
33
32
|
function DeleteItemAnimations(duration, droppedItemDuration) {
|
|
34
33
|
if (duration === void 0) { duration = 1; }
|
|
@@ -47,7 +46,10 @@ var DeleteItemAnimations = (function (_super) {
|
|
|
47
46
|
return this.duration;
|
|
48
47
|
};
|
|
49
48
|
DeleteItemAnimations.prototype.getItemAnimation = function (context, animation) {
|
|
50
|
-
|
|
49
|
+
var rules = context.rules, type = context.type, index = context.index, locators = context.locators;
|
|
50
|
+
var item = rules.material(type).getItem(index);
|
|
51
|
+
var itemLocator = locators[item.location.type];
|
|
52
|
+
if (!(itemLocator === null || itemLocator === void 0 ? void 0 : itemLocator.isItemToAnimate(item, context, animation.move)))
|
|
51
53
|
return;
|
|
52
54
|
var stockTransforms = (0, getFirstStockItemTransforms_util_1.getFirstStockItemTransforms)(context);
|
|
53
55
|
if (stockTransforms) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItemAnimations.js","sourceRoot":"","sources":["../../../../src/components/material/animations/DeleteItemAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqE;AAIrE,wDAAsD;AACtD,uFAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"DeleteItemAnimations.js","sourceRoot":"","sources":["../../../../src/components/material/animations/DeleteItemAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqE;AAIrE,wDAAsD;AACtD,uFAAgF;AAChF,mDAAiD;AACjD,+DAA6D;AAE7D,qDAAwE;AACxE,2DAAoD;AAEpD;IACU,wCAAuB;IAE/B,8BAAsB,QAAY,EAAY,mBAAyB;QAAjD,yBAAA,EAAA,YAAY;QAAY,oCAAA,EAAA,yBAAyB;QAAvE,YACE,iBAAO,SACR;QAFqB,cAAQ,GAAR,QAAQ,CAAI;QAAY,yBAAmB,GAAnB,mBAAmB,CAAM;;IAEvE,CAAC;IAEQ,6CAAc,GAAvB,UAAwB,IAAuB,EAAE,OAA8C;;QAC7F,IAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,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BAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;YACjI,OAAO,IAAA,2CAAoB,EAAC,kBAAkB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;SACpE;aAAM;YACL,IAAM,OAAO,OAAG,iBAAS,8HAAA,0DAIxB,IAAA,CAAA;YACD,WAAO,WAAG,gHAAA,aAAc,EAAO,GAAI,EAAkB,wBAAwB,KAArD,OAAO,EAAI,SAAS,CAAC,QAAQ,EAAwB;SAC9E;IACH,CAAC;IAES,wDAAyB,GAAnC,UAAoC,WAAmB,EAAE,UAAwC,EAAE,QAA8B;QAC/H,WAAO,iBAAS,2HAAA,mCAEC,EAAW,kBAE3B,KAFgB,WAAW,EAE3B;IACH,CAAC;IACH,2BAAC;AAAD,CAAC,AA5CD,CACU,+BAAc,GA2CvB;AA5CY,oDAAoB"}
|
|
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
exports.ItemAnimations = void 0;
|
|
34
34
|
var react_1 = require("@emotion/react");
|
|
35
35
|
var react_client_1 = require("@gamepark/react-client");
|
|
36
|
-
var ItemAnimations = (function (_super) {
|
|
36
|
+
var ItemAnimations = /** @class */ (function (_super) {
|
|
37
37
|
__extends(ItemAnimations, _super);
|
|
38
38
|
function ItemAnimations() {
|
|
39
39
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -24,7 +24,7 @@ var MoveItemAnimations_1 = require("./MoveItemAnimations");
|
|
|
24
24
|
var MoveItemAtOnceAnimations_1 = require("./MoveItemAtOnceAnimations");
|
|
25
25
|
var RollItemAnimations_1 = require("./RollItemAnimations");
|
|
26
26
|
var ShuffleAnimations_1 = require("./ShuffleAnimations");
|
|
27
|
-
var MaterialAnimations = (function (_super) {
|
|
27
|
+
var MaterialAnimations = /** @class */ (function (_super) {
|
|
28
28
|
__extends(MaterialAnimations, _super);
|
|
29
29
|
function MaterialAnimations(duration, droppedItemDuration) {
|
|
30
30
|
var _a;
|
|
@@ -20,7 +20,7 @@ var react_client_1 = require("@gamepark/react-client");
|
|
|
20
20
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
21
21
|
var ItemAnimations_1 = require("./ItemAnimations");
|
|
22
22
|
var MaterialAnimations_1 = require("./MaterialAnimations");
|
|
23
|
-
var MaterialGameAnimations = (function (_super) {
|
|
23
|
+
var MaterialGameAnimations = /** @class */ (function (_super) {
|
|
24
24
|
__extends(MaterialGameAnimations, _super);
|
|
25
25
|
function MaterialGameAnimations() {
|
|
26
26
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -55,7 +55,7 @@ var MaterialGameAnimations = (function (_super) {
|
|
|
55
55
|
return MaterialGameAnimations;
|
|
56
56
|
}(react_client_1.Animations));
|
|
57
57
|
exports.MaterialGameAnimations = MaterialGameAnimations;
|
|
58
|
-
var AnimationConfig = (function (_super) {
|
|
58
|
+
var AnimationConfig = /** @class */ (function (_super) {
|
|
59
59
|
__extends(AnimationConfig, _super);
|
|
60
60
|
function AnimationConfig() {
|
|
61
61
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -30,12 +30,11 @@ exports.MoveItemAnimations = void 0;
|
|
|
30
30
|
var lodash_1 = require("lodash");
|
|
31
31
|
var isDroppedItem_1 = require("../utils/isDroppedItem");
|
|
32
32
|
var isPlacedOnItem_1 = require("../utils/isPlacedOnItem");
|
|
33
|
-
var isMovedOrDeletedItem_util_1 = require("./isMovedOrDeletedItem.util");
|
|
34
33
|
var ItemAnimations_1 = require("./ItemAnimations");
|
|
35
34
|
var itemMovementCss_util_1 = require("./itemMovementCss.util");
|
|
36
35
|
var rotations_utils_1 = require("./rotations.utils");
|
|
37
36
|
var transformItem_util_1 = require("./transformItem.util");
|
|
38
|
-
var MoveItemAnimations = (function (_super) {
|
|
37
|
+
var MoveItemAnimations = /** @class */ (function (_super) {
|
|
39
38
|
__extends(MoveItemAnimations, _super);
|
|
40
39
|
function MoveItemAnimations(duration, droppedItemDuration) {
|
|
41
40
|
if (duration === void 0) { duration = 1; }
|
|
@@ -52,15 +51,17 @@ var MoveItemAnimations = (function (_super) {
|
|
|
52
51
|
return this.droppedItemDuration;
|
|
53
52
|
}
|
|
54
53
|
if ((0, lodash_1.isEqual)((_d = (_c = context.game.items[move.itemType]) === null || _c === void 0 ? void 0 : _c[move.itemIndex]) === null || _d === void 0 ? void 0 : _d.location, move.location)) {
|
|
55
|
-
return 0;
|
|
54
|
+
return 0; // item is moved where it is already (local move preview being validated for instance)
|
|
56
55
|
}
|
|
57
56
|
return this.duration;
|
|
58
57
|
};
|
|
59
58
|
MoveItemAnimations.prototype.getItemAnimation = function (context, animation) {
|
|
60
|
-
|
|
59
|
+
var rules = context.rules, type = context.type, index = context.index, locators = context.locators;
|
|
60
|
+
var item = rules.material(type).getItem(index);
|
|
61
|
+
var itemLocator = locators[item.location.type];
|
|
62
|
+
if (itemLocator === null || itemLocator === void 0 ? void 0 : itemLocator.isItemToAnimate(item, context, animation.move)) {
|
|
61
63
|
return this.getMovedItemAnimation(context, animation);
|
|
62
64
|
}
|
|
63
|
-
var item = context.rules.material(context.type).getItem(context.index);
|
|
64
65
|
var animatedItemContext = __assign(__assign({}, context), { type: animation.move.itemType, index: animation.move.itemIndex });
|
|
65
66
|
if ((0, isPlacedOnItem_1.isPlacedOnItem)(item, animatedItemContext)) {
|
|
66
67
|
return this.getChildItemAnimation(item, context, animation);
|
|
@@ -74,6 +75,7 @@ var MoveItemAnimations = (function (_super) {
|
|
|
74
75
|
var futureRules = new Rules(JSON.parse(JSON.stringify(rules.game)), { player: player });
|
|
75
76
|
futureRules.play(animation.move);
|
|
76
77
|
var futureItem = futureRules.material(type).getItem(futureIndex);
|
|
78
|
+
// 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
|
|
77
79
|
var futureDisplayIndex = ((_a = futureItem.quantity) !== null && _a !== void 0 ? _a : 1) - ((_b = animation.move.quantity) !== null && _b !== void 0 ? _b : 1);
|
|
78
80
|
var futureContext = __assign(__assign({}, context), { rules: futureRules, index: futureIndex, displayIndex: futureDisplayIndex });
|
|
79
81
|
var originTransforms = (0, rotations_utils_1.toSingleRotation)((0, transformItem_util_1.transformItem)(context));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoveItemAnimations.js","sourceRoot":"","sources":["../../../../src/components/material/animations/MoveItemAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iCAAgC;AAEhC,wDAAsD;AACtD,0DAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"MoveItemAnimations.js","sourceRoot":"","sources":["../../../../src/components/material/animations/MoveItemAnimations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iCAAgC;AAEhC,wDAAsD;AACtD,0DAAwD;AACxD,mDAAiD;AACjD,+DAA6D;AAE7D,qDAAwE;AACxE,2DAAoD;AAEpD;IACU,sCAAuB;IAE/B,4BAAsB,QAAY,EAAY,mBAAyB;QAAjD,yBAAA,EAAA,YAAY;QAAY,oCAAA,EAAA,yBAAyB;QAAvE,YACE,iBAAO,SACR;QAFqB,cAAQ,GAAR,QAAQ,CAAI;QAAY,yBAAmB,GAAnB,mBAAmB,CAAM;;IAEvE,CAAC;IAEQ,2CAAc,GAAvB,UAAwB,IAAuB,EAAE,OAA8C;;QAC7F,IAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,CAAC,WAAW,0CAAE,YAAY,mCAAI,CAAC,EAAE,CAAA;QACtI,IAAI,IAAA,6BAAa,EAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,EAAE;YACrE,OAAO,IAAI,CAAC,mBAAmB,CAAA;SAChC;QACD,IAAI,IAAA,gBAAO,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AE,MAAM,GAAK,OAAO,OAAZ,CAAY;QACjD,IAAM,KAAK,GAAG,KAAK,CAAC,WAA4C,CAAA;QAChE,IAAM,WAAW,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAA;QACjF,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAChC,IAAM,aAAa,yBAAQ,OAAO,KAAE,KAAK,EAAE,WAAW,GAAE,CAAA;QACxD,IAAM,gBAAgB,GAAG,IAAA,kCAAa,EAAC,OAAO,CAAC,CAAA;QAC/C,IAAM,gBAAgB,GAAG,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,0CAAE,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,mCAAI,EAAE,CAAA;QACpF,IAAA,oCAAkB,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;QACtD,IAAM,kBAAkB,GAAG,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QACjI,OAAO,IAAA,2CAAoB,EAAC,kBAAkB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IACrE,CAAC;IACH,yBAAC;AAAD,CAAC,AA3ED,CACU,+BAAc,GA0EvB;AA3EY,gDAAkB"}
|
|
@@ -31,7 +31,7 @@ var ItemAnimations_1 = require("./ItemAnimations");
|
|
|
31
31
|
var itemMovementCss_util_1 = require("./itemMovementCss.util");
|
|
32
32
|
var rotations_utils_1 = require("./rotations.utils");
|
|
33
33
|
var transformItem_util_1 = require("./transformItem.util");
|
|
34
|
-
var MoveItemAtOnceAnimations = (function (_super) {
|
|
34
|
+
var MoveItemAtOnceAnimations = /** @class */ (function (_super) {
|
|
35
35
|
__extends(MoveItemAtOnceAnimations, _super);
|
|
36
36
|
function MoveItemAtOnceAnimations(duration) {
|
|
37
37
|
if (duration === void 0) { duration = 1; }
|
|
@@ -54,6 +54,7 @@ var MoveItemAtOnceAnimations = (function (_super) {
|
|
|
54
54
|
var futureRules = new Rules(JSON.parse(JSON.stringify(rules.game)), { player: player });
|
|
55
55
|
futureRules.play(animation.move);
|
|
56
56
|
var futureItem = futureRules.material(type).getItem(context.index);
|
|
57
|
+
// 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
|
|
57
58
|
var futureContext = __assign(__assign({}, context), { rules: futureRules, index: context.index, displayIndex: context.displayIndex });
|
|
58
59
|
var originTransforms = (0, rotations_utils_1.toSingleRotation)((0, transformItem_util_1.transformItem)(context));
|
|
59
60
|
var targetTransforms = (0, rotations_utils_1.toSingleRotation)((_b = (_a = material[type]) === null || _a === void 0 ? void 0 : _a.getItemTransform(futureItem, futureContext)) !== null && _b !== void 0 ? _b : []);
|