@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
|
@@ -18,32 +18,61 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.PileLocator = void 0;
|
|
19
19
|
var components_1 = require("../components");
|
|
20
20
|
var Locator_1 = require("./Locator");
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* This Locator places items in a disorganised pile.
|
|
23
|
+
*/
|
|
24
|
+
var PileLocator = /** @class */ (function (_super) {
|
|
22
25
|
__extends(PileLocator, _super);
|
|
23
26
|
function PileLocator(clone) {
|
|
24
27
|
var _this = _super.call(this) || this;
|
|
25
28
|
_this.positions = new Map();
|
|
26
29
|
_this.rotations = new Map();
|
|
30
|
+
/**
|
|
31
|
+
* By default, a maximum of 20 items are displayed
|
|
32
|
+
*/
|
|
27
33
|
_this.limit = 20;
|
|
34
|
+
/**
|
|
35
|
+
* Maximum dispersion radius of the items.
|
|
36
|
+
*/
|
|
28
37
|
_this.radius = 0;
|
|
38
|
+
/**
|
|
39
|
+
* Maximum angle of rotation of the items. Defaults to 180, bidirectional so items can have any rotation.
|
|
40
|
+
*/
|
|
29
41
|
_this.maxAngle = 180;
|
|
30
42
|
Object.assign(_this, clone);
|
|
31
43
|
return _this;
|
|
32
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Function to override to provide a {@link radius} that depends on the context
|
|
47
|
+
* @param _location Location to position
|
|
48
|
+
* @param _context Context of the game
|
|
49
|
+
* @returns the maximum dispersion radius of the items.
|
|
50
|
+
*/
|
|
33
51
|
PileLocator.prototype.getRadius = function (_location, _context) {
|
|
34
52
|
return this.radius;
|
|
35
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Function to override to provide a {@link maxAngle} that depends on the context
|
|
56
|
+
* @param _location Location to position
|
|
57
|
+
* @param _context Context of the game
|
|
58
|
+
* @returns the maximum angle of rotation of the items
|
|
59
|
+
*/
|
|
36
60
|
PileLocator.prototype.getMaxAngle = function (_location, _context) {
|
|
37
61
|
return this.maxAngle;
|
|
38
62
|
};
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Identifier of the pile. By default, distinct location areas (different player, id or parent) forms distinct piles.
|
|
65
|
+
* @param item Item to position
|
|
66
|
+
* @param _context Context of the item
|
|
67
|
+
* @returns a unique identifier for the pile of items this location goes to
|
|
68
|
+
*/
|
|
69
|
+
PileLocator.prototype.getPileId = function (item, _context) {
|
|
70
|
+
return [item.location.player, item.location.id, item.location.parent].filter(function (part) { return part !== undefined; }).join('_');
|
|
41
71
|
};
|
|
42
|
-
PileLocator.prototype.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var pileId = this.getPileId(location, context);
|
|
72
|
+
PileLocator.prototype.getItemCoordinates = function (item, context) {
|
|
73
|
+
var location = item.location;
|
|
74
|
+
var index = this.getItemIndex(item, context);
|
|
75
|
+
var pileId = this.getPileId(item, context);
|
|
47
76
|
if (!this.positions.has(pileId))
|
|
48
77
|
this.positions.set(pileId, new Map());
|
|
49
78
|
var pilePositions = this.positions.get(pileId);
|
|
@@ -60,13 +89,10 @@ var PileLocator = (function (_super) {
|
|
|
60
89
|
}
|
|
61
90
|
return pilePositions.get(index);
|
|
62
91
|
};
|
|
63
|
-
PileLocator.prototype.getItemCoordinates = function (item, context) {
|
|
64
|
-
return this.getLocationCoordinates(item.location, context, this.getItemIndex(item, context));
|
|
65
|
-
};
|
|
66
92
|
PileLocator.prototype.getItemRotateZ = function (item, context) {
|
|
67
93
|
var _a;
|
|
68
94
|
var index = this.getItemIndex(item, context);
|
|
69
|
-
var pileId = this.getPileId(item
|
|
95
|
+
var pileId = this.getPileId(item, context);
|
|
70
96
|
if (!this.rotations.has(pileId))
|
|
71
97
|
this.rotations.set(pileId, new Map());
|
|
72
98
|
var pileRotations = this.rotations.get(pileId);
|
|
@@ -81,13 +107,18 @@ var PileLocator = (function (_super) {
|
|
|
81
107
|
var itemDescription = (_a = context.material[context.type]) !== null && _a !== void 0 ? _a : new components_1.CardDescription();
|
|
82
108
|
var item = context.rules.material(context.type).getItem(context.index);
|
|
83
109
|
var _b = itemDescription.getSize(item.id), width = _b.width, height = _b.height;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
if (this.getMaxAngle(location, context) < 180) {
|
|
111
|
+
return new components_1.DropAreaDescription(itemDescription);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
var max = Math.max(width, height);
|
|
115
|
+
var radius = this.getRadius(location, context);
|
|
116
|
+
return new components_1.DropAreaDescription({
|
|
117
|
+
width: max + (typeof radius === 'number' ? radius * 2 : radius.x * 2),
|
|
118
|
+
height: max + (typeof radius === 'number' ? radius * 2 : radius.y * 2),
|
|
119
|
+
borderRadius: max / 2 + (typeof radius === 'number' ? radius : Math.max(radius.x, radius.y))
|
|
120
|
+
});
|
|
121
|
+
}
|
|
91
122
|
};
|
|
92
123
|
return PileLocator;
|
|
93
124
|
}(Locator_1.Locator));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAyF;AACzF,qCAAiE;
|
|
1
|
+
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAyF;AACzF,qCAAiE;AAEjE;;GAEG;AACH;IAAkH,+BAAgB;IAEhI,qBAAY,KAA4B;QAAxC,YACE,iBAAO,SAER;QAEO,eAAS,GAAG,IAAI,GAAG,EAAoC,CAAA;QACvD,eAAS,GAAG,IAAI,GAAG,EAA+B,CAAA;QAE1D;;WAEG;QACH,WAAK,GAAG,EAAE,CAAA;QAEV;;WAEG;QACH,YAAM,GAA2B,CAAC,CAAA;QAYlC;;WAEG;QACH,cAAQ,GAAG,GAAG,CAAA;QA7BZ,MAAM,CAAC,MAAM,CAAC,KAAI,EAAE,KAAK,CAAC,CAAA;;IAC5B,CAAC;IAeD;;;;;OAKG;IACH,+BAAS,GAAT,UAAU,SAAyB,EAAE,QAAkC;QACrE,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAOD;;;;;OAKG;IACH,iCAAW,GAAX,UAAY,SAAyB,EAAE,QAAkC;QACvE,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;;;;OAKG;IACH,+BAAS,GAAT,UAAU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AG,CAAC,CAAC;gBACtE,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAC7F,CAAC,CAAA;SACH;IACH,CAAC;IACH,kBAAC;AAAD,CAAC,AAvGD,CAAkH,iBAAO,GAuGxH;AAvGY,kCAAW"}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines listeners returned by useLongPress hook (onClick, onMouseDown...) with existing properties in order for both functions to be called.
|
|
3
|
+
* @param listeners Listener functions
|
|
4
|
+
* @param props React component properties
|
|
5
|
+
* @returns the properties but if listeners and props contains the same function, both will be called (listener first, then props once which returns the value)
|
|
6
|
+
*/
|
|
1
7
|
export declare function combineEventListeners<T extends Object>(listeners: T, props: Record<string, any>): T;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.combineEventListeners = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Combines listeners returned by useLongPress hook (onClick, onMouseDown...) with existing properties in order for both functions to be called.
|
|
6
|
+
* @param listeners Listener functions
|
|
7
|
+
* @param props React component properties
|
|
8
|
+
* @returns the properties but if listeners and props contains the same function, both will be called (listener first, then props once which returns the value)
|
|
9
|
+
*/
|
|
4
10
|
function combineEventListeners(listeners, props) {
|
|
5
11
|
return Object.entries(listeners).reduce(function (result, _a) {
|
|
6
12
|
var key = _a[0], value = _a[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combineEventListeners.js","sourceRoot":"","sources":["../../src/utilities/combineEventListeners.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"combineEventListeners.js","sourceRoot":"","sources":["../../src/utilities/combineEventListeners.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAmB,SAAY,EAAE,KAA0B;IAC9F,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,UAAC,MAAM,EAAE,EAAY;YAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QAC1D,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;YAAC,cAAY;iBAAZ,UAAY,EAAZ,qBAAY,EAAZ,IAAY;gBAAZ,yBAAY;;YAC5D,KAAK,eAAI,IAAI,EAAC;YACd,OAAO,KAAK,CAAC,GAAG,CAAC,OAAV,KAAK,EAAS,IAAI,EAAC;QAC5B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QACT,OAAO,MAAM,CAAA;IACf,CAAC,EAAE,EAAE,CAAM,CAAA;AACb,CAAC;AARD,sDAQC"}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search for a value that match a predicate in a collection, but only return the match if it is the only match in the collection
|
|
3
|
+
* @param collection Array of values
|
|
4
|
+
* @param predicate Predicate function to test the value
|
|
5
|
+
* @returns Matching item if and only if it is the only matching item
|
|
6
|
+
*/
|
|
1
7
|
export declare function findIfUnique<T>(collection: ArrayLike<T>, predicate: (value: T, index: number, collection: ArrayLike<T>) => boolean): T | undefined;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findIfUnique = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Search for a value that match a predicate in a collection, but only return the match if it is the only match in the collection
|
|
6
|
+
* @param collection Array of values
|
|
7
|
+
* @param predicate Predicate function to test the value
|
|
8
|
+
* @returns Matching item if and only if it is the only matching item
|
|
9
|
+
*/
|
|
4
10
|
function findIfUnique(collection, predicate) {
|
|
5
11
|
var result = undefined;
|
|
6
12
|
for (var i = 0; i < collection.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findIfUnique.util.js","sourceRoot":"","sources":["../../src/utilities/findIfUnique.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"findIfUnique.util.js","sourceRoot":"","sources":["../../src/utilities/findIfUnique.util.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,YAAY,CAAI,UAAwB,EAAE,SAAyE;IACjI,IAAI,MAAM,GAAG,SAAS,CAAA;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;QACvB,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE;YAC/B,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAA;YAC1C,MAAM,GAAG,CAAC,CAAA;SACX;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAVD,oCAUC"}
|
|
@@ -2,4 +2,9 @@ import { InitOptions, Resource } from 'i18next';
|
|
|
2
2
|
import 'dayjs/locale/de';
|
|
3
3
|
import 'dayjs/locale/fr';
|
|
4
4
|
import 'dayjs/locale/ru';
|
|
5
|
+
/**
|
|
6
|
+
* Setup i18next global instance.
|
|
7
|
+
* @param translations The translation mapping
|
|
8
|
+
* @param options i18next options
|
|
9
|
+
*/
|
|
5
10
|
export declare const setupTranslation: (translations: Resource, options?: InitOptions) => void;
|
|
@@ -22,6 +22,11 @@ require("dayjs/locale/de");
|
|
|
22
22
|
require("dayjs/locale/fr");
|
|
23
23
|
require("dayjs/locale/ru");
|
|
24
24
|
var react_i18next_1 = require("react-i18next");
|
|
25
|
+
/**
|
|
26
|
+
* Setup i18next global instance.
|
|
27
|
+
* @param translations The translation mapping
|
|
28
|
+
* @param options i18next options
|
|
29
|
+
*/
|
|
25
30
|
var setupTranslation = function (translations, options) {
|
|
26
31
|
i18next_1.default.use(react_i18next_1.initReactI18next).use(i18next_icu_1.default);
|
|
27
32
|
var query = new URLSearchParams(window.location.search);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.util.js","sourceRoot":"","sources":["../../src/utilities/translation.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAsD;AACtD,4DAA6B;AAC7B,gDAAyB;AACzB,2BAAwB;AACxB,2BAAwB;AACxB,2BAAwB;AACxB,+CAA8C;
|
|
1
|
+
{"version":3,"file":"translation.util.js","sourceRoot":"","sources":["../../src/utilities/translation.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAsD;AACtD,4DAA6B;AAC7B,gDAAyB;AACzB,2BAAwB;AACxB,2BAAwB;AACxB,2BAAwB;AACxB,+CAA8C;AAE9C;;;;GAIG;AACI,IAAM,gBAAgB,GAAG,UAAC,YAAsB,EAAE,OAAqB;IAC5E,iBAAO,CAAC,GAAG,CAAC,gCAAgB,CAAC,CAAC,GAAG,CAAC,qBAAG,CAAC,CAAA;IAEtC,IAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAA;IAE1C,iBAAO,CAAC,IAAI,YACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAC7C,WAAW,EAAE,IAAI,EACjB,YAAY,EAAE,KAAK,EACnB,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,YAAY,IACpB,OAAO,EACV,CAAC,KAAK,CAAC,UAAA,KAAK,IAAI,OAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAA;IAEvC,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC,CAAA;AAjBY,QAAA,gBAAgB,oBAiB5B"}
|
|
@@ -1,45 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.animations = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.constants.ts
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Functions should return denominator of the target value, which is the next animation step.
|
|
9
|
+
* t is a value from 0 to 1, reflecting the percentage of animation status.
|
|
10
|
+
*/
|
|
4
11
|
var easeOut = function (t) {
|
|
5
12
|
return -Math.cos(t * Math.PI) / 2 + 0.5;
|
|
6
13
|
};
|
|
14
|
+
// linear
|
|
7
15
|
var linear = function (t) {
|
|
8
16
|
return t;
|
|
9
17
|
};
|
|
18
|
+
// accelerating from zero velocity
|
|
10
19
|
var easeInQuad = function (t) {
|
|
11
20
|
return t * t;
|
|
12
21
|
};
|
|
22
|
+
// decelerating to zero velocity
|
|
13
23
|
var easeOutQuad = function (t) {
|
|
14
24
|
return t * (2 - t);
|
|
15
25
|
};
|
|
26
|
+
// acceleration until halfway, then deceleration
|
|
16
27
|
var easeInOutQuad = function (t) {
|
|
17
28
|
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
18
29
|
};
|
|
30
|
+
// accelerating from zero velocity
|
|
19
31
|
var easeInCubic = function (t) {
|
|
20
32
|
return t * t * t;
|
|
21
33
|
};
|
|
34
|
+
// decelerating to zero velocity
|
|
22
35
|
var easeOutCubic = function (t) {
|
|
23
36
|
return --t * t * t + 1;
|
|
24
37
|
};
|
|
38
|
+
// acceleration until halfway, then deceleration
|
|
25
39
|
var easeInOutCubic = function (t) {
|
|
26
40
|
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
27
41
|
};
|
|
42
|
+
// accelerating from zero velocity
|
|
28
43
|
var easeInQuart = function (t) {
|
|
29
44
|
return t * t * t * t;
|
|
30
45
|
};
|
|
46
|
+
// decelerating to zero velocity
|
|
31
47
|
var easeOutQuart = function (t) {
|
|
32
48
|
return 1 - --t * t * t * t;
|
|
33
49
|
};
|
|
50
|
+
// acceleration until halfway, then deceleration
|
|
34
51
|
var easeInOutQuart = function (t) {
|
|
35
52
|
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
36
53
|
};
|
|
54
|
+
// accelerating from zero velocity
|
|
37
55
|
var easeInQuint = function (t) {
|
|
38
56
|
return t * t * t * t * t;
|
|
39
57
|
};
|
|
58
|
+
// decelerating to zero velocity
|
|
40
59
|
var easeOutQuint = function (t) {
|
|
41
60
|
return 1 + --t * t * t * t * t;
|
|
42
61
|
};
|
|
62
|
+
// acceleration until halfway, then deceleration
|
|
43
63
|
var easeInOutQuint = function (t) {
|
|
44
64
|
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
45
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.constants.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"animations.constants.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH;;;GAGG;AACH,IAAM,OAAO,GAAG,UAAC,CAAS;IACxB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;AACzC,CAAC,CAAA;AACD,SAAS;AACT,IAAM,MAAM,GAAG,UAAC,CAAS;IACvB,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AACD,kCAAkC;AAClC,IAAM,UAAU,GAAG,UAAC,CAAS;IAC3B,OAAO,CAAC,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(exports, "__esModule", { value: true });
|
|
3
3
|
exports.animate = exports.handleSetupAnimation = exports.handleCancelAnimation = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/animations/animations.utils.ts
|
|
6
|
+
*/
|
|
4
7
|
var animations_constants_1 = require("./animations.constants");
|
|
5
8
|
var handleCancelAnimationFrame = function (animation) {
|
|
6
9
|
if (typeof animation === 'number') {
|
|
@@ -11,6 +14,7 @@ var handleCancelAnimation = function (contextInstance) {
|
|
|
11
14
|
if (!contextInstance.mounted)
|
|
12
15
|
return;
|
|
13
16
|
handleCancelAnimationFrame(contextInstance.animation);
|
|
17
|
+
// Clear animation state
|
|
14
18
|
contextInstance.animate = false;
|
|
15
19
|
contextInstance.animation = null;
|
|
16
20
|
contextInstance.velocity = null;
|
|
@@ -21,7 +25,9 @@ function handleSetupAnimation(contextInstance, animationName, animationTime, cal
|
|
|
21
25
|
return;
|
|
22
26
|
var startTime = new Date().getTime();
|
|
23
27
|
var lastStep = 1;
|
|
28
|
+
// if another animation is active
|
|
24
29
|
(0, exports.handleCancelAnimation)(contextInstance);
|
|
30
|
+
// new animation
|
|
25
31
|
contextInstance.animation = function () {
|
|
26
32
|
if (!contextInstance.mounted) {
|
|
27
33
|
return handleCancelAnimationFrame(contextInstance.animation);
|
|
@@ -59,6 +65,7 @@ function animate(contextInstance, targetState, animationTime, animationName) {
|
|
|
59
65
|
setTransformState(targetState.scale, targetState.positionX, targetState.positionY);
|
|
60
66
|
}
|
|
61
67
|
else {
|
|
68
|
+
// animation start timestamp
|
|
62
69
|
handleSetupAnimation(contextInstance, animationName, animationTime, function (step) {
|
|
63
70
|
var newScale = scale + scaleDiff * step;
|
|
64
71
|
var newPositionX = positionX + positionXDiff * step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"animations.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.util.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAmD;AAGnD,IAAM,0BAA0B,GAAG,UAAC,SAA+B;IACjE,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QACjC,oBAAoB,CAAC,SAAS,CAAC,CAAA;KAChC;AACH,CAAC,CAAA;AAEM,IAAM,qBAAqB,GAAG,UACnC,eAAyC;IAEzC,IAAI,CAAC,eAAe,CAAC,OAAO;QAAE,OAAM;IACpC,0BAA0B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;IACrD,wBAAwB;IACxB,eAAe,CAAC,OAAO,GAAG,KAAK,CAAA;IAC/B,eAAe,CAAC,SAAS,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAA;AACjC,CAAC,CAAA;AATY,QAAA,qBAAqB,yBASjC;AAED,SAAgB,oBAAoB,CAClC,eAAyC,EACzC,aAAqB,EACrB,aAAqB,EACrB,QAAgC;IAEhC,IAAI,CAAC,eAAe,CAAC,OAAO;QAAE,OAAM;IACpC,IAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IACtC,IAAM,QAAQ,GAAG,CAAC,CAAA;IAElB,iCAAiC;IACjC,IAAA,6BAAqB,EAAC,eAAe,CAAC,CAAA;IAEtC,gBAAgB;IAChB,eAAe,CAAC,SAAS,GAAG;QAC1B,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE;YAC5B,OAAO,0BAA0B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;SAC7D;QAED,IAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,SAAS,CAAA;QAClD,IAAM,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAAA;QACnD,IAAM,aAAa,GAAG,iCAAU,CAAC,aAAa,CAAC,CAAA;QAE/C,IAAM,IAA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IAAI,aAAa,KAAK,CAAC,EAAE;QACvB,iBAAiB,CACf,WAAW,CAAC,KAAK,EACjB,WAAW,CAAC,SAAS,EACrB,WAAW,CAAC,SAAS,CACtB,CAAA;KACF;SAAM;QACL,4BAA4B;QAC5B,oBAAoB,CAClB,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAC,IAAY;YACX,IAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,CAAA;YACzC,IAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAAA;YACrD,IAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAAA;YAErD,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAA;QACzD,CAAC,CACF,CAAA;KACF;AACH,CAAC;AArCD,0BAqCC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/bounds.util.ts
|
|
3
|
+
*/
|
|
1
4
|
import { BoundsType, PositionType, ReactZoomPanPinchContext } from 'react-zoom-pan-pinch';
|
|
2
5
|
export declare function getComponentsSizes(wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement, newScale: number): any;
|
|
3
6
|
export declare const getBounds: (wrapperWidth: number, newContentWidth: number, diffWidth: number, wrapperHeight: number, newContentHeight: number, diffHeight: number, centerZoomedOut: boolean) => BoundsType;
|
|
4
7
|
export declare const calculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
8
|
+
/**
|
|
9
|
+
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
10
|
+
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
11
|
+
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
12
|
+
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
13
|
+
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
14
|
+
*/
|
|
5
15
|
export declare const boundLimiter: (value: number, minBound: number, maxBound: number, isActive: boolean) => number;
|
|
6
16
|
export declare const handleCalculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
7
17
|
export declare function getMouseBoundedPosition(positionX: number, positionY: number, bounds: BoundsType, limitToBounds: boolean, paddingValueX: number, paddingValueY: number, wrapperComponent: HTMLDivElement | null): PositionType;
|
|
@@ -45,6 +45,13 @@ var calculateBounds = function (contextInstance, newScale) {
|
|
|
45
45
|
return (0, exports.getBounds)(wrapperWidth, newContentWidth, newDiffWidth, wrapperHeight, newContentHeight, newDiffHeight, Boolean(centerZoomedOut));
|
|
46
46
|
};
|
|
47
47
|
exports.calculateBounds = calculateBounds;
|
|
48
|
+
/**
|
|
49
|
+
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
50
|
+
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
51
|
+
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
52
|
+
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
53
|
+
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
54
|
+
*/
|
|
48
55
|
var boundLimiter = function (value, minBound, maxBound, isActive) {
|
|
49
56
|
if (!isActive)
|
|
50
57
|
return (0, calculation_util_1.roundNumber)(value, 2);
|
|
@@ -57,6 +64,7 @@ var boundLimiter = function (value, minBound, maxBound, isActive) {
|
|
|
57
64
|
exports.boundLimiter = boundLimiter;
|
|
58
65
|
var handleCalculateBounds = function (contextInstance, newScale) {
|
|
59
66
|
var bounds = (0, exports.calculateBounds)(contextInstance, newScale);
|
|
67
|
+
// Save bounds
|
|
60
68
|
contextInstance.bounds = bounds;
|
|
61
69
|
return bounds;
|
|
62
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/bounds.util.ts"],"names":[],"mappings":";;;AAIA,uDAAgD;AAEhD,SAAg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EAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;IAEzD,cAAc;IACd,eAAe,CAAC,MAAM,GAAG,MAAM,CAAA;IAC/B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AATY,QAAA,qBAAqB,yBASjC;AAED,SAAgB,uBAAuB,CACrC,SAAiB,EACjB,SAAiB,EACjB,MAAkB,EAClB,aAAsB,EACtB,aAAqB,EACrB,aAAqB,EACrB,gBAAuC;IAE/B,IAAA,YAAY,GAA+C,MAAM,aAArD,EAAE,YAAY,GAAiC,MAAM,aAAvC,EAAE,YAAY,GAAmB,MAAM,aAAzB,EAAE,YAAY,GAAK,MAAM,aAAX,CAAW;IAEzE,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,QAAQ,GAAG,CAAC,CAAA;IAEhB,IAAI,gBAAgB,EAAE;QACpB,QAAQ,GAAG,aAAa,CAAA;QACxB,QAAQ,GAAG,aAAa,CAAA;KACzB;IAED,IAAM,CAAC,GAAG,IAAA,oBAAY,EACpB,SAAS,EACT,YAAY,GAAG,QAAQ,EACvB,YAAY,GAAG,QAAQ,EACvB,aAAa,CACd,CAAA;IAED,IAAM,CAAC,GAAG,IAAA,oBAAY,EACpB,SAAS,EACT,YAAY,GAAG,QAAQ,EACvB,YAAY,GAAG,QAAQ,EACvB,aAAa,CACd,CAAA;IACD,OAAO,EAAE,CAAC,GAAA,EAAE,CAAC,GAAA,EAAE,CAAA;AACjB,CAAC;AAjCD,0DAiCC"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/calculations.utils.ts
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Rounds number to given decimal
|
|
6
|
+
* eg. roundNumber(2.34343, 1) => 2.3
|
|
7
|
+
*/
|
|
1
8
|
export declare const roundNumber: (num: number, decimal: number) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if value is number, if not it returns default value
|
|
11
|
+
* 1# eg. checkIsNumber(2, 30) => 2
|
|
12
|
+
* 2# eg. checkIsNumber(null, 30) => 30
|
|
13
|
+
*/
|
|
2
14
|
export declare const checkIsNumber: (num: any, defaultValue: number) => number;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/utils/calculations.utils.ts
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.checkIsNumber = exports.roundNumber = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Rounds number to given decimal
|
|
9
|
+
* eg. roundNumber(2.34343, 1) => 2.3
|
|
10
|
+
*/
|
|
4
11
|
var roundNumber = function (num, decimal) {
|
|
5
12
|
return Number(num.toFixed(decimal));
|
|
6
13
|
};
|
|
7
14
|
exports.roundNumber = roundNumber;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if value is number, if not it returns default value
|
|
17
|
+
* 1# eg. checkIsNumber(2, 30) => 2
|
|
18
|
+
* 2# eg. checkIsNumber(null, 30) => 30
|
|
19
|
+
*/
|
|
8
20
|
var checkIsNumber = function (num, defaultValue) {
|
|
9
21
|
return typeof num === "number" ? num : defaultValue;
|
|
10
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculation.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/calculation.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"calculation.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/calculation.util.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;;GAGG;AACI,IAAM,WAAW,GAAG,UAAC,GAAW,EAAE,OAAe;IACtD,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEF;;;;GAIG;AACI,IAAM,aAAa,GAAG,UAAC,GAAQ,EAAE,YAAoB;IAC1D,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lib https://github.com/BetterTyped/react-zoom-pan-pinch does not export their utility functions and does not offer a "zoom to multiple elements" feature
|
|
3
|
+
* that we need. The code from "zoomToElement" is simply adapted and all the utility functions they use is copied here.
|
|
4
|
+
*/
|
|
1
5
|
export * from './animations.constants';
|
|
2
6
|
export * from './animations.util';
|
|
3
7
|
export * from './bounds.util';
|
|
@@ -14,6 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Lib https://github.com/BetterTyped/react-zoom-pan-pinch does not export their utility functions and does not offer a "zoom to multiple elements" feature
|
|
19
|
+
* that we need. The code from "zoomToElement" is simply adapted and all the utility functions they use is copied here.
|
|
20
|
+
*/
|
|
17
21
|
__exportStar(require("./animations.constants"), exports);
|
|
18
22
|
__exportStar(require("./animations.util"), exports);
|
|
19
23
|
__exportStar(require("./bounds.util"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,yDAAsC;AACtC,oDAAiC;AACjC,gDAA6B;AAC7B,qDAAkC;AAClC,8CAA2B"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkZoomBounds = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comes from https://github.com/prc5/react-zoom-pan-pinch/blob/master/src/core/zoom/zoom.utils.ts
|
|
6
|
+
*/
|
|
4
7
|
function checkZoomBounds(zoom, minScale, maxScale, zoomPadding, enablePadding) {
|
|
5
8
|
var scalePadding = enablePadding ? zoomPadding : 0;
|
|
6
9
|
var minScaleWithPadding = minScale - scalePadding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/zoom.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"zoom.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/zoom.util.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,eAAe,CAC7B,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,WAAmB,EACnB,aAAsB;IAEtB,IAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,IAAM,mBAAmB,GAAG,QAAQ,GAAG,YAAY,CAAA;IAEnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAChE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,mBAAmB;QACxD,OAAO,mBAAmB,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC;AAdD,0CAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/react-game",
|
|
3
|
-
"version": "6.24.
|
|
3
|
+
"version": "6.24.3",
|
|
4
4
|
"description": "React components & tools to create a Board Game user interface for Game Park",
|
|
5
5
|
"author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",
|
|
6
6
|
"license": "ISC",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
28
28
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
29
29
|
"@gamepark/avataaars": "^2.2.0",
|
|
30
|
-
"@gamepark/react-client": "~6.24.
|
|
31
|
-
"@gamepark/rules-api": "~6.24.
|
|
30
|
+
"@gamepark/react-client": "~6.24.3",
|
|
31
|
+
"@gamepark/rules-api": "~6.24.3",
|
|
32
32
|
"dayjs": "^1.11.7",
|
|
33
33
|
"emotion-normalize": "^11.0.1",
|
|
34
34
|
"fscreen": "^1.2.0",
|