@gamepark/react-game 6.38.4 → 6.38.6
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/PlayerPanel/Counters.d.ts +3 -2
- package/dist/components/PlayerPanel/Counters.js +21 -12
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +7 -31
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +6 -4
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/material/utils/getBestDropMove.d.ts +1 -1
- package/dist/locators/Locator.d.ts +3 -1
- package/dist/locators/Locator.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/Chat/Chat.d.ts +0 -3
- package/dist/components/Chat/Chat.js +0 -80
- package/dist/components/Chat/Chat.js.map +0 -1
- package/dist/components/Chat/ChatMessage.d.ts +0 -7
- package/dist/components/Chat/ChatMessage.js +0 -29
- package/dist/components/Chat/ChatMessage.js.map +0 -1
- package/dist/components/Chat/ChatMessageAuthor.d.ts +0 -3
- package/dist/components/Chat/ChatMessageAuthor.js +0 -34
- package/dist/components/Chat/ChatMessageAuthor.js.map +0 -1
- package/dist/components/Chat/ChatTextInput.d.ts +0 -7
- package/dist/components/Chat/ChatTextInput.js +0 -44
- package/dist/components/Chat/ChatTextInput.js.map +0 -1
- package/dist/components/Chat/SignInToChat.d.ts +0 -1
- package/dist/components/Chat/SignInToChat.js +0 -35
- package/dist/components/Chat/SignInToChat.js.map +0 -1
- package/dist/components/Chat/index.d.ts +0 -5
- package/dist/components/Chat/index.js +0 -22
- package/dist/components/Chat/index.js.map +0 -1
- package/dist/components/Header/PlayerTurnHeader.d.ts +0 -11
- package/dist/components/Header/PlayerTurnHeader.js +0 -37
- package/dist/components/Header/PlayerTurnHeader.js.map +0 -1
- package/dist/components/Header/SimultaneousHeader.d.ts +0 -8
- package/dist/components/Header/SimultaneousHeader.js +0 -35
- package/dist/components/Header/SimultaneousHeader.js.map +0 -1
- package/dist/components/JournalTabs/History/ActionHistoryEntry.d.ts +0 -12
- package/dist/components/JournalTabs/History/ActionHistoryEntry.js +0 -62
- package/dist/components/JournalTabs/History/ActionHistoryEntry.js.map +0 -1
- package/dist/components/JournalTabs/History/MaterialHistory.d.ts +0 -10
- package/dist/components/JournalTabs/History/MaterialHistory.js +0 -3
- package/dist/components/JournalTabs/History/MaterialHistory.js.map +0 -1
- package/dist/components/JournalTabs/History/PlayerActionHistory.d.ts +0 -8
- package/dist/components/JournalTabs/History/PlayerActionHistory.js +0 -42
- package/dist/components/JournalTabs/History/PlayerActionHistory.js.map +0 -1
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.d.ts +0 -8
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.js +0 -44
- package/dist/components/JournalTabs/History/PlayerHistoryEntry.js.map +0 -1
- package/dist/components/JournalTabs/History/StartHistory.d.ts +0 -2
- package/dist/components/JournalTabs/History/StartHistory.js +0 -30
- package/dist/components/JournalTabs/History/StartHistory.js.map +0 -1
- package/dist/components/material/Dices/DiceDescription.d.ts +0 -10
- package/dist/components/material/Dices/DiceDescription.js +0 -56
- package/dist/components/material/Dices/DiceDescription.js.map +0 -1
- package/dist/components/material/GameTable/DraggableStockItem.d.ts +0 -4
- package/dist/components/material/GameTable/DraggableStockItem.js +0 -82
- package/dist/components/material/GameTable/DraggableStockItem.js.map +0 -1
- package/dist/components/material/GameTable/FocusableElement.d.ts +0 -13
- package/dist/components/material/GameTable/FocusableElement.js +0 -63
- package/dist/components/material/GameTable/FocusableElement.js.map +0 -1
- package/dist/components/material/GameTable/FocusableLocation.d.ts +0 -8
- package/dist/components/material/GameTable/FocusableLocation.js +0 -37
- package/dist/components/material/GameTable/FocusableLocation.js.map +0 -1
- package/dist/components/material/GameTable/FocusableLocations.d.ts +0 -0
- package/dist/components/material/GameTable/FocusableLocations.js +0 -2
- package/dist/components/material/GameTable/FocusableLocations.js.map +0 -1
- package/dist/components/material/GameTable/GameTableContent.d.ts +0 -18
- package/dist/components/material/GameTable/GameTableContent.js +0 -63
- package/dist/components/material/GameTable/GameTableContent.js.map +0 -1
- package/dist/components/material/GameTable/focus/FocusableElement.d.ts +0 -13
- package/dist/components/material/GameTable/focus/FocusableElement.js +0 -63
- package/dist/components/material/GameTable/focus/FocusableElement.js.map +0 -1
- package/dist/components/material/GameTable/focus/FocusableLocation.d.ts +0 -8
- package/dist/components/material/GameTable/focus/FocusableLocation.js +0 -38
- package/dist/components/material/GameTable/focus/FocusableLocation.js.map +0 -1
- package/dist/components/material/GameTable/focus/LocationsWithFocus.d.ts +0 -9
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js +0 -45
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js.map +0 -1
- package/dist/components/material/GameTable/locations.utils.d.ts +0 -0
- package/dist/components/material/GameTable/locations.utils.js +0 -2
- package/dist/components/material/GameTable/locations.utils.js.map +0 -1
- package/dist/components/material/ItemMenu.js.map +0 -1
- package/dist/components/material/MaterialAnimations.d.ts +0 -25
- package/dist/components/material/MaterialAnimations.js +0 -219
- package/dist/components/material/MaterialAnimations.js.map +0 -1
- package/dist/components/material/MaterialGameAnimations.d.ts +0 -10
- package/dist/components/material/MaterialGameAnimations.js +0 -47
- package/dist/components/material/MaterialGameAnimations.js.map +0 -1
- package/dist/components/material/animations/adjustRotation.d.ts +0 -1
- package/dist/components/material/animations/adjustRotation.js +0 -67
- package/dist/components/material/animations/adjustRotation.js.map +0 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.d.ts +0 -3
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js +0 -26
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js.map +0 -1
- package/dist/components/material/animations/itemMovementCss.util.d.ts +0 -2
- package/dist/components/material/animations/itemMovementCss.util.js +0 -13
- package/dist/components/material/animations/itemMovementCss.util.js.map +0 -1
- package/dist/components/material/locations/HexGridDropArea.d.ts +0 -11
- package/dist/components/material/locations/HexGridDropArea.js +0 -74
- package/dist/components/material/locations/HexGridDropArea.js.map +0 -1
- package/dist/components/material/utils/IsMoveOnItem.d.ts +0 -2
- package/dist/components/material/utils/IsMoveOnItem.js +0 -12
- package/dist/components/material/utils/IsMoveOnItem.js.map +0 -1
- package/dist/components/material/utils/getItemFromContext.d.ts +0 -3
- package/dist/components/material/utils/getItemFromContext.js +0 -10
- package/dist/components/material/utils/getItemFromContext.js.map +0 -1
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.d.ts +0 -4
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js +0 -27
- package/dist/components/menus/ContrastThemeButton/ContrastThemeButton.js.map +0 -1
- package/dist/components/menus/ContrastThemeButton/index.d.ts +0 -1
- package/dist/components/menus/ContrastThemeButton/index.js +0 -18
- package/dist/components/menus/ContrastThemeButton/index.js.map +0 -1
- package/dist/components/tutorial/FocusableElement.d.ts +0 -0
- package/dist/components/tutorial/FocusableElement.js +0 -2
- package/dist/components/tutorial/FocusableElement.js.map +0 -1
- package/dist/hooks/useCloseHelpDialog.d.ts +0 -1
- package/dist/hooks/useCloseHelpDialog.js +0 -14
- package/dist/hooks/useCloseHelpDialog.js.map +0 -1
- package/dist/hooks/useContrastTheme.d.ts +0 -7
- package/dist/hooks/useContrastTheme.js +0 -27
- package/dist/hooks/useContrastTheme.js.map +0 -1
- package/dist/hooks/useGameHistory.d.ts +0 -1
- package/dist/hooks/useGameHistory.js +0 -13
- package/dist/hooks/useGameHistory.js.map +0 -1
- package/dist/hooks/useHistory.d.ts +0 -6
- package/dist/hooks/useHistory.js +0 -85
- package/dist/hooks/useHistory.js.map +0 -1
- package/dist/hooks/useMaterialAnimations.d.ts +0 -2
- package/dist/hooks/useMaterialAnimations.js +0 -17
- package/dist/hooks/useMaterialAnimations.js.map +0 -1
- package/dist/hooks/useMaterials.d.ts +0 -2
- package/dist/hooks/useMaterials.js +0 -10
- package/dist/hooks/useMaterials.js.map +0 -1
- package/dist/hooks/useRulesStep.d.ts +0 -2
- package/dist/hooks/useRulesStep.js +0 -10
- package/dist/hooks/useRulesStep.js.map +0 -1
- package/dist/hooks/useScale.d.ts +0 -1
- package/dist/hooks/useScale.js +0 -16
- package/dist/hooks/useScale.js.map +0 -1
- package/dist/locators/GridLocator.d.ts +0 -13
- package/dist/locators/GridLocator.js +0 -59
- package/dist/locators/GridLocator.js.map +0 -1
- package/dist/locators/ItemLocator.d.ts +0 -49
- package/dist/locators/ItemLocator.js +0 -144
- package/dist/locators/ItemLocator.js.map +0 -1
- package/dist/locators/LineLocator.d.ts +0 -12
- package/dist/locators/LineLocator.js +0 -77
- package/dist/locators/LineLocator.js.map +0 -1
- package/dist/translation/index.d.ts +0 -1
- package/dist/translation/index.js +0 -18
- package/dist/translation/index.js.map +0 -1
- package/dist/translation/setupTranslation.d.ts +0 -5
- package/dist/translation/setupTranslation.js +0 -33
- package/dist/translation/setupTranslation.js.map +0 -1
- package/dist/utilities/animations.constants.d.ts +0 -16
- package/dist/utilities/animations.constants.js +0 -62
- package/dist/utilities/animations.constants.js.map +0 -1
- package/dist/utilities/animations.util.d.ts +0 -4
- package/dist/utilities/animations.util.js +0 -71
- package/dist/utilities/animations.util.js.map +0 -1
- package/dist/utilities/bounds.util.d.ts +0 -7
- package/dist/utilities/bounds.util.js +0 -77
- package/dist/utilities/bounds.util.js.map +0 -1
- package/dist/utilities/calculation.util.d.ts +0 -2
- package/dist/utilities/calculation.util.js +0 -12
- package/dist/utilities/calculation.util.js.map +0 -1
- package/dist/utilities/zoom.util.d.ts +0 -1
- package/dist/utilities/zoom.util.js +0 -14
- package/dist/utilities/zoom.util.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Location, LocationBuilder, Material, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
export type FocusableElement<P extends number = number, M extends number = number, L extends number = number> = Material<P, M, L> | StaticItem<P, M, L> | LocationBuilder<P, L>;
|
|
3
|
-
export type StaticItem<P extends number = number, M extends number = number, L extends number = number> = {
|
|
4
|
-
type: M;
|
|
5
|
-
item: MaterialItem<P, L>;
|
|
6
|
-
};
|
|
7
|
-
export declare function isItemFocus(itemType: number, itemIndex: number, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
8
|
-
export declare function isMaterialFocus(focus?: FocusableElement): focus is Material;
|
|
9
|
-
export declare function countTutorialFocusRefs(focus?: FocusableElement | FocusableElement[]): number;
|
|
10
|
-
export declare function isStaticItem(focus?: FocusableElement): focus is StaticItem;
|
|
11
|
-
export declare function isStaticItemFocus(itemType: number, item: MaterialItem, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
12
|
-
export declare function isLocationBuilder(focus?: FocusableElement): focus is LocationBuilder;
|
|
13
|
-
export declare function isLocationFocus(location: Location, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isLocationFocus = exports.isLocationBuilder = exports.isStaticItemFocus = exports.isStaticItem = exports.countTutorialFocusRefs = exports.isMaterialFocus = exports.isItemFocus = void 0;
|
|
7
|
-
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
var sumBy_1 = __importDefault(require("lodash/sumBy"));
|
|
9
|
-
function isItemFocus(itemType, itemIndex, focus) {
|
|
10
|
-
if (Array.isArray(focus)) {
|
|
11
|
-
return focus.some(function (focus) { return isItemFocus(itemType, itemIndex, focus); });
|
|
12
|
-
}
|
|
13
|
-
return isMaterialFocus(focus) && focus.type === itemType && focus.getIndexes().includes(itemIndex);
|
|
14
|
-
}
|
|
15
|
-
exports.isItemFocus = isItemFocus;
|
|
16
|
-
function isMaterialFocus(focus) {
|
|
17
|
-
return typeof focus === 'object' && focus.entries !== undefined;
|
|
18
|
-
}
|
|
19
|
-
exports.isMaterialFocus = isMaterialFocus;
|
|
20
|
-
function countTutorialFocusRefs(focus) {
|
|
21
|
-
var _a;
|
|
22
|
-
if (!focus)
|
|
23
|
-
return 0;
|
|
24
|
-
if (Array.isArray(focus)) {
|
|
25
|
-
return (0, sumBy_1.default)(focus, function (focus) { return countTutorialFocusRefs(focus); });
|
|
26
|
-
}
|
|
27
|
-
if (isMaterialFocus(focus)) {
|
|
28
|
-
return (0, sumBy_1.default)(focus.getItems(), function (item) { var _a; return (_a = item.quantity) !== null && _a !== void 0 ? _a : 1; });
|
|
29
|
-
}
|
|
30
|
-
else if (isStaticItem(focus)) {
|
|
31
|
-
return (_a = focus.item.quantity) !== null && _a !== void 0 ? _a : 1;
|
|
32
|
-
}
|
|
33
|
-
else if (isLocationBuilder(focus)) {
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.countTutorialFocusRefs = countTutorialFocusRefs;
|
|
41
|
-
function isStaticItem(focus) {
|
|
42
|
-
return typeof focus === 'object' && typeof focus.type === 'number' && typeof focus.item === 'object';
|
|
43
|
-
}
|
|
44
|
-
exports.isStaticItem = isStaticItem;
|
|
45
|
-
function isStaticItemFocus(itemType, item, focus) {
|
|
46
|
-
if (Array.isArray(focus)) {
|
|
47
|
-
return focus.some(function (focus) { return isStaticItemFocus(itemType, item, focus); });
|
|
48
|
-
}
|
|
49
|
-
return isStaticItem(focus) && focus.type === itemType && (0, fast_deep_equal_1.default)(focus.item, item);
|
|
50
|
-
}
|
|
51
|
-
exports.isStaticItemFocus = isStaticItemFocus;
|
|
52
|
-
function isLocationBuilder(focus) {
|
|
53
|
-
return typeof focus === 'object' && typeof focus.location === 'object';
|
|
54
|
-
}
|
|
55
|
-
exports.isLocationBuilder = isLocationBuilder;
|
|
56
|
-
function isLocationFocus(location, focus) {
|
|
57
|
-
if (Array.isArray(focus)) {
|
|
58
|
-
return focus.some(function (focus) { return isLocationFocus(location, focus); });
|
|
59
|
-
}
|
|
60
|
-
return isLocationBuilder(focus) && (0, fast_deep_equal_1.default)(focus.location, location);
|
|
61
|
-
}
|
|
62
|
-
exports.isLocationFocus = isLocationFocus;
|
|
63
|
-
//# sourceMappingURL=FocusableElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableElement.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/FocusableElement.ts"],"names":[],"mappings":";;;;;;AACA,oEAAmC;AACnC,uDAAgC;AAShC,SAAgB,WAAW,CAAC,QAAgB,EAAE,SAAiB,EAAE,KAA6C;IAC5G,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAvC,CAAuC,CAAC,CAAA;KACpE;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;AACpG,CAAC;AALD,kCAKC;AAED,SAAgB,eAAe,CAAC,KAAwB;IACtD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,KAAkB,CAAC,OAAO,KAAK,SAAS,CAAA;AAC/E,CAAC;AAFD,0CAEC;AAED,SAAgB,sBAAsB,CAAC,KAA6C;;IAClF,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,CAAA;IACpB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,IAAA,eAAK,EAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,sBAAsB,CAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAAA;KAC5D;IACD,IA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EAAE,KAA6C;IAC/F,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAhC,CAAgC,CAAC,CAAA;KAC7D;IACD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAK,EAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACpE,CAAC;AALD,0CAKC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Location, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
import { ItemContext } from '../../../locators';
|
|
3
|
-
import { FocusableElement } from './FocusableElement';
|
|
4
|
-
export type FocusableLocation = {
|
|
5
|
-
location: Location;
|
|
6
|
-
focus?: true;
|
|
7
|
-
};
|
|
8
|
-
export declare const getInnerLocations: (item: MaterialItem, context: ItemContext, focus?: FocusableElement | FocusableElement[]) => FocusableLocation[];
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getInnerLocations = void 0;
|
|
7
|
-
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
var FocusableElement_1 = require("./FocusableElement");
|
|
9
|
-
var getInnerLocations = function (item, context, focus) {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
var locationsFocus = getLocationsFocus(focus).filter(function (location) { var _a, _b; return ((_a = context.locators[location.type]) === null || _a === void 0 ? void 0 : _a.parentItemType) === context.type && ((_b = location.parent) !== null && _b !== void 0 ? _b : 0) === context.index; });
|
|
12
|
-
var result = (_b = (_a = context.material[context.type]) === null || _a === void 0 ? void 0 : _a.getLocations(item, context).map(function (location) { return ({ location: location }); })) !== null && _b !== void 0 ? _b : [];
|
|
13
|
-
var _loop_1 = function (locationFocus) {
|
|
14
|
-
var focusableLocation = result.find(function (focusableLocation) { return (0, fast_deep_equal_1.default)(focusableLocation.location, locationFocus); });
|
|
15
|
-
if (focusableLocation) {
|
|
16
|
-
focusableLocation.focus = true;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
result.push({ location: locationFocus, focus: true });
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
for (var _i = 0, locationsFocus_1 = locationsFocus; _i < locationsFocus_1.length; _i++) {
|
|
23
|
-
var locationFocus = locationsFocus_1[_i];
|
|
24
|
-
_loop_1(locationFocus);
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
exports.getInnerLocations = getInnerLocations;
|
|
29
|
-
var getLocationsFocus = function (focus) {
|
|
30
|
-
if (!focus)
|
|
31
|
-
return [];
|
|
32
|
-
if (Array.isArray(focus)) {
|
|
33
|
-
return focus.filter(FocusableElement_1.isLocationBuilder).map(function (builder) { return builder.location; });
|
|
34
|
-
}
|
|
35
|
-
return (0, FocusableElement_1.isLocationBuilder)(focus) ? [focus.location] : [];
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=FocusableLocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableLocation.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/FocusableLocation.ts"],"names":[],"mappings":";;;;;;AACA,oEAAmC;AAEnC,uDAAwE;AAOjE,IAAM,iBAAiB,GAAG,UAC/B,IAAkB,EAAE,OAAoB,EAAE,KAA6C;;IAEvF,IAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAA,QAAQ,gBAC7D,OAAA,CAAA,MAAA,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAE,cAAc,MAAK,OAAO,CAAC,IAAI,IAAI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,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACzD,CAAC,CAAA"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableLocations.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/FocusableLocations.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
export type GameTableContentProps = {
|
|
4
|
-
xMin: number;
|
|
5
|
-
xMax: number;
|
|
6
|
-
yMin: number;
|
|
7
|
-
yMax: number;
|
|
8
|
-
zoomMin?: number;
|
|
9
|
-
zoomMax?: number;
|
|
10
|
-
perspective?: number;
|
|
11
|
-
margin?: {
|
|
12
|
-
left: number;
|
|
13
|
-
top: number;
|
|
14
|
-
right: number;
|
|
15
|
-
bottom: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const GameTableContent: FC<GameTableContentProps>;
|
|
@@ -1,63 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.GameTableContent = void 0;
|
|
22
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
23
|
-
/** @jsxImportSource @emotion/react */
|
|
24
|
-
var react_1 = require("react");
|
|
25
|
-
var react_2 = require("@emotion/react");
|
|
26
|
-
var react_zoom_pan_pinch_1 = require("react-zoom-pan-pinch");
|
|
27
|
-
var css_1 = require("../../../css");
|
|
28
|
-
var GameMaterialDisplay_1 = require("./GameMaterialDisplay");
|
|
29
|
-
var bounds_util_1 = require("../../../utilities/bounds.util");
|
|
30
|
-
var emotion_normalize_1 = __importDefault(require("emotion-normalize"));
|
|
31
|
-
var GameTableContent = function (props) {
|
|
32
|
-
var perspective = props.perspective, xMin = props.xMin, xMax = props.xMax, yMin = props.yMin, yMax = props.yMax, _a = props.margin, margin = _a === void 0 ? { left: 0, right: 0, top: 7, bottom: 0 } : _a;
|
|
33
|
-
var ratio = (xMax - xMin) / (yMax - yMin);
|
|
34
|
-
var context = (0, react_zoom_pan_pinch_1.useTransformContext)();
|
|
35
|
-
(0, react_1.useEffect)(function () {
|
|
36
|
-
var handler = function () {
|
|
37
|
-
if (!context.bounds)
|
|
38
|
-
return;
|
|
39
|
-
var _a = context.transformState, positionX = _a.positionX, positionY = _a.positionY, scale = _a.scale;
|
|
40
|
-
var bounds = (0, bounds_util_1.calculateBounds)(context, scale);
|
|
41
|
-
var _b = (0, bounds_util_1.getMouseBoundedPosition)(positionX, positionY, bounds, true, 0, 0, context.wrapperComponent), x = _b.x, y = _b.y;
|
|
42
|
-
context.setTransformState(scale, x, y);
|
|
43
|
-
};
|
|
44
|
-
window.addEventListener('resize', handler);
|
|
45
|
-
return function () {
|
|
46
|
-
window.removeEventListener('resize', handler);
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(react_zoom_pan_pinch_1.TransformComponent, __assign({ wrapperStyle: {
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
margin: "".concat(margin.top, "em ").concat(margin.right, "em ").concat(margin.bottom, "em ").concat(margin.left, "em"),
|
|
52
|
-
transformStyle: 'preserve-3d',
|
|
53
|
-
height: "min(100% - ".concat((margin.top + margin.bottom), "em, 100vw / ").concat(ratio, ")"),
|
|
54
|
-
width: "calc(100% - ".concat(margin.left + margin.right, "em)"),
|
|
55
|
-
overflow: 'visible'
|
|
56
|
-
} }, { children: [(0, jsx_runtime_1.jsx)(react_2.Global, { styles: [emotion_normalize_1.default, globalStyle, globalFontSize(xMax - xMin + margin.left + margin.right, yMax - yMin + margin.top + margin.bottom)] }), (0, jsx_runtime_1.jsx)("div", __assign({ css: [tableCss(xMin, xMax, yMin, yMax), perspective && (0, css_1.perspectiveCss)(perspective)] }, { children: (0, jsx_runtime_1.jsx)(GameMaterialDisplay_1.GameMaterialDisplay, {}) }))] })));
|
|
57
|
-
};
|
|
58
|
-
exports.GameTableContent = GameTableContent;
|
|
59
|
-
var tableCss = function (xMin, xMax, yMin, yMax) { return (0, react_2.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transform-style: preserve-3d;\n width: ", "em;\n height: ", "em;\n\n > * {\n position: absolute;\n top: ", "em;\n left: ", "em;\n transform-style: preserve-3d;\n }\n"], ["\n transform-style: preserve-3d;\n width: ", "em;\n height: ", "em;\n\n > * {\n position: absolute;\n top: ", "em;\n left: ", "em;\n transform-style: preserve-3d;\n }\n"])), xMax - xMin, yMax - yMin, -yMin, -xMin); };
|
|
60
|
-
var globalStyle = (0, react_2.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n html {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n *, *::before, *::after {\n -webkit-box-sizing: inherit;\n -moz-box-sizing: inherit;\n box-sizing: inherit;\n }\n\n body {\n margin: 0;\n font-family: 'Oswald', \"Roboto Light\", serif;\n }\n\n #root {\n position: absolute;\n height: 100vh;\n width: 100vw;\n user-select: none;\n overflow: hidden;\n background-image: url(", ");\n background-color: white;\n background-size: cover;\n background-position: center;\n color: #eee;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n }\n }\n"], ["\n html {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n *, *::before, *::after {\n -webkit-box-sizing: inherit;\n -moz-box-sizing: inherit;\n box-sizing: inherit;\n }\n\n body {\n margin: 0;\n font-family: 'Oswald', \"Roboto Light\", serif;\n }\n\n #root {\n position: absolute;\n height: 100vh;\n width: 100vw;\n user-select: none;\n overflow: hidden;\n background-image: url(", ");\n background-color: white;\n background-size: cover;\n background-position: center;\n color: #eee;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n }\n }\n"])), process.env.PUBLIC_URL + '/cover-1920.jpg');
|
|
61
|
-
var globalFontSize = function (width, height) { return (0, react_2.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n body {\n font-size: 1vh;\n @media (max-aspect-ratio: ", "/", ") {\n font-size: calc(", "vw / ", ");\n }\n }\n"], ["\n body {\n font-size: 1vh;\n @media (max-aspect-ratio: ", "/", ") {\n font-size: calc(", "vw / ", ");\n }\n }\n"])), width, height, height, width); };
|
|
62
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
63
|
-
//# sourceMappingURL=GameTableContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GameTableContent.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/GameTableContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,+BAAqC;AACrC,wCAA4C;AAC5C,6DAA8E;AAC9E,oCAA6C;AAC7C,6DAA2D;AAC3D,8DA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W,OAAG,WAAG,q3BAAA,ieAwBK,EAA0C,8UAiBrE,KAjB2B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,iBAAiB,CAiBrE,CAAA;AAED,IAAM,cAAc,GAAG,UAAC,KAAa,EAAE,MAAc,IAAK,WAAA,WAAG,sMAAA,iEAG7B,EAAK,GAAI,EAAM,6BACvB,EAAM,OAAQ,EAAK,kBAG1C,KAJ+B,KAAK,EAAI,MAAM,EACvB,MAAM,EAAQ,KAAK,GAJe,CAOzD,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Location, LocationBuilder, Material, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
export type FocusableElement<P extends number = number, M extends number = number, L extends number = number> = Material<P, M, L> | StaticItem<P, M, L> | LocationBuilder<P, L>;
|
|
3
|
-
export type StaticItem<P extends number = number, M extends number = number, L extends number = number> = {
|
|
4
|
-
type: M;
|
|
5
|
-
item: MaterialItem<P, L>;
|
|
6
|
-
};
|
|
7
|
-
export declare function isItemFocus(itemType: number, itemIndex: number, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
8
|
-
export declare function isMaterialFocus(focus?: FocusableElement): focus is Material;
|
|
9
|
-
export declare function countTutorialFocusRefs(focus?: FocusableElement | FocusableElement[]): number;
|
|
10
|
-
export declare function isStaticItem(focus?: FocusableElement): focus is StaticItem;
|
|
11
|
-
export declare function isStaticItemFocus(itemType: number, item: MaterialItem, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
12
|
-
export declare function isLocationBuilder(focus?: FocusableElement): focus is LocationBuilder;
|
|
13
|
-
export declare function isLocationFocus(location: Location, focus?: FocusableElement | FocusableElement[]): boolean;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isLocationFocus = exports.isLocationBuilder = exports.isStaticItemFocus = exports.isStaticItem = exports.countTutorialFocusRefs = exports.isMaterialFocus = exports.isItemFocus = void 0;
|
|
7
|
-
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
var sumBy_1 = __importDefault(require("lodash/sumBy"));
|
|
9
|
-
function isItemFocus(itemType, itemIndex, focus) {
|
|
10
|
-
if (Array.isArray(focus)) {
|
|
11
|
-
return focus.some(function (focus) { return isItemFocus(itemType, itemIndex, focus); });
|
|
12
|
-
}
|
|
13
|
-
return isMaterialFocus(focus) && focus.type === itemType && focus.getIndexes().includes(itemIndex);
|
|
14
|
-
}
|
|
15
|
-
exports.isItemFocus = isItemFocus;
|
|
16
|
-
function isMaterialFocus(focus) {
|
|
17
|
-
return typeof focus === 'object' && focus.entries !== undefined;
|
|
18
|
-
}
|
|
19
|
-
exports.isMaterialFocus = isMaterialFocus;
|
|
20
|
-
function countTutorialFocusRefs(focus) {
|
|
21
|
-
var _a;
|
|
22
|
-
if (!focus)
|
|
23
|
-
return 0;
|
|
24
|
-
if (Array.isArray(focus)) {
|
|
25
|
-
return (0, sumBy_1.default)(focus, function (focus) { return countTutorialFocusRefs(focus); });
|
|
26
|
-
}
|
|
27
|
-
if (isMaterialFocus(focus)) {
|
|
28
|
-
return (0, sumBy_1.default)(focus.getItems(), function (item) { var _a; return (_a = item.quantity) !== null && _a !== void 0 ? _a : 1; });
|
|
29
|
-
}
|
|
30
|
-
else if (isStaticItem(focus)) {
|
|
31
|
-
return (_a = focus.item.quantity) !== null && _a !== void 0 ? _a : 1;
|
|
32
|
-
}
|
|
33
|
-
else if (isLocationBuilder(focus)) {
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.countTutorialFocusRefs = countTutorialFocusRefs;
|
|
41
|
-
function isStaticItem(focus) {
|
|
42
|
-
return typeof focus === 'object' && typeof focus.type === 'number' && typeof focus.item === 'object';
|
|
43
|
-
}
|
|
44
|
-
exports.isStaticItem = isStaticItem;
|
|
45
|
-
function isStaticItemFocus(itemType, item, focus) {
|
|
46
|
-
if (Array.isArray(focus)) {
|
|
47
|
-
return focus.some(function (focus) { return isStaticItemFocus(itemType, item, focus); });
|
|
48
|
-
}
|
|
49
|
-
return isStaticItem(focus) && focus.type === itemType && (0, fast_deep_equal_1.default)(focus.item, item);
|
|
50
|
-
}
|
|
51
|
-
exports.isStaticItemFocus = isStaticItemFocus;
|
|
52
|
-
function isLocationBuilder(focus) {
|
|
53
|
-
return typeof focus === 'object' && typeof focus.location === 'object';
|
|
54
|
-
}
|
|
55
|
-
exports.isLocationBuilder = isLocationBuilder;
|
|
56
|
-
function isLocationFocus(location, focus) {
|
|
57
|
-
if (Array.isArray(focus)) {
|
|
58
|
-
return focus.some(function (focus) { return isLocationFocus(location, focus); });
|
|
59
|
-
}
|
|
60
|
-
return isLocationBuilder(focus) && (0, fast_deep_equal_1.default)(focus.location, location);
|
|
61
|
-
}
|
|
62
|
-
exports.isLocationFocus = isLocationFocus;
|
|
63
|
-
//# sourceMappingURL=FocusableElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableElement.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/FocusableElement.ts"],"names":[],"mappings":";;;;;;AACA,oEAAmC;AACnC,uDAAgC;AAShC,SAAgB,WAAW,CAAC,QAAgB,EAAE,SAAiB,EAAE,KAA6C;IAC5G,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAvC,CAAuC,CAAC,CAAA;KACpE;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAA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,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,iBAAiB,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,EAAxC,CAAwC,CAAC,CAAA;KACrE;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAA,yBAAK,EAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAClF,CAAC;AALD,8CAKC;AAED,SAAgB,iBAAiB,CAAC,KAAwB;IACxD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAAyB,CAAC,QAAQ,KAAK,QAAQ,CAAA;AAC7F,CAAC;AAFD,8CAEC;AAED,SAAgB,eAAe,CAAC,QAAkB,EAAE,KAA6C;IAC/F,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAhC,CAAgC,CAAC,CAAA;KAC7D;IACD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAK,EAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACpE,CAAC;AALD,0CAKC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Location, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
import { ItemContext } from '../../../../locators';
|
|
3
|
-
import { FocusableElement } from './FocusableElement';
|
|
4
|
-
export type FocusableLocation = {
|
|
5
|
-
location: Location;
|
|
6
|
-
focus?: true;
|
|
7
|
-
};
|
|
8
|
-
export declare const getLocationsWithFocus: (item: MaterialItem, context: ItemContext, focus?: FocusableElement | FocusableElement[]) => [Location[], number[]];
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getLocationsWithFocus = void 0;
|
|
7
|
-
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
var FocusableElement_1 = require("./FocusableElement");
|
|
9
|
-
var getLocationsWithFocus = function (item, context, focus) {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
var locationsFocus = getLocationsFocus(focus).filter(function (location) { var _a, _b; return ((_a = context.locators[location.type]) === null || _a === void 0 ? void 0 : _a.parentItemType) === context.type && ((_b = location.parent) !== null && _b !== void 0 ? _b : 0) === context.index; });
|
|
12
|
-
var result = [(_b = (_a = context.material[context.type]) === null || _a === void 0 ? void 0 : _a.getLocations(item, context)) !== null && _b !== void 0 ? _b : [], []];
|
|
13
|
-
var _loop_1 = function (locationFocus) {
|
|
14
|
-
var index = result[0].findIndex(function (location) { return (0, fast_deep_equal_1.default)(location, locationFocus); });
|
|
15
|
-
if (index !== -1) {
|
|
16
|
-
result[1].push(index);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
result[1].push(result[0].length);
|
|
20
|
-
result[0].push(locationFocus);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
for (var _i = 0, locationsFocus_1 = locationsFocus; _i < locationsFocus_1.length; _i++) {
|
|
24
|
-
var locationFocus = locationsFocus_1[_i];
|
|
25
|
-
_loop_1(locationFocus);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
exports.getLocationsWithFocus = getLocationsWithFocus;
|
|
30
|
-
var getLocationsFocus = function (focus) {
|
|
31
|
-
if (!focus)
|
|
32
|
-
return [];
|
|
33
|
-
if (Array.isArray(focus)) {
|
|
34
|
-
return focus.filter(FocusableElement_1.isLocationBuilder).map(function (builder) { return builder.location; });
|
|
35
|
-
}
|
|
36
|
-
return (0, FocusableElement_1.isLocationBuilder)(focus) ? [focus.location] : [];
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=FocusableLocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusableLocation.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/FocusableLocation.ts"],"names":[],"mappings":";;;;;;AACA,oEAAmC;AAEnC,uDAAwE;AAOjE,IAAM,qBAAqB,GAAG,UACnC,IAAkB,EAAE,OAAoB,EAAE,KAA6C;;IAEvF,IAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAA,QAAQ,gBAC7D,OAAA,CAAA,MAAA,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAE,cAAc,MAAK,OAAO,CAAC,IAAI,IAAI,CAAC,MAAA,QAAQ,CAAC,MAAM,mCAAI,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK,CAAA,EAAA,CAC7G,CAAA;IACD,IAAM,MAAM,GAA2B,CAAC,MAAA,MAAA,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,0CAAE,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,mCAAI,EAAE,EAAE,EAAE,CAAC,CAAA;4BACnG,aAAa;QACtB,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAA,QAAQ,IAAI,OAAA,IAAA,yBAAK,EAAC,QAAQ,EAAE,aAAa,CAAC,EAA9B,CAA8B,CAAC,CAAA;QAC7E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SACtB;aAAM;YACL,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;YAChC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;SAC9B;;IAPH,KAA4B,UAAc,EAAd,iCAAc,EAAd,4BAAc,EAAd,IAAc;QAArC,IAAM,aAAa,uBAAA;gBAAb,aAAa;KAQvB;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAjBY,QAAA,qBAAqB,yBAiBjC;AAED,IAAM,iBAAiB,GAAG,UAAC,KAA6C;IACtE,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IACrB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,MAAM,CAAC,oCAAiB,CAAC,CAAC,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,QAAQ,EAAhB,CAAgB,CAAC,CAAA;KACxE;IACD,OAAO,IAAA,oCAAiB,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACzD,CAAC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Location, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
-
import { ItemContext, LocationContext } from '../../../../locators';
|
|
3
|
-
import { MaterialFocus } from './MaterialFocus';
|
|
4
|
-
export type LocationsWithFocus = {
|
|
5
|
-
locations: Location[];
|
|
6
|
-
focusedIndexes: number[];
|
|
7
|
-
};
|
|
8
|
-
export declare const getLocationsWithFocus: (item: MaterialItem, context: ItemContext, focus?: MaterialFocus) => LocationsWithFocus;
|
|
9
|
-
export declare const getStaticLocationsWithFocus: (context: LocationContext, focus?: MaterialFocus) => Location[];
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getStaticLocationsWithFocus = exports.getLocationsWithFocus = void 0;
|
|
7
|
-
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
8
|
-
var getFocusedLocations = function (locationsFocus, locations) {
|
|
9
|
-
var focusedIndexes = [];
|
|
10
|
-
var _loop_1 = function (locationFocus) {
|
|
11
|
-
var index = locations.findIndex(function (location) { return (0, isEqual_1.default)(location, locationFocus); });
|
|
12
|
-
if (index !== -1) {
|
|
13
|
-
focusedIndexes.push(index);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
focusedIndexes.push(locations.length);
|
|
17
|
-
locations.push(locationFocus);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
for (var _i = 0, locationsFocus_1 = locationsFocus; _i < locationsFocus_1.length; _i++) {
|
|
21
|
-
var locationFocus = locationsFocus_1[_i];
|
|
22
|
-
_loop_1(locationFocus);
|
|
23
|
-
}
|
|
24
|
-
return { locations: locations, focusedIndexes: focusedIndexes };
|
|
25
|
-
};
|
|
26
|
-
var getLocationsWithFocus = function (item, context, focus) {
|
|
27
|
-
var _a, _b, _c, _d;
|
|
28
|
-
var locationsFocus = (_b = (_a = focus === null || focus === void 0 ? void 0 : focus.locations) === null || _a === void 0 ? void 0 : _a.filter(function (location) { var _a, _b; return ((_a = context.locators[location.type]) === null || _a === void 0 ? void 0 : _a.parentItemType) === context.type && ((_b = location.parent) !== null && _b !== void 0 ? _b : 0) === context.index; })) !== null && _b !== void 0 ? _b : [];
|
|
29
|
-
var locations = (_d = (_c = context.material[context.type]) === null || _c === void 0 ? void 0 : _c.getLocations(item, context)) !== null && _d !== void 0 ? _d : [];
|
|
30
|
-
return getFocusedLocations(locationsFocus, locations);
|
|
31
|
-
};
|
|
32
|
-
exports.getLocationsWithFocus = getLocationsWithFocus;
|
|
33
|
-
var getStaticLocationsWithFocus = function (context, focus) {
|
|
34
|
-
return Object.keys(context.locators).flatMap(function (type) {
|
|
35
|
-
var _a, _b, _c;
|
|
36
|
-
var locator = context.locators[type];
|
|
37
|
-
if (locator.parentItemType !== undefined)
|
|
38
|
-
return [];
|
|
39
|
-
var locationsFocus = (_a = focus === null || focus === void 0 ? void 0 : focus.locations.filter(function (l) { return l.type === +type; })) !== null && _a !== void 0 ? _a : [];
|
|
40
|
-
var locations = (_c = (_b = locator.getLocationDescription(context)) === null || _b === void 0 ? void 0 : _b.getLocations(context)) !== null && _c !== void 0 ? _c : [];
|
|
41
|
-
return getFocusedLocations(locationsFocus, locations).locations;
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
exports.getStaticLocationsWithFocus = getStaticLocationsWithFocus;
|
|
45
|
-
//# sourceMappingURL=LocationsWithFocus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsWithFocus.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/focus/LocationsWithFocus.ts"],"names":[],"mappings":";;;;;;AACA,2DAAoC;AASpC,IAAM,mBAAmB,GAAG,UAAC,cAA0B,EAAE,SAAqB;IAC5E,IAAM,cAAc,GAAG,EAAE,CAAA;4BACd,aAAa;QACtB,IAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,UAAA,QAAQ,IAAI,OAAA,IAAA,iBAAO,EAAC,QAAQ,EAAE,aAAa,CAAC,EAAhC,CAAgC,CAAC,CAAA;QAC/E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC3B;aAAM;YACL,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YACrC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;SAC9B;;IAPH,KAA4B,UAAc,EAAd,iCAAc,EAAd,4BAAc,EAAd,IAAc;QAArC,IAAM,aAAa,uBAAA;gBAAb,aAAa;KAQvB;IACD,OAAO,EAAE,SAAS,WAAA,EAAE,cAAc,gBAAA,EAAE,CAAA;AACtC,CAAC,CAAA;AAEM,IAAM,qBAAqB,GAAG,UACnC,IAAkB,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,mBAAmB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,SAAS,CAAA;IACjE,CAAC,CAAC,CAAA;AAEJ,CAAC,CAAA;AAXY,QAAA,2BAA2B,+BAWvC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locations.utils.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/locations.utils.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ItemMenu.js","sourceRoot":"","sources":["../../../src/components/material/ItemMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAAoC;AAGpC,qCAAqC;AAM9B,IAAM,QAAQ,GAAG,UAAC,EAAoC;IAAlC,IAAA,OAAO,aAAA,EAAK,KAAK,cAAnB,WAAqB,CAAF;IAC1C,OAAO,2CAAS,KAAK,cAClB,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,KAAK;YACzB,OAAA,uBAAC,sBAAc,eAAiB,MAAM,GAAjB,KAAK,CAAe;QAAzC,CAAyC,CAC1C,IACG,CAAA;AACR,CAAC,CAAA;AANY,QAAA,QAAQ,YAMpB;AAWM,IAAM,cAAc,GAAG,UAC5B,EAAgH;IAA9G,IAAA,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA,EAAE,cAAU,EAAV,MAAM,mBAAG,CAAC,KAAA,EAAE,IAAI,UAAA,EAAE,OAAO,aAAA,EAAK,KAAK,cAAzD,uDAA2D,CAAF;IAEzD,IAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAA;IACtB,OAAO,6CAAQ,GAAG,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,EAC1E,OAAO,EAAE,cAAM,OAAA,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAnB,CAAmB,IAAM,KAAK,eACzD,IAAI,EACL,0CAAM,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,gBAAG,KAAK,IAAQ,KAC9F,CAAA;AACX,CAAC,CAAA;AATY,QAAA,cAAc,kBAS1B;AAED,IAAM,iBAAiB,OAAG,WAAG,4MAAA,wIAO5B,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAG,UAAC,KAAa,EAAE,MAAc,IAAK,WAAA,WAAG,uIAAA,iDACjB,EAAwB,MAAO,EAAyB,QACtG,KAD8C,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAO,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAD1C,CAE5D,CAAA;AAED,IAAM,cAAc,OAAG,WAAG,wNAAA,oJAOzB,IAAA,CAAA;AAED,IAAM,SAAS,OAAG,WAAG,2LAAA,uHAKpB,IAAA,CAAA;AAED,IAAM,UAAU,OAAG,WAAG,2LAAA,uHAKrB,IAAA,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Animation, AnimationContext, Animations } from '@gamepark/react-client';
|
|
2
|
-
import { CreateItem, DeleteItem, ItemMove, MaterialGame, MaterialMove, MaterialRules, MoveItem } from '@gamepark/rules-api';
|
|
3
|
-
import { Interpolation, Keyframes, Theme } from '@emotion/react';
|
|
4
|
-
import { ItemContext, ItemLocator } from '../../locators';
|
|
5
|
-
import { MaterialDescription } from './MaterialDescription';
|
|
6
|
-
export declare class MaterialAnimations<P extends number = number, M extends number = number, L extends number = number> extends Animations<MaterialGame<P, M, L>, ItemMove<P, M, L>, P> {
|
|
7
|
-
getPreDuration(move: ItemMove<P, M, L>, context: AnimationContext<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P>): number;
|
|
8
|
-
getPostDuration(move: ItemMove<P, M, L>, context: AnimationContext<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P>): number;
|
|
9
|
-
moveDuration(_move: ItemMove<P, M, L>, _context: AnimationContext<MaterialGame<P, M, L>, MaterialMove<P, M, L>, P>): number;
|
|
10
|
-
isItemToAnimate({ game, type, index, displayIndex, locators }: ItemContext<P, M, L>, animation: Animation<MaterialMove<P, M, L>>): boolean;
|
|
11
|
-
getItemAnimation(context: ItemContext<P, M, L>, animation: Animation<MaterialMove<P, M, L>>): Interpolation<Theme>;
|
|
12
|
-
protected getCreateItemAnimation(context: ItemContext<P, M, L>, animation: Animation<CreateItem<P, M, L>>): Interpolation<Theme>;
|
|
13
|
-
protected fadein(duration: number): import("@emotion/utils").SerializedStyles;
|
|
14
|
-
protected getFirstStockItemTransforms(context: ItemContext<P, M, L>): string[];
|
|
15
|
-
protected getKeyframesFromOrigin(origin: string, _animation: Animation<ItemMove<P, M, L>>, _context: ItemContext<P, M, L>): Keyframes;
|
|
16
|
-
protected getMoveItemAnimation(context: ItemContext<P, M, L>, animation: Animation<MoveItem<P, M, L>>): Interpolation<Theme>;
|
|
17
|
-
protected getKeyframesToDestination(destination: string, _animation: Animation<ItemMove<P, M, L>>, _context: ItemContext<P, M, L>): Keyframes;
|
|
18
|
-
protected getDeleteItemAnimation(context: ItemContext<P, M, L>, animation: Animation<DeleteItem<M>>): Interpolation<Theme>;
|
|
19
|
-
}
|
|
20
|
-
export type ItemAnimationContext<P extends number = number, M extends number = number, L extends number = number> = {
|
|
21
|
-
material: Record<M, MaterialDescription<P, M, L>>;
|
|
22
|
-
locators: Record<L, ItemLocator<P, M, L>>;
|
|
23
|
-
rules: MaterialRules<P, M, L>;
|
|
24
|
-
player?: P;
|
|
25
|
-
};
|