@gamepark/react-client 7.0.0-beta.0 → 7.0.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 (258) hide show
  1. package/dist/Actions/ActionFailed.js +3 -7
  2. package/dist/Actions/ActionFailed.js.map +1 -1
  3. package/dist/Actions/AnimationComplete.js +3 -7
  4. package/dist/Actions/AnimationComplete.js.map +1 -1
  5. package/dist/Actions/AnimationPaused.js +3 -7
  6. package/dist/Actions/AnimationPaused.js.map +1 -1
  7. package/dist/Actions/AnimationStart.js +1 -4
  8. package/dist/Actions/AnimationStart.js.map +1 -1
  9. package/dist/Actions/ClearFailures.d.ts +1 -5
  10. package/dist/Actions/ClearFailures.js +3 -9
  11. package/dist/Actions/ClearFailures.js.map +1 -1
  12. package/dist/Actions/GameNotificationsReceived.d.ts +2 -4
  13. package/dist/Actions/GameNotificationsReceived.js +2 -9
  14. package/dist/Actions/GameNotificationsReceived.js.map +1 -1
  15. package/dist/Actions/GameOver.js +3 -7
  16. package/dist/Actions/GameOver.js.map +1 -1
  17. package/dist/Actions/GameStateLoaded.js +5 -18
  18. package/dist/Actions/GameStateLoaded.js.map +1 -1
  19. package/dist/Actions/MovePlayed.d.ts +4 -4
  20. package/dist/Actions/MovePlayed.js +3 -4
  21. package/dist/Actions/MovePlayed.js.map +1 -1
  22. package/dist/Actions/MoveUndone.js +3 -8
  23. package/dist/Actions/MoveUndone.js.map +1 -1
  24. package/dist/Actions/PlayerQuit.d.ts +3 -9
  25. package/dist/Actions/PlayerQuit.js +2 -19
  26. package/dist/Actions/PlayerQuit.js.map +1 -1
  27. package/dist/Actions/SetAnimationsSpeed.d.ts +1 -6
  28. package/dist/Actions/SetAnimationsSpeed.js +3 -9
  29. package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
  30. package/dist/Actions/giveUp.d.ts +1 -0
  31. package/dist/Actions/giveUp.js +3 -0
  32. package/dist/Actions/giveUp.js.map +1 -0
  33. package/dist/Actions/index.d.ts +7 -11
  34. package/dist/Actions/index.js +7 -27
  35. package/dist/Actions/index.js.map +1 -1
  36. package/dist/Actions/loadGameState.d.ts +14 -0
  37. package/dist/Actions/loadGameState.js +3 -0
  38. package/dist/Actions/loadGameState.js.map +1 -0
  39. package/dist/Actions/playMove.d.ts +10 -0
  40. package/dist/Actions/playMove.js +3 -0
  41. package/dist/Actions/playMove.js.map +1 -0
  42. package/dist/Actions/receiveNotifications.d.ts +8 -0
  43. package/dist/Actions/receiveNotifications.js +3 -0
  44. package/dist/Actions/receiveNotifications.js.map +1 -0
  45. package/dist/Actions/removePlayer.d.ts +5 -0
  46. package/dist/Actions/removePlayer.js +3 -0
  47. package/dist/Actions/removePlayer.js.map +1 -0
  48. package/dist/Actions/reportFailure.d.ts +1 -0
  49. package/dist/Actions/reportFailure.js +3 -0
  50. package/dist/Actions/reportFailure.js.map +1 -0
  51. package/dist/Actions/setGameOver.d.ts +2 -0
  52. package/dist/Actions/setGameOver.js +3 -0
  53. package/dist/Actions/setGameOver.js.map +1 -0
  54. package/dist/Actions/startAnimation.d.ts +1 -0
  55. package/dist/Actions/startAnimation.js +3 -0
  56. package/dist/Actions/startAnimation.js.map +1 -0
  57. package/dist/Actions/undoMove.d.ts +5 -0
  58. package/dist/Actions/undoMove.js +4 -0
  59. package/dist/Actions/undoMove.js.map +1 -0
  60. package/dist/Chat/ChatChannel.js +1 -2
  61. package/dist/Chat/Message.js +1 -2
  62. package/dist/Chat/index.js +2 -18
  63. package/dist/Chat/index.js.map +1 -1
  64. package/dist/Deckbuilding/Deck.js +1 -2
  65. package/dist/Deckbuilding/index.js +4 -24
  66. package/dist/Deckbuilding/index.js.map +1 -1
  67. package/dist/Deckbuilding/useDeleteDeck.d.ts +4 -1
  68. package/dist/Deckbuilding/useDeleteDeck.js +8 -14
  69. package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
  70. package/dist/Deckbuilding/useMyDecks.d.ts +5 -1
  71. package/dist/Deckbuilding/useMyDecks.js +7 -13
  72. package/dist/Deckbuilding/useMyDecks.js.map +1 -1
  73. package/dist/Deckbuilding/useSaveDeck.d.ts +7 -1
  74. package/dist/Deckbuilding/useSaveDeck.js +8 -14
  75. package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
  76. package/dist/EjectPlayer/EjectPlayer.d.ts +1 -6
  77. package/dist/EjectPlayer/EjectPlayer.js +2 -8
  78. package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
  79. package/dist/EjectPlayer/index.js +1 -17
  80. package/dist/EjectPlayer/index.js.map +1 -1
  81. package/dist/Failure/Failure.js +1 -4
  82. package/dist/Failure/Failure.js.map +1 -1
  83. package/dist/Failure/index.js +1 -17
  84. package/dist/Failure/index.js.map +1 -1
  85. package/dist/GiveUp/GiveUp.js +2 -5
  86. package/dist/GiveUp/GiveUp.js.map +1 -1
  87. package/dist/GiveUp/index.js +1 -17
  88. package/dist/GiveUp/index.js.map +1 -1
  89. package/dist/Hooks/index.js +5 -21
  90. package/dist/Hooks/index.js.map +1 -1
  91. package/dist/Hooks/useChatMessages.d.ts +1 -6
  92. package/dist/Hooks/useChatMessages.js +35 -44
  93. package/dist/Hooks/useChatMessages.js.map +1 -1
  94. package/dist/Hooks/useMessageAuthor.js +12 -16
  95. package/dist/Hooks/useMessageAuthor.js.map +1 -1
  96. package/dist/Hooks/useOptions.js +3 -6
  97. package/dist/Hooks/useOptions.js.map +1 -1
  98. package/dist/Hooks/useRematch.d.ts +1 -1
  99. package/dist/Hooks/useRematch.js +16 -20
  100. package/dist/Hooks/useRematch.js.map +1 -1
  101. package/dist/Hooks/useSendMessage.d.ts +4 -1
  102. package/dist/Hooks/useSendMessage.js +5 -12
  103. package/dist/Hooks/useSendMessage.js.map +1 -1
  104. package/dist/Log/StartLiveLog.d.ts +1 -4
  105. package/dist/Log/StartLiveLog.js +3 -5
  106. package/dist/Log/StartLiveLog.js.map +1 -1
  107. package/dist/Log/StopLiveLog.d.ts +1 -4
  108. package/dist/Log/StopLiveLog.js +4 -7
  109. package/dist/Log/StopLiveLog.js.map +1 -1
  110. package/dist/Log/index.d.ts +2 -2
  111. package/dist/Log/index.js +4 -20
  112. package/dist/Log/index.js.map +1 -1
  113. package/dist/Log/useLogControls.js +11 -14
  114. package/dist/Log/useLogControls.js.map +1 -1
  115. package/dist/PlayerTime/PlayerTime.js +1 -2
  116. package/dist/PlayerTime/index.js +1 -17
  117. package/dist/PlayerTime/index.js.map +1 -1
  118. package/dist/Rematch/RematchQueries.js +23 -13
  119. package/dist/Rematch/RematchQueries.js.map +1 -1
  120. package/dist/Rematch/index.js +1 -17
  121. package/dist/Rematch/index.js.map +1 -1
  122. package/dist/Sound/MuteSounds.d.ts +1 -4
  123. package/dist/Sound/MuteSounds.js +5 -8
  124. package/dist/Sound/MuteSounds.js.map +1 -1
  125. package/dist/Sound/UnmuteSounds.d.ts +1 -4
  126. package/dist/Sound/UnmuteSounds.js +3 -5
  127. package/dist/Sound/UnmuteSounds.js.map +1 -1
  128. package/dist/Sound/index.d.ts +2 -2
  129. package/dist/Sound/index.js +3 -19
  130. package/dist/Sound/index.js.map +1 -1
  131. package/dist/Sound/useSoundControls.js +11 -14
  132. package/dist/Sound/useSoundControls.js.map +1 -1
  133. package/dist/Store/DisplayedAction.js +4 -10
  134. package/dist/Store/DisplayedAction.js.map +1 -1
  135. package/dist/Store/GamePageState.d.ts +0 -1
  136. package/dist/Store/GamePageState.js +1 -2
  137. package/dist/Store/PlayedMove.js +1 -2
  138. package/dist/Store/endAnimation.d.ts +1 -0
  139. package/dist/Store/endAnimation.js +3 -0
  140. package/dist/Store/endAnimation.js.map +1 -0
  141. package/dist/Store/gameMiddleware.js +30 -41
  142. package/dist/Store/gameMiddleware.js.map +1 -1
  143. package/dist/Store/gameReducer.d.ts +2 -11
  144. package/dist/Store/gameReducer.js +301 -377
  145. package/dist/Store/gameReducer.js.map +1 -1
  146. package/dist/Store/index.d.ts +1 -0
  147. package/dist/Store/index.js +4 -19
  148. package/dist/Store/index.js.map +1 -1
  149. package/dist/Store/localMovePreviewMiddleware.js +15 -13
  150. package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
  151. package/dist/Store/store.d.ts +13 -0
  152. package/dist/Store/store.js +27 -0
  153. package/dist/Store/store.js.map +1 -0
  154. package/dist/Tutorial/PlayTutorialMoves.d.ts +1 -9
  155. package/dist/Tutorial/PlayTutorialMoves.js +2 -6
  156. package/dist/Tutorial/PlayTutorialMoves.js.map +1 -1
  157. package/dist/Tutorial/Tutorial.js +1 -2
  158. package/dist/Tutorial/TutorialDescription.d.ts +1 -1
  159. package/dist/Tutorial/TutorialDescription.js +1 -2
  160. package/dist/Tutorial/index.js +4 -20
  161. package/dist/Tutorial/index.js.map +1 -1
  162. package/dist/Tutorial/useTutorial.js +11 -20
  163. package/dist/Tutorial/useTutorial.js.map +1 -1
  164. package/dist/Types/GameAI.js +1 -2
  165. package/dist/Types/GameData.js +1 -2
  166. package/dist/Types/GameMessage.js +1 -2
  167. package/dist/Types/GameMode.js +2 -5
  168. package/dist/Types/GameMode.js.map +1 -1
  169. package/dist/Types/GameNotification.js +1 -2
  170. package/dist/Types/GameOptions.js +2 -5
  171. package/dist/Types/GameOptions.js.map +1 -1
  172. package/dist/Types/MovePlayedNotification.d.ts +1 -1
  173. package/dist/Types/MovePlayedNotification.js +3 -8
  174. package/dist/Types/MovePlayedNotification.js.map +1 -1
  175. package/dist/Types/MoveUndoneNotification.d.ts +1 -1
  176. package/dist/Types/MoveUndoneNotification.js +3 -8
  177. package/dist/Types/MoveUndoneNotification.js.map +1 -1
  178. package/dist/Types/Player.js +1 -2
  179. package/dist/Types/PlayerQuitReason.js +2 -5
  180. package/dist/Types/PlayerQuitReason.js.map +1 -1
  181. package/dist/Types/ProxyGameData.js +1 -2
  182. package/dist/Types/Tournament.js +1 -2
  183. package/dist/Types/index.js +12 -28
  184. package/dist/Types/index.js.map +1 -1
  185. package/dist/User/User.js +1 -2
  186. package/dist/User/index.js +2 -18
  187. package/dist/User/index.js.map +1 -1
  188. package/dist/User/useMe.js +9 -19
  189. package/dist/User/useMe.js.map +1 -1
  190. package/dist/animations/Animation.js +1 -2
  191. package/dist/animations/AnimationContext.d.ts +1 -1
  192. package/dist/animations/AnimationContext.js +1 -2
  193. package/dist/animations/AnimationState.js +1 -2
  194. package/dist/animations/AnimationStep.js +2 -5
  195. package/dist/animations/AnimationStep.js.map +1 -1
  196. package/dist/animations/Animations.js +9 -16
  197. package/dist/animations/Animations.js.map +1 -1
  198. package/dist/animations/AnimationsListener.d.ts +6 -0
  199. package/dist/animations/AnimationsListener.js +54 -0
  200. package/dist/animations/AnimationsListener.js.map +1 -0
  201. package/dist/animations/AnimationsListenerCreator.d.ts +1 -4
  202. package/dist/animations/AnimationsListenerCreator.js +24 -30
  203. package/dist/animations/AnimationsListenerCreator.js.map +1 -1
  204. package/dist/animations/animationMiddleware.d.ts +4 -0
  205. package/dist/animations/animationMiddleware.js +46 -0
  206. package/dist/animations/animationMiddleware.js.map +1 -0
  207. package/dist/animations/index.d.ts +0 -1
  208. package/dist/animations/index.js +5 -22
  209. package/dist/animations/index.js.map +1 -1
  210. package/dist/api/Client/GameClientAPI.d.ts +5 -6
  211. package/dist/api/Client/GameClientAPI.js +70 -119
  212. package/dist/api/Client/GameClientAPI.js.map +1 -1
  213. package/dist/api/Client/GameNotificationsListener.js +51 -104
  214. package/dist/api/Client/GameNotificationsListener.js.map +1 -1
  215. package/dist/api/Client/RemoteGameLoader.js +50 -45
  216. package/dist/api/Client/RemoteGameLoader.js.map +1 -1
  217. package/dist/api/Client/RemoteGameProvider.js +15 -51
  218. package/dist/api/Client/RemoteGameProvider.js.map +1 -1
  219. package/dist/api/Client/apollo-client.d.ts +1 -1
  220. package/dist/api/Client/apollo-client.js +14 -31
  221. package/dist/api/Client/apollo-client.js.map +1 -1
  222. package/dist/api/Client/index.js +4 -20
  223. package/dist/api/Client/index.js.map +1 -1
  224. package/dist/api/Client/pusher.js +5 -12
  225. package/dist/api/Client/pusher.js.map +1 -1
  226. package/dist/api/GameAPI.d.ts +2 -3
  227. package/dist/api/GameAPI.js +1 -2
  228. package/dist/api/Local/ConsoleTools.d.ts +1 -2
  229. package/dist/api/Local/ConsoleTools.js +15 -22
  230. package/dist/api/Local/ConsoleTools.js.map +1 -1
  231. package/dist/api/Local/GameLocalAPI.d.ts +4 -5
  232. package/dist/api/Local/GameLocalAPI.js +264 -363
  233. package/dist/api/Local/GameLocalAPI.js.map +1 -1
  234. package/dist/api/Local/LocalGameProvider.d.ts +1 -1
  235. package/dist/api/Local/LocalGameProvider.js +17 -48
  236. package/dist/api/Local/LocalGameProvider.js.map +1 -1
  237. package/dist/api/Local/index.js +1 -17
  238. package/dist/api/Local/index.js.map +1 -1
  239. package/dist/api/index.js +2 -18
  240. package/dist/api/index.js.map +1 -1
  241. package/dist/index.d.ts +0 -2
  242. package/dist/index.js +16 -36
  243. package/dist/index.js.map +1 -1
  244. package/dist/util/ArrayUtil.js +4 -8
  245. package/dist/util/ArrayUtil.js.map +1 -1
  246. package/package.json +64 -62
  247. package/dist/Actions/ActionType.d.ts +0 -3
  248. package/dist/Actions/ActionType.js +0 -8
  249. package/dist/Actions/ActionType.js.map +0 -1
  250. package/dist/Scoring/ScoringDescription.d.ts +0 -8
  251. package/dist/Scoring/ScoringDescription.js +0 -3
  252. package/dist/Scoring/ScoringDescription.js.map +0 -1
  253. package/dist/Scoring/index.d.ts +0 -1
  254. package/dist/Scoring/index.js +0 -18
  255. package/dist/Scoring/index.js.map +0 -1
  256. package/dist/util/TimeUtil.d.ts +0 -2
  257. package/dist/util/TimeUtil.js +0 -27
  258. package/dist/util/TimeUtil.js.map +0 -1
@@ -1,14 +1,7 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.useSendMessage = useSendMessage;
8
- var client_1 = require("@apollo/client");
9
- var SEND_MESSAGE = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }"], ["mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }"])));
10
- function useSendMessage() {
11
- return (0, client_1.useMutation)(SEND_MESSAGE);
1
+ import { gql } from '@apollo/client';
2
+ import { useMutation } from '@apollo/client/react';
3
+ const SEND_MESSAGE = gql `mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }`;
4
+ export function useSendMessage() {
5
+ return useMutation(SEND_MESSAGE);
12
6
  }
13
- var templateObject_1;
14
7
  //# sourceMappingURL=useSendMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSendMessage.js","sourceRoot":"","sources":["../../src/Hooks/useSendMessage.ts"],"names":[],"mappings":";;;;;;AAIA,wCAEC;AAND,yCAAiD;AAEjD,IAAM,YAAY,OAAG,YAAG,sLAAA,kHAAkH,IAAA,CAAA;AAE1I,SAAgB,cAAc;IAC5B,OAAO,IAAA,oBAAW,EAAC,YAAY,CAAC,CAAA;AAClC,CAAC"}
1
+ {"version":3,"file":"useSendMessage.js","sourceRoot":"","sources":["../../src/Hooks/useSendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,YAAY,GAAG,GAAG,CAAA,kHAAkH,CAAA;AAE1I,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAC,YAAY,CAAC,CAAA;AAClC,CAAC"}
@@ -1,4 +1 @@
1
- export declare const START_LIVE_LOG = "START_LIVE_LOG";
2
- export interface StartLiveLog {
3
- type: typeof START_LIVE_LOG;
4
- }
1
+ export declare const startLiveLog: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"startLiveLog">;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.START_LIVE_LOG = void 0;
4
- exports.START_LIVE_LOG = 'START_LIVE_LOG';
5
- //# sourceMappingURL=StartLiveLog.js.map
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ export const startLiveLog = createAction('startLiveLog');
3
+ //# sourceMappingURL=startLiveLog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StartLiveLog.js","sourceRoot":"","sources":["../../src/Log/StartLiveLog.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,gBAAgB,CAAA"}
1
+ {"version":3,"file":"startLiveLog.js","sourceRoot":"","sources":["../../src/Log/startLiveLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA"}
@@ -1,5 +1,2 @@
1
- export declare const STOP_LIVE_LOG = "STOP_LIVE_LOG";
2
- export interface StopLiveLog {
3
- type: typeof STOP_LIVE_LOG;
4
- }
5
1
  export declare function liveLogStopped(): boolean;
2
+ export declare const stopLiveLog: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"stopLiveLog">;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STOP_LIVE_LOG = void 0;
4
- exports.liveLogStopped = liveLogStopped;
5
- exports.STOP_LIVE_LOG = 'STOP_LIVE_LOG';
6
- function liveLogStopped() {
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ export function liveLogStopped() {
7
3
  return !!localStorage.getItem('liveLogStopped');
8
4
  }
9
- //# sourceMappingURL=StopLiveLog.js.map
5
+ export const stopLiveLog = createAction('stopLiveLog');
6
+ //# sourceMappingURL=stopLiveLog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StopLiveLog.js","sourceRoot":"","sources":["../../src/Log/StopLiveLog.ts"],"names":[],"mappings":";;;AAMA,wCAEC;AARY,QAAA,aAAa,GAAG,eAAe,CAAA;AAM5C,SAAgB,cAAc;IAC5B,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACjD,CAAC"}
1
+ {"version":3,"file":"stopLiveLog.js","sourceRoot":"","sources":["../../src/Log/stopLiveLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
1
  export * from './useLogControls';
2
- export * from './StartLiveLog';
3
- export * from './StopLiveLog';
2
+ export * from './startLiveLog';
3
+ export * from './stopLiveLog';
4
4
  export * from './useLogControls';
package/dist/Log/index.js CHANGED
@@ -1,21 +1,5 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./useLogControls"), exports);
18
- __exportStar(require("./StartLiveLog"), exports);
19
- __exportStar(require("./StopLiveLog"), exports);
20
- __exportStar(require("./useLogControls"), exports);
1
+ export * from './useLogControls';
2
+ export * from './startLiveLog';
3
+ export * from './stopLiveLog';
4
+ export * from './useLogControls';
21
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC;AAChC,iDAA8B;AAC9B,gDAA6B;AAC7B,mDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
@@ -1,22 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLogControls = useLogControls;
4
- var react_redux_1 = require("react-redux");
5
- var StartLiveLog_1 = require("./StartLiveLog");
6
- var StopLiveLog_1 = require("./StopLiveLog");
7
- function useLogControls() {
8
- var stopped = (0, react_redux_1.useSelector)(function (state) { return state.liveLogStopped; });
9
- var dispatch = (0, react_redux_1.useDispatch)();
1
+ import { useGameDispatch, useGameSelector } from '../Store';
2
+ import { startLiveLog } from './startLiveLog';
3
+ import { stopLiveLog } from './stopLiveLog';
4
+ export function useLogControls() {
5
+ const stopped = useGameSelector(state => state.liveLogStopped);
6
+ const dispatch = useGameDispatch();
10
7
  return {
11
- stop: function () {
12
- dispatch({ type: StopLiveLog_1.STOP_LIVE_LOG });
8
+ stop: () => {
9
+ dispatch(stopLiveLog());
13
10
  localStorage.setItem('liveLogStopped', 'true');
14
11
  },
15
- start: function () {
16
- dispatch({ type: StartLiveLog_1.START_LIVE_LOG });
12
+ start: () => {
13
+ dispatch(startLiveLog());
17
14
  localStorage.removeItem('liveLogStopped');
18
15
  },
19
- stopped: stopped
16
+ stopped
20
17
  };
21
18
  }
22
19
  //# sourceMappingURL=useLogControls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLogControls.js","sourceRoot":"","sources":["../../src/Log/useLogControls.ts"],"names":[],"mappings":";;AAWA,wCAcC;AAzBD,2CAAsD;AAEtD,+CAA+C;AAC/C,6CAA6C;AAQ7C,SAAgB,cAAc;IAC5B,IAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAoB,IAAK,OAAA,KAAK,CAAC,cAAc,EAApB,CAAoB,CAAC,CAAA;IAC3E,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAO,CAAA;IACnC,OAAO;QACL,IAAI,EAAE;YACJ,QAAQ,CAAC,EAAE,IAAI,EAAE,2BAAa,EAAE,CAAC,CAAA;YACjC,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;QAChD,CAAC;QACD,KAAK,EAAE;YACL,QAAQ,CAAC,EAAE,IAAI,EAAE,6BAAc,EAAE,CAAC,CAAA;YAClC,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,SAAA;KACR,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"useLogControls.js","sourceRoot":"","sources":["../../src/Log/useLogControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAQ3C,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAC9D,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAA;IAClC,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;YACvB,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;QAChD,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;YACxB,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO;KACR,CAAA;AACH,CAAC"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=PlayerTime.js.map
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./PlayerTime"), exports);
1
+ export * from './PlayerTime';
18
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PlayerTime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PlayerTime/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -1,14 +1,24 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.REFUSE_REMATCH = exports.ACCEPT_REMATCH = exports.REMATCH = exports.CAN_REMATCH = void 0;
8
- var client_1 = require("@apollo/client");
9
- exports.CAN_REMATCH = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n query Game($id: String!) {\n game(id: $id) {\n id canRematch rematch { id startDate players { name userId ready } }\n }\n }\n"], ["\n query Game($id: String!) {\n game(id: $id) {\n id canRematch rematch { id startDate players { name userId ready } }\n }\n }\n"])));
10
- exports.REMATCH = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n mutation Rematch($gameId: String!) {\n rematch(gameId: $gameId) { id canRematch rematch { id startDate myPlayerId players { id name userId ready } } }\n }\n"], ["\n mutation Rematch($gameId: String!) {\n rematch(gameId: $gameId) { id canRematch rematch { id startDate myPlayerId players { id name userId ready } } }\n }\n"])));
11
- exports.ACCEPT_REMATCH = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n mutation AcceptRematch($gameId: String!) {\n joinGame(gameId: $gameId) { id myPlayerId players { id ready } }\n }\n"], ["\n mutation AcceptRematch($gameId: String!) {\n joinGame(gameId: $gameId) { id myPlayerId players { id ready } }\n }\n"])));
12
- exports.REFUSE_REMATCH = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n mutation RefuseRematch($gameId: String!) {\n leaveGameSetup(gameId: $gameId) { id myPlayerId players { id ready } }\n }\n"], ["\n mutation RefuseRematch($gameId: String!) {\n leaveGameSetup(gameId: $gameId) { id myPlayerId players { id ready } }\n }\n"])));
13
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
1
+ import { gql } from '@apollo/client';
2
+ export const CAN_REMATCH = gql `
3
+ query Game($id: String!) {
4
+ game(id: $id) {
5
+ id canRematch rematch { id startDate players { name userId ready } }
6
+ }
7
+ }
8
+ `;
9
+ export const REMATCH = gql `
10
+ mutation Rematch($gameId: String!) {
11
+ rematch(gameId: $gameId) { id canRematch rematch { id startDate myPlayerId players { id name userId ready } } }
12
+ }
13
+ `;
14
+ export const ACCEPT_REMATCH = gql `
15
+ mutation AcceptRematch($gameId: String!) {
16
+ joinGame(gameId: $gameId) { id myPlayerId players { id ready } }
17
+ }
18
+ `;
19
+ export const REFUSE_REMATCH = gql `
20
+ mutation RefuseRematch($gameId: String!) {
21
+ leaveGameSetup(gameId: $gameId) { id myPlayerId players { id ready } }
22
+ }
23
+ `;
14
24
  //# sourceMappingURL=RematchQueries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RematchQueries.js","sourceRoot":"","sources":["../../src/Rematch/RematchQueries.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAAkC;AAErB,QAAA,WAAW,OAAG,YAAG,mNAAA,+IAM7B,KAAA;AAoBY,QAAA,OAAO,OAAG,YAAG,0OAAA,sKAIzB,KAAA;AAEY,QAAA,cAAc,OAAG,YAAG,iMAAA,6HAIhC,KAAA;AAEY,QAAA,cAAc,OAAG,YAAG,uMAAA,mIAIhC,KAAA"}
1
+ {"version":3,"file":"RematchQueries.js","sourceRoot":"","sources":["../../src/Rematch/RematchQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAA;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;CAM7B,CAAA;AAoBD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;;;;CAIzB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIhC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIhC,CAAA"}
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./RematchQueries"), exports);
1
+ export * from './RematchQueries';
18
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Rematch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Rematch/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1,5 +1,2 @@
1
- export declare const MUTE_SOUNDS = "MUTE_SOUNDS";
2
- export interface MuteSounds {
3
- type: typeof MUTE_SOUNDS;
4
- }
5
1
  export declare function soundsMuted(): boolean;
2
+ export declare const muteSounds: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"muteSounds">;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MUTE_SOUNDS = void 0;
4
- exports.soundsMuted = soundsMuted;
5
- exports.MUTE_SOUNDS = 'MUTE_SOUNDS';
6
- function soundsMuted() {
7
- var query = new URLSearchParams(window.location.search);
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ export function soundsMuted() {
3
+ const query = new URLSearchParams(window.location.search);
8
4
  return !!query.get('mute') || !!localStorage.getItem('soundsMuted');
9
5
  }
10
- //# sourceMappingURL=MuteSounds.js.map
6
+ export const muteSounds = createAction('muteSounds');
7
+ //# sourceMappingURL=muteSounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MuteSounds.js","sourceRoot":"","sources":["../../src/Sound/MuteSounds.ts"],"names":[],"mappings":";;;AAMA,kCAGC;AATY,QAAA,WAAW,GAAG,aAAa,CAAA;AAMxC,SAAgB,WAAW;IACzB,IAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;AACrE,CAAC"}
1
+ {"version":3,"file":"muteSounds.js","sourceRoot":"","sources":["../../src/Sound/muteSounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA"}
@@ -1,4 +1 @@
1
- export declare const UNMUTE_SOUNDS = "UNMUTE_SOUNDS";
2
- export interface UnmuteSounds {
3
- type: typeof UNMUTE_SOUNDS;
4
- }
1
+ export declare const unmuteSounds: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"unmuteSounds">;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UNMUTE_SOUNDS = void 0;
4
- exports.UNMUTE_SOUNDS = 'UNMUTE_SOUNDS';
5
- //# sourceMappingURL=UnmuteSounds.js.map
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ export const unmuteSounds = createAction('unmuteSounds');
3
+ //# sourceMappingURL=unmuteSounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnmuteSounds.js","sourceRoot":"","sources":["../../src/Sound/UnmuteSounds.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,eAAe,CAAA"}
1
+ {"version":3,"file":"unmuteSounds.js","sourceRoot":"","sources":["../../src/Sound/unmuteSounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './MuteSounds';
2
- export * from './UnmuteSounds';
1
+ export * from './muteSounds';
2
+ export * from './unmuteSounds';
3
3
  export * from './useSoundControls';
@@ -1,20 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./MuteSounds"), exports);
18
- __exportStar(require("./UnmuteSounds"), exports);
19
- __exportStar(require("./useSoundControls"), exports);
1
+ export * from './muteSounds';
2
+ export * from './unmuteSounds';
3
+ export * from './useSoundControls';
20
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Sound/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,iDAA8B;AAC9B,qDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Sound/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
@@ -1,22 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSoundControls = useSoundControls;
4
- var react_redux_1 = require("react-redux");
5
- var MuteSounds_1 = require("./MuteSounds");
6
- var UnmuteSounds_1 = require("./UnmuteSounds");
7
- function useSoundControls() {
8
- var muted = (0, react_redux_1.useSelector)(function (state) { return state.soundsMuted; });
9
- var dispatch = (0, react_redux_1.useDispatch)();
1
+ import { useGameDispatch, useGameSelector } from '../Store';
2
+ import { muteSounds } from './muteSounds';
3
+ import { unmuteSounds } from './unmuteSounds';
4
+ export function useSoundControls() {
5
+ const muted = useGameSelector(state => state.soundsMuted);
6
+ const dispatch = useGameDispatch();
10
7
  return {
11
- mute: function () {
12
- dispatch({ type: MuteSounds_1.MUTE_SOUNDS });
8
+ mute: () => {
9
+ dispatch(muteSounds());
13
10
  localStorage.setItem('soundsMuted', 'true');
14
11
  },
15
- unmute: function () {
16
- dispatch({ type: UnmuteSounds_1.UNMUTE_SOUNDS });
12
+ unmute: () => {
13
+ dispatch(unmuteSounds());
17
14
  localStorage.removeItem('soundsMuted');
18
15
  },
19
- muted: muted
16
+ muted
20
17
  };
21
18
  }
22
19
  //# sourceMappingURL=useSoundControls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSoundControls.js","sourceRoot":"","sources":["../../src/Sound/useSoundControls.ts"],"names":[],"mappings":";;AAWA,4CAcC;AAzBD,2CAAsD;AAEtD,2CAA0C;AAC1C,+CAA8C;AAQ9C,SAAgB,gBAAgB;IAC9B,IAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAoB,IAAK,OAAA,KAAK,CAAC,WAAW,EAAjB,CAAiB,CAAC,CAAA;IACtE,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAO,CAAA;IACnC,OAAO;QACL,IAAI,EAAE;YACJ,QAAQ,CAAC,EAAE,IAAI,EAAE,wBAAW,EAAE,CAAC,CAAA;YAC/B,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;QAC7C,CAAC;QACD,MAAM,EAAE;YACN,QAAQ,CAAC,EAAE,IAAI,EAAE,4BAAa,EAAE,CAAC,CAAA;YACjC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QACxC,CAAC;QACD,KAAK,OAAA;KACN,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"useSoundControls.js","sourceRoot":"","sources":["../../src/Sound/useSoundControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7C,MAAM,UAAU,gBAAgB;IAC9B,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IACzD,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAA;IAClC,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;YACtB,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;QAC7C,CAAC;QACD,MAAM,EAAE,GAAG,EAAE;YACX,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;YACxB,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QACxC,CAAC;QACD,KAAK;KACN,CAAA;AACH,CAAC"}
@@ -1,19 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isActionToAnimate = isActionToAnimate;
4
- exports.getAnimatedMove = getAnimatedMove;
5
- var animations_1 = require("../animations");
6
- function isActionToAnimate(action) {
1
+ import { AnimationStep } from '../animations';
2
+ export function isActionToAnimate(action) {
7
3
  if (action.delayed)
8
4
  return false;
9
5
  if (action.cancelled)
10
6
  return action.played > 0;
11
7
  return action.played <= action.consequences.length;
12
8
  }
13
- function getAnimatedMove(action, step) {
14
- var _a;
15
- if (step === void 0) { step = (_a = action.animation) === null || _a === void 0 ? void 0 : _a.step; }
16
- var consequenceIndex = (step === animations_1.AnimationStep.BEFORE_MOVE || step === animations_1.AnimationStep.AFTER_UNDO) ? action.played - 1 : action.played - 2;
9
+ export function getAnimatedMove(action, step = action.animation?.step) {
10
+ const consequenceIndex = (step === AnimationStep.BEFORE_MOVE || step === AnimationStep.AFTER_UNDO) ? action.played - 1 : action.played - 2;
17
11
  return consequenceIndex < 0 ? action.move : action.consequences[consequenceIndex];
18
12
  }
19
13
  //# sourceMappingURL=DisplayedAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayedAction.js","sourceRoot":"","sources":["../../src/Store/DisplayedAction.ts"],"names":[],"mappings":";;AAeA,8CAIC;AAED,0CAGC;AAvBD,4CAA6D;AAc7D,SAAgB,iBAAiB,CAAC,MAAuB;IACvD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAChC,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAA;AACpD,CAAC;AAED,SAAgB,eAAe,CAAO,MAA6B,EAAE,IAA6B;;IAA7B,qBAAA,EAAA,aAAO,MAAM,CAAC,SAAS,0CAAE,IAAI;IAChG,IAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK,0BAAa,CAAC,WAAW,IAAI,IAAI,KAAK,0BAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC1I,OAAO,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;AACnF,CAAC"}
1
+ {"version":3,"file":"DisplayedAction.js","sourceRoot":"","sources":["../../src/Store/DisplayedAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,aAAa,EAAE,MAAM,eAAe,CAAA;AAc7D,MAAM,UAAU,iBAAiB,CAAC,MAAuB;IACvD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAChC,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,eAAe,CAAO,MAA6B,EAAE,IAAI,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI;IAChG,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,WAAW,IAAI,IAAI,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC1I,OAAO,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;AACnF,CAAC"}
@@ -15,7 +15,6 @@ export type GamePageState<Game = any, Move = any, PlayerId = any> = {
15
15
  failures: string[];
16
16
  animationIncrement: number;
17
17
  animationsSpeed: number;
18
- animationPaused: boolean;
19
18
  soundsMuted: boolean;
20
19
  liveLogStopped: boolean;
21
20
  clientTimeDelta: number;
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=GamePageState.js.map
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=PlayedMove.js.map
@@ -0,0 +1 @@
1
+ export declare const endAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
@@ -0,0 +1,3 @@
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ export const endAnimation = createAction('endAnimation');
3
+ //# sourceMappingURL=endAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endAnimation.js","sourceRoot":"","sources":["../../src/Store/endAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAS,cAAc,CAAC,CAAA"}
@@ -1,46 +1,35 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gameMiddleware = gameMiddleware;
4
- var Actions_1 = require("../Actions");
5
- var EjectPlayer_1 = require("../EjectPlayer");
6
- var GiveUp_1 = require("../GiveUp");
7
- var Tutorial_1 = require("../Tutorial");
8
- var ArrayUtil_1 = require("../util/ArrayUtil");
9
- var gameReducer_1 = require("./gameReducer");
10
- function gameMiddleware(api) {
11
- return function (store) { return function (next) { return function (action) {
12
- if ((0, gameReducer_1.isGameAction)(action)) {
13
- switch (action.type) {
14
- case Actions_1.MOVE_PLAYED: {
15
- if (!action.local && !action.transient) {
16
- api.play(action.move);
17
- }
18
- break;
19
- }
20
- case Actions_1.MOVE_UNDONE: {
21
- var actions = store.getState().actions;
22
- if (!actions)
23
- return console.error('gameMiddleware - MOVE_UNDONE: Actions is missing');
24
- var gameAction = (0, ArrayUtil_1.findLastItem)(actions, function (gameAction) { return gameAction.id === action.actionId; });
25
- if (!gameAction)
26
- return console.error('gameMiddleware - MOVE_UNDONE: Action not found');
27
- if (!gameAction.local) {
28
- api.undo(action.actionId);
29
- }
30
- break;
31
- }
32
- case EjectPlayer_1.EJECT_PLAYER:
33
- api.eject(action.playerId);
34
- break;
35
- case GiveUp_1.GIVE_UP:
36
- api.giveUp();
37
- break;
38
- case Tutorial_1.PLAY_TUTORIAL_MOVES:
39
- api.playTutorialMoves(action.quantity);
40
- break;
1
+ import { giveUp, playMove, undoMove } from '../Actions';
2
+ import { ejectPlayer } from '../EjectPlayer';
3
+ import { playTutorialMoves } from '../Tutorial';
4
+ import { findLastItem } from '../util/ArrayUtil';
5
+ export function gameMiddleware(api) {
6
+ return store => next => action => {
7
+ if (playMove.match(action)) {
8
+ if (!action.payload.options?.local && !action.payload.options?.transient) {
9
+ api.play(action.payload.move);
41
10
  }
42
11
  }
12
+ else if (undoMove.match(action)) {
13
+ const actions = store.getState().actions;
14
+ if (!actions)
15
+ return console.error('gameMiddleware - undoMove: Actions is missing');
16
+ const gameAction = findLastItem(actions, gameAction => gameAction.id === action.payload.actionId);
17
+ if (!gameAction)
18
+ return console.error('gameMiddleware - undoMove: Action not found');
19
+ if (!gameAction.local) {
20
+ api.undo(action.payload.actionId);
21
+ }
22
+ }
23
+ else if (ejectPlayer.match(action)) {
24
+ api.eject(action.payload);
25
+ }
26
+ else if (giveUp.match(action)) {
27
+ api.giveUp();
28
+ }
29
+ else if (playTutorialMoves.match(action)) {
30
+ api.playTutorialMoves(action.payload);
31
+ }
43
32
  return next(action);
44
- }; }; };
33
+ };
45
34
  }
46
35
  //# sourceMappingURL=gameMiddleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gameMiddleware.js","sourceRoot":"","sources":["../../src/Store/gameMiddleware.ts"],"names":[],"mappings":";;AAUA,wCAmCC;AA5CD,sCAAqD;AAErD,8CAA6C;AAC7C,oCAAmC;AACnC,wCAAiD;AACjD,+CAAgD;AAEhD,6CAA4C;AAE5C,SAAgB,cAAc,CAAuB,GAA4B;IAE/E,OAAO,UAAA,KAAK,IAAI,OAAA,UAAA,IAAI,IAAI,OAAA,UAAA,MAAM;QAC5B,IAAI,IAAA,0BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;YACzB,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,qBAAW,CAAC,CAAC,CAAC;oBACjB,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;wBACvC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;oBACvB,CAAC;oBACD,MAAK;gBACP,CAAC;gBACD,KAAK,qBAAW,CAAC,CAAC,CAAC;oBACjB,IAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAA;oBACxC,IAAI,CAAC,OAAO;wBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;oBACtF,IAAM,UAAU,GAAG,IAAA,wBAAY,EAAC,OAAO,EAAE,UAAA,UAAU,IAAI,OAAA,UAAU,CAAC,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAjC,CAAiC,CAAC,CAAA;oBACzF,IAAI,CAAC,UAAU;wBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAA;oBACvF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;wBACtB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;oBAC3B,CAAC;oBACD,MAAK;gBAEP,CAAC;gBACD,KAAK,0BAAY;oBACf,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;oBAC1B,MAAK;gBACP,KAAK,gBAAO;oBACV,GAAG,CAAC,MAAM,EAAE,CAAA;oBACZ,MAAK;gBACP,KAAK,8BAAmB;oBACtB,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;oBACtC,MAAK;YACT,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC,EAhCuB,CAgCvB,EAhCe,CAgCf,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"gameMiddleware.js","sourceRoot":"","sources":["../../src/Store/gameMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,MAAM,UAAU,cAAc,CAAuB,GAA4B;IAE/E,OAAO,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;QAC/B,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;gBACzE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAA;YACxC,IAAI,CAAC,OAAO;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAA;YACnF,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YACjG,IAAI,CAAC,UAAU;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;YACpF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBACtB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YACnC,CAAC;QACH,CAAC;aAAM,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAmB,CAAC,CAAA;QACvC,CAAC;aAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,MAAM,EAAE,CAAA;QACd,CAAC;aAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACvC,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC,CAAA;AACH,CAAC"}
@@ -1,13 +1,6 @@
1
1
  import { Rules, RulesCreator } from '@gamepark/rules-api';
2
- import { Reducer } from 'redux';
3
- import { ActionFailed, AnimationComplete, AnimationPaused, AnimationStart, ClearFailures, GameNotificationsReceived, GameOver, GameStateLoaded, MovePlayed, MoveUndone, SetAnimationsSpeed } from '../Actions';
4
- import { PlayerQuit } from '../Actions/PlayerQuit';
2
+ import { Reducer } from '@reduxjs/toolkit';
5
3
  import { Animations } from '../animations';
6
- import { EjectPlayer } from '../EjectPlayer';
7
- import { GiveUp } from '../GiveUp';
8
- import { StartLiveLog, StopLiveLog } from '../Log';
9
- import { MuteSounds, UnmuteSounds } from '../Sound';
10
- import { PlayTutorialMoves } from '../Tutorial';
11
4
  import { DisplayedAction } from './DisplayedAction';
12
5
  import { GamePageState } from './GamePageState';
13
6
  export type GameReducerContext<Game = any, Move = any, PlayerId = any> = {
@@ -15,9 +8,7 @@ export type GameReducerContext<Game = any, Move = any, PlayerId = any> = {
15
8
  animations?: Animations<Game, Move, PlayerId>;
16
9
  version?: number;
17
10
  };
18
- export type GameActions<Game = any, Move = any, PlayerId = any> = GameStateLoaded<Game, PlayerId> | GameNotificationsReceived<PlayerId> | MovePlayed<Move> | MoveUndone | AnimationStart | AnimationComplete | AnimationPaused | ActionFailed | ClearFailures | SetAnimationsSpeed | GiveUp | PlayerQuit | MuteSounds | UnmuteSounds | GameOver<PlayerId> | StopLiveLog | StartLiveLog | EjectPlayer | PlayTutorialMoves;
19
- export declare function gameReducer<Game, Move, PlayerId>(context: GameReducerContext<Game, Move, PlayerId>): Reducer<GamePageState<Game, Move, PlayerId>, GameActions<Game, Move, PlayerId>>;
11
+ export declare function gameReducer(context?: GameReducerContext): Reducer<GamePageState>;
20
12
  export declare function getGameAfterAnimations<Game, Move, PlayerId>(state: GamePageState<Game, Move, PlayerId>, Rules: RulesCreator<Game, Move, PlayerId>): Rules<Game, Move, PlayerId>;
21
13
  export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: DisplayedAction<Move, PlayerId>[], previousState: Game): void;
22
14
  export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: DisplayedAction<Move, PlayerId>): void;
23
- export declare function isGameAction(action: unknown): action is GameActions;