@gamepark/react-game 6.23.3 → 6.24.1
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/Header/MaterialHeader.js +2 -1
- package/dist/components/Header/MaterialHeader.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.d.ts +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +6 -6
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +13 -6
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/material/ComponentDescription.d.ts +14 -0
- package/dist/components/material/ComponentDescription.js +27 -0
- package/dist/components/material/ComponentDescription.js.map +1 -0
- package/dist/components/material/Dices/CubicDiceDescription.d.ts +1 -0
- package/dist/components/material/Dices/CubicDiceDescription.js +13 -0
- package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
- package/dist/components/material/DraggableMaterial.d.ts +1 -13
- package/dist/components/material/DraggableMaterial.js +37 -91
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.d.ts +2 -2
- package/dist/components/material/FlatMaterial/CardDescription.js +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +4 -2
- package/dist/components/material/FlatMaterial/FlatMaterial.js +17 -11
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/TokenDescription.d.ts +1 -1
- package/dist/components/material/FlatMaterial/TokenDescription.js.map +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.js +9 -7
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.d.ts +4 -2
- package/dist/components/material/GameTable/ItemDisplay.js +104 -15
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.js +2 -2
- package/dist/components/material/GameTable/StaticItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticLocationsDisplay.js +12 -12
- package/dist/components/material/GameTable/StaticLocationsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/focus/FocusProvider.d.ts +6 -6
- package/dist/components/material/GameTable/focus/FocusProvider.js +2 -2
- package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
- package/dist/components/material/GameTable/focus/LocationsWithFocus.d.ts +2 -3
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js +3 -10
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js.map +1 -1
- package/dist/components/material/GameTable/focus/index.d.ts +0 -1
- package/dist/components/material/GameTable/focus/index.js +0 -1
- package/dist/components/material/GameTable/focus/index.js.map +1 -1
- package/dist/components/material/ImageLoader/MaterialImageLoader.js +17 -11
- package/dist/components/material/ImageLoader/MaterialImageLoader.js.map +1 -1
- package/dist/components/material/MaterialComponent.d.ts +0 -4
- package/dist/components/material/MaterialComponent.js +5 -18
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialDescription.d.ts +5 -13
- package/dist/components/material/MaterialDescription.js +48 -22
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.d.ts +0 -4
- package/dist/components/material/Writing/WritingDescription.js +0 -10
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/animations/MaterialAnimations.d.ts +2 -2
- package/dist/components/material/animations/MoveItemAnimations.js +11 -13
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +7 -10
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.js +3 -5
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js +3 -6
- package/dist/components/material/animations/getFirstStockItemTransforms.util.js.map +1 -1
- package/dist/components/material/animations/transformItem.util.js +3 -5
- package/dist/components/material/animations/transformItem.util.js.map +1 -1
- package/dist/components/material/index.d.ts +1 -0
- package/dist/components/material/index.js +1 -0
- package/dist/components/material/index.js.map +1 -1
- package/dist/components/material/locations/DropAreaDescription.d.ts +9 -0
- package/dist/components/material/locations/DropAreaDescription.js +39 -0
- package/dist/components/material/locations/DropAreaDescription.js.map +1 -0
- package/dist/components/material/locations/LocationComponent.d.ts +16 -0
- package/dist/components/material/locations/LocationComponent.js +89 -0
- package/dist/components/material/locations/LocationComponent.js.map +1 -0
- package/dist/components/material/locations/LocationDescription.d.ts +14 -25
- package/dist/components/material/locations/LocationDescription.js +43 -50
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/LocationDisplay.d.ts +4 -1
- package/dist/components/material/locations/LocationDisplay.js +4 -9
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/LocationsMask.js +4 -4
- package/dist/components/material/locations/LocationsMask.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.d.ts +4 -7
- package/dist/components/material/locations/SimpleDropArea.js +18 -88
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/material/locations/index.d.ts +1 -0
- package/dist/components/material/locations/index.js +1 -0
- package/dist/components/material/locations/index.js.map +1 -1
- package/dist/components/material/utils/isDroppedItem.js +12 -1
- package/dist/components/material/utils/isDroppedItem.js.map +1 -1
- package/dist/components/material/utils/isPlacedOnItem.d.ts +3 -3
- package/dist/components/material/utils/isPlacedOnItem.js +5 -5
- package/dist/components/material/utils/isPlacedOnItem.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorial.js +4 -4
- package/dist/components/tutorial/MaterialTutorial.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +7 -6
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/components/tutorial/TutorialRulesWrapper.js +26 -26
- package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useDraggedItem.d.ts +2 -0
- package/dist/hooks/useDraggedItem.js +19 -0
- package/dist/hooks/useDraggedItem.js.map +1 -0
- package/dist/hooks/useItemLocations.d.ts +8 -0
- package/dist/hooks/useItemLocations.js +83 -0
- package/dist/hooks/useItemLocations.js.map +1 -0
- package/dist/hooks/useItemLocator.d.ts +2 -2
- package/dist/hooks/useItemLocator.js.map +1 -1
- package/dist/hooks/useLegalMoves.js +4 -18
- package/dist/hooks/useLegalMoves.js.map +1 -1
- package/dist/hooks/useStaticLocations.d.ts +2 -0
- package/dist/hooks/useStaticLocations.js +53 -0
- package/dist/hooks/useStaticLocations.js.map +1 -0
- package/dist/hooks/useTutorialStep.js +2 -2
- package/dist/hooks/useTutorialStep.js.map +1 -1
- package/dist/hooks/useZoomToElements.d.ts +1 -1
- package/dist/hooks/useZoomToElements.js +8 -8
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/locators/DeckLocator.d.ts +5 -4
- package/dist/locators/DeckLocator.js +6 -8
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.d.ts +18 -0
- package/dist/locators/FlexLocator.js +88 -0
- package/dist/locators/FlexLocator.js.map +1 -0
- package/dist/locators/HandLocator.d.ts +22 -13
- package/dist/locators/HandLocator.js +71 -39
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/LineLocator.d.ts +8 -8
- package/dist/locators/LineLocator.js +22 -30
- package/dist/locators/LineLocator.js.map +1 -1
- package/dist/locators/ListLocator.d.ts +18 -0
- package/dist/locators/ListLocator.js +97 -0
- package/dist/locators/ListLocator.js.map +1 -0
- package/dist/locators/Locator.d.ts +50 -0
- package/dist/locators/Locator.js +152 -0
- package/dist/locators/Locator.js.map +1 -0
- package/dist/locators/PileLocator.d.ts +13 -11
- package/dist/locators/PileLocator.js +45 -31
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/locators/index.d.ts +3 -3
- package/dist/locators/index.js +3 -3
- package/dist/locators/index.js.map +1 -1
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/translation.util.d.ts +5 -0
- package/dist/utilities/translation.util.js +33 -0
- package/dist/utilities/translation.util.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/animations.constants.d.ts +16 -0
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +62 -0
- package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/animations.util.d.ts +4 -0
- package/dist/utilities/zoom-pan-pinch/animations.util.js +71 -0
- package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.d.ts +7 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js +77 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.d.ts +2 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js +12 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/index.d.ts +5 -0
- package/dist/utilities/zoom-pan-pinch/index.js +22 -0
- package/dist/utilities/zoom-pan-pinch/index.js.map +1 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +1 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +14 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -0
- package/package.json +3 -3
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { Coordinates, MaterialItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Coordinates, Location, MaterialItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
+
import { LocationDescription } from '../components';
|
|
3
|
+
import { ItemContext, Locator, MaterialContext } from './Locator';
|
|
4
|
+
export declare class PileLocator<P extends number = number, M extends number = number, L extends number = number> extends Locator<P, M, L> {
|
|
5
|
+
constructor(clone?: Partial<PileLocator>);
|
|
5
6
|
private positions;
|
|
6
7
|
private rotations;
|
|
7
|
-
|
|
8
|
-
getRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
|
|
9
|
-
coordinates: Coordinates;
|
|
10
|
-
getCoordinates(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Coordinates;
|
|
8
|
+
limit: number;
|
|
11
9
|
radius: number | XYCoordinates;
|
|
12
|
-
getRadius(
|
|
10
|
+
getRadius(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number | XYCoordinates;
|
|
13
11
|
maxAngle: number;
|
|
14
|
-
getMaxAngle(
|
|
15
|
-
getPileId(
|
|
12
|
+
getMaxAngle(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
13
|
+
getPileId(location: Location<P, L>, _context: MaterialContext<P, M, L>): string;
|
|
14
|
+
getLocationCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>, index?: number | undefined): Partial<Coordinates>;
|
|
15
|
+
getItemCoordinates(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Partial<Coordinates>;
|
|
16
|
+
getItemRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
|
|
17
|
+
protected generateLocationDescriptionFromDraggedItem(location: Location<P, L>, context: ItemContext<P, M, L>): LocationDescription<P, M, L>;
|
|
16
18
|
}
|
|
@@ -16,66 +16,80 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PileLocator = void 0;
|
|
19
|
-
var
|
|
19
|
+
var components_1 = require("../components");
|
|
20
|
+
var Locator_1 = require("./Locator");
|
|
20
21
|
var PileLocator = (function (_super) {
|
|
21
22
|
__extends(PileLocator, _super);
|
|
22
|
-
function PileLocator() {
|
|
23
|
-
var _this = _super
|
|
24
|
-
_this.limit = 20;
|
|
23
|
+
function PileLocator(clone) {
|
|
24
|
+
var _this = _super.call(this) || this;
|
|
25
25
|
_this.positions = new Map();
|
|
26
26
|
_this.rotations = new Map();
|
|
27
|
-
_this.
|
|
27
|
+
_this.limit = 20;
|
|
28
28
|
_this.radius = 0;
|
|
29
29
|
_this.maxAngle = 180;
|
|
30
|
+
Object.assign(_this, clone);
|
|
30
31
|
return _this;
|
|
31
32
|
}
|
|
32
|
-
PileLocator.prototype.
|
|
33
|
-
|
|
33
|
+
PileLocator.prototype.getRadius = function (_location, _context) {
|
|
34
|
+
return this.radius;
|
|
35
|
+
};
|
|
36
|
+
PileLocator.prototype.getMaxAngle = function (_location, _context) {
|
|
37
|
+
return this.maxAngle;
|
|
38
|
+
};
|
|
39
|
+
PileLocator.prototype.getPileId = function (location, _context) {
|
|
40
|
+
return [location.player, location.id, location.parent].filter(function (part) { return part !== undefined; }).join('_');
|
|
41
|
+
};
|
|
42
|
+
PileLocator.prototype.getLocationCoordinates = function (location, context, index) {
|
|
43
|
+
if (index === void 0) { index = this.getLocationIndex(location, context); }
|
|
44
|
+
if (index === undefined)
|
|
45
|
+
return this.getCoordinates(location, context);
|
|
46
|
+
var pileId = this.getPileId(location, context);
|
|
34
47
|
if (!this.positions.has(pileId))
|
|
35
48
|
this.positions.set(pileId, new Map());
|
|
36
49
|
var pilePositions = this.positions.get(pileId);
|
|
37
|
-
var
|
|
38
|
-
var radius = this.getRadius(item, context);
|
|
50
|
+
var radius = this.getRadius(location, context);
|
|
39
51
|
if (!pilePositions.has(index)) {
|
|
40
|
-
var
|
|
52
|
+
var _a = this.getCoordinates(location, context), _b = _a.x, x = _b === void 0 ? 0 : _b, _c = _a.y, y = _c === void 0 ? 0 : _c, _d = _a.z, z = _d === void 0 ? 0 : _d;
|
|
41
53
|
var distance = Math.random();
|
|
42
54
|
var direction = Math.random() * 2 * Math.PI;
|
|
43
55
|
pilePositions.set(index, {
|
|
44
|
-
x:
|
|
45
|
-
y:
|
|
46
|
-
z:
|
|
56
|
+
x: x + Math.cos(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.x),
|
|
57
|
+
y: y + Math.sin(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.y),
|
|
58
|
+
z: z + index * 0.05
|
|
47
59
|
});
|
|
48
60
|
}
|
|
49
61
|
return pilePositions.get(index);
|
|
50
62
|
};
|
|
51
|
-
PileLocator.prototype.
|
|
63
|
+
PileLocator.prototype.getItemCoordinates = function (item, context) {
|
|
64
|
+
return this.getLocationCoordinates(item.location, context, this.getItemIndex(item, context));
|
|
65
|
+
};
|
|
66
|
+
PileLocator.prototype.getItemRotateZ = function (item, context) {
|
|
52
67
|
var _a;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var pileId = this.getPileId(item, context);
|
|
68
|
+
var index = this.getItemIndex(item, context);
|
|
69
|
+
var pileId = this.getPileId(item.location, context);
|
|
56
70
|
if (!this.rotations.has(pileId))
|
|
57
71
|
this.rotations.set(pileId, new Map());
|
|
58
72
|
var pileRotations = this.rotations.get(pileId);
|
|
59
|
-
var index = this.getItemIndex(item, context);
|
|
60
73
|
if (!pileRotations.has(index)) {
|
|
61
|
-
var maxAngle = this.getMaxAngle(item, context);
|
|
74
|
+
var maxAngle = this.getMaxAngle(item.location, context);
|
|
62
75
|
pileRotations.set(index, (Math.random() - 0.5) * maxAngle);
|
|
63
76
|
}
|
|
64
77
|
return (_a = pileRotations.get(index)) !== null && _a !== void 0 ? _a : 0;
|
|
65
78
|
};
|
|
66
|
-
PileLocator.prototype.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
PileLocator.prototype.generateLocationDescriptionFromDraggedItem = function (location, context) {
|
|
80
|
+
var _a;
|
|
81
|
+
var itemDescription = (_a = context.material[context.type]) !== null && _a !== void 0 ? _a : new components_1.CardDescription();
|
|
82
|
+
var item = context.rules.material(context.type).getItem(context.index);
|
|
83
|
+
var _b = itemDescription.getSize(item.id), width = _b.width, height = _b.height;
|
|
84
|
+
var max = Math.max(width, height);
|
|
85
|
+
var radius = this.getRadius(location, context);
|
|
86
|
+
return new components_1.DropAreaDescription({
|
|
87
|
+
width: max + (typeof radius === 'number' ? radius * 2 : radius.x * 2),
|
|
88
|
+
height: max + (typeof radius === 'number' ? radius * 2 : radius.y * 2),
|
|
89
|
+
borderRadius: max / 2 + (typeof radius === 'number' ? radius : Math.max(radius.x, radius.y))
|
|
90
|
+
});
|
|
77
91
|
};
|
|
78
92
|
return PileLocator;
|
|
79
|
-
}(
|
|
93
|
+
}(Locator_1.Locator));
|
|
80
94
|
exports.PileLocator = PileLocator;
|
|
81
95
|
//# sourceMappingURL=PileLocator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAyF;AACzF,qCAAiE;AAKjE;IAAkH,+BAAgB;IAEhI,qBAAY,KAA4B;QAAxC,YACE,iBAAO,SAER;QAEO,eAAS,GAAG,IAAI,GAAG,EAAoC,CAAA;QACvD,eAAS,GAAG,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MAAM,YAAqC,CAAA;QAC1D,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACnC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAChD,OAAO,IAAI,gCAAmB,CAAC;YAC7B,KAAK,EAAE,GAAG,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;YACtE,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;SAC7F,CAAC,CAAA;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AAvGD,CAAkH,iBAAO,GAuGxH;AAvGY,kCAAW"}
|
package/dist/locators/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './utils';
|
|
2
2
|
export * from './DeckLocator';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './FlexLocator';
|
|
4
4
|
export * from './HandLocator';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
5
|
+
export * from './Locator';
|
|
6
|
+
export * from './ListLocator';
|
|
7
7
|
export * from './PileLocator';
|
package/dist/locators/index.js
CHANGED
|
@@ -16,9 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./utils"), exports);
|
|
18
18
|
__exportStar(require("./DeckLocator"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./FlexLocator"), exports);
|
|
20
20
|
__exportStar(require("./HandLocator"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./Locator"), exports);
|
|
22
|
+
__exportStar(require("./ListLocator"), exports);
|
|
23
23
|
__exportStar(require("./PileLocator"), exports);
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,gDAA6B;AAC7B,gDAA6B;AAC7B,gDAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,gDAA6B;AAC7B,gDAA6B;AAC7B,gDAA6B;AAC7B,4CAAyB;AACzB,gDAA6B;AAC7B,gDAA6B"}
|
|
@@ -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":";;;AAMA,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 @@
|
|
|
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":";;;AAMA,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"}
|
package/dist/utilities/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./combineEventListeners"), exports);
|
|
18
18
|
__exportStar(require("./DeepPartial"), exports);
|
|
19
19
|
__exportStar(require("./findIfUnique.util"), exports);
|
|
20
|
+
__exportStar(require("./translation.util"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,gDAA6B;AAC7B,sDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,gDAA6B;AAC7B,sDAAmC;AACnC,qDAAkC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.setupTranslation = void 0;
|
|
18
|
+
var i18next_1 = __importDefault(require("i18next"));
|
|
19
|
+
var i18next_icu_1 = __importDefault(require("i18next-icu"));
|
|
20
|
+
var dayjs_1 = __importDefault(require("dayjs"));
|
|
21
|
+
require("dayjs/locale/de");
|
|
22
|
+
require("dayjs/locale/fr");
|
|
23
|
+
require("dayjs/locale/ru");
|
|
24
|
+
var react_i18next_1 = require("react-i18next");
|
|
25
|
+
var setupTranslation = function (translations, options) {
|
|
26
|
+
i18next_1.default.use(react_i18next_1.initReactI18next).use(i18next_icu_1.default);
|
|
27
|
+
var query = new URLSearchParams(window.location.search);
|
|
28
|
+
var locale = query.get('locale') || 'en';
|
|
29
|
+
i18next_1.default.init(__assign({ lng: locale, debug: process.env.NODE_ENV === 'development', fallbackLng: 'en', keySeparator: false, nsSeparator: false, resources: translations }, options)).catch(function (error) { return console.error(error); });
|
|
30
|
+
dayjs_1.default.locale(locale);
|
|
31
|
+
};
|
|
32
|
+
exports.setupTranslation = setupTranslation;
|
|
33
|
+
//# sourceMappingURL=translation.util.js.map
|
|
@@ -0,0 +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;AAOvC,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const animations: {
|
|
2
|
+
easeOut: (t: number) => number;
|
|
3
|
+
linear: (t: number) => number;
|
|
4
|
+
easeInQuad: (t: number) => number;
|
|
5
|
+
easeOutQuad: (t: number) => number;
|
|
6
|
+
easeInOutQuad: (t: number) => number;
|
|
7
|
+
easeInCubic: (t: number) => number;
|
|
8
|
+
easeOutCubic: (t: number) => number;
|
|
9
|
+
easeInOutCubic: (t: number) => number;
|
|
10
|
+
easeInQuart: (t: number) => number;
|
|
11
|
+
easeOutQuart: (t: number) => number;
|
|
12
|
+
easeInOutQuart: (t: number) => number;
|
|
13
|
+
easeInQuint: (t: number) => number;
|
|
14
|
+
easeOutQuint: (t: number) => number;
|
|
15
|
+
easeInOutQuint: (t: number) => number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.animations = void 0;
|
|
4
|
+
var easeOut = function (t) {
|
|
5
|
+
return -Math.cos(t * Math.PI) / 2 + 0.5;
|
|
6
|
+
};
|
|
7
|
+
var linear = function (t) {
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
var easeInQuad = function (t) {
|
|
11
|
+
return t * t;
|
|
12
|
+
};
|
|
13
|
+
var easeOutQuad = function (t) {
|
|
14
|
+
return t * (2 - t);
|
|
15
|
+
};
|
|
16
|
+
var easeInOutQuad = function (t) {
|
|
17
|
+
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
18
|
+
};
|
|
19
|
+
var easeInCubic = function (t) {
|
|
20
|
+
return t * t * t;
|
|
21
|
+
};
|
|
22
|
+
var easeOutCubic = function (t) {
|
|
23
|
+
return --t * t * t + 1;
|
|
24
|
+
};
|
|
25
|
+
var easeInOutCubic = function (t) {
|
|
26
|
+
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
27
|
+
};
|
|
28
|
+
var easeInQuart = function (t) {
|
|
29
|
+
return t * t * t * t;
|
|
30
|
+
};
|
|
31
|
+
var easeOutQuart = function (t) {
|
|
32
|
+
return 1 - --t * t * t * t;
|
|
33
|
+
};
|
|
34
|
+
var easeInOutQuart = function (t) {
|
|
35
|
+
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
36
|
+
};
|
|
37
|
+
var easeInQuint = function (t) {
|
|
38
|
+
return t * t * t * t * t;
|
|
39
|
+
};
|
|
40
|
+
var easeOutQuint = function (t) {
|
|
41
|
+
return 1 + --t * t * t * t * t;
|
|
42
|
+
};
|
|
43
|
+
var easeInOutQuint = function (t) {
|
|
44
|
+
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
45
|
+
};
|
|
46
|
+
exports.animations = {
|
|
47
|
+
easeOut: easeOut,
|
|
48
|
+
linear: linear,
|
|
49
|
+
easeInQuad: easeInQuad,
|
|
50
|
+
easeOutQuad: easeOutQuad,
|
|
51
|
+
easeInOutQuad: easeInOutQuad,
|
|
52
|
+
easeInCubic: easeInCubic,
|
|
53
|
+
easeOutCubic: easeOutCubic,
|
|
54
|
+
easeInOutCubic: easeInOutCubic,
|
|
55
|
+
easeInQuart: easeInQuart,
|
|
56
|
+
easeOutQuart: easeOutQuart,
|
|
57
|
+
easeInOutQuart: easeInOutQuart,
|
|
58
|
+
easeInQuint: easeInQuint,
|
|
59
|
+
easeOutQuint: easeOutQuint,
|
|
60
|
+
easeInOutQuint: easeInOutQuint
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=animations.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.constants.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/animations.constants.ts"],"names":[],"mappings":";;;AAOA,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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export declare const handleCancelAnimation: (contextInstance: ReactZoomPanPinchContext) => void;
|
|
3
|
+
export declare function handleSetupAnimation(contextInstance: ReactZoomPanPinchContext, animationName: string, animationTime: number, callback: (step: number) => void): void;
|
|
4
|
+
export declare function animate(contextInstance: ReactZoomPanPinchContext, targetState: StateType, animationTime: number, animationName: string): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.animate = exports.handleSetupAnimation = exports.handleCancelAnimation = void 0;
|
|
4
|
+
var animations_constants_1 = require("./animations.constants");
|
|
5
|
+
var handleCancelAnimationFrame = function (animation) {
|
|
6
|
+
if (typeof animation === 'number') {
|
|
7
|
+
cancelAnimationFrame(animation);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var handleCancelAnimation = function (contextInstance) {
|
|
11
|
+
if (!contextInstance.mounted)
|
|
12
|
+
return;
|
|
13
|
+
handleCancelAnimationFrame(contextInstance.animation);
|
|
14
|
+
contextInstance.animate = false;
|
|
15
|
+
contextInstance.animation = null;
|
|
16
|
+
contextInstance.velocity = null;
|
|
17
|
+
};
|
|
18
|
+
exports.handleCancelAnimation = handleCancelAnimation;
|
|
19
|
+
function handleSetupAnimation(contextInstance, animationName, animationTime, callback) {
|
|
20
|
+
if (!contextInstance.mounted)
|
|
21
|
+
return;
|
|
22
|
+
var startTime = new Date().getTime();
|
|
23
|
+
var lastStep = 1;
|
|
24
|
+
(0, exports.handleCancelAnimation)(contextInstance);
|
|
25
|
+
contextInstance.animation = function () {
|
|
26
|
+
if (!contextInstance.mounted) {
|
|
27
|
+
return handleCancelAnimationFrame(contextInstance.animation);
|
|
28
|
+
}
|
|
29
|
+
var frameTime = new Date().getTime() - startTime;
|
|
30
|
+
var animationProgress = frameTime / animationTime;
|
|
31
|
+
var animationType = animations_constants_1.animations[animationName];
|
|
32
|
+
var step = animationType(animationProgress);
|
|
33
|
+
if (frameTime >= animationTime) {
|
|
34
|
+
callback(lastStep);
|
|
35
|
+
contextInstance.animation = null;
|
|
36
|
+
}
|
|
37
|
+
else if (contextInstance.animation) {
|
|
38
|
+
callback(step);
|
|
39
|
+
requestAnimationFrame(contextInstance.animation);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
requestAnimationFrame(contextInstance.animation);
|
|
43
|
+
}
|
|
44
|
+
exports.handleSetupAnimation = handleSetupAnimation;
|
|
45
|
+
function isValidTargetState(targetState) {
|
|
46
|
+
var scale = targetState.scale, positionX = targetState.positionX, positionY = targetState.positionY;
|
|
47
|
+
return !(Number.isNaN(scale) || Number.isNaN(positionX) || Number.isNaN(positionY));
|
|
48
|
+
}
|
|
49
|
+
function animate(contextInstance, targetState, animationTime, animationName) {
|
|
50
|
+
var isValid = isValidTargetState(targetState);
|
|
51
|
+
if (!contextInstance.mounted || !isValid)
|
|
52
|
+
return;
|
|
53
|
+
var setTransformState = contextInstance.setTransformState;
|
|
54
|
+
var _a = contextInstance.transformState, scale = _a.scale, positionX = _a.positionX, positionY = _a.positionY;
|
|
55
|
+
var scaleDiff = targetState.scale - scale;
|
|
56
|
+
var positionXDiff = targetState.positionX - positionX;
|
|
57
|
+
var positionYDiff = targetState.positionY - positionY;
|
|
58
|
+
if (animationTime === 0) {
|
|
59
|
+
setTransformState(targetState.scale, targetState.positionX, targetState.positionY);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
handleSetupAnimation(contextInstance, animationName, animationTime, function (step) {
|
|
63
|
+
var newScale = scale + scaleDiff * step;
|
|
64
|
+
var newPositionX = positionX + positionXDiff * step;
|
|
65
|
+
var newPositionY = positionY + positionYDiff * step;
|
|
66
|
+
setTransformState(newScale, newPositionX, newPositionY);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.animate = animate;
|
|
71
|
+
//# sourceMappingURL=animations.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.util.js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AAC,SAAS,EACrB,WAAW,CAAC,SAAS,CACtB,CAAA;KACF;SAAM;QAEL,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoundsType, PositionType, ReactZoomPanPinchContext } from 'react-zoom-pan-pinch';
|
|
2
|
+
export declare function getComponentsSizes(wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement, newScale: number): any;
|
|
3
|
+
export declare const getBounds: (wrapperWidth: number, newContentWidth: number, diffWidth: number, wrapperHeight: number, newContentHeight: number, diffHeight: number, centerZoomedOut: boolean) => BoundsType;
|
|
4
|
+
export declare const calculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
5
|
+
export declare const boundLimiter: (value: number, minBound: number, maxBound: number, isActive: boolean) => number;
|
|
6
|
+
export declare const handleCalculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
7
|
+
export declare function getMouseBoundedPosition(positionX: number, positionY: number, bounds: BoundsType, limitToBounds: boolean, paddingValueX: number, paddingValueY: number, wrapperComponent: HTMLDivElement | null): PositionType;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMouseBoundedPosition = exports.handleCalculateBounds = exports.boundLimiter = exports.calculateBounds = exports.getBounds = exports.getComponentsSizes = void 0;
|
|
4
|
+
var calculation_util_1 = require("./calculation.util");
|
|
5
|
+
function getComponentsSizes(wrapperComponent, contentComponent, newScale) {
|
|
6
|
+
var wrapperWidth = wrapperComponent.offsetWidth;
|
|
7
|
+
var wrapperHeight = wrapperComponent.offsetHeight;
|
|
8
|
+
var contentWidth = contentComponent.offsetWidth;
|
|
9
|
+
var contentHeight = contentComponent.offsetHeight;
|
|
10
|
+
var newContentWidth = contentWidth * newScale;
|
|
11
|
+
var newContentHeight = contentHeight * newScale;
|
|
12
|
+
var newDiffWidth = wrapperWidth - newContentWidth;
|
|
13
|
+
var newDiffHeight = wrapperHeight - newContentHeight;
|
|
14
|
+
return {
|
|
15
|
+
wrapperWidth: wrapperWidth,
|
|
16
|
+
wrapperHeight: wrapperHeight,
|
|
17
|
+
newContentWidth: newContentWidth,
|
|
18
|
+
newDiffWidth: newDiffWidth,
|
|
19
|
+
newContentHeight: newContentHeight,
|
|
20
|
+
newDiffHeight: newDiffHeight
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.getComponentsSizes = getComponentsSizes;
|
|
24
|
+
var getBounds = function (wrapperWidth, newContentWidth, diffWidth, wrapperHeight, newContentHeight, diffHeight, centerZoomedOut) {
|
|
25
|
+
var scaleWidthFactor = wrapperWidth > newContentWidth
|
|
26
|
+
? diffWidth * (centerZoomedOut ? 1 : 0.5)
|
|
27
|
+
: 0;
|
|
28
|
+
var scaleHeightFactor = wrapperHeight > newContentHeight
|
|
29
|
+
? diffHeight * (centerZoomedOut ? 1 : 0.5)
|
|
30
|
+
: 0;
|
|
31
|
+
var minPositionX = wrapperWidth - newContentWidth - scaleWidthFactor;
|
|
32
|
+
var maxPositionX = scaleWidthFactor;
|
|
33
|
+
var minPositionY = wrapperHeight - newContentHeight - scaleHeightFactor;
|
|
34
|
+
var maxPositionY = scaleHeightFactor;
|
|
35
|
+
return { minPositionX: minPositionX, maxPositionX: maxPositionX, minPositionY: minPositionY, maxPositionY: maxPositionY };
|
|
36
|
+
};
|
|
37
|
+
exports.getBounds = getBounds;
|
|
38
|
+
var calculateBounds = function (contextInstance, newScale) {
|
|
39
|
+
var wrapperComponent = contextInstance.wrapperComponent, contentComponent = contextInstance.contentComponent;
|
|
40
|
+
var centerZoomedOut = contextInstance.setup.centerZoomedOut;
|
|
41
|
+
if (!wrapperComponent || !contentComponent) {
|
|
42
|
+
throw new Error('Components are not mounted');
|
|
43
|
+
}
|
|
44
|
+
var _a = getComponentsSizes(wrapperComponent, contentComponent, newScale), wrapperWidth = _a.wrapperWidth, wrapperHeight = _a.wrapperHeight, newContentWidth = _a.newContentWidth, newDiffWidth = _a.newDiffWidth, newContentHeight = _a.newContentHeight, newDiffHeight = _a.newDiffHeight;
|
|
45
|
+
return (0, exports.getBounds)(wrapperWidth, newContentWidth, newDiffWidth, wrapperHeight, newContentHeight, newDiffHeight, Boolean(centerZoomedOut));
|
|
46
|
+
};
|
|
47
|
+
exports.calculateBounds = calculateBounds;
|
|
48
|
+
var boundLimiter = function (value, minBound, maxBound, isActive) {
|
|
49
|
+
if (!isActive)
|
|
50
|
+
return (0, calculation_util_1.roundNumber)(value, 2);
|
|
51
|
+
if (value < minBound)
|
|
52
|
+
return (0, calculation_util_1.roundNumber)(minBound, 2);
|
|
53
|
+
if (value > maxBound)
|
|
54
|
+
return (0, calculation_util_1.roundNumber)(maxBound, 2);
|
|
55
|
+
return (0, calculation_util_1.roundNumber)(value, 2);
|
|
56
|
+
};
|
|
57
|
+
exports.boundLimiter = boundLimiter;
|
|
58
|
+
var handleCalculateBounds = function (contextInstance, newScale) {
|
|
59
|
+
var bounds = (0, exports.calculateBounds)(contextInstance, newScale);
|
|
60
|
+
contextInstance.bounds = bounds;
|
|
61
|
+
return bounds;
|
|
62
|
+
};
|
|
63
|
+
exports.handleCalculateBounds = handleCalculateBounds;
|
|
64
|
+
function getMouseBoundedPosition(positionX, positionY, bounds, limitToBounds, paddingValueX, paddingValueY, wrapperComponent) {
|
|
65
|
+
var minPositionX = bounds.minPositionX, minPositionY = bounds.minPositionY, maxPositionX = bounds.maxPositionX, maxPositionY = bounds.maxPositionY;
|
|
66
|
+
var paddingX = 0;
|
|
67
|
+
var paddingY = 0;
|
|
68
|
+
if (wrapperComponent) {
|
|
69
|
+
paddingX = paddingValueX;
|
|
70
|
+
paddingY = paddingValueY;
|
|
71
|
+
}
|
|
72
|
+
var x = (0, exports.boundLimiter)(positionX, minPositionX - paddingX, maxPositionX + paddingX, limitToBounds);
|
|
73
|
+
var y = (0, exports.boundLimiter)(positionY, minPositionY - paddingY, maxPositionY + paddingY, limitToBounds);
|
|
74
|
+
return { x: x, y: y };
|
|
75
|
+
}
|
|
76
|
+
exports.getMouseBoundedPosition = getMouseBoundedPosition;
|
|
77
|
+
//# sourceMappingURL=bounds.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/bounds.util.ts"],"names":[],"mappings":";;;AAIA,uDAAgD;AAEhD,SAAgB,kBAAkB,CAChC,gBAAgC,EAChC,gBAAgC,EAChC,QAAgB;IAEhB,IAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAA;IACjD,IAAM,aAAa,GAAG,gBAAgB,CAAC,YAAY,CAAA;IAEnD,IAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAA;IACjD,IAAM,aAAa,GAAG,gBAAgB,CAAC,YAAY,CAAA;IAEnD,IAAM,eAAe,GAAG,YAAY,GAAG,QAAQ,CAAA;IAC/C,IAAM,gBAAgB,GAAG,aAAa,GAAG,QAAQ,CAAA;IACjD,IAAM,YAAY,GAAG,YAAY,GAAG,eAAe,CAAA;IACnD,IAAM,aAAa,GAAG,aAAa,GAAG,gBAAgB,CAAA;IAEtD,OAAO;QACL,YAAY,cAAA;QACZ,aAAa,eAAA;QACb,eAAe,iBAAA;QACf,YAAY,cAAA;QACZ,gBAAgB,kBAAA;QAChB,aAAa,eAAA;KACd,CAAA;AACH,CAAC;AAxBD,gDAw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I,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkIsNumber = exports.roundNumber = void 0;
|
|
4
|
+
var roundNumber = function (num, decimal) {
|
|
5
|
+
return Number(num.toFixed(decimal));
|
|
6
|
+
};
|
|
7
|
+
exports.roundNumber = roundNumber;
|
|
8
|
+
var checkIsNumber = function (num, defaultValue) {
|
|
9
|
+
return typeof num === "number" ? num : defaultValue;
|
|
10
|
+
};
|
|
11
|
+
exports.checkIsNumber = checkIsNumber;
|
|
12
|
+
//# sourceMappingURL=calculation.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculation.util.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/calculation.util.ts"],"names":[],"mappings":";;;AAQO,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;AAOK,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./animations.constants"), exports);
|
|
18
|
+
__exportStar(require("./animations.util"), exports);
|
|
19
|
+
__exportStar(require("./bounds.util"), exports);
|
|
20
|
+
__exportStar(require("./calculation.util"), exports);
|
|
21
|
+
__exportStar(require("./zoom.util"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/zoom-pan-pinch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,yDAAsC;AACtC,oDAAiC;AACjC,gDAA6B;AAC7B,qDAAkC;AAClC,8CAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkZoomBounds(zoom: number, minScale: number, maxScale: number, zoomPadding: number, enablePadding: boolean): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkZoomBounds = void 0;
|
|
4
|
+
function checkZoomBounds(zoom, minScale, maxScale, zoomPadding, enablePadding) {
|
|
5
|
+
var scalePadding = enablePadding ? zoomPadding : 0;
|
|
6
|
+
var minScaleWithPadding = minScale - scalePadding;
|
|
7
|
+
if (!Number.isNaN(maxScale) && zoom >= maxScale)
|
|
8
|
+
return maxScale;
|
|
9
|
+
if (!Number.isNaN(minScale) && zoom <= minScaleWithPadding)
|
|
10
|
+
return minScaleWithPadding;
|
|
11
|
+
return zoom;
|
|
12
|
+
}
|
|
13
|
+
exports.checkZoomBounds = checkZoomBounds;
|
|
14
|
+
//# sourceMappingURL=zoom.util.js.map
|