@gamepark/react-game 6.38.2 → 6.38.4
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/Log/LogDescription.d.ts +4 -2
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +8 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +12 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.js +5 -4
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Interpolation, Theme } from '@emotion/react';
|
|
2
2
|
import { DisplayedAction } from '@gamepark/react-client';
|
|
3
|
+
import { MaterialGame, MaterialMove } from '@gamepark/rules-api';
|
|
3
4
|
import { ComponentType } from 'react';
|
|
4
|
-
export type
|
|
5
|
+
export type MaterialLogProps<M extends MaterialMove = MaterialMove, P extends number = number> = MoveComponentProps<M, P, MaterialGame>;
|
|
6
|
+
export type MoveComponentProps<Move = any, Player = number, Game = any> = {
|
|
5
7
|
move: Move;
|
|
6
|
-
context: MoveComponentContext<Move, Player>;
|
|
8
|
+
context: MoveComponentContext<Move, Player, Game>;
|
|
7
9
|
};
|
|
8
10
|
export type MoveComponentContext<Move = any, Player = number, Game = any> = {
|
|
9
11
|
game: Game;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
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
|
+
};
|
|
2
6
|
var __assign = (this && this.__assign) || function () {
|
|
3
7
|
__assign = Object.assign || function(t) {
|
|
4
8
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -14,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
18
|
exports.MaterialRulesDialog = void 0;
|
|
15
19
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
20
|
/** @jsxImportSource @emotion/react */
|
|
21
|
+
var react_1 = require("@emotion/react");
|
|
17
22
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
18
23
|
var hooks_1 = require("../../../hooks");
|
|
19
24
|
var index_1 = require("../index");
|
|
@@ -24,10 +29,12 @@ var MaterialRulesDialog = function (props) {
|
|
|
24
29
|
var game = (0, hooks_1.useGame)();
|
|
25
30
|
if (!(game === null || game === void 0 ? void 0 : game.helpDisplay))
|
|
26
31
|
return null;
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(index_1.RulesDialog, __assign({}, props, { children: [game.helpDisplay.type === rules_api_1.HelpDisplayType.Material &&
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(index_1.RulesDialog, __assign({}, props, { css: inlineImg }, { children: [game.helpDisplay.type === rules_api_1.HelpDisplayType.Material &&
|
|
28
33
|
(0, jsx_runtime_1.jsx)(MaterialRulesDialogContent_1.MaterialRulesDialogContent, { helpDisplay: game.helpDisplay }), game.helpDisplay.type === rules_api_1.HelpDisplayType.Location &&
|
|
29
34
|
(0, jsx_runtime_1.jsx)(LocationRulesDialogContent_1.LocationRulesDialogContent, { helpDisplay: game.helpDisplay }), game.helpDisplay.type === rules_api_1.HelpDisplayType.Rules &&
|
|
30
35
|
(0, jsx_runtime_1.jsx)(RulesHelpDialogContent_1.RulesHelpDialogContent, { helpDisplay: game.helpDisplay })] })));
|
|
31
36
|
};
|
|
32
37
|
exports.MaterialRulesDialog = MaterialRulesDialog;
|
|
38
|
+
var inlineImg = (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n p img {\n height: 1em;\n position: relative;\n top: 0.1em;\n }\n"], ["\n p img {\n height: 1em;\n position: relative;\n top: 0.1em;\n }\n"])));
|
|
39
|
+
var templateObject_1;
|
|
33
40
|
//# sourceMappingURL=MaterialRulesDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialRulesDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/MaterialRulesDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaterialRulesDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/MaterialRulesDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAAoC;AACpC,iDAAmE;AAEnE,wCAAwC;AACxC,kCAAwD;AACxD,2EAAyE;AACzE,2EAAyE;AACzE,mEAAiE;AAE1D,IAAM,mBAAmB,GAAyB,UAAC,KAAuB;IAC/E,IAAM,IAAI,GAAG,IAAA,eAAO,GAAgB,CAAA;IACpC,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAA;QAAE,OAAO,IAAI,CAAA;IACnC,OAAO,CACL,wBAAC,mBAAW,eAAK,KAAK,IAAE,GAAG,EAAE,SAAS,iBACnC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,2BAAe,CAAC,QAAQ;gBACjD,uBAAC,uDAA0B,IAAC,WAAW,EAAE,IAAI,CAAC,WAAW,GAAG,EAE7D,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,2BAAe,CAAC,QAAQ;gBACjD,uBAAC,uDAA0B,IAAC,WAAW,EAAE,IAAI,CAAC,WAAW,GAAG,EAE7D,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,2BAAe,CAAC,KAAK;gBAC9C,uBAAC,+CAAsB,IAAC,WAAW,EAAE,IAAI,CAAC,WAAW,GAAG,KAE9C,CACf,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,mBAAmB,uBAgB/B;AAED,IAAM,SAAS,OAAG,WAAG,oJAAA,gFAMpB,IAAA,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { Interpolation, Theme } from '@emotion/react';
|
|
3
3
|
import { MaterialItem } from '@gamepark/rules-api';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
4
5
|
import { ItemContext, MaterialContext } from '../../../locators';
|
|
5
6
|
import { MaterialContentProps } from '../MaterialDescription';
|
|
6
7
|
import { MobileMaterialDescription } from '../MobileMaterialDescription';
|
|
@@ -19,7 +20,17 @@ export declare abstract class FlatMaterialDescription<P extends number = number,
|
|
|
19
20
|
isFlippedOnTable(item: Partial<MaterialItem<P, L>>, context: MaterialContext<P, M, L>): boolean;
|
|
20
21
|
isFlippedInDialog(item: Partial<MaterialItem<P, L>>, context: MaterialContext<P, M, L>): boolean;
|
|
21
22
|
getItemTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
22
|
-
content: (
|
|
23
|
+
content: (props: MaterialContentProps<ItemId>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
contentWithBackChildren: ({ itemId, highlight, playDown, preview, children, backChildren }: {
|
|
25
|
+
itemId: ItemId;
|
|
26
|
+
itemIndex?: number | undefined;
|
|
27
|
+
type?: number | undefined;
|
|
28
|
+
highlight?: boolean | undefined;
|
|
29
|
+
playDown?: boolean | undefined;
|
|
30
|
+
preview?: boolean | undefined;
|
|
31
|
+
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
32
|
+
backChildren?: ReactNode;
|
|
33
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
34
|
getFrontExtraCss(_itemId: ItemId): Interpolation<Theme>;
|
|
24
35
|
getBackExtraCss(_itemId: ItemId): Interpolation<Theme>;
|
|
25
36
|
getHoverTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
@@ -65,8 +65,9 @@ var FlatMaterialDescription = /** @class */ (function (_super) {
|
|
|
65
65
|
__extends(FlatMaterialDescription, _super);
|
|
66
66
|
function FlatMaterialDescription() {
|
|
67
67
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
68
|
-
_this.content = function (
|
|
69
|
-
|
|
68
|
+
_this.content = function (props) { return _this.contentWithBackChildren(props); };
|
|
69
|
+
_this.contentWithBackChildren = function (_a) {
|
|
70
|
+
var itemId = _a.itemId, highlight = _a.highlight, playDown = _a.playDown, preview = _a.preview, children = _a.children, backChildren = _a.backChildren;
|
|
70
71
|
var image = _this.getImage(itemId);
|
|
71
72
|
var backImage = _this.getBackImage(itemId);
|
|
72
73
|
var size = _this.getSize(itemId);
|
|
@@ -81,7 +82,7 @@ var FlatMaterialDescription = /** @class */ (function (_super) {
|
|
|
81
82
|
preview && previewCss,
|
|
82
83
|
// We must add a little of translateZ since Safari/Chrome on iOS consider the two faces at the same level, so the backface-visibility is wrongly applied
|
|
83
84
|
(0, css_1.transformCss)('translateZ(0.001px)')
|
|
84
|
-
] }, { children: children })), backImage && (0, jsx_runtime_1.jsx)("div", { css: [
|
|
85
|
+
] }, { children: children })), backImage && (0, jsx_runtime_1.jsx)("div", __assign({ css: [
|
|
85
86
|
faceCss,
|
|
86
87
|
_this.getBackExtraCss(itemId),
|
|
87
88
|
(0, css_1.sizeCss)(size.width, size.height),
|
|
@@ -90,7 +91,7 @@ var FlatMaterialDescription = /** @class */ (function (_super) {
|
|
|
90
91
|
(0, css_1.transformCss)('rotateY(-180deg)'),
|
|
91
92
|
highlight ? css_1.shineEffect : (playDown && playDownCss(backImage)),
|
|
92
93
|
preview && previewCss
|
|
93
|
-
] })] });
|
|
94
|
+
] }, { children: backChildren }))] });
|
|
94
95
|
};
|
|
95
96
|
return _this;
|
|
96
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatMaterial.js","sourceRoot":"","sources":["../../../../src/components/material/FlatMaterial/FlatMaterial.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,wCAA0D;
|
|
1
|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2
2
|
"name": "@gamepark/react-game",
|
|
3
|
-
"version": "6.38.
|
|
3
|
+
"version": "6.38.4",
|
|
4
4
|
"description": "React components & tools to create a Board Game user interface for Game Park",
|
|
5
5
|
"author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",
|
|
6
6
|
"license": "ISC",
|