@gamepark/react-game 6.15.4 → 6.16.0
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/Avatar/Avatar.d.ts +3 -3
- package/dist/components/Avatar/Avatar.js +13 -8
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/GameProvider/GameProvider.js +1 -1
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/dialogs/Dialog.js +1 -1
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +14 -42
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +16 -6
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/material/DraggableMaterial.js +7 -4
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +2 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js +4 -2
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.js +2 -1
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.d.ts +2 -0
- package/dist/components/material/GameTable/GameTableNavigation.js +44 -0
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -0
- package/dist/components/material/GameTable/index.d.ts +1 -0
- package/dist/components/material/GameTable/index.js +1 -0
- package/dist/components/material/GameTable/index.js.map +1 -1
- package/dist/components/material/MaterialComponent.js +2 -2
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialDescription.js +2 -1
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.d.ts +1 -0
- package/dist/components/material/Writing/WritingDescription.js +5 -1
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.d.ts +5 -5
- package/dist/components/material/animations/CreateItemAnimations.js +4 -4
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.d.ts +4 -4
- package/dist/components/material/animations/DeleteItemAnimations.js +4 -4
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +4 -4
- package/dist/components/material/animations/ItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialAnimations.d.ts +2 -2
- package/dist/components/material/animations/MaterialAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialGameAnimations.d.ts +25 -7
- package/dist/components/material/animations/MaterialGameAnimations.js +63 -10
- package/dist/components/material/animations/MaterialGameAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAnimations.d.ts +2 -2
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.d.ts +3 -3
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.d.ts +3 -3
- package/dist/components/material/animations/ShuffleAnimations.js.map +1 -1
- package/dist/components/material/locations/LocationDescription.d.ts +1 -0
- package/dist/components/material/locations/LocationDescription.js +6 -0
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.js +19 -16
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +2 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.d.ts +1 -1
- package/dist/components/menus/Menu/MenuPopButton.js +7 -6
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.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/useRankedPlayers.d.ts +5 -0
- package/dist/hooks/useRankedPlayers.js +38 -0
- package/dist/hooks/useRankedPlayers.js.map +1 -0
- package/dist/hooks/useUndo.js +12 -7
- package/dist/hooks/useUndo.js.map +1 -1
- package/dist/locators/HandLocator.d.ts +1 -0
- package/dist/locators/HandLocator.js +4 -1
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/LineLocator.js +3 -3
- package/dist/locators/LineLocator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +3 -3
- package/dist/locators/PileLocator.js +2 -2
- package/dist/locators/PileLocator.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineLocator.js","sourceRoot":"","sources":["../../src/locators/LineLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAwD;AAExD;IAA2H,+BAAoB;IAA/I;QAAA,qEAyCC;QAjBC,iBAAW,GAAgB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;;IAiBjD,CAAC;IAxCC,iCAAW,GAAX,UAAY,IAAwB,EAAE,OAA6B;;QACjE,IAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACtD,IAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9C,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,C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K,CAAA;IACd,CAAC;IAID,oCAAc,GAAd,UAAe,KAAyB,EAAE,QAA8B;QACtE,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAID,8BAAQ,GAAR,UAAS,KAAyB,EAAE,QAA8B;;QAChE,OAAO,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAA;IACzB,CAAC;IAID,iCAAW,GAAX,UAAY,KAAyB,EAAE,QAA8B;;QACnE,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAA;IAC5B,CAAC;IACH,kBAAC;AAAD,CAAC,AAzCD,CAA2H,yBAAW,GAyCrI;AAzCqB,kCAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Coordinates, MaterialItem } from '@gamepark/rules-api';
|
|
1
|
+
import { Coordinates, MaterialItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { ItemContext, ItemLocator } from './ItemLocator';
|
|
3
3
|
export declare abstract class PileLocator<P extends number = number, M extends number = number, L extends number = number> extends ItemLocator<P, M, L> {
|
|
4
4
|
limit: number;
|
|
@@ -8,8 +8,8 @@ export declare abstract class PileLocator<P extends number = number, M extends n
|
|
|
8
8
|
getRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
|
|
9
9
|
coordinates: Coordinates;
|
|
10
10
|
getCoordinates(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Coordinates;
|
|
11
|
-
radius: number;
|
|
12
|
-
getRadius(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number;
|
|
11
|
+
radius: number | XYCoordinates;
|
|
12
|
+
getRadius(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number | XYCoordinates;
|
|
13
13
|
maxAngle: number;
|
|
14
14
|
getMaxAngle(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): number;
|
|
15
15
|
getPileId(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string;
|
|
@@ -41,8 +41,8 @@ var PileLocator = (function (_super) {
|
|
|
41
41
|
var distance = Math.random();
|
|
42
42
|
var direction = Math.random() * 2 * Math.PI;
|
|
43
43
|
pilePositions.set(index, {
|
|
44
|
-
x: coordinates.x + Math.cos(direction) * Math.sqrt(distance) * radius,
|
|
45
|
-
y: coordinates.y + Math.sin(direction) * Math.sqrt(distance) * radius,
|
|
44
|
+
x: coordinates.x + Math.cos(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.x),
|
|
45
|
+
y: coordinates.y + Math.sin(direction) * Math.sqrt(distance) * (typeof radius === 'number' ? radius : radius.y),
|
|
46
46
|
z: coordinates.z
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6CAAwD;AAExD;IAA2H,+BAAoB;IAA/I;QAAA,qEA0DC;QAzDC,WAAK,GAAG,EAAE,CAAA;QACF,eAAS,GAAG,IAAI,GAAG,EAAoC,CAAA;QACvD,eAAS,GAAG,IAAI,GAAG,EAA+B,CAAA;QAkC1D,iBAAW,GAAgB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QAM/C,YAAM,
|
|
1
|
+
{"version":3,"file":"PileLocator.js","sourceRoot":"","sources":["../../src/locators/PileLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6CAAwD;AAExD;IAA2H,+BAAoB;IAA/I;QAAA,qEA0DC;QAzDC,WAAK,GAAG,EAAE,CAAA;QACF,eAAS,GAAG,IAAI,GAAG,EAAoC,CAAA;QACvD,eAAS,GAAG,IAAI,GAAG,EAA+B,CAAA;QAkC1D,iBAAW,GAAgB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QAM/C,YAAM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A8B;QACjE,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAID,iCAAW,GAAX,UAAY,KAAyB,EAAE,QAA8B;QACnE,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,+BAAS,GAAT,UAAU,IAAwB,EAAE,OAA6B;QAC/D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,KAAK,SAAS,EAAlB,CAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAClI,CAAC;IACH,kBAAC;AAAD,CAAC,AA1DD,CAA2H,yBAAW,GA0DrI;AA1DqB,kCAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/react-game",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.16.0",
|
|
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",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
28
28
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
29
29
|
"@gamepark/avataaars": "^2.2.0",
|
|
30
|
-
"@gamepark/react-client": "^6.
|
|
31
|
-
"@gamepark/rules-api": "^6.
|
|
30
|
+
"@gamepark/react-client": "^6.16.0",
|
|
31
|
+
"@gamepark/rules-api": "^6.16.0",
|
|
32
32
|
"dayjs": "^1.11.7",
|
|
33
33
|
"emotion-normalize": "^11.0.1",
|
|
34
34
|
"fscreen": "^1.2.0",
|