@gamepark/react-game 6.23.4 → 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
|
@@ -10,13 +10,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.transformItem = void 0;
|
|
13
|
-
var locators_1 = require("../../../locators");
|
|
14
13
|
function transformItem(context) {
|
|
15
|
-
var _a;
|
|
16
|
-
var rules = context.rules, type = context.type, index = context.index,
|
|
14
|
+
var _a, _b;
|
|
15
|
+
var rules = context.rules, type = context.type, index = context.index, material = context.material, dragTransform = context.dragTransform;
|
|
17
16
|
var currentItem = rules.material(type).getItem(index);
|
|
18
|
-
var
|
|
19
|
-
var locatorTransforms = sourceLocator.transformItem(currentItem, context);
|
|
17
|
+
var locatorTransforms = (_b = (_a = material[type]) === null || _a === void 0 ? void 0 : _a.getItemTransform(currentItem, context)) !== null && _b !== void 0 ? _b : [];
|
|
20
18
|
return dragTransform ? __spreadArray([dragTransform], locatorTransforms, true) : locatorTransforms;
|
|
21
19
|
}
|
|
22
20
|
exports.transformItem = transformItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformItem.util.js","sourceRoot":"","sources":["../../../../src/components/material/animations/transformItem.util.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transformItem.util.js","sourceRoot":"","sources":["../../../../src/components/material/animations/transformItem.util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,SAAgB,aAAa,CAAkF,OAA6B;;IAClI,IAAA,KAAK,GAA2C,OAAO,MAAlD,EAAE,IAAI,GAAqC,OAAO,KAA5C,EAAE,KAAK,GAA8B,OAAO,MAArC,EAAE,QAAQ,GAAoB,OAAO,SAA3B,EAAE,aAAa,GAAK,OAAO,cAAZ,CAAY;IAC/D,IAAM,WAAW,GAAuB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAE,CAAA;IAC5E,IAAM,iBAAiB,GAAG,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,0CAAE,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,mCAAI,EAAE,CAAA;IACtF,OAAO,aAAa,CAAC,CAAC,gBAAE,aAAa,GAAK,iBAAiB,QAAE,CAAC,CAAC,iBAAiB,CAAA;AAClF,CAAC;AALD,sCAKC"}
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./animations"), exports);
|
|
18
18
|
__exportStar(require("./locations"), exports);
|
|
19
|
+
__exportStar(require("./ComponentDescription"), exports);
|
|
19
20
|
__exportStar(require("./Dices"), exports);
|
|
20
21
|
__exportStar(require("./Writing"), exports);
|
|
21
22
|
__exportStar(require("./FlatMaterial"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/material/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8CAA2B;AAC3B,0CAAuB;AACvB,4CAAyB;AACzB,iDAA8B;AAC9B,8CAA2B;AAC3B,sDAAmC;AACnC,0DAAuC;AACvC,wDAAqC;AACrC,gDAA6B;AAC7B,0CAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/material/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8CAA2B;AAC3B,yDAAsC;AACtC,0CAAuB;AACvB,4CAAyB;AACzB,iDAA8B;AAC9B,8CAA2B;AAC3B,sDAAmC;AACnC,0DAAuC;AACvC,wDAAqC;AACrC,gDAA6B;AAC7B,0CAAuB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Location, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { ItemContext } from '../../../locators';
|
|
4
|
+
import { LocationDescription } from './LocationDescription';
|
|
5
|
+
export declare class DropAreaDescription<P extends number = number, M extends number = number, L extends number = number, Id = any> extends LocationDescription<P, M, L, Id> {
|
|
6
|
+
Component: ElementType;
|
|
7
|
+
canDrop(move: MaterialMove<P, M, L>, location: Location<P, L>, context: ItemContext<P, M, L>): boolean;
|
|
8
|
+
getBestDropMove(moves: MaterialMove<P, M, L>[], _location: Location<P, L>, context: ItemContext<P, M, L>): MaterialMove<P, M, L>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DropAreaDescription = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var LocationDescription_1 = require("./LocationDescription");
|
|
21
|
+
var SimpleDropArea_1 = require("./SimpleDropArea");
|
|
22
|
+
var DropAreaDescription = (function (_super) {
|
|
23
|
+
__extends(DropAreaDescription, _super);
|
|
24
|
+
function DropAreaDescription() {
|
|
25
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
_this.Component = SimpleDropArea_1.SimpleDropArea;
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
DropAreaDescription.prototype.canDrop = function (move, location, context) {
|
|
30
|
+
return this.isMoveToLocation(move, location, context);
|
|
31
|
+
};
|
|
32
|
+
DropAreaDescription.prototype.getBestDropMove = function (moves, _location, context) {
|
|
33
|
+
var moveWithSameRotation = moves.find(function (move) { var _a; return (0, rules_api_1.isMoveItem)(move) && move.location.rotation === ((_a = context.rules.material(move.itemType).getItem(move.itemIndex)) === null || _a === void 0 ? void 0 : _a.location.rotation); });
|
|
34
|
+
return moveWithSameRotation !== null && moveWithSameRotation !== void 0 ? moveWithSameRotation : moves[0];
|
|
35
|
+
};
|
|
36
|
+
return DropAreaDescription;
|
|
37
|
+
}(LocationDescription_1.LocationDescription));
|
|
38
|
+
exports.DropAreaDescription = DropAreaDescription;
|
|
39
|
+
//# sourceMappingURL=DropAreaDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropAreaDescription.js","sourceRoot":"","sources":["../../../../src/components/material/locations/DropAreaDescription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iDAAwE;AAGxE,6DAA2D;AAC3D,mDAAiD;AAEjD;IACU,uCAAgC;IAD1C;QAAA,qEAeC;QAZC,eAAS,GAAgB,+BAAc,CAAA;;IAYzC,CAAC;IAVC,qCAAO,GAAP,UAAQ,IAA2B,EAAE,QAAwB,EAAE,OAA6B;QAC1F,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,6CAAe,GAAf,UAAgB,KAA8B,EAAE,SAAyB,EAAE,OAA6B;QACtG,IAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,UAAA,IAAI,YAC1C,OAAA,IAAA,sBAAU,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,MAAK,MAAA,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,0CAAE,QAAQ,CAAC,QAAQ,CAAA,CAAA,EAAA,CAChI,CAAA;QACD,OAAO,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,KAAK,CAAC,CAAC,CAAC,CAAA;IACzC,CAAC;IACH,0BAAC;AAAD,CAAC,AAfD,CACU,yCAAmB,GAc5B;AAfY,kDAAmB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LocationDisplayProps } from './LocationDisplay';
|
|
3
|
+
export type LocationComponentProps<P extends number = number, M extends number = number, L extends number = number> = LocationDisplayProps<P, M, L> & {
|
|
4
|
+
highlight?: boolean;
|
|
5
|
+
onShortClick?: () => void;
|
|
6
|
+
onLongClick?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const LocationComponent: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
location: import("@gamepark/rules-api").Location<number, number, any, any>;
|
|
10
|
+
description: import("./LocationDescription").LocationDescription<number, number, number, any>;
|
|
11
|
+
canDrop?: boolean | undefined;
|
|
12
|
+
} & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
highlight?: boolean | undefined;
|
|
14
|
+
onShortClick?: (() => void) | undefined;
|
|
15
|
+
onLongClick?: (() => void) | undefined;
|
|
16
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
+
t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LocationComponent = void 0;
|
|
30
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
31
|
+
var react_1 = require("@emotion/react");
|
|
32
|
+
var react_2 = require("react");
|
|
33
|
+
var use_long_press_1 = require("use-long-press");
|
|
34
|
+
var css_1 = require("../../../css");
|
|
35
|
+
var hooks_1 = require("../../../hooks");
|
|
36
|
+
var utilities_1 = require("../../../utilities");
|
|
37
|
+
var LocationDisplay_1 = require("./LocationDisplay");
|
|
38
|
+
exports.LocationComponent = (0, react_2.forwardRef)(function (_a, ref) {
|
|
39
|
+
var _b;
|
|
40
|
+
var location = _a.location, description = _a.description, highlight = _a.highlight, onShortClick = _a.onShortClick, onLongClick = _a.onLongClick, props = __rest(_a, ["location", "description", "highlight", "onShortClick", "onLongClick"]);
|
|
41
|
+
var context = (0, hooks_1.useMaterialContext)();
|
|
42
|
+
var play = (0, hooks_1.usePlay)();
|
|
43
|
+
var displayHelp = (0, react_2.useMemo)(function () {
|
|
44
|
+
var move = description.displayHelp(location, context);
|
|
45
|
+
return move && (function () { return play(move, { local: true }); });
|
|
46
|
+
}, [location, context]);
|
|
47
|
+
onLongClick = onLongClick !== null && onLongClick !== void 0 ? onLongClick : (onShortClick ? displayHelp : undefined);
|
|
48
|
+
onShortClick = onShortClick !== null && onShortClick !== void 0 ? onShortClick : displayHelp;
|
|
49
|
+
var _c = (0, react_2.useState)(false), clicking = _c[0], setClicking = _c[1];
|
|
50
|
+
var lastShortClick = (0, react_2.useRef)(new Date().getTime());
|
|
51
|
+
var listeners = (0, use_long_press_1.useLongPress)(function () { return onLongClick && onLongClick(); }, {
|
|
52
|
+
detect: use_long_press_1.LongPressEventType.Pointer,
|
|
53
|
+
cancelOnMovement: 5,
|
|
54
|
+
threshold: 600,
|
|
55
|
+
onStart: function (event) {
|
|
56
|
+
setClicking(true);
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
},
|
|
59
|
+
onFinish: function () { return setClicking(false); },
|
|
60
|
+
onCancel: function (_, _a) {
|
|
61
|
+
var reason = _a.reason;
|
|
62
|
+
if (reason === use_long_press_1.LongPressCallbackReason.CancelledByRelease && onShortClick) {
|
|
63
|
+
var time = new Date().getTime();
|
|
64
|
+
if (time - lastShortClick.current < 300)
|
|
65
|
+
return;
|
|
66
|
+
lastShortClick.current = time;
|
|
67
|
+
setTimeout(onShortClick);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
filterEvents: function (event) { return !event.button; }
|
|
71
|
+
})();
|
|
72
|
+
highlight = highlight || ((_b = description.highlight) === null || _b === void 0 ? void 0 : _b.call(description, location, context));
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(LocationDisplay_1.LocationDisplay, __assign({ ref: ref, location: location, description: description, css: [
|
|
74
|
+
(onShortClick || onLongClick) ? hoverHighlight : noPointerEvents,
|
|
75
|
+
onLongClick && clicking && clickingAnimation,
|
|
76
|
+
highlight && css_1.shineEffect
|
|
77
|
+
] }, props, (0, utilities_1.combineEventListeners)(listeners, props))));
|
|
78
|
+
});
|
|
79
|
+
var hoverHighlight = (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: pointer;\n\n &:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n"], ["\n cursor: pointer;\n\n &:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n"])));
|
|
80
|
+
var noPointerEvents = (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
81
|
+
var clickingKeyframes = function (theme) {
|
|
82
|
+
var _a;
|
|
83
|
+
return (0, react_1.keyframes)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n from {\n background-color: rgba(255, 255, 255, 0.2);\n }\n to {\n background-color: ", ";\n }\n"], ["\n from {\n background-color: rgba(255, 255, 255, 0.2);\n }\n to {\n background-color: ", ";\n }\n"])), (_a = theme.dropArea) === null || _a === void 0 ? void 0 : _a.backgroundColor);
|
|
84
|
+
};
|
|
85
|
+
var longClickThreshold = 600;
|
|
86
|
+
var clickingAnimation = function (theme) { return (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n animation: ", " ", "ms ease-in-out;\n"], ["\n animation: ", " ", "ms ease-in-out;\n"])), clickingKeyframes(theme), longClickThreshold); };
|
|
87
|
+
exports.LocationComponent.displayName = 'LocationComponent';
|
|
88
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
89
|
+
//# sourceMappingURL=LocationComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationComponent.js","sourceRoot":"","sources":["../../../../src/components/material/locations/LocationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAsD;AAEtD,+BAAyE;AACzE,iDAA0F;AAC1F,oCAA0C;AAC1C,wCAA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BAE1B,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAG,UAAC,KAAY;;IAAK,WAAA,iBAAS,kLAAA,kGAK7B,EAA+B,UAEtD,KAFuB,MAAA,KAAK,CAAC,QAAQ,0CAAE,eAAe,EAEtD;CAAA,CAAA;AAED,IAAM,kBAAkB,GAAG,GAAG,CAAA;AAE9B,IAAM,iBAAiB,GAAG,UAAC,KAAY,IAAK,WAAA,WAAG,+GAAA,iBAChC,EAAwB,GAAI,EAAkB,mBAC5D,KADc,iBAAiB,CAAC,KAAK,CAAC,EAAI,kBAAkB,GADjB,CAE3C,CAAA;AAED,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAA"}
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentType } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { ComponentSize } from '../
|
|
6
|
-
export declare class LocationDescription<P extends number = number, M extends number = number, L extends number = number, Id = any> {
|
|
2
|
+
import { Location, MaterialMove } from '@gamepark/rules-api';
|
|
3
|
+
import { ComponentType, ElementType } from 'react';
|
|
4
|
+
import { LocationContext, MaterialContext } from '../../../locators';
|
|
5
|
+
import { ComponentDescription, ComponentSize } from '../ComponentDescription';
|
|
6
|
+
export declare class LocationDescription<P extends number = number, M extends number = number, L extends number = number, Id = any> extends ComponentDescription<Id> {
|
|
7
|
+
Component: ElementType;
|
|
7
8
|
help?: ComponentType<LocationHelpProps<P, L>>;
|
|
8
|
-
|
|
9
|
-
width?: number;
|
|
10
|
-
ratio?: number;
|
|
11
|
-
rotationUnit: string;
|
|
12
|
-
location?: Location<P, L>;
|
|
13
|
-
locations: Location<P, L>[];
|
|
14
|
-
getLocations(_context: MaterialContext<P, M, L>): Location<P, L>[];
|
|
15
|
-
getSize(_location: Location<P, L>, _context: MaterialContext<P, M, L>): ComponentSize;
|
|
9
|
+
getLocationSize(location: Location<P, L>, _context: MaterialContext<P, M, L>): ComponentSize;
|
|
16
10
|
image?: string;
|
|
17
11
|
images?: Record<Id extends keyof any ? Id : never, string>;
|
|
18
12
|
getImage(location: Location<P, L>, _context: MaterialContext<P, M, L>): string | undefined;
|
|
19
13
|
helpImage?: string;
|
|
20
14
|
getHelpImage(location: Location<P, L>, context: MaterialContext<P, M, L>): string | undefined;
|
|
21
|
-
|
|
22
|
-
getBorderRadius(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number | undefined;
|
|
15
|
+
getImages(): string[];
|
|
23
16
|
extraCss?: Interpolation<Theme>;
|
|
24
17
|
getExtraCss(_location: Location<P, L>, _context: LocationContext<P, M, L>): Interpolation<Theme>;
|
|
25
|
-
|
|
26
|
-
transformOwnLocation(location: Location<P, L>, context: LocationContext<P, M, L>): string[];
|
|
27
|
-
coordinates?: Coordinates;
|
|
28
|
-
getCoordinates(_location: Location<P, L>, _context: LocationContext<P, M, L>): Coordinates | undefined;
|
|
29
|
-
rotateZ: number;
|
|
30
|
-
getRotateZ(_location: Location<P, L>, _context: LocationContext<P, M, L>): number;
|
|
31
|
-
alwaysVisible?: boolean;
|
|
32
|
-
isAlwaysVisible(location: Location<P, L>, context: MaterialContext<P, M, L>): boolean;
|
|
18
|
+
getLocationTransform(location: Location<P, L>, context: LocationContext<P, M, L>): string[];
|
|
33
19
|
highlight?(location: Location<P, L>, context: MaterialContext<P, M, L>): boolean | undefined;
|
|
34
20
|
content?: ComponentType<{
|
|
35
21
|
location: Location;
|
|
36
22
|
}>;
|
|
37
|
-
canDrop(move: MaterialMove<P, M, L>, location: Location<P, L>, context: ItemContext<P, M, L>): boolean;
|
|
38
|
-
getBestDropMove(moves: MaterialMove<P, M, L>[], _location: Location<P, L>, context: ItemContext<P, M, L>): MaterialMove<P, M, L>;
|
|
39
23
|
canLongClick(move: MaterialMove<P, M, L>, location: Location<P, L>, context: MaterialContext<P, M, L>): boolean;
|
|
40
24
|
canShortClick(move: MaterialMove<P, M, L>, location: Location<P, L>, context: MaterialContext<P, M, L>): boolean;
|
|
41
25
|
isMoveToLocation(move: MaterialMove<P, M, L>, location: Location<P, L>, context: MaterialContext<P, M, L>): boolean;
|
|
42
26
|
getShortClickMove(_location: Location<P, L>, _context: MaterialContext<P, M, L>): MaterialMove<P, M, L> | undefined;
|
|
43
27
|
getShortClickLocalMove(_location: Location<P, L>, _context: MaterialContext<P, M, L>): MaterialMove<P, M, L> | undefined;
|
|
44
28
|
displayInParentItemHelp?: boolean;
|
|
29
|
+
displayHelp(location: Location<P, L>, _context: MaterialContext<P, M, L>): MaterialMove<P, M, L> | undefined;
|
|
45
30
|
}
|
|
31
|
+
export type LocationHelpProps<P extends number = number, L extends number = number> = {
|
|
32
|
+
location: Location<P, L>;
|
|
33
|
+
closeDialog: () => void;
|
|
34
|
+
};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
19
|
};
|
|
@@ -6,25 +21,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
21
|
exports.LocationDescription = void 0;
|
|
7
22
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
8
23
|
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
24
|
+
var ComponentDescription_1 = require("../ComponentDescription");
|
|
9
25
|
var utils_1 = require("../utils");
|
|
10
26
|
var Writing_1 = require("../Writing");
|
|
11
|
-
var
|
|
27
|
+
var LocationComponent_1 = require("./LocationComponent");
|
|
28
|
+
var displayLocationHelp = rules_api_1.MaterialMoveBuilder.displayLocationHelp;
|
|
29
|
+
var LocationDescription = (function (_super) {
|
|
30
|
+
__extends(LocationDescription, _super);
|
|
12
31
|
function LocationDescription() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
_this.Component = LocationComponent_1.LocationComponent;
|
|
34
|
+
return _this;
|
|
16
35
|
}
|
|
17
|
-
LocationDescription.prototype.
|
|
18
|
-
return this.location
|
|
19
|
-
};
|
|
20
|
-
LocationDescription.prototype.getSize = function (_location, _context) {
|
|
21
|
-
if (this.width && this.height)
|
|
22
|
-
return { width: this.width, height: this.height };
|
|
23
|
-
if (this.ratio && this.width)
|
|
24
|
-
return { width: this.width, height: this.width / this.ratio };
|
|
25
|
-
if (this.ratio && this.height)
|
|
26
|
-
return { width: this.height * this.ratio, height: this.height };
|
|
27
|
-
throw new Error('You must implement 2 of "width", "height" & "ratio" in any Location description');
|
|
36
|
+
LocationDescription.prototype.getLocationSize = function (location, _context) {
|
|
37
|
+
return this.getSize(location.id);
|
|
28
38
|
};
|
|
29
39
|
LocationDescription.prototype.getImage = function (location, _context) {
|
|
30
40
|
var _a, _b;
|
|
@@ -34,46 +44,26 @@ var LocationDescription = (function () {
|
|
|
34
44
|
var _a;
|
|
35
45
|
return (_a = this.helpImage) !== null && _a !== void 0 ? _a : this.getImage(location, context);
|
|
36
46
|
};
|
|
37
|
-
LocationDescription.prototype.
|
|
38
|
-
|
|
47
|
+
LocationDescription.prototype.getImages = function () {
|
|
48
|
+
var images = [];
|
|
49
|
+
if (this.image)
|
|
50
|
+
images.push(this.image);
|
|
51
|
+
if (this.images)
|
|
52
|
+
images.push.apply(images, Object.values(this.images));
|
|
53
|
+
if (this.helpImage)
|
|
54
|
+
images.push(this.helpImage);
|
|
55
|
+
return images;
|
|
39
56
|
};
|
|
40
57
|
LocationDescription.prototype.getExtraCss = function (_location, _context) {
|
|
41
58
|
return this.extraCss;
|
|
42
59
|
};
|
|
43
|
-
LocationDescription.prototype.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var coordinates = this.getCoordinates(location, context);
|
|
49
|
-
if (coordinates) {
|
|
50
|
-
transform.push("translate3d(".concat(coordinates.x, "em, ").concat(coordinates.y, "em, ").concat(coordinates.z, "em)"));
|
|
51
|
-
}
|
|
52
|
-
var rotateZ = this.getRotateZ(location, context);
|
|
53
|
-
if (rotateZ) {
|
|
54
|
-
transform.push("rotateZ(".concat(rotateZ).concat(this.rotationUnit, ")"));
|
|
55
|
-
}
|
|
60
|
+
LocationDescription.prototype.getLocationTransform = function (location, context) {
|
|
61
|
+
var transform = ['translate(-50%, -50%)'];
|
|
62
|
+
var locator = context.locators[location.type];
|
|
63
|
+
if (locator)
|
|
64
|
+
transform.push.apply(transform, locator.placeLocation(location, context));
|
|
56
65
|
return transform;
|
|
57
66
|
};
|
|
58
|
-
LocationDescription.prototype.getCoordinates = function (_location, _context) {
|
|
59
|
-
return this.coordinates;
|
|
60
|
-
};
|
|
61
|
-
LocationDescription.prototype.getRotateZ = function (_location, _context) {
|
|
62
|
-
return this.rotateZ;
|
|
63
|
-
};
|
|
64
|
-
LocationDescription.prototype.isAlwaysVisible = function (location, context) {
|
|
65
|
-
var _a;
|
|
66
|
-
if (this.alwaysVisible !== undefined)
|
|
67
|
-
return this.alwaysVisible;
|
|
68
|
-
return ((_a = context.locators[location.type]) === null || _a === void 0 ? void 0 : _a.parentItemType) !== undefined;
|
|
69
|
-
};
|
|
70
|
-
LocationDescription.prototype.canDrop = function (move, location, context) {
|
|
71
|
-
return this.isMoveToLocation(move, location, context);
|
|
72
|
-
};
|
|
73
|
-
LocationDescription.prototype.getBestDropMove = function (moves, _location, context) {
|
|
74
|
-
var moveWithSameRotation = moves.find(function (move) { var _a; return (0, rules_api_1.isMoveItem)(move) && move.location.rotation === ((_a = context.rules.material(move.itemType).getItem(move.itemIndex)) === null || _a === void 0 ? void 0 : _a.location.rotation); });
|
|
75
|
-
return moveWithSameRotation !== null && moveWithSameRotation !== void 0 ? moveWithSameRotation : moves[0];
|
|
76
|
-
};
|
|
77
67
|
LocationDescription.prototype.canLongClick = function (move, location, context) {
|
|
78
68
|
return this.isMoveToLocation(move, location, context);
|
|
79
69
|
};
|
|
@@ -93,7 +83,10 @@ var LocationDescription = (function () {
|
|
|
93
83
|
LocationDescription.prototype.getShortClickLocalMove = function (_location, _context) {
|
|
94
84
|
return undefined;
|
|
95
85
|
};
|
|
86
|
+
LocationDescription.prototype.displayHelp = function (location, _context) {
|
|
87
|
+
return this.help && displayLocationHelp(location);
|
|
88
|
+
};
|
|
96
89
|
return LocationDescription;
|
|
97
|
-
}());
|
|
90
|
+
}(ComponentDescription_1.ComponentDescription));
|
|
98
91
|
exports.LocationDescription = LocationDescription;
|
|
99
92
|
//# sourceMappingURL=LocationDescription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationDescription.js","sourceRoot":"","sources":["../../../../src/components/material/locations/LocationDescription.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationDescription.js","sourceRoot":"","sources":["../../../../src/components/material/locations/LocationDescription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,iDAAyH;AACzH,2DAAoC;AAGpC,gEAA6E;AAC7E,kCAA2C;AAC3C,sCAAiD;AACjD,yDAAuD;AACvD,IAAO,mBAAmB,GAAG,+BAAmB,CAAC,mBAAmB,CAAA;AAEpE;IACU,uCAAwB;IADlC;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AAC,CACzE,CACF,CAAA;IACH,CAAC;IAED,+CAAiB,GAAjB,UAAkB,SAAyB,EAAE,QAAkC;QAC7E,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,oDAAsB,GAAtB,UAAuB,SAAyB,EAAE,QAAkC;QAClF,OAAO,SAAS,CAAA;IAClB,CAAC;IAWD,yCAAW,GAAX,UAAY,QAAwB,EAAE,QAAkC;QACtE,OAAO,IAAI,CAAC,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACnD,CAAC;IACH,0BAAC;AAAD,CAAC,AAzFD,CACU,2CAAoB,GAwF7B;AAzFY,kDAAmB"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Location } from '@gamepark/rules-api';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
|
-
|
|
3
|
+
import { LocationDescription } from './LocationDescription';
|
|
4
|
+
export type LocationDisplayProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
4
5
|
location: Location<P, L>;
|
|
6
|
+
description: LocationDescription<P, M, L>;
|
|
5
7
|
canDrop?: boolean;
|
|
6
8
|
} & HTMLAttributes<HTMLDivElement>;
|
|
7
9
|
export declare const LocationDisplay: import("react").ForwardRefExoticComponent<{
|
|
8
10
|
location: Location<number, number, any, any>;
|
|
11
|
+
description: LocationDescription<number, number, number, any>;
|
|
9
12
|
canDrop?: boolean | undefined;
|
|
10
13
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -33,23 +33,18 @@ var react_2 = require("react");
|
|
|
33
33
|
var css_1 = require("../../../css");
|
|
34
34
|
var hooks_1 = require("../../../hooks");
|
|
35
35
|
exports.LocationDisplay = (0, react_2.forwardRef)(function (_a, ref) {
|
|
36
|
-
var location = _a.location, _b = _a.canDrop, canDrop = _b === void 0 ? false : _b, props = __rest(_a, ["location", "canDrop"]);
|
|
36
|
+
var location = _a.location, description = _a.description, _b = _a.canDrop, canDrop = _b === void 0 ? false : _b, props = __rest(_a, ["location", "description", "canDrop"]);
|
|
37
37
|
var context = (0, hooks_1.useMaterialContext)();
|
|
38
38
|
var locator = context.locators[location.type];
|
|
39
|
-
var description = locator === null || locator === void 0 ? void 0 : locator.getLocationDescription(context);
|
|
40
39
|
var locationContext = (0, react_2.useMemo)(function () { return (__assign(__assign({}, context), { canDrop: canDrop })); }, [context, canDrop]);
|
|
41
|
-
|
|
42
|
-
console.warn('You must provide a LocationDescription to create drop locations with an ItemLocator');
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
var _c = description.getSize(location, context), width = _c.width, height = _c.height;
|
|
40
|
+
var _c = description.getLocationSize(location, context), width = _c.width, height = _c.height;
|
|
46
41
|
var image = description.getImage(location, context);
|
|
47
|
-
var borderRadius = description.getBorderRadius(location
|
|
42
|
+
var borderRadius = description.getBorderRadius(location.id);
|
|
48
43
|
var positionOnParent = (0, react_2.useMemo)(function () { return (locator === null || locator === void 0 ? void 0 : locator.parentItemType) !== undefined ? locator.getPositionOnParent(location, context) : undefined; }, [location, context, location]);
|
|
49
44
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ ref: ref, css: [
|
|
50
45
|
absolute,
|
|
51
46
|
positionOnParent && positionOnParentCss(positionOnParent),
|
|
52
|
-
css_1.transformCss.apply(void 0, description.
|
|
47
|
+
css_1.transformCss.apply(void 0, description.getLocationTransform(location, locationContext)),
|
|
53
48
|
(0, css_1.sizeCss)(width, height), image && (0, css_1.backgroundCss)(image), borderRadius && (0, css_1.borderRadiusCss)(borderRadius),
|
|
54
49
|
description.getExtraCss(location, locationContext)
|
|
55
50
|
] }, props, { children: description.content && (0, jsx_runtime_1.jsx)(description.content, { location: location }) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationDisplay.js","sourceRoot":"","sources":["../../../../src/components/material/locations/LocationDisplay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAoC;AAEpC,+BAA2D;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O,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEzK,OAAO,CACL,yCAAK,GAAG,EAAE,GAAG,EACR,GAAG,EAAE;YACH,QAAQ;YACR,gBAAgB,IAAI,mBAAmB,CAAC,gBAAgB,CAAC;YACzD,kBAAY,eAAI,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,eAAe,CAAC;YAC3E,IAAA,aAAO,EAAC,KAAK,EAAE,MAAM,CAAC,EAAE,KAAK,IAAI,IAAA,mBAAa,EAAC,KAAK,CAAC,EAAE,YAAY,IAAI,IAAA,qBAAe,EAAC,YAAY,CAAC;YACpG,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,eAAe,CAAC;SACnD,IACG,KAAK,cACX,WAAW,CAAC,OAAO,IAAI,uBAAC,WAAW,CAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,GAAG,IAC9D,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAE/C,IAAM,QAAQ,OAAG,WAAG,+FAAA,2BAEnB,IAAA,CAAA;AAED,IAAM,mBAAmB,GAAG,UAAC,EAAuB;QAArB,CAAC,OAAA,EAAE,CAAC,OAAA;IAAsB,WAAA,WAAG,uGAAA,YAClD,EAAC,aACF,EAAC,MACT,KAFS,CAAC,EACF,CAAC;AAF+C,CAGxD,CAAA"}
|
|
@@ -30,11 +30,11 @@ var LocationRect = function (_a) {
|
|
|
30
30
|
var location = _a.location;
|
|
31
31
|
var locator = (0, hooks_1.useItemLocator)(location.type);
|
|
32
32
|
var context = (0, hooks_1.useMaterialContext)();
|
|
33
|
-
var description = locator.getLocationDescription(context);
|
|
33
|
+
var description = locator.getLocationDescription(location, context);
|
|
34
34
|
var position = locator.getPositionOnParent(location, context);
|
|
35
|
-
var _c = description.
|
|
36
|
-
var radius = (_b = description.getBorderRadius(location
|
|
37
|
-
var transforms = description.
|
|
35
|
+
var _c = description.getLocationSize(location, context), width = _c.width, height = _c.height;
|
|
36
|
+
var radius = (_b = description.getBorderRadius(location.id)) !== null && _b !== void 0 ? _b : 0;
|
|
37
|
+
var transforms = description.getLocationTransform(location, context);
|
|
38
38
|
return ((0, jsx_runtime_1.jsx)("rect", { fill: "black", x: "".concat(position.x, "%"), y: "".concat(position.y, "%"), width: "".concat(width, "em"), height: "".concat(height, "em"), rx: "".concat(radius, "em"), ry: "".concat(radius, "em"), style: { transformBox: 'fill-box', transformOrigin: 'center', transform: transforms.join(' ') } }));
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=LocationsMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsMask.js","sourceRoot":"","sources":["../../../../src/components/material/locations/LocationsMask.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6DAAsC;AACtC,+BAA+B;AAC/B,wCAAmE;AAM5D,IAAM,aAAa,GAAG,UAAC,EAAiC;QAA/B,SAAS,eAAA;IACvC,IAAM,EAAE,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,IAAA,kBAAQ,EAAC,MAAM,CAAC,EAAhB,CAAgB,EAAE,EAAE,CAAC,CAAA;IAC9C,OAAO,CACL,0CAAK,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAC7D,2CACE,2CAAM,EAAE,EAAE,EAAE,iBACV,iCAAM,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,GAAE,EAC9C,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,uBAAC,YAAY,IAAgC,QAAQ,EAAE,QAAQ,IAA5C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAuB,EAAlE,CAAkE,CAAC,KACzF,GACF,EACP,iCAAM,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,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
1
1
|
import { Location } from '@gamepark/rules-api';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
|
-
|
|
3
|
+
import { DropAreaDescription } from './DropAreaDescription';
|
|
4
|
+
export type SimpleDropAreaProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
4
5
|
location: Location<P, L>;
|
|
5
|
-
|
|
6
|
-
onLongClick?: () => void;
|
|
7
|
-
alwaysVisible?: boolean;
|
|
6
|
+
description: DropAreaDescription<P, M, L>;
|
|
8
7
|
} & HTMLAttributes<HTMLDivElement>;
|
|
9
8
|
export declare const SimpleDropArea: import("react").ForwardRefExoticComponent<{
|
|
10
9
|
location: Location<number, number, any, any>;
|
|
11
|
-
|
|
12
|
-
onLongClick?: (() => void) | undefined;
|
|
13
|
-
alwaysVisible?: boolean | undefined;
|
|
10
|
+
description: DropAreaDescription<number, number, number, any>;
|
|
14
11
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|