@gamepark/react-game 6.24.1 → 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 +14 -0
- package/dist/components/PlayerPanel/Counters.js +45 -0
- package/dist/components/PlayerPanel/Counters.js.map +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.js +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +5 -2
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +48 -15
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/index.d.ts +1 -0
- package/dist/components/PlayerPanel/index.js +1 -0
- package/dist/components/PlayerPanel/index.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 +4 -3
- 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/GameTable/focus/LocationsWithFocus.d.ts +3 -2
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js +10 -3
- package/dist/components/material/GameTable/focus/LocationsWithFocus.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 +6 -4
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.js +12 -8
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +2 -1
- package/dist/components/material/animations/ItemAnimations.js +10 -1
- package/dist/components/material/animations/ItemAnimations.js.map +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.d.ts +1 -2
- package/dist/components/material/animations/MoveItemAnimations.js +15 -24
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.d.ts +1 -2
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +10 -20
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.d.ts +1 -2
- package/dist/components/material/animations/RollItemAnimations.js +5 -11
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.js +1 -1
- package/dist/components/material/animations/adjustRotation.d.ts +1 -1
- package/dist/components/material/animations/adjustRotation.js +60 -19
- package/dist/components/material/animations/adjustRotation.js.map +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.d.ts +2 -0
- package/dist/components/material/animations/rotations.utils.js +110 -0
- package/dist/components/material/animations/rotations.utils.js.map +1 -0
- package/dist/components/material/locations/DropAreaDescription.d.ts +1 -1
- package/dist/components/material/locations/DropAreaDescription.js +9 -2
- package/dist/components/material/locations/DropAreaDescription.js.map +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/LocationsMask.d.ts +2 -1
- package/dist/components/material/locations/LocationsMask.js +2 -2
- package/dist/components/material/locations/LocationsMask.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/usePlayers.js +14 -1
- package/dist/hooks/usePlayers.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/LineLocator.d.ts +8 -8
- package/dist/locators/LineLocator.js +30 -22
- package/dist/locators/LineLocator.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 +192 -3
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +31 -2
- package/dist/locators/PileLocator.js +50 -19
- 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
|
@@ -40,6 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.ItemDisplay = void 0;
|
|
42
42
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
43
|
+
/** @jsxImportSource @emotion/react */
|
|
43
44
|
var react_1 = require("@emotion/react");
|
|
44
45
|
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
45
46
|
var partition_1 = __importDefault(require("lodash/partition"));
|
|
@@ -82,16 +83,16 @@ exports.ItemDisplay = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
82
83
|
setTimeout(onShortClick !== null && onShortClick !== void 0 ? onShortClick : displayHelp);
|
|
83
84
|
}
|
|
84
85
|
},
|
|
85
|
-
filterEvents: function (event) { return !event.button; }
|
|
86
|
+
filterEvents: function (event) { return !event.button; } // Ignore clicks on mouse buttons > 0
|
|
86
87
|
})();
|
|
87
88
|
var canHaveChildren = (0, react_2.useMemo)(function () { return Object.values(context.locators).some(function (locator) { return (locator === null || locator === void 0 ? void 0 : locator.parentItemType) === type; }); }, [context, type]);
|
|
88
89
|
return (0, jsx_runtime_1.jsx)("div", __assign({ css: [
|
|
89
90
|
itemCss,
|
|
90
91
|
hoverTransform && hoverCss(itemTransform.join(' '), description.getSize(item.id), hoverTransform, animating || !!dragTransform)
|
|
91
|
-
] }, props, (0, utilities_1.combineEventListeners)(listeners, props), { children: (0, jsx_runtime_1.jsxs)(MaterialComponent_1.MaterialComponent, __assign({ ref: isFocused ? (0, react_merge_refs_1.mergeRefs)([ref, focusRef]) : ref, type: type, itemId: item.id, highlight: highlight, playDown: playDown !== null && playDown !== void 0 ? playDown : ((focus === null || focus === void 0 ? void 0 : focus.highlight) && !isFocused && !focusedLocations.length), style: { transform: transformStyle }, css: description.getItemExtraCss(item, itemContext) }, { children: [canHaveChildren ? (0, jsx_runtime_1.jsx)(ItemDropLocations, { locations: otherLocations, item: item, type: type }) : (0, jsx_runtime_1.jsx)(ItemLocations, { locations: otherLocations }), focusedLocations.length > 0 && (0, jsx_runtime_1.jsx)(locations_1.LocationsMask, { locations: focusedLocations.map(function (l) { return l.location; }) }), (0, jsx_runtime_1.jsx)(ItemLocations, { locations: focusedLocations })] })) }));
|
|
92
|
+
] }, props, (0, utilities_1.combineEventListeners)(listeners, props), { children: (0, jsx_runtime_1.jsxs)(MaterialComponent_1.MaterialComponent, __assign({ ref: isFocused ? (0, react_merge_refs_1.mergeRefs)([ref, focusRef]) : ref, type: type, itemId: item.id, highlight: highlight, playDown: playDown !== null && playDown !== void 0 ? playDown : ((focus === null || focus === void 0 ? void 0 : focus.highlight) && !isFocused && !focusedLocations.length), style: { transform: transformStyle }, css: description.getItemExtraCss(item, itemContext) }, { children: [canHaveChildren ? (0, jsx_runtime_1.jsx)(ItemDropLocations, { locations: otherLocations, item: item, type: type }) : (0, jsx_runtime_1.jsx)(ItemLocations, { locations: otherLocations }), focusedLocations.length > 0 && (0, jsx_runtime_1.jsx)(locations_1.LocationsMask, { locations: focusedLocations.map(function (l) { return l.location; }), borderRadius: description.getBorderRadius(item.id) }), (0, jsx_runtime_1.jsx)(ItemLocations, { locations: focusedLocations })] })) }));
|
|
92
93
|
});
|
|
93
94
|
var itemCss = (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > * {\n position: absolute;\n }\n"], ["\n > * {\n position: absolute;\n }\n"])));
|
|
94
|
-
var hoverCss = function (itemTransform, itemSize, hoverTransform, disable) { return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover > * > * {\n
|
|
95
|
+
var hoverCss = function (itemTransform, itemSize, hoverTransform, disable) { return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (hover) {\n &:hover > * > * {\n transition: transform 50ms ease-in-out;\n transform: ", ";\n } \n }\n \n > * {\n pointer-events: ", ";\n }\n\n &:before {\n content: \" \";\n position: absolute;\n width: ", "em;\n height: ", "em;\n transform: ", ";\n }\n"], ["\n @media (hover) {\n &:hover > * > * {\n transition: transform 50ms ease-in-out;\n transform: ", ";\n } \n }\n \n > * {\n pointer-events: ", ";\n }\n\n &:before {\n content: \" \";\n position: absolute;\n width: ", "em;\n height: ", "em;\n transform: ", ";\n }\n"])), disable ? '' : hoverTransform, disable ? 'auto' : 'none', itemSize.width, itemSize.height, itemTransform); };
|
|
95
96
|
exports.ItemDisplay.displayName = 'ItemDisplay';
|
|
96
97
|
var ItemLocations = function (_a) {
|
|
97
98
|
var locations = _a.locations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/ItemDisplay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ItemDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/ItemDisplay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAAoC;AAEpC,2DAAoC;AACpC,+DAAwC;AACxC,+BAA+D;AAC/D,qDAA4C;AAC5C,iDAA0F;AAC1F,wCAA4E;AAC5E,oEAA8G;AAC9G,gDAA0D;AAE1D,0CAA4C;AAC5C,0DAAgF;AAChF,kCAA2C;AAC3C,iCAAyC;AAa5B,QAAA,WAAW,GAAG,IAAA,kBAAU,EAAmC,UACtE,EAAoJ,EAAE,GAAG;IAAvJ,IAAA,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,YAAY,kBAAA,EAAE,IAAI,UAAA,EAAE,aAAa,mBAAA,EAAE,SAAS,eAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,WAAW,iBAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAK,KAAK,cAAhI,4IAAkI,CAAF;IAEhI,IAAM,OAAO,GAAG,IAAA,0BAAkB,GAAE,CAAA;IAC9B,IAAA,KAAsB,IAAA,uBAAe,GAAE,EAArC,KAAK,WAAA,EAAE,QAAQ,cAAsB,CAAA;IAC7C,IAAM,WAAW,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,uBAAM,OAAO,KAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,YAAY,cAAA,EAAE,aAAa,eAAA,IAAG,EAA1D,CAA0D,EAAE,CAAC,OAAO,EAAE,IAAI,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AAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAE,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;YACzG,IAAM,iBAAiB,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA;YAChD,IAAI,CAAC,iBAAiB;gBAAE,OAAO,IAAI,CAAA;YACnC,OAAO,uBAAC,iBAAiB,IAAgC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,IAArF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAgE,CAAA;QACzH,CAAC,CAAC,GACD,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -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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MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAE,KAAK,mCAAI,QAAQ,CAAC,CAAA,EAAA,CAChF;IAFD,CAEC,CACF;UACC,IAAA,eAAK,EAAC,KAAK,CAAC,WAAW,EAAE,UAAC,EAAQ;;gBAAN,IAAI,UAAA;YAChC,OAAA,IAAI,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,QAAQ,mCAAI,CAAC,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAE,KAAK,mCAAI,QAAQ,CAAC,CAAA;SAAA,CAChF;UACC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAA;AAC5B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Location } from '@gamepark/rules-api';
|
|
2
|
-
import { LocationContext } from '../../../../locators';
|
|
1
|
+
import { Location, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
+
import { ItemContext, LocationContext } from '../../../../locators';
|
|
3
3
|
import { MaterialFocus } from './MaterialFocus';
|
|
4
4
|
export type LocationsWithFocus = {
|
|
5
5
|
locations: Location[];
|
|
6
6
|
focusedIndexes: number[];
|
|
7
7
|
};
|
|
8
|
+
export declare const getLocationsWithFocus: (item: MaterialItem, context: ItemContext, focus?: MaterialFocus) => LocationsWithFocus;
|
|
8
9
|
export declare const getStaticLocationsWithFocus: (context: LocationContext, focus?: MaterialFocus) => Location[];
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getStaticLocationsWithFocus = void 0;
|
|
6
|
+
exports.getStaticLocationsWithFocus = exports.getLocationsWithFocus = void 0;
|
|
7
7
|
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
8
8
|
var getFocusedLocations = function (locationsFocus, locations) {
|
|
9
9
|
var focusedIndexes = [];
|
|
@@ -23,14 +23,21 @@ var getFocusedLocations = function (locationsFocus, locations) {
|
|
|
23
23
|
}
|
|
24
24
|
return { locations: locations, focusedIndexes: focusedIndexes };
|
|
25
25
|
};
|
|
26
|
+
var getLocationsWithFocus = function (item, context, focus) {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
var locationsFocus = (_b = (_a = focus === null || focus === void 0 ? void 0 : focus.locations) === null || _a === void 0 ? void 0 : _a.filter(function (location) { var _a, _b; return ((_a = context.locators[location.type]) === null || _a === void 0 ? void 0 : _a.parentItemType) === context.type && ((_b = location.parent) !== null && _b !== void 0 ? _b : 0) === context.index; })) !== null && _b !== void 0 ? _b : [];
|
|
29
|
+
var locations = (_d = (_c = context.material[context.type]) === null || _c === void 0 ? void 0 : _c.getLocations(item, context)) !== null && _d !== void 0 ? _d : [];
|
|
30
|
+
return getFocusedLocations(locationsFocus, locations);
|
|
31
|
+
};
|
|
32
|
+
exports.getLocationsWithFocus = getLocationsWithFocus;
|
|
26
33
|
var getStaticLocationsWithFocus = function (context, focus) {
|
|
27
34
|
return Object.keys(context.locators).flatMap(function (type) {
|
|
28
|
-
var _a;
|
|
35
|
+
var _a, _b, _c;
|
|
29
36
|
var locator = context.locators[type];
|
|
30
37
|
if (locator.parentItemType !== undefined)
|
|
31
38
|
return [];
|
|
32
39
|
var locationsFocus = (_a = focus === null || focus === void 0 ? void 0 : focus.locations.filter(function (l) { return l.type === +type; })) !== null && _a !== void 0 ? _a : [];
|
|
33
|
-
var locations = locator.getLocations(context);
|
|
40
|
+
var locations = (_c = (_b = locator.getLocationDescription(context)) === null || _b === void 0 ? void 0 : _b.getLocations(context)) !== null && _c !== void 0 ? _c : [];
|
|
34
41
|
return getFocusedLocations(locationsFocus, locations).locations;
|
|
35
42
|
});
|
|
36
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsWithFocus.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/LocationsWithFocus.ts"],"names":[],"mappings":";;;;;;AACA,2DAAoC;AASpC,IAAM,mBAAmB,GAAG,UAAC,cAA0B,EAAE,SAAqB;IAC5E,IAAM,cAAc,GAAG,EAAE,CAAA;4BACd,aAAa;QACtB,IAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,UAAA,QAAQ,IAAI,OAAA,IAAA,iBAAO,EAAC,QAAQ,EAAE,aAAa,CAAC,EAAhC,CAAgC,CAAC,CAAA;QAC/E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC3B;aAAM;YACL,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YACrC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;SAC9B;;IAPH,KAA4B,UAAc,EAAd,iCAAc,EAAd,4BAAc,EAAd,IAAc;QAArC,IAAM,aAAa,uBAAA;gBAAb,aAAa;KAQvB;IACD,OAAO,EAAE,SAAS,WAAA,EAAE,cAAc,gBAAA,EAAE,CAAA;AACtC,CAAC,CAAA;AAEM,IAAM,2BAA2B,GAAG,UACzC,OAAwB,EAAE,KAAqB;IAE/C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;;QAChD,IAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"LocationsWithFocus.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/LocationsWithFocus.ts"],"names":[],"mappings":";;;;;;AACA,2DAAoC;AASpC,IAAM,mBAAmB,GAAG,UAAC,cAA0B,EAAE,SAAqB;IAC5E,IAAM,cAAc,GAAG,EAAE,CAAA;4BACd,aAAa;QACtB,IAAM,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wB,EAAE,KAAqB;IAE/C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;;QAChD,IAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB,CAAA;QACrD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS;YAAE,OAAO,EAAE,CAAA;QACnD,IAAM,cAAc,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,EAAhB,CAAgB,CAAC,mCAAI,EAAE,CAAA;QAC3E,IAAM,SAAS,GAAG,MAAA,MAAA,OAAO,CAAC,sBAAsB,CAAC,OAAO,CAAC,0CAAE,YAAY,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAA;QACtF,OAAO,mBAAmB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,SAAS,CAAA;IACjE,CAAC,CAAC,CAAA;AAEJ,CAAC,CAAA;AAXY,QAAA,2BAA2B,+BAWvC"}
|
|
@@ -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":[],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otion/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;AA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ClB,CAAC;IAED;;;;;OAKG;IACH,+CAAiB,GAAjB,UAAkB,KAAyB,EAAE,QAA8B;QACzE,OAAO,EAAE,CAAA;IACX,CAAC;IAED,8CAAgB,GAAhB,UAAiB,IAAwB,EAAE,IAA2B,EAAE,OAA6B;;QACnG,IAAI,IAAA,sBAAU,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE;YACxD,OAAO,CAAC,IAAI,CAAC,QAA0B,CAAC,CAAA;SACzC;aAAM,IAAI,IAAA,wBAAY,EAAC,IAAI,CAAC,EAAE;YAC7B,IAAM,aAAa,GAAG,MAAA,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,0CAAE,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACrF,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SAC5C;QACD,OAAO,EAAE,CAAA;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;IAnBC,2CAAO,GAAP,UAAQ,IAA2B,EAAE,OAA6B;;QAChE,IAAI,IAAA,sBAAU,EAAC,IAAI,CAAC,EAAE;YACpB,OAAO,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,MAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACpJ;aAAM,IAAI,IAAA,wBAAY,EAAC,IAAI,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACjH;aAAM;YACL,OAAO,KAAK,CAAA;SACb;IACH,CAAC;IAES,iDAAa,GAAvB,UAAwB,IAAuB,EAAE,EAA4C;;YAA1C,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;QACnE,IAAM,KAAkC,MAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,0CAAE,QAAS,EAA9E,QAAQ,cAAA,EAAK,cAAc,cAA7B,YAA+B,CAAiD,CAAA;QACtF,IAAM,KAA8C,IAAI,CAAC,QAAQ,EAA/C,YAAY,cAAA,EAAK,YAAY,cAAzC,YAA2C,CAAgB,CAAA;QACjE,OAAO,CAAC,IAAA,iBAAO,EAAC,cAAc,EAAE,YAAY,CAAC,CAAA;IAC/C,CAAC;IAES,mDAAe,GAAzB,UAA0B,KAAoB,EAAE,QAA8B;QAC5E,OAAO,IAAI,CAAC,aAAa,KAAK,SAAS,CAAA;IACzC,CAAC;IACH,gCAAC;AAAD,CAAC,AAvBD,CACU,yCAAmB,GAsB5B;AAvBqB,8DAAyB"}
|
|
@@ -32,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,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;oBAChC,KAAK,IAAI,CAAC,IAAA,mBAAa,EAAC,KAAK,CAAC,EAAE,IAAA,eAAS,EAAC,KAAK,CAAC,CAAC;oBACjD,YAAY,IAAI,IAAA,qBAAe,EAAC,YAAY,CAAC;oBAC7C,SAAS,CAAC,CAAC,CAAC,iBAAW,CAAC,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC;iBACzD,gBACE,KAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IACzB,CAAA;QACR,CAAC,CAAA;;IACH,CAAC;IAjCC,qCAAQ,GAAR,UAAS,MAAc;;QACrB,OAAO,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,mCAAI,IAAI,CAAC,KAAK,CAAA;IAC7D,CAAC;IAED,sCAAS,GAAT;QACE,IAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,IAAI,IAAI,CAAC,KAAK;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,CAAC,IAAI,OAAX,MAAM,EAAS,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAa,EAAC;QACvE,OAAO,MAAM,CAAA;IACf,CAAC;IAES,uCAAU,GAApB,UAAqB,MAAc;QACjC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAc,CAAC,KAAK,CAAC,CAAC,CAAC,MAAmB,CAAA;IACjF,CAAC;IAED,4CAAe,GAAf,UAAgB,OAAe;QAC7B,OAAM;IACR,CAAC;IAgBH,yBAAC;AAAD,CAAC,AAvCD,CACU,yCAAmB,GAsC5B;AAvCqB,gDAAkB;AAyCjC,IAAM,oBAAoB,GAAG,UAAgG,WAAiD;IACnL,OAAO,OAAQ,WAAmD,CAAC,eAAe,KAAK,UAAU,CAAA;AACnG,CAAC,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"}
|
|
@@ -22,13 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.CreateItemAnimations = void 0;
|
|
23
23
|
var react_1 = require("@emotion/react");
|
|
24
24
|
var css_1 = require("../../../css");
|
|
25
|
-
var adjustRotation_1 = require("./adjustRotation");
|
|
26
25
|
var getFirstStockItemTransforms_util_1 = require("./getFirstStockItemTransforms.util");
|
|
27
26
|
var ItemAnimations_1 = require("./ItemAnimations");
|
|
28
27
|
var itemMovementCss_util_1 = require("./itemMovementCss.util");
|
|
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; }
|
|
@@ -51,8 +51,10 @@ var CreateItemAnimations = (function (_super) {
|
|
|
51
51
|
return;
|
|
52
52
|
var stockTransforms = (0, getFirstStockItemTransforms_util_1.getFirstStockItemTransforms)(context);
|
|
53
53
|
if (stockTransforms) {
|
|
54
|
-
var
|
|
55
|
-
var
|
|
54
|
+
var originTransforms = (0, rotations_utils_1.toSingleRotation)(stockTransforms);
|
|
55
|
+
var targetTransforms = (0, rotations_utils_1.toSingleRotation)((0, transformItem_util_1.transformItem)(context));
|
|
56
|
+
(0, rotations_utils_1.toClosestRotations)(originTransforms, targetTransforms);
|
|
57
|
+
var animationKeyframes = this.getTransformKeyframes(originTransforms.join(' '), targetTransforms.join(' '), animation, context);
|
|
56
58
|
return (0, itemMovementCss_util_1.movementAnimationCss)(animationKeyframes, animation.duration);
|
|
57
59
|
}
|
|
58
60
|
else {
|