@gamepark/react-game 6.23.4 → 6.24.2

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.
Files changed (197) hide show
  1. package/dist/components/Header/MaterialHeader.js +2 -1
  2. package/dist/components/Header/MaterialHeader.js.map +1 -1
  3. package/dist/components/PlayerPanel/Counters.d.ts +13 -0
  4. package/dist/components/PlayerPanel/Counters.js +44 -0
  5. package/dist/components/PlayerPanel/Counters.js.map +1 -0
  6. package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +4 -2
  7. package/dist/components/PlayerPanel/StyledPlayerPanel.js +30 -25
  8. package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
  9. package/dist/components/PlayerPanel/index.d.ts +1 -0
  10. package/dist/components/PlayerPanel/index.js +1 -0
  11. package/dist/components/PlayerPanel/index.js.map +1 -1
  12. package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.d.ts +1 -1
  13. package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +6 -6
  14. package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
  15. package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +13 -6
  16. package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
  17. package/dist/components/material/ComponentDescription.d.ts +14 -0
  18. package/dist/components/material/ComponentDescription.js +27 -0
  19. package/dist/components/material/ComponentDescription.js.map +1 -0
  20. package/dist/components/material/Dices/CubicDiceDescription.d.ts +1 -0
  21. package/dist/components/material/Dices/CubicDiceDescription.js +13 -0
  22. package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
  23. package/dist/components/material/DraggableMaterial.d.ts +1 -13
  24. package/dist/components/material/DraggableMaterial.js +37 -91
  25. package/dist/components/material/DraggableMaterial.js.map +1 -1
  26. package/dist/components/material/FlatMaterial/CardDescription.d.ts +2 -2
  27. package/dist/components/material/FlatMaterial/CardDescription.js +1 -1
  28. package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
  29. package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +4 -2
  30. package/dist/components/material/FlatMaterial/FlatMaterial.js +17 -11
  31. package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
  32. package/dist/components/material/FlatMaterial/TokenDescription.d.ts +1 -1
  33. package/dist/components/material/FlatMaterial/TokenDescription.js.map +1 -1
  34. package/dist/components/material/GameTable/GameMaterialDisplay.js +1 -1
  35. package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
  36. package/dist/components/material/GameTable/GameTable.js +9 -7
  37. package/dist/components/material/GameTable/GameTable.js.map +1 -1
  38. package/dist/components/material/GameTable/ItemDisplay.d.ts +4 -2
  39. package/dist/components/material/GameTable/ItemDisplay.js +104 -15
  40. package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
  41. package/dist/components/material/GameTable/StaticItemsDisplay.js +2 -2
  42. package/dist/components/material/GameTable/StaticItemsDisplay.js.map +1 -1
  43. package/dist/components/material/GameTable/StaticLocationsDisplay.js +12 -12
  44. package/dist/components/material/GameTable/StaticLocationsDisplay.js.map +1 -1
  45. package/dist/components/material/GameTable/focus/FocusProvider.d.ts +6 -6
  46. package/dist/components/material/GameTable/focus/FocusProvider.js +2 -2
  47. package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
  48. package/dist/components/material/GameTable/focus/index.d.ts +0 -1
  49. package/dist/components/material/GameTable/focus/index.js +0 -1
  50. package/dist/components/material/GameTable/focus/index.js.map +1 -1
  51. package/dist/components/material/ImageLoader/MaterialImageLoader.js +17 -11
  52. package/dist/components/material/ImageLoader/MaterialImageLoader.js.map +1 -1
  53. package/dist/components/material/MaterialComponent.d.ts +0 -4
  54. package/dist/components/material/MaterialComponent.js +5 -18
  55. package/dist/components/material/MaterialComponent.js.map +1 -1
  56. package/dist/components/material/MaterialDescription.d.ts +5 -13
  57. package/dist/components/material/MaterialDescription.js +48 -22
  58. package/dist/components/material/MaterialDescription.js.map +1 -1
  59. package/dist/components/material/Writing/WritingDescription.d.ts +0 -4
  60. package/dist/components/material/Writing/WritingDescription.js +0 -10
  61. package/dist/components/material/Writing/WritingDescription.js.map +1 -1
  62. package/dist/components/material/animations/CreateItemAnimations.js +5 -3
  63. package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
  64. package/dist/components/material/animations/DeleteItemAnimations.js +7 -5
  65. package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
  66. package/dist/components/material/animations/ItemAnimations.d.ts +2 -1
  67. package/dist/components/material/animations/ItemAnimations.js +9 -0
  68. package/dist/components/material/animations/ItemAnimations.js.map +1 -1
  69. package/dist/components/material/animations/MaterialAnimations.d.ts +2 -2
  70. package/dist/components/material/animations/MoveItemAnimations.d.ts +1 -2
  71. package/dist/components/material/animations/MoveItemAnimations.js +18 -31
  72. package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
  73. package/dist/components/material/animations/MoveItemAtOnceAnimations.d.ts +1 -2
  74. package/dist/components/material/animations/MoveItemAtOnceAnimations.js +14 -28
  75. package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
  76. package/dist/components/material/animations/RollItemAnimations.d.ts +1 -2
  77. package/dist/components/material/animations/RollItemAnimations.js +4 -15
  78. package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
  79. package/dist/components/material/animations/adjustRotation.d.ts +1 -1
  80. package/dist/components/material/animations/adjustRotation.js +60 -19
  81. package/dist/components/material/animations/adjustRotation.js.map +1 -1
  82. package/dist/components/material/animations/getFirstStockItemTransforms.util.js +3 -6
  83. package/dist/components/material/animations/getFirstStockItemTransforms.util.js.map +1 -1
  84. package/dist/components/material/animations/rotations.utils.d.ts +2 -0
  85. package/dist/components/material/animations/rotations.utils.js +99 -0
  86. package/dist/components/material/animations/rotations.utils.js.map +1 -0
  87. package/dist/components/material/animations/transformItem.util.js +3 -5
  88. package/dist/components/material/animations/transformItem.util.js.map +1 -1
  89. package/dist/components/material/index.d.ts +1 -0
  90. package/dist/components/material/index.js +1 -0
  91. package/dist/components/material/index.js.map +1 -1
  92. package/dist/components/material/locations/DropAreaDescription.d.ts +9 -0
  93. package/dist/components/material/locations/DropAreaDescription.js +46 -0
  94. package/dist/components/material/locations/DropAreaDescription.js.map +1 -0
  95. package/dist/components/material/locations/LocationComponent.d.ts +16 -0
  96. package/dist/components/material/locations/LocationComponent.js +89 -0
  97. package/dist/components/material/locations/LocationComponent.js.map +1 -0
  98. package/dist/components/material/locations/LocationDescription.d.ts +14 -25
  99. package/dist/components/material/locations/LocationDescription.js +43 -50
  100. package/dist/components/material/locations/LocationDescription.js.map +1 -1
  101. package/dist/components/material/locations/LocationDisplay.d.ts +4 -1
  102. package/dist/components/material/locations/LocationDisplay.js +4 -9
  103. package/dist/components/material/locations/LocationDisplay.js.map +1 -1
  104. package/dist/components/material/locations/LocationsMask.d.ts +2 -1
  105. package/dist/components/material/locations/LocationsMask.js +6 -6
  106. package/dist/components/material/locations/LocationsMask.js.map +1 -1
  107. package/dist/components/material/locations/SimpleDropArea.d.ts +4 -7
  108. package/dist/components/material/locations/SimpleDropArea.js +18 -88
  109. package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
  110. package/dist/components/material/locations/index.d.ts +1 -0
  111. package/dist/components/material/locations/index.js +1 -0
  112. package/dist/components/material/locations/index.js.map +1 -1
  113. package/dist/components/material/utils/isDroppedItem.js +12 -1
  114. package/dist/components/material/utils/isDroppedItem.js.map +1 -1
  115. package/dist/components/material/utils/isPlacedOnItem.d.ts +3 -3
  116. package/dist/components/material/utils/isPlacedOnItem.js +5 -5
  117. package/dist/components/material/utils/isPlacedOnItem.js.map +1 -1
  118. package/dist/components/tutorial/MaterialTutorial.js +4 -4
  119. package/dist/components/tutorial/MaterialTutorial.js.map +1 -1
  120. package/dist/components/tutorial/MaterialTutorialDisplay.js +7 -6
  121. package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
  122. package/dist/components/tutorial/TutorialRulesWrapper.js +26 -26
  123. package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
  124. package/dist/hooks/index.d.ts +1 -1
  125. package/dist/hooks/index.js +1 -1
  126. package/dist/hooks/index.js.map +1 -1
  127. package/dist/hooks/useDraggedItem.d.ts +2 -0
  128. package/dist/hooks/useDraggedItem.js +19 -0
  129. package/dist/hooks/useDraggedItem.js.map +1 -0
  130. package/dist/hooks/useItemLocations.d.ts +8 -0
  131. package/dist/hooks/useItemLocations.js +83 -0
  132. package/dist/hooks/useItemLocations.js.map +1 -0
  133. package/dist/hooks/useItemLocator.d.ts +2 -2
  134. package/dist/hooks/useItemLocator.js.map +1 -1
  135. package/dist/hooks/useLegalMoves.js +4 -18
  136. package/dist/hooks/useLegalMoves.js.map +1 -1
  137. package/dist/hooks/usePlayers.js +14 -1
  138. package/dist/hooks/usePlayers.js.map +1 -1
  139. package/dist/hooks/useStaticLocations.d.ts +2 -0
  140. package/dist/hooks/useStaticLocations.js +53 -0
  141. package/dist/hooks/useStaticLocations.js.map +1 -0
  142. package/dist/hooks/useTutorialStep.js +2 -2
  143. package/dist/hooks/useTutorialStep.js.map +1 -1
  144. package/dist/hooks/useZoomToElements.d.ts +1 -1
  145. package/dist/hooks/useZoomToElements.js +8 -8
  146. package/dist/hooks/useZoomToElements.js.map +1 -1
  147. package/dist/index.d.ts +1 -1
  148. package/dist/index.js +3 -1
  149. package/dist/index.js.map +1 -1
  150. package/dist/locators/DeckLocator.d.ts +5 -4
  151. package/dist/locators/DeckLocator.js +6 -8
  152. package/dist/locators/DeckLocator.js.map +1 -1
  153. package/dist/locators/FlexLocator.d.ts +18 -0
  154. package/dist/locators/FlexLocator.js +88 -0
  155. package/dist/locators/FlexLocator.js.map +1 -0
  156. package/dist/locators/HandLocator.d.ts +22 -13
  157. package/dist/locators/HandLocator.js +71 -39
  158. package/dist/locators/HandLocator.js.map +1 -1
  159. package/dist/locators/ListLocator.d.ts +18 -0
  160. package/dist/locators/ListLocator.js +97 -0
  161. package/dist/locators/ListLocator.js.map +1 -0
  162. package/dist/locators/Locator.d.ts +50 -0
  163. package/dist/locators/Locator.js +153 -0
  164. package/dist/locators/Locator.js.map +1 -0
  165. package/dist/locators/PileLocator.d.ts +12 -11
  166. package/dist/locators/PileLocator.js +44 -29
  167. package/dist/locators/PileLocator.js.map +1 -1
  168. package/dist/locators/index.d.ts +3 -3
  169. package/dist/locators/index.js +3 -3
  170. package/dist/locators/index.js.map +1 -1
  171. package/dist/utilities/combineEventListeners.js.map +1 -1
  172. package/dist/utilities/findIfUnique.util.js.map +1 -1
  173. package/dist/utilities/index.d.ts +1 -0
  174. package/dist/utilities/index.js +1 -0
  175. package/dist/utilities/index.js.map +1 -1
  176. package/dist/utilities/translation.util.d.ts +5 -0
  177. package/dist/utilities/translation.util.js +33 -0
  178. package/dist/utilities/translation.util.js.map +1 -0
  179. package/dist/utilities/zoom-pan-pinch/animations.constants.d.ts +16 -0
  180. package/dist/utilities/zoom-pan-pinch/animations.constants.js +62 -0
  181. package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -0
  182. package/dist/utilities/zoom-pan-pinch/animations.util.d.ts +4 -0
  183. package/dist/utilities/zoom-pan-pinch/animations.util.js +71 -0
  184. package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -0
  185. package/dist/utilities/zoom-pan-pinch/bounds.util.d.ts +7 -0
  186. package/dist/utilities/zoom-pan-pinch/bounds.util.js +77 -0
  187. package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -0
  188. package/dist/utilities/zoom-pan-pinch/calculation.util.d.ts +2 -0
  189. package/dist/utilities/zoom-pan-pinch/calculation.util.js +12 -0
  190. package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -0
  191. package/dist/utilities/zoom-pan-pinch/index.d.ts +5 -0
  192. package/dist/utilities/zoom-pan-pinch/index.js +22 -0
  193. package/dist/utilities/zoom-pan-pinch/index.js.map +1 -0
  194. package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +1 -0
  195. package/dist/utilities/zoom-pan-pinch/zoom.util.js +14 -0
  196. package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -0
  197. package/package.json +3 -3
@@ -0,0 +1,50 @@
1
+ import { Coordinates, DisplayedItem, Location, MaterialItem, MaterialRules, XYCoordinates } from '@gamepark/rules-api';
2
+ import { LocationDescription, MaterialDescriptionRecord } from '../components';
3
+ export type SortFunction = ((item: MaterialItem) => number);
4
+ export declare class Locator<P extends number = number, M extends number = number, L extends number = number> {
5
+ constructor(clone?: Partial<Locator>);
6
+ protected itemTypes: M[];
7
+ parentItemType?: M;
8
+ limit?: number;
9
+ rotationUnit: string;
10
+ location?: Location<P, L>;
11
+ locations: Location<P, L>[];
12
+ getLocations(_context: MaterialContext<P, M, L>): Location<P, L>[];
13
+ locationDescription?: LocationDescription<P, M, L>;
14
+ getLocationDescription(location: Location<P, L>, context: MaterialContext<P, M, L> | ItemContext<P, M, L>): LocationDescription<P, M, L> | undefined;
15
+ protected generateLocationDescriptionFromDraggedItem(_location: Location<P, L>, context: ItemContext<P, M, L>): LocationDescription<P, M, L> | undefined;
16
+ hide(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): boolean;
17
+ placeLocation(location: Location<P, L>, context: LocationContext<P, M, L>): string[];
18
+ placeItem(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
19
+ protected placeItemOnParent(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
20
+ getParentItem(location: Location<P, L>, { rules, material }: MaterialContext<P, M, L>): MaterialItem<P, L> | undefined;
21
+ positionOnParent: XYCoordinates;
22
+ getPositionOnParent(_location: Location<P, L>, _context: MaterialContext<P, M, L>): XYCoordinates;
23
+ coordinates: Partial<Coordinates>;
24
+ getCoordinates(_location: Location<P, L>, _context: MaterialContext<P, M, L>): Partial<Coordinates>;
25
+ getLocationCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>): Partial<Coordinates>;
26
+ getItemCoordinates(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Partial<Coordinates>;
27
+ rotateZ: number;
28
+ getRotateZ(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
29
+ getItemRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
30
+ getLocationIndex(location: Location<P, L>, _context: MaterialContext<P, M, L>): number | undefined;
31
+ getItemIndex(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
32
+ countItems(location: Location<P, L>, { rules }: MaterialContext<P, M, L>): number;
33
+ getHoverTransform(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): string[];
34
+ navigationSorts: SortFunction[];
35
+ getNavigationSorts(_context: ItemContext<P, M, L>): SortFunction[];
36
+ }
37
+ export type ItemLocatorRecord<P extends number = number, M extends number = number, L extends number = number> = Record<L, Locator<P, M, L>>;
38
+ export type MaterialContext<P extends number = number, M extends number = number, L extends number = number> = {
39
+ rules: MaterialRules<P, M, L>;
40
+ material: Partial<MaterialDescriptionRecord<P, M, L>>;
41
+ locators: Partial<ItemLocatorRecord<P, M, L>>;
42
+ player?: P;
43
+ };
44
+ export type ItemContext<P extends number = number, M extends number = number, L extends number = number> = MaterialContext<P, M, L> & DisplayedItem<M> & {
45
+ dragTransform?: string;
46
+ };
47
+ export declare function isItemContext<P extends number = number, M extends number = number, L extends number = number>(context: MaterialContext<P, M, L>): context is ItemContext<P, M, L>;
48
+ export type LocationContext<P extends number = number, M extends number = number, L extends number = number> = MaterialContext<P, M, L> & {
49
+ canDrop?: boolean;
50
+ };
@@ -0,0 +1,153 @@
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.isItemContext = exports.Locator = void 0;
18
+ var rules_api_1 = require("@gamepark/rules-api");
19
+ var sumBy_1 = __importDefault(require("lodash/sumBy"));
20
+ var components_1 = require("../components");
21
+ var Locator = (function () {
22
+ function Locator(clone) {
23
+ this.itemTypes = [];
24
+ this.rotationUnit = 'deg';
25
+ this.locations = [];
26
+ this.positionOnParent = { x: 50, y: 50 };
27
+ this.coordinates = { x: 0, y: 0, z: 0 };
28
+ this.rotateZ = 0;
29
+ this.navigationSorts = [function (item) { var _a; return (_a = item.location.x) !== null && _a !== void 0 ? _a : 0; }, function (item) { var _a; return (_a = item.location.y) !== null && _a !== void 0 ? _a : 0; }, function (item) { var _a; return (_a = item.location.z) !== null && _a !== void 0 ? _a : 0; }];
30
+ Object.assign(this, clone);
31
+ }
32
+ Locator.prototype.getLocations = function (_context) {
33
+ return this.location ? [this.location] : this.locations;
34
+ };
35
+ Locator.prototype.getLocationDescription = function (location, context) {
36
+ if (!this.locationDescription) {
37
+ if (this.parentItemType !== undefined && location.x === undefined && location.y === undefined && location.z === undefined) {
38
+ var material = context.material[this.parentItemType];
39
+ if (material) {
40
+ this.locationDescription = new components_1.DropAreaDescription(material);
41
+ }
42
+ }
43
+ else if (isItemContext(context)) {
44
+ return this.generateLocationDescriptionFromDraggedItem(location, context);
45
+ }
46
+ }
47
+ return this.locationDescription;
48
+ };
49
+ Locator.prototype.generateLocationDescriptionFromDraggedItem = function (_location, context) {
50
+ return new components_1.DropAreaDescription(context.material[context.type]);
51
+ };
52
+ Locator.prototype.hide = function (item, context) {
53
+ return this.limit ? this.getItemIndex(item, context) >= this.limit : false;
54
+ };
55
+ Locator.prototype.placeLocation = function (location, context) {
56
+ var transform = [];
57
+ var _a = this.getLocationCoordinates(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;
58
+ if (x || y || z) {
59
+ transform.push("translate3d(".concat(x, "em, ").concat(y, "em, ").concat(z, "em)"));
60
+ }
61
+ var rotateZ = this.getRotateZ(location, context);
62
+ if (rotateZ) {
63
+ transform.push("rotateZ(".concat(rotateZ).concat(this.rotationUnit, ")"));
64
+ }
65
+ if (context.canDrop)
66
+ transform.push('translateZ(5em)');
67
+ return transform;
68
+ };
69
+ Locator.prototype.placeItem = function (item, context) {
70
+ if (!this.itemTypes.includes(context.type)) {
71
+ this.itemTypes.push(context.type);
72
+ }
73
+ var transform = this.placeItemOnParent(item, context);
74
+ var _a = this.getItemCoordinates(item, 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;
75
+ if (x || y || z) {
76
+ transform.push("translate3d(".concat(x, "em, ").concat(y, "em, ").concat(z, "em)"));
77
+ }
78
+ var rotateZ = this.getItemRotateZ(item, context);
79
+ if (rotateZ) {
80
+ transform.push("rotateZ(".concat(rotateZ).concat(this.rotationUnit, ")"));
81
+ }
82
+ return transform;
83
+ };
84
+ Locator.prototype.placeItemOnParent = function (item, context) {
85
+ var _a;
86
+ var parentItem = this.getParentItem(item.location, context);
87
+ if (this.parentItemType === undefined || !parentItem)
88
+ return [];
89
+ var locator = context.locators[parentItem.location.type];
90
+ var parentContext = __assign(__assign({}, context), { type: this.parentItemType, displayIndex: 0 });
91
+ var transform = (_a = locator === null || locator === void 0 ? void 0 : locator.placeItem(parentItem, parentContext)) !== null && _a !== void 0 ? _a : [];
92
+ var parentMaterial = context.material[this.parentItemType];
93
+ var _b = this.getPositionOnParent(item.location, context), x = _b.x, y = _b.y;
94
+ if (parentMaterial && (x !== 0 || y !== 0)) {
95
+ var _c = parentMaterial.getSize(parentItem.id), width = _c.width, height = _c.height;
96
+ transform.push("translate3d(".concat(width * (x - 50) / 100, "em, ").concat(height * (y - 50) / 100, "em, ").concat(parentMaterial.getThickness(parentItem, parentContext), "em)"));
97
+ }
98
+ return transform;
99
+ };
100
+ Locator.prototype.getParentItem = function (location, _a) {
101
+ var _b;
102
+ var rules = _a.rules, material = _a.material;
103
+ if (this.parentItemType === undefined)
104
+ return undefined;
105
+ if (location.parent === undefined)
106
+ return (_b = material[this.parentItemType]) === null || _b === void 0 ? void 0 : _b.staticItem;
107
+ return rules.material(this.parentItemType).getItem(location.parent);
108
+ };
109
+ Locator.prototype.getPositionOnParent = function (_location, _context) {
110
+ return this.positionOnParent;
111
+ };
112
+ Locator.prototype.getCoordinates = function (_location, _context) {
113
+ return this.coordinates;
114
+ };
115
+ Locator.prototype.getLocationCoordinates = function (location, context) {
116
+ return this.getCoordinates(location, context);
117
+ };
118
+ Locator.prototype.getItemCoordinates = function (item, context) {
119
+ return this.getLocationCoordinates(item.location, context);
120
+ };
121
+ Locator.prototype.getRotateZ = function (_location, _context) {
122
+ return this.rotateZ;
123
+ };
124
+ Locator.prototype.getItemRotateZ = function (item, context) {
125
+ return this.getRotateZ(item.location, context);
126
+ };
127
+ Locator.prototype.getLocationIndex = function (location, _context) {
128
+ var _a, _b;
129
+ return (_b = (_a = location.x) !== null && _a !== void 0 ? _a : location.y) !== null && _b !== void 0 ? _b : location.z;
130
+ };
131
+ Locator.prototype.getItemIndex = function (item, context) {
132
+ var _a;
133
+ return (_a = this.getLocationIndex(item.location, context)) !== null && _a !== void 0 ? _a : context.displayIndex;
134
+ };
135
+ Locator.prototype.countItems = function (location, _a) {
136
+ var rules = _a.rules;
137
+ return (0, sumBy_1.default)(this.itemTypes, function (type) { return rules.material(type).location(function (itemLocation) { return (0, rules_api_1.isSameLocationArea)(itemLocation, location); }).getQuantity(); });
138
+ };
139
+ Locator.prototype.getHoverTransform = function (_item, _context) {
140
+ return [];
141
+ };
142
+ Locator.prototype.getNavigationSorts = function (_context) {
143
+ return this.navigationSorts;
144
+ };
145
+ return Locator;
146
+ }());
147
+ exports.Locator = Locator;
148
+ function isItemContext(context) {
149
+ var itemContext = context;
150
+ return itemContext.type !== undefined && itemContext.index !== undefined && itemContext.displayIndex !== undefined;
151
+ }
152
+ exports.isItemContext = isItemContext;
153
+ //# sourceMappingURL=Locator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Locator.js","sourceRoot":"","sources":["../../src/locators/Locator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,iDAA0I;AAC1I,uDAAgC;AAChC,4CAAmG;AAOnG;IAOE,iBAAY,KAAwB;QAS1B,cAAS,GAAQ,EAAE,CAAA;QAe7B,iBAAY,GAAW,KAAK,CAAA;QAU5B,cAAS,GAAqB,EAAE,CAAA;QAmIhC,qBAAgB,GAAkB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;QAkBlD,gBAAW,GAAyB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QA0CxD,YAAO,GAAW,CAAC,CAAA;QAqEnB,oBAAe,GAAmB,CAAC,UAAC,IAAI,YAAK,OAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,CAAC,mCAAI,CAAC,CAAA,EAAA,EAAE,UAAC,IAAI,YAAK,OAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,CAAC,mCAAI,CAAC,CAAA,EAAA,EAAE,UAAC,IAAI,YAAK,OAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,CAAC,mCAAI,CAAC,CAAA,EAAA,CAAC,CAAA;QArShI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC5B,CAAC;IAsCD,8BAAY,GAAZ,UAAa,QAAkC;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;IACzD,CAAC;IAcD,wCAAsB,GAAtB,UAAuB,QAAwB,EAAE,OAAwD;QACvG,IAAI,CAAC,I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AQ,CAAC,CAAC,mCAAI,QAAQ,CAAC,CAAC,mCAAI,QAAQ,CAAC,CAAC,CAAA;IAC/C,CAAC;IAQD,8BAAY,GAAZ,UAAa,IAAwB,EAAE,OAA6B;;QAClE,OAAO,MAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,mCAAI,OAAO,CAAC,YAAY,CAAA;IAC9E,CAAC;IASD,4BAAU,GAAV,UAAW,QAAwB,EAAE,EAAmC;YAAjC,KAAK,WAAA;QAC1C,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,SAAS,EAAE,UAAA,IAAI,IAAI,OAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAA,YAAY,IAAI,OAAA,IAAA,8BAAkB,EAAC,YAAY,EAAE,QAAQ,CAAC,EAA1C,CAA0C,CAAC,CAAC,WAAW,EAAE,EAAvG,CAAuG,CAAC,CAAA;IAC/I,CAAC;IAQD,mCAAiB,GAAjB,UAAkB,KAAyB,EAAE,QAA8B;QACzE,OAAO,EAAE,CAAA;IACX,CAAC;IAYD,oCAAkB,GAAlB,UAAmB,QAA8B;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IACH,cAAC;AAAD,CAAC,AAvTD,IAuTC;AAvTY,0BAAO;AAyVpB,SAAgB,aAAa,CAC3B,OAAiC;IAEjC,IAAM,WAAW,GAAG,OAA+B,CAAA;IACnD,OAAO,WAAW,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,YAAY,KAAK,SAAS,CAAA;AACpH,CAAC;AALD,sCAKC"}
@@ -1,16 +1,17 @@
1
- import { Coordinates, MaterialItem, XYCoordinates } from '@gamepark/rules-api';
2
- import { ItemContext, ItemLocator } from './ItemLocator';
3
- export declare abstract class PileLocator<P extends number = number, M extends number = number, L extends number = number> extends ItemLocator<P, M, L> {
4
- limit: number;
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
- getPosition(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Coordinates;
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(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number | XYCoordinates;
10
+ getRadius(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number | XYCoordinates;
13
11
  maxAngle: number;
14
- getMaxAngle(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number;
15
- getPileId(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string;
12
+ getMaxAngle(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
13
+ getPileId(item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): string;
14
+ getItemCoordinates(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Partial<Coordinates>;
15
+ getItemRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
16
+ protected generateLocationDescriptionFromDraggedItem(location: Location<P, L>, context: ItemContext<P, M, L>): LocationDescription<P, M, L>;
16
17
  }
@@ -16,66 +16,81 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.PileLocator = void 0;
19
- var ItemLocator_1 = require("./ItemLocator");
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 !== null && _super.apply(this, arguments) || this;
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.coordinates = { x: 0, y: 0, z: 0 };
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.getPosition = function (item, context) {
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 (item, _context) {
40
+ return [item.location.player, item.location.id, item.location.parent].filter(function (part) { return part !== undefined; }).join('_');
41
+ };
42
+ PileLocator.prototype.getItemCoordinates = function (item, context) {
43
+ var location = item.location;
44
+ var index = this.getItemIndex(item, context);
33
45
  var pileId = this.getPileId(item, context);
34
46
  if (!this.positions.has(pileId))
35
47
  this.positions.set(pileId, new Map());
36
48
  var pilePositions = this.positions.get(pileId);
37
- var index = this.getItemIndex(item, context);
38
- var radius = this.getRadius(item, context);
49
+ var radius = this.getRadius(location, context);
39
50
  if (!pilePositions.has(index)) {
40
- var coordinates = this.getCoordinates(item, context);
51
+ 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
52
  var distance = Math.random();
42
53
  var direction = Math.random() * 2 * Math.PI;
43
54
  pilePositions.set(index, {
44
- x: coordinates.x + Math.cos(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.x),
45
- y: coordinates.y + Math.sin(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.y),
46
- z: coordinates.z
55
+ x: x + Math.cos(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.x),
56
+ y: y + Math.sin(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.y),
57
+ z: z + index * 0.05
47
58
  });
48
59
  }
49
60
  return pilePositions.get(index);
50
61
  };
51
- PileLocator.prototype.getRotateZ = function (item, context) {
62
+ PileLocator.prototype.getItemRotateZ = function (item, context) {
52
63
  var _a;
53
- if (!this.maxAngle)
54
- return 0;
64
+ var index = this.getItemIndex(item, context);
55
65
  var pileId = this.getPileId(item, context);
56
66
  if (!this.rotations.has(pileId))
57
67
  this.rotations.set(pileId, new Map());
58
68
  var pileRotations = this.rotations.get(pileId);
59
- var index = this.getItemIndex(item, context);
60
69
  if (!pileRotations.has(index)) {
61
- var maxAngle = this.getMaxAngle(item, context);
70
+ var maxAngle = this.getMaxAngle(item.location, context);
62
71
  pileRotations.set(index, (Math.random() - 0.5) * maxAngle);
63
72
  }
64
73
  return (_a = pileRotations.get(index)) !== null && _a !== void 0 ? _a : 0;
65
74
  };
66
- PileLocator.prototype.getCoordinates = function (_item, _context) {
67
- return this.coordinates;
68
- };
69
- PileLocator.prototype.getRadius = function (_item, _context) {
70
- return this.radius;
71
- };
72
- PileLocator.prototype.getMaxAngle = function (_item, _context) {
73
- return this.maxAngle;
74
- };
75
- PileLocator.prototype.getPileId = function (item, context) {
76
- return [item.location.player, item.location.id, item.location.parent, context.type].filter(function (part) { return part !== undefined; }).join('_');
75
+ PileLocator.prototype.generateLocationDescriptionFromDraggedItem = function (location, context) {
76
+ var _a;
77
+ var itemDescription = (_a = context.material[context.type]) !== null && _a !== void 0 ? _a : new components_1.CardDescription();
78
+ var item = context.rules.material(context.type).getItem(context.index);
79
+ var _b = itemDescription.getSize(item.id), width = _b.width, height = _b.height;
80
+ if (this.getMaxAngle(location, context) < 180) {
81
+ return new components_1.DropAreaDescription(itemDescription);
82
+ }
83
+ else {
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
+ });
91
+ }
77
92
  };
78
93
  return PileLocator;
79
- }(ItemLocator_1.ItemLocator));
94
+ }(Locator_1.Locator));
80
95
  exports.PileLocator = PileLocator;
81
96
  //# sourceMappingURL=PileLocator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6CAAwD;AAExD;IAA2H,+BAAoB;IAA/I;QAAA,qEA0DC;QAzDC,WAAK,GAAG,EAAE,CAAA;QACF,eAAS,GAAG,IAAI,GAAG,EAAoC,CAAA;QACvD,eAAS,GAAG,IAAI,GAAG,EAA+B,CAAA;QAkC1D,iBAAW,GAAgB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QAM/C,YAAM,GAA2B,CAAC,CAAA;QAMlC,cAAQ,GAAG,GAAG,CAAA;;IAShB,CAAC;IArDC,iCAAW,GAAX,UAAY,IAAwB,EAAE,OAA6B;QACjE,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAA;QACtE,IAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAE,CAAA;QACjD,IAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9C,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5C,IA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QAC1D,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,GAAG,EAAE;YAC7C,OAAO,IAAI,gCAAmB,CAAC,eAAe,CAAC,CAAA;SAChD;aAAM;YACL,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACnC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,IAAI,gCAAmB,CAAC;gBAC7B,KAAK,EAAE,GAAG,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACrE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,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,7 +1,7 @@
1
1
  export * from './utils';
2
2
  export * from './DeckLocator';
3
- export * from './GridLocator';
3
+ export * from './FlexLocator';
4
4
  export * from './HandLocator';
5
- export * from './ItemLocator';
6
- export * from './LineLocator';
5
+ export * from './Locator';
6
+ export * from './ListLocator';
7
7
  export * from './PileLocator';
@@ -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("./GridLocator"), exports);
19
+ __exportStar(require("./FlexLocator"), exports);
20
20
  __exportStar(require("./HandLocator"), exports);
21
- __exportStar(require("./ItemLocator"), exports);
22
- __exportStar(require("./LineLocator"), exports);
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,gDAA6B;AAC7B,gDAA6B;AAC7B,gDAA6B"}
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":";;;AAAA,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
+ {"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":";;;AAAA,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"}
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"}
@@ -1,3 +1,4 @@
1
1
  export * from './combineEventListeners';
2
2
  export * from './DeepPartial';
3
3
  export * from './findIfUnique.util';
4
+ export * from './translation.util';
@@ -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,5 @@
1
+ import { InitOptions, Resource } from 'i18next';
2
+ import 'dayjs/locale/de';
3
+ import 'dayjs/locale/fr';
4
+ import 'dayjs/locale/ru';
5
+ export declare const setupTranslation: (translations: Resource, options?: InitOptions) => void;
@@ -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;AAED,IAAM,MAAM,GAAG,UAAC,CAAS;IACvB,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,IAAM,UAAU,GAAG,UAAC,CAAS;IAC3B,OAAO,CAAC,GAAG,CAAC,CAAA;AACd,CAAC,CAAA;AAED,IAAM,WAAW,GAAG,UAAC,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;AACpB,CAAC,CAAA;AAED,IAAM,aAAa,GAAG,UAAC,CAAS;IAC9B,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC,CAAA;AAED,IAAM,WAAW,GAAG,UAAC,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAClB,CAAC,CAAA;AAED,IAAM,YAAY,GAAG,UAAC,CAAS;IAC7B,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA;AAED,IAAM,cAAc,GAAG,UAAC,CAAS;IAC/B,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CA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X,aAAa,eAAA;IACb,WAAW,aAAA;IACX,YAAY,cAAA;IACZ,cAAc,gBAAA;IACd,WAAW,aAAA;IACX,YAAY,cAAA;IACZ,cAAc,gBAAA;IACd,WAAW,aAAA;IACX,YAAY,cAAA;IACZ,cAAc,gBAAA;CACf,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { ReactZoomPanPinchContext, StateType } from 'react-zoom-pan-pinch';
2
+ 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;