@gamepark/react-game 6.6.0 → 6.7.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.
Files changed (56) hide show
  1. package/dist/components/GameProvider/GameProvider.d.ts +6 -2
  2. package/dist/components/GameProvider/GameProvider.js +16 -4
  3. package/dist/components/GameProvider/GameProvider.js.map +1 -1
  4. package/dist/components/LoadingScreen/LoadingScreen.js +6 -2
  5. package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
  6. package/dist/components/PlayerPanel/PlayerPanel.js +9 -17
  7. package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
  8. package/dist/components/PlayerTimer/PlayerTimer.d.ts +5 -1
  9. package/dist/components/PlayerTimer/PlayerTimer.js +10 -6
  10. package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -1
  11. package/dist/components/dialogs/Dialog.d.ts +0 -1
  12. package/dist/components/dialogs/Dialog.js +3 -3
  13. package/dist/components/dialogs/Dialog.js.map +1 -1
  14. package/dist/components/dialogs/ResultDialog/ResultDialog.js +13 -10
  15. package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
  16. package/dist/components/dialogs/RulesDialog/RulesDialog.d.ts +0 -1
  17. package/dist/components/dialogs/RulesDialog/RulesDialog.js +3 -4
  18. package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
  19. package/dist/components/material/DraggableMaterial.js +9 -7
  20. package/dist/components/material/DraggableMaterial.js.map +1 -1
  21. package/dist/components/material/GameTable/GameTable.d.ts +0 -2
  22. package/dist/components/material/GameTable/GameTable.js +20 -29
  23. package/dist/components/material/GameTable/GameTable.js.map +1 -1
  24. package/dist/components/material/locations/LocationDescription.d.ts +4 -4
  25. package/dist/components/material/locations/LocationDescription.js +9 -8
  26. package/dist/components/material/locations/LocationDescription.js.map +1 -1
  27. package/dist/components/material/locations/SimpleDropArea.js +15 -12
  28. package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
  29. package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +1 -5
  30. package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
  31. package/dist/components/menus/Menu/Menu.js +1 -5
  32. package/dist/components/menus/Menu/Menu.js.map +1 -1
  33. package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +7 -5
  34. package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
  35. package/dist/components/menus/menuCss.js +1 -2
  36. package/dist/components/menus/menuCss.js.map +1 -1
  37. package/dist/components/tutorial/MaterialTutorialDisplay.js +0 -1
  38. package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
  39. package/dist/css/GameTheme.d.ts +19 -0
  40. package/dist/css/GameTheme.js +19 -0
  41. package/dist/css/GameTheme.js.map +1 -0
  42. package/dist/css/index.d.ts +1 -0
  43. package/dist/css/index.js +1 -0
  44. package/dist/css/index.js.map +1 -1
  45. package/dist/hooks/index.d.ts +0 -1
  46. package/dist/hooks/index.js +0 -1
  47. package/dist/hooks/index.js.map +1 -1
  48. package/dist/hooks/usePlayerName.js +7 -0
  49. package/dist/hooks/usePlayerName.js.map +1 -1
  50. package/dist/utilities/DeepPartial.d.ts +3 -0
  51. package/dist/utilities/DeepPartial.js +3 -0
  52. package/dist/utilities/DeepPartial.js.map +1 -0
  53. package/dist/utilities/index.d.ts +1 -0
  54. package/dist/utilities/index.js +1 -0
  55. package/dist/utilities/index.js.map +1 -1
  56. package/package.json +1 -1
package/dist/css/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./buttonCss"), exports);
19
19
  __exportStar(require("./componentSizeCss"), exports);
20
20
  __exportStar(require("./cursorCss"), exports);
21
21
  __exportStar(require("./fadeIn"), exports);
22
+ __exportStar(require("./GameTheme"), exports);
22
23
  __exportStar(require("./shadowEffect"), exports);
23
24
  __exportStar(require("./shineEffect"), exports);
24
25
  __exportStar(require("./transformCss"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/css/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,8CAA2B;AAC3B,qDAAkC;AAClC,8CAA2B;AAC3B,2CAAwB;AACxB,iDAA8B;AAC9B,gDAA6B;AAC7B,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/css/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,8CAA2B;AAC3B,qDAAkC;AAClC,8CAA2B;AAC3B,2CAAwB;AACxB,8CAA2B;AAC3B,iDAA8B;AAC9B,gDAA6B;AAC7B,iDAA8B"}
@@ -1,6 +1,5 @@
1
1
  export * from './useActions';
2
2
  export * from './useAnimations';
3
- export * from './useContrastTheme';
4
3
  export * from './useFailures';
5
4
  export * from './useFullscreen';
6
5
  export * from './useGame';
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./useActions"), exports);
18
18
  __exportStar(require("./useAnimations"), exports);
19
- __exportStar(require("./useContrastTheme"), exports);
20
19
  __exportStar(require("./useFailures"), exports);
21
20
  __exportStar(require("./useFullscreen"), exports);
22
21
  __exportStar(require("./useGame"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,kDAA+B;AAC/B,qDAAkC;AAClC,gDAA6B;AAC7B,kDAA+B;AAC/B,4CAAyB;AACzB,8CAA2B;AAC3B,mDAAgC;AAChC,+CAA4B;AAC5B,kDAA+B;AAC/B,0DAAuC;AACvC,uDAAoC;AACpC,2DAAwC;AACxC,2CAAwB;AACxB,uDAAoC;AACpC,2DAAwC;AACxC,4CAAyB;AACzB,gDAA6B;AAC7B,kDAA+B;AAC/B,+CAA4B;AAC5B,kDAA+B;AAC/B,6CAA0B;AAC1B,iDAA8B;AAC9B,6CAA0B;AAC1B,4CAAyB;AACzB,4CAAyB;AACzB,sDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,kDAA+B;AAC/B,gDAA6B;AAC7B,kDAA+B;AAC/B,4CAAyB;AACzB,8CAA2B;AAC3B,mDAAgC;AAChC,+CAA4B;AAC5B,kDAA+B;AAC/B,0DAAuC;AACvC,uDAAoC;AACpC,2DAAwC;AACxC,2CAAwB;AACxB,uDAAoC;AACpC,2DAAwC;AACxC,4CAAyB;AACzB,gDAA6B;AAC7B,kDAA+B;AAC/B,+CAA4B;AAC5B,kDAA+B;AAC/B,6CAA0B;AAC1B,iDAA8B;AAC9B,6CAA0B;AAC1B,4CAAyB;AACzB,4CAAyB;AACzB,sDAAmC"}
@@ -1,17 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.usePlayerName = void 0;
4
+ var react_client_1 = require("@gamepark/react-client");
4
5
  var react_redux_1 = require("react-redux");
5
6
  var react_1 = require("react");
6
7
  var components_1 = require("../components");
7
8
  var rules_api_1 = require("@gamepark/rules-api");
8
9
  var react_i18next_1 = require("react-i18next");
10
+ var usePlayerId_1 = require("./usePlayerId");
9
11
  function usePlayerName(playerId) {
12
+ var _a;
10
13
  var name = (0, react_redux_1.useSelector)(function (state) { var _a, _b; return (_b = (_a = state.players.find(function (player) { var _a; return (_a = player.id === playerId) !== null && _a !== void 0 ? _a : state.playerId; })) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''; });
11
14
  var optionsSpec = (0, react_1.useContext)(components_1.gameContext).optionsSpec;
15
+ var me = (0, react_client_1.useMe)();
16
+ var myId = (0, usePlayerId_1.usePlayerId)();
12
17
  var t = (0, react_i18next_1.useTranslation)().t;
13
18
  if (name)
14
19
  return name;
20
+ if (myId === playerId && ((_a = me === null || me === void 0 ? void 0 : me.user) === null || _a === void 0 ? void 0 : _a.name))
21
+ return me.user.name;
15
22
  if ((0, rules_api_1.isWithPlayerIdOptions)(optionsSpec))
16
23
  return optionsSpec.players.id.valueSpec(playerId).label(t);
17
24
  return t('Player {number}', { number: playerId });
@@ -1 +1 @@
1
- {"version":3,"file":"usePlayerName.js","sourceRoot":"","sources":["../../src/hooks/usePlayerName.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AACzC,+BAAkC;AAClC,4CAA2C;AAC3C,iDAA2D;AAC3D,+CAA8C;AAE9C,SAAgB,aAAa,CAAiB,QAAkB;IAC9D,IAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAoB,gBAAK,OAAA,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,MAAM,YAAI,OAAA,MAAA,MAAM,CAAC,EAAE,KAAK,QAAQ,mCAAI,KAAK,CAAC,QAAQ,CAAA,EAAA,CAAC,0CAAE,IAAI,mCAAI,EAAE,CAAA,EAAA,CAAC,CAAA;IACtI,IAAM,WAAW,GAAG,IAAA,kBAAU,EAAC,wBAAW,CAAC,CAAC,WAAW,CAAA;IAC/C,IAAA,CAAC,GAAK,IAAA,8BAAc,GAAE,EAArB,CAAqB;IAC9B,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,IAAI,IAAA,iCAAqB,EAAC,WAAW,CAAC;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClG,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;AACnD,CAAC;AAPD,sCAOC"}
1
+ {"version":3,"file":"usePlayerName.js","sourceRoot":"","sources":["../../src/hooks/usePlayerName.ts"],"names":[],"mappings":";;;AAAA,uDAA6D;AAC7D,2CAAyC;AACzC,+BAAkC;AAClC,4CAA2C;AAC3C,iDAA2D;AAC3D,+CAA8C;AAC9C,6CAA2C;AAE3C,SAAgB,aAAa,CAAiB,QAAkB;;IAC9D,IAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAoB,gBAAK,OAAA,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,MAAM,YAAI,OAAA,MAAA,MAAM,CAAC,EAAE,KAAK,QAAQ,mCAAI,KAAK,CAAC,QAAQ,CAAA,EAAA,CAAC,0CAAE,IAAI,mCAAI,EAAE,CAAA,EAAA,CAAC,CAAA;IACtI,IAAM,WAAW,GAAG,IAAA,kBAAU,EAAC,wBAAW,CAAC,CAAC,WAAW,CAAA;IACvD,IAAM,EAAE,GAAG,IAAA,oBAAK,GAAE,CAAA;IAClB,IAAM,IAAI,GAAG,IAAA,yBAAW,GAAE,CAAA;IAClB,IAAA,CAAC,GAAK,IAAA,8BAAc,GAAE,EAArB,CAAqB;IAC9B,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,IAAI,IAAI,KAAK,QAAQ,KAAI,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,IAAI,0CAAE,IAAI,CAAA;QAAE,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAA;IAC5D,IAAI,IAAA,iCAAqB,EAAC,WAAW,CAAC;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClG,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;AACnD,CAAC;AAVD,sCAUC"}
@@ -0,0 +1,3 @@
1
+ export type DeepPartial<T> = T extends object ? {
2
+ [P in keyof T]?: DeepPartial<T[P]>;
3
+ } : T;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DeepPartial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepPartial.js","sourceRoot":"","sources":["../../src/utilities/DeepPartial.ts"],"names":[],"mappings":""}
@@ -1 +1,2 @@
1
1
  export * from './combineEventListeners';
2
+ export * from './DeepPartial';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./combineEventListeners"), exports);
18
+ __exportStar(require("./DeepPartial"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,gDAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/react-game",
3
- "version": "6.6.0",
3
+ "version": "6.7.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",