@gamepark/react-client 6.38.5 → 7.0.0-beta.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/Actions/ActionFailed.d.ts +6 -6
- package/dist/Actions/ActionFailed.js +8 -8
- package/dist/Actions/ActionFailed.js.map +1 -1
- package/dist/Actions/ActionType.d.ts +3 -3
- package/dist/Actions/ActionType.js +7 -7
- package/dist/Actions/ActionType.js.map +1 -1
- package/dist/Actions/AnimationComplete.d.ts +6 -6
- package/dist/Actions/AnimationComplete.js +8 -8
- package/dist/Actions/AnimationComplete.js.map +1 -1
- package/dist/Actions/AnimationPaused.d.ts +6 -6
- package/dist/Actions/AnimationPaused.js +8 -8
- package/dist/Actions/AnimationPaused.js.map +1 -1
- package/dist/Actions/AnimationStart.d.ts +5 -5
- package/dist/Actions/AnimationStart.js +4 -4
- package/dist/Actions/ClearFailures.d.ts +5 -5
- package/dist/Actions/ClearFailures.js +8 -8
- package/dist/Actions/ClearFailures.js.map +1 -1
- package/dist/Actions/GameNotificationsReceived.d.ts +10 -10
- package/dist/Actions/GameNotificationsReceived.js +9 -9
- package/dist/Actions/GameNotificationsReceived.js.map +1 -1
- package/dist/Actions/GameOver.d.ts +16 -16
- package/dist/Actions/GameOver.js +8 -8
- package/dist/Actions/GameOver.js.map +1 -1
- package/dist/Actions/GameStateLoaded.d.ts +16 -16
- package/dist/Actions/GameStateLoaded.js +20 -20
- package/dist/Actions/GameStateLoaded.js.map +1 -1
- package/dist/Actions/MovePlayed.d.ts +11 -11
- package/dist/Actions/MovePlayed.js +4 -2
- package/dist/Actions/MovePlayed.js.map +1 -1
- package/dist/Actions/MoveUndone.d.ts +7 -7
- package/dist/Actions/MoveUndone.js +9 -9
- package/dist/Actions/MoveUndone.js.map +1 -1
- package/dist/Actions/PlayerQuit.d.ts +11 -11
- package/dist/Actions/PlayerQuit.js +19 -19
- package/dist/Actions/PlayerQuit.js.map +1 -1
- package/dist/Actions/SetAnimationsSpeed.d.ts +6 -6
- package/dist/Actions/SetAnimationsSpeed.js +8 -8
- package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
- package/dist/Actions/index.d.ts +11 -12
- package/dist/Actions/index.js +27 -28
- package/dist/Actions/index.js.map +1 -1
- package/dist/Chat/ChatChannel.d.ts +5 -5
- package/dist/Chat/ChatChannel.js +2 -2
- package/dist/Chat/Message.d.ts +6 -6
- package/dist/Chat/Message.js +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +18 -18
- package/dist/Deckbuilding/Deck.d.ts +5 -5
- package/dist/Deckbuilding/Deck.js +2 -2
- package/dist/Deckbuilding/index.d.ts +4 -4
- package/dist/Deckbuilding/index.js +24 -24
- package/dist/Deckbuilding/useDeleteDeck.d.ts +2 -2
- package/dist/Deckbuilding/useDeleteDeck.js +15 -15
- package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
- package/dist/Deckbuilding/useMyDecks.d.ts +2 -2
- package/dist/Deckbuilding/useMyDecks.js +14 -14
- package/dist/Deckbuilding/useMyDecks.js.map +1 -1
- package/dist/Deckbuilding/useSaveDeck.d.ts +2 -2
- package/dist/Deckbuilding/useSaveDeck.js +15 -15
- package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
- package/dist/EjectPlayer/EjectPlayer.d.ts +6 -6
- package/dist/EjectPlayer/EjectPlayer.js +8 -8
- package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
- package/dist/EjectPlayer/index.d.ts +1 -1
- package/dist/EjectPlayer/index.js +17 -17
- package/dist/Failure/Failure.d.ts +6 -6
- package/dist/Failure/Failure.js +9 -9
- package/dist/Failure/index.d.ts +1 -1
- package/dist/Failure/index.js +17 -17
- package/dist/GiveUp/GiveUp.d.ts +7 -7
- package/dist/GiveUp/GiveUp.js +5 -5
- package/dist/GiveUp/index.d.ts +1 -1
- package/dist/GiveUp/index.js +17 -17
- package/dist/Hooks/index.d.ts +5 -5
- package/dist/Hooks/index.js +21 -21
- package/dist/Hooks/useChatMessages.d.ts +12 -12
- package/dist/Hooks/useChatMessages.js +53 -51
- package/dist/Hooks/useChatMessages.js.map +1 -1
- package/dist/Hooks/useMessageAuthor.d.ts +4 -4
- package/dist/Hooks/useMessageAuthor.js +17 -18
- package/dist/Hooks/useMessageAuthor.js.map +1 -1
- package/dist/Hooks/useOptions.d.ts +2 -2
- package/dist/Hooks/useOptions.js +7 -8
- package/dist/Hooks/useOptions.js.map +1 -1
- package/dist/Hooks/useRematch.d.ts +7 -7
- package/dist/Hooks/useRematch.js +22 -19
- package/dist/Hooks/useRematch.js.map +1 -1
- package/dist/Hooks/useSendMessage.d.ts +1 -1
- package/dist/Hooks/useSendMessage.js +13 -14
- package/dist/Hooks/useSendMessage.js.map +1 -1
- package/dist/Log/StartLiveLog.d.ts +4 -4
- package/dist/Log/StartLiveLog.js +4 -4
- package/dist/Log/StopLiveLog.d.ts +5 -5
- package/dist/Log/StopLiveLog.js +8 -8
- package/dist/Log/StopLiveLog.js.map +1 -1
- package/dist/Log/index.d.ts +4 -4
- package/dist/Log/index.js +20 -20
- package/dist/Log/useLogControls.d.ts +7 -7
- package/dist/Log/useLogControls.js +21 -22
- package/dist/Log/useLogControls.js.map +1 -1
- package/dist/PlayerTime/PlayerTime.d.ts +11 -11
- package/dist/PlayerTime/PlayerTime.js +2 -2
- package/dist/PlayerTime/index.d.ts +1 -1
- package/dist/PlayerTime/index.js +17 -17
- package/dist/Rematch/RematchQueries.d.ts +19 -19
- package/dist/Rematch/RematchQueries.js +13 -13
- package/dist/Rematch/index.d.ts +1 -1
- package/dist/Rematch/index.js +17 -17
- package/dist/Sound/MuteSounds.d.ts +5 -5
- package/dist/Sound/MuteSounds.js +9 -9
- package/dist/Sound/MuteSounds.js.map +1 -1
- package/dist/Sound/UnmuteSounds.d.ts +4 -4
- package/dist/Sound/UnmuteSounds.js +4 -4
- package/dist/Sound/index.d.ts +3 -3
- package/dist/Sound/index.js +19 -19
- package/dist/Sound/useSoundControls.d.ts +7 -7
- package/dist/Sound/useSoundControls.js +21 -22
- package/dist/Sound/useSoundControls.js.map +1 -1
- package/dist/Store/DisplayedAction.d.ts +15 -15
- package/dist/Store/DisplayedAction.js +18 -19
- package/dist/Store/DisplayedAction.js.map +1 -1
- package/dist/Store/GamePageState.d.ts +28 -28
- package/dist/Store/GamePageState.js +2 -2
- package/dist/Store/PlayedMove.d.ts +5 -5
- package/dist/Store/PlayedMove.js +2 -2
- package/dist/Store/gameMiddleware.d.ts +4 -4
- package/dist/Store/gameMiddleware.js +45 -41
- package/dist/Store/gameMiddleware.js.map +1 -1
- package/dist/Store/gameReducer.d.ts +23 -20
- package/dist/Store/gameReducer.js +538 -525
- package/dist/Store/gameReducer.js.map +1 -1
- package/dist/Store/index.d.ts +3 -3
- package/dist/Store/index.js +19 -19
- package/dist/Store/localMovePreviewMiddleware.d.ts +4 -4
- package/dist/Store/localMovePreviewMiddleware.js +17 -18
- package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
- package/dist/Tutorial/PlayTutorialMoves.d.ts +9 -9
- package/dist/Tutorial/PlayTutorialMoves.js +6 -6
- package/dist/Tutorial/Tutorial.d.ts +5 -5
- package/dist/Tutorial/Tutorial.js +2 -2
- package/dist/Tutorial/TutorialDescription.d.ts +7 -7
- package/dist/Tutorial/TutorialDescription.js +2 -2
- package/dist/Tutorial/index.d.ts +4 -4
- package/dist/Tutorial/index.js +20 -20
- package/dist/Tutorial/useTutorial.d.ts +2 -2
- package/dist/Tutorial/useTutorial.js +21 -22
- package/dist/Tutorial/useTutorial.js.map +1 -1
- package/dist/Types/GameAI.d.ts +1 -1
- package/dist/Types/GameAI.js +2 -2
- package/dist/Types/GameData.d.ts +18 -18
- package/dist/Types/GameData.js +2 -2
- package/dist/Types/GameMessage.d.ts +8 -8
- package/dist/Types/GameMessage.js +2 -2
- package/dist/Types/GameMode.d.ts +6 -6
- package/dist/Types/GameMode.js +10 -10
- package/dist/Types/GameMode.js.map +1 -1
- package/dist/Types/GameNotification.d.ts +6 -6
- package/dist/Types/GameNotification.js +2 -2
- package/dist/Types/GameOptions.d.ts +9 -9
- package/dist/Types/GameOptions.js +8 -8
- package/dist/Types/GameOptions.js.map +1 -1
- package/dist/Types/MovePlayedNotification.d.ts +9 -9
- package/dist/Types/MovePlayedNotification.js +11 -12
- package/dist/Types/MovePlayedNotification.js.map +1 -1
- package/dist/Types/MoveUndoneNotification.d.ts +8 -8
- package/dist/Types/MoveUndoneNotification.js +11 -12
- package/dist/Types/MoveUndoneNotification.js.map +1 -1
- package/dist/Types/Player.d.ts +13 -13
- package/dist/Types/Player.js +2 -2
- package/dist/Types/PlayerQuitReason.d.ts +4 -4
- package/dist/Types/PlayerQuitReason.js +8 -8
- package/dist/Types/PlayerQuitReason.js.map +1 -1
- package/dist/Types/ProxyGameData.d.ts +13 -13
- package/dist/Types/ProxyGameData.js +2 -2
- package/dist/Types/Tournament.d.ts +4 -4
- package/dist/Types/Tournament.js +2 -2
- package/dist/Types/index.d.ts +12 -12
- package/dist/Types/index.js +28 -28
- package/dist/User/User.d.ts +6 -6
- package/dist/User/User.js +2 -2
- package/dist/User/index.d.ts +2 -2
- package/dist/User/index.js +18 -18
- package/dist/User/useMe.d.ts +4 -4
- package/dist/User/useMe.js +20 -21
- package/dist/User/useMe.js.map +1 -1
- package/dist/animations/Animation.d.ts +6 -6
- package/dist/animations/Animation.js +2 -2
- package/dist/animations/AnimationContext.d.ts +8 -8
- package/dist/animations/AnimationContext.js +2 -2
- package/dist/animations/AnimationState.d.ts +6 -6
- package/dist/animations/AnimationState.js +2 -2
- package/dist/animations/AnimationStep.d.ts +6 -6
- package/dist/animations/AnimationStep.js +10 -10
- package/dist/animations/AnimationStep.js.map +1 -1
- package/dist/animations/Animations.d.ts +8 -8
- package/dist/animations/Animations.js +22 -22
- package/dist/animations/Animations.js.map +1 -1
- package/dist/animations/AnimationsListenerCreator.d.ts +5 -4
- package/dist/animations/AnimationsListenerCreator.js +46 -50
- package/dist/animations/AnimationsListenerCreator.js.map +1 -1
- package/dist/animations/index.d.ts +6 -6
- package/dist/animations/index.js +22 -22
- package/dist/api/Client/GameClientAPI.d.ts +25 -24
- package/dist/api/Client/GameClientAPI.js +166 -166
- package/dist/api/Client/GameClientAPI.js.map +1 -1
- package/dist/api/Client/GameNotificationsListener.d.ts +5 -5
- package/dist/api/Client/GameNotificationsListener.js +116 -114
- package/dist/api/Client/GameNotificationsListener.js.map +1 -1
- package/dist/api/Client/RemoteGameLoader.d.ts +4 -5
- package/dist/api/Client/RemoteGameLoader.js +61 -62
- package/dist/api/Client/RemoteGameLoader.js.map +1 -1
- package/dist/api/Client/RemoteGameProvider.d.ts +7 -7
- package/dist/api/Client/RemoteGameProvider.js +55 -70
- package/dist/api/Client/RemoteGameProvider.js.map +1 -1
- package/dist/api/Client/apollo-client.d.ts +2 -2
- package/dist/api/Client/apollo-client.js +57 -58
- package/dist/api/Client/apollo-client.js.map +1 -1
- package/dist/api/Client/index.d.ts +4 -3
- package/dist/api/Client/index.js +20 -19
- package/dist/api/Client/index.js.map +1 -1
- package/dist/api/Client/pusher.d.ts +2 -0
- package/dist/api/Client/pusher.js +16 -0
- package/dist/api/Client/pusher.js.map +1 -0
- package/dist/api/GameAPI.d.ts +11 -10
- package/dist/api/GameAPI.js +2 -2
- package/dist/api/Local/ConsoleTools.d.ts +26 -25
- package/dist/api/Local/ConsoleTools.js +85 -86
- package/dist/api/Local/ConsoleTools.js.map +1 -1
- package/dist/api/Local/GameLocalAPI.d.ts +45 -44
- package/dist/api/Local/GameLocalAPI.js +541 -540
- package/dist/api/Local/GameLocalAPI.js.map +1 -1
- package/dist/api/Local/LocalGameProvider.d.ts +15 -15
- package/dist/api/Local/LocalGameProvider.js +49 -58
- package/dist/api/Local/LocalGameProvider.js.map +1 -1
- package/dist/api/Local/index.d.ts +1 -1
- package/dist/api/Local/index.js +17 -17
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +36 -36
- package/dist/util/ArrayUtil.d.ts +2 -2
- package/dist/util/ArrayUtil.js +20 -21
- package/dist/util/ArrayUtil.js.map +1 -1
- package/package.json +19 -22
package/dist/Hooks/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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("./useChatMessages"), exports);
|
|
18
|
-
__exportStar(require("./useMessageAuthor"), exports);
|
|
19
|
-
__exportStar(require("./useOptions"), exports);
|
|
20
|
-
__exportStar(require("./useRematch"), exports);
|
|
21
|
-
__exportStar(require("./useSendMessage"), exports);
|
|
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("./useChatMessages"), exports);
|
|
18
|
+
__exportStar(require("./useMessageAuthor"), exports);
|
|
19
|
+
__exportStar(require("./useOptions"), exports);
|
|
20
|
+
__exportStar(require("./useRematch"), exports);
|
|
21
|
+
__exportStar(require("./useSendMessage"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Message } from '../Chat';
|
|
2
|
-
export declare function useChatMessages(gameId: string, onMessageReceived?: (message: Message) => void): {
|
|
3
|
-
messages: Message[];
|
|
4
|
-
hasMoreMessages: boolean;
|
|
5
|
-
loading: boolean;
|
|
6
|
-
fetchMore: <TFetchData = any, TFetchVars extends import("@apollo/client").OperationVariables = import("@apollo/client").OperationVariables>(fetchMoreOptions: import("@apollo/client").FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
|
7
|
-
updateQuery?: ((previousQueryResult: any, options: {
|
|
8
|
-
fetchMoreResult: TFetchData;
|
|
9
|
-
variables: TFetchVars;
|
|
10
|
-
}) => any) | undefined;
|
|
11
|
-
}) => Promise<import("@apollo/client").ApolloQueryResult<TFetchData>>;
|
|
12
|
-
};
|
|
1
|
+
import { Message } from '../Chat';
|
|
2
|
+
export declare function useChatMessages(gameId: string, onMessageReceived?: (message: Message) => void): {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
hasMoreMessages: boolean;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
fetchMore: <TFetchData = any, TFetchVars extends import("@apollo/client").OperationVariables = import("@apollo/client").OperationVariables>(fetchMoreOptions: import("@apollo/client").FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
|
7
|
+
updateQuery?: ((previousQueryResult: any, options: {
|
|
8
|
+
fetchMoreResult: TFetchData;
|
|
9
|
+
variables: TFetchVars;
|
|
10
|
+
}) => any) | undefined;
|
|
11
|
+
}) => Promise<import("@apollo/client").ApolloQueryResult<TFetchData>>;
|
|
12
|
+
};
|
|
@@ -1,52 +1,54 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.useChatMessages =
|
|
19
|
-
var client_1 = require("@apollo/client");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var GET_CHAT_MESSAGES = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["query ChatMessages($channel: String!, $limit: Int, $maxDate: DateTime) {\n chatChannel(name: $channel) {\n name\n messages(limit: $limit, maxDate: $maxDate) {\n id userId text date\n }\n }\n}"], ["query ChatMessages($channel: String!, $limit: Int, $maxDate: DateTime) {\n chatChannel(name: $channel) {\n name\n messages(limit: $limit, maxDate: $maxDate) {\n id userId text date\n }\n }\n}"])));
|
|
23
|
-
function useChatMessages(gameId, onMessageReceived) {
|
|
24
|
-
var _a;
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onMessageReceived
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.useChatMessages = useChatMessages;
|
|
19
|
+
var client_1 = require("@apollo/client");
|
|
20
|
+
var react_1 = require("react");
|
|
21
|
+
var api_1 = require("../api");
|
|
22
|
+
var GET_CHAT_MESSAGES = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["query ChatMessages($channel: String!, $limit: Int, $maxDate: DateTime) {\n chatChannel(name: $channel) {\n name\n messages(limit: $limit, maxDate: $maxDate) {\n id userId text date\n }\n }\n}"], ["query ChatMessages($channel: String!, $limit: Int, $maxDate: DateTime) {\n chatChannel(name: $channel) {\n name\n messages(limit: $limit, maxDate: $maxDate) {\n id userId text date\n }\n }\n}"])));
|
|
23
|
+
function useChatMessages(gameId, onMessageReceived) {
|
|
24
|
+
var _a;
|
|
25
|
+
var _b = (0, react_1.useState)(false), subscribed = _b[0], setSubscribed = _b[1];
|
|
26
|
+
var _c = (0, react_1.useState)(false), hasMoreMessages = _c[0], setHasMoreMessages = _c[1];
|
|
27
|
+
var _d = (0, client_1.useQuery)(GET_CHAT_MESSAGES, {
|
|
28
|
+
variables: { channel: "game=".concat(gameId) }, skip: !subscribed,
|
|
29
|
+
onCompleted: function (_a) {
|
|
30
|
+
var messages = _a.chatChannel.messages;
|
|
31
|
+
return setHasMoreMessages(messages.length === 10);
|
|
32
|
+
}
|
|
33
|
+
}), data = _d.data, loading = _d.loading, fetchMore = _d.fetchMore, client = _d.client;
|
|
34
|
+
var messages = (_a = data === null || data === void 0 ? void 0 : data.chatChannel.messages) !== null && _a !== void 0 ? _a : [];
|
|
35
|
+
(0, react_1.useEffect)(function () {
|
|
36
|
+
var channel = api_1.pusherClient.subscribe("game=".concat(gameId));
|
|
37
|
+
channel.bind('pusher:subscription_succeeded', function () { return setSubscribed(true); });
|
|
38
|
+
channel.bind('message', function (message) {
|
|
39
|
+
if (message) {
|
|
40
|
+
client.writeFragment({
|
|
41
|
+
id: "ChatChannel:{\"name\":\"game=".concat(gameId, "\"}"),
|
|
42
|
+
fragment: (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["fragment ChatMessages on ChatChannel { messages { id userId text date } }"], ["fragment ChatMessages on ChatChannel { messages { id userId text date } }"]))),
|
|
43
|
+
data: { messages: [__assign({ __typename: 'Message' }, message)] }
|
|
44
|
+
});
|
|
45
|
+
if (onMessageReceived)
|
|
46
|
+
onMessageReceived(message);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return function () { return api_1.pusherClient.unsubscribe("game=".concat(gameId)); };
|
|
50
|
+
}, []);
|
|
51
|
+
return { messages: messages, hasMoreMessages: hasMoreMessages, loading: loading, fetchMore: fetchMore };
|
|
52
|
+
}
|
|
53
|
+
var templateObject_1, templateObject_2;
|
|
52
54
|
//# sourceMappingURL=useChatMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatMessages.js","sourceRoot":"","sources":["../../src/Hooks/useChatMessages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChatMessages.js","sourceRoot":"","sources":["../../src/Hooks/useChatMessages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAcA,0CA2BC;AAzCD,yCAA8C;AAC9C,+BAA2C;AAC3C,8BAAqC;AAGrC,IAAM,iBAAiB,OAAG,YAAG,qRAAA,iNAO3B,IAAA,CAAA;AAEF,SAAgB,eAAe,CAAC,MAAc,EAAE,iBAA8C;;IACtF,IAAA,KAA8B,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAA5C,UAAU,QAAA,EAAE,aAAa,QAAmB,CAAA;IAC7C,IAAA,KAAwC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtD,eAAe,QAAA,EAAE,kBAAkB,QAAmB,CAAA;IACvD,IAAA,KAAuC,IAAA,iBAAQ,EAAC,iBAAiB,EAAE;QACvE,SAAS,EAAE,EAAE,OAAO,EAAE,eAAQ,MAAM,CAAE,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU;QAC3D,WAAW,EAAE,UAAC,EAA2D;gBAA1C,QAAQ,0BAAA;YAAuC,OAAA,kBAAkB,CAAC,QAAQ,CAAC,MAAM,KAAK,EAAE,CAAC;QAA1C,CAA0C;KACzH,CAAC,EAHM,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAGtC,CAAA;IACF,IAAM,QAAQ,GAAc,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC,QAAQ,mCAAI,EAAE,CAAA;IAE5D,IAAA,iBAAS,EAAC;QACR,IAAM,OAAO,GAAG,kBAAY,CAAC,SAAS,CAAC,eAAQ,MAAM,CAAE,CAAC,CAAA;QAExD,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,cAAM,OAAA,aAAa,CAAC,IAAI,CAAC,EAAnB,CAAmB,CAAC,CAAA;QACxE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAC,OAAgB;YACvC,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,CAAC,aAAa,CAAC;oBACnB,EAAE,EAAE,uCAA6B,MAAM,QAAI;oBAC3C,QAAQ,MAAE,YAAG,gJAAA,4EAA4E,IAAA;oBACzF,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAG,UAAU,EAAE,SAAS,IAAK,OAAO,EAAG,EAAE;iBAC5D,CAAC,CAAA;gBACF,IAAI,iBAAiB;oBAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;YACnD,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,cAAM,OAAA,kBAAY,CAAC,WAAW,CAAC,eAAQ,MAAM,CAAE,CAAC,EAA1C,CAA0C,CAAA;IACzD,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,EAAE,QAAQ,UAAA,EAAE,eAAe,iBAAA,EAAE,OAAO,SAAA,EAAE,SAAS,WAAA,EAAE,CAAA;AAC1D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useMessageAuthor(author: string): {
|
|
2
|
-
avatar: any;
|
|
3
|
-
name: string | undefined;
|
|
4
|
-
};
|
|
1
|
+
export declare function useMessageAuthor(author: string): {
|
|
2
|
+
avatar: any;
|
|
3
|
+
name: string | undefined;
|
|
4
|
+
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMessageAuthor =
|
|
4
|
-
var client_1 = require("@apollo/client");
|
|
5
|
-
var react_redux_1 = require("react-redux");
|
|
6
|
-
var GameClientAPI_1 = require("../api/Client/GameClientAPI");
|
|
7
|
-
var query = new URLSearchParams(window.location.search);
|
|
8
|
-
function useMessageAuthor(author) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
var players = (0, react_redux_1.useSelector)(function (state) { return state.players; });
|
|
11
|
-
var player = players.find(function (p) { return p.userId === author; });
|
|
12
|
-
var skip = !!player || query.get('game') === null;
|
|
13
|
-
var data = (0, client_1.useQuery)(GameClientAPI_1.GET_MESSAGE_AUTHOR, { variables: { id: author }, skip: skip }).data;
|
|
14
|
-
var avatar = (_a = player === null || player === void 0 ? void 0 : player.avatar) !== null && _a !== void 0 ? _a : data === null || data === void 0 ? void 0 : data.user.avatar;
|
|
15
|
-
var name = (_b = player === null || player === void 0 ? void 0 : player.name) !== null && _b !== void 0 ? _b : data === null || data === void 0 ? void 0 : data.user.name;
|
|
16
|
-
return { avatar: avatar, name: name };
|
|
17
|
-
}
|
|
18
|
-
exports.useMessageAuthor = useMessageAuthor;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMessageAuthor = useMessageAuthor;
|
|
4
|
+
var client_1 = require("@apollo/client");
|
|
5
|
+
var react_redux_1 = require("react-redux");
|
|
6
|
+
var GameClientAPI_1 = require("../api/Client/GameClientAPI");
|
|
7
|
+
var query = new URLSearchParams(window.location.search);
|
|
8
|
+
function useMessageAuthor(author) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
var players = (0, react_redux_1.useSelector)(function (state) { return state.players; });
|
|
11
|
+
var player = players.find(function (p) { return p.userId === author; });
|
|
12
|
+
var skip = !!player || query.get('game') === null;
|
|
13
|
+
var data = (0, client_1.useQuery)(GameClientAPI_1.GET_MESSAGE_AUTHOR, { variables: { id: author }, skip: skip }).data;
|
|
14
|
+
var avatar = (_a = player === null || player === void 0 ? void 0 : player.avatar) !== null && _a !== void 0 ? _a : data === null || data === void 0 ? void 0 : data.user.avatar;
|
|
15
|
+
var name = (_b = player === null || player === void 0 ? void 0 : player.name) !== null && _b !== void 0 ? _b : data === null || data === void 0 ? void 0 : data.user.name;
|
|
16
|
+
return { avatar: avatar, name: name };
|
|
17
|
+
}
|
|
19
18
|
//# sourceMappingURL=useMessageAuthor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageAuthor.js","sourceRoot":"","sources":["../../src/Hooks/useMessageAuthor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMessageAuthor.js","sourceRoot":"","sources":["../../src/Hooks/useMessageAuthor.ts"],"names":[],"mappings":";;AAOA,4CASC;AAhBD,yCAAyC;AACzC,2CAAyC;AACzC,6DAAgE;AAIhE,IAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACzD,SAAgB,gBAAgB,CAAC,MAAc;;IAE7C,IAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAoB,IAAK,OAAA,KAAK,CAAC,OAAO,EAAb,CAAa,CAAC,CAAA;IACpE,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,KAAK,MAAM,EAAnB,CAAmB,CAAC,CAAA;IACrD,IAAM,IAAI,GAAG,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IAC3C,IAAA,IAAI,GAAK,IAAA,iBAAQ,EAAiB,kCAAkB,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAA5F,CAA4F;IACxG,IAAM,MAAM,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,mCAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,MAAM,CAAA;IAClD,IAAM,IAAI,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,IAAI,CAAA;IAC5C,OAAO,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,CAAA;AACzB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GameOptions } from '../Types';
|
|
2
|
-
export declare function useOptions(): GameOptions | undefined;
|
|
1
|
+
import { GameOptions } from '../Types';
|
|
2
|
+
export declare function useOptions(): GameOptions | undefined;
|
package/dist/Hooks/useOptions.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useOptions =
|
|
4
|
-
var react_redux_1 = require("react-redux");
|
|
5
|
-
function useOptions() {
|
|
6
|
-
return (0, react_redux_1.useSelector)(function (state) { return state.options; });
|
|
7
|
-
}
|
|
8
|
-
exports.useOptions = useOptions;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOptions = useOptions;
|
|
4
|
+
var react_redux_1 = require("react-redux");
|
|
5
|
+
function useOptions() {
|
|
6
|
+
return (0, react_redux_1.useSelector)(function (state) { return state.options; });
|
|
7
|
+
}
|
|
9
8
|
//# sourceMappingURL=useOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOptions.js","sourceRoot":"","sources":["../../src/Hooks/useOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useOptions.js","sourceRoot":"","sources":["../../src/Hooks/useOptions.ts"],"names":[],"mappings":";;AAIA,gCAEC;AAND,2CAAyC;AAIzC,SAAgB,UAAU;IACxB,OAAO,IAAA,yBAAW,EAAC,UAAC,KAAoB,IAAK,OAAA,KAAK,CAAC,OAAO,EAAb,CAAa,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CanRematchData } from '../Rematch';
|
|
2
|
-
export declare function useRematch(): {
|
|
3
|
-
game: CanRematchData | undefined;
|
|
4
|
-
rematch: () => Promise<import("@apollo/client").FetchResult<any
|
|
5
|
-
game: CanRematchData;
|
|
6
|
-
}>>;
|
|
7
|
-
};
|
|
1
|
+
import { CanRematchData } from '../Rematch';
|
|
2
|
+
export declare function useRematch(): {
|
|
3
|
+
game: CanRematchData | undefined;
|
|
4
|
+
rematch: () => Promise<import("@apollo/client").FetchResult<any> | import("@apollo/client").ApolloQueryResult<{
|
|
5
|
+
game: CanRematchData;
|
|
6
|
+
}>>;
|
|
7
|
+
};
|
package/dist/Hooks/useRematch.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useRematch =
|
|
4
|
-
var client_1 = require("@apollo/client");
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
(0,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRematch = useRematch;
|
|
4
|
+
var client_1 = require("@apollo/client");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var api_1 = require("../api");
|
|
7
|
+
var Rematch_1 = require("../Rematch");
|
|
8
|
+
function useRematch() {
|
|
9
|
+
var _a;
|
|
10
|
+
var query = new URLSearchParams(window.location.search);
|
|
11
|
+
var gameId = query.get('game');
|
|
12
|
+
var canRematchResult = (0, client_1.useQuery)(Rematch_1.CAN_REMATCH, { variables: { id: gameId } });
|
|
13
|
+
var game = (_a = canRematchResult.data) === null || _a === void 0 ? void 0 : _a.game;
|
|
14
|
+
var rematch = (0, client_1.useMutation)(Rematch_1.REMATCH)[0];
|
|
15
|
+
(0, react_1.useEffect)(function () {
|
|
16
|
+
var channel = api_1.pusherClient.subscribe('rematch=' + gameId);
|
|
17
|
+
channel.bind('rematch', function () { return canRematchResult.refetch(); });
|
|
18
|
+
channel.bind('pusher:subscription_succeeded', function () { return canRematchResult.refetch(); });
|
|
19
|
+
return function () { return api_1.pusherClient.unsubscribe('rematch=' + gameId); };
|
|
20
|
+
}, []);
|
|
21
|
+
return { game: game, rematch: function () { return rematch({ variables: { gameId: gameId } }).catch(function () { return canRematchResult.refetch(); }); } };
|
|
22
|
+
}
|
|
20
23
|
//# sourceMappingURL=useRematch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRematch.js","sourceRoot":"","sources":["../../src/Hooks/useRematch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRematch.js","sourceRoot":"","sources":["../../src/Hooks/useRematch.ts"],"names":[],"mappings":";;AAKA,gCAaC;AAlBD,yCAAsD;AACtD,+BAAiC;AACjC,8BAAqC;AACrC,sCAAiE;AAEjE,SAAgB,UAAU;;IACxB,IAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAChC,IAAM,gBAAgB,GAAG,IAAA,iBAAQ,EAA2B,qBAAW,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;IACvG,IAAM,IAAI,GAAG,MAAA,gBAAgB,CAAC,IAAI,0CAAE,IAAI,CAAA;IACjC,IAAA,OAAO,GAAI,IAAA,oBAAW,EAAC,iBAAO,CAAC,GAAxB,CAAwB;IACtC,IAAA,iBAAS,EAAC;QACR,IAAM,OAAO,GAAG,kBAAY,CAAC,SAAS,CAAC,UAAU,GAAG,MAAM,CAAC,CAAA;QAC3D,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,cAAM,OAAA,gBAAgB,CAAC,OAAO,EAAE,EAA1B,CAA0B,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,cAAM,OAAA,gBAAgB,CAAC,OAAO,EAAE,EAA1B,CAA0B,CAAC,CAAA;QAC/E,OAAO,cAAM,OAAA,kBAAY,CAAC,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,EAA7C,CAA6C,CAAA;IAC5D,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,EAAE,IAAI,MAAA,EAAE,OAAO,EAAE,cAAM,OAAA,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,QAAA,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,gBAAgB,CAAC,OAAO,EAAE,EAA1B,CAA0B,CAAC,EAA1E,CAA0E,EAAE,CAAA;AAC5G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useSendMessage(): import("@apollo/client").MutationTuple<any, import("@apollo/client").OperationVariables, import("@apollo/client").DefaultContext, import("@apollo/client").ApolloCache<any>>;
|
|
1
|
+
export declare function useSendMessage(): import("@apollo/client").MutationTuple<any, import("@apollo/client").OperationVariables, import("@apollo/client").DefaultContext, import("@apollo/client").ApolloCache<any>>;
|
|
@@ -1,15 +1,14 @@
|
|
|
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 =
|
|
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);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
var templateObject_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
|
+
};
|
|
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);
|
|
12
|
+
}
|
|
13
|
+
var templateObject_1;
|
|
15
14
|
//# sourceMappingURL=useSendMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSendMessage.js","sourceRoot":"","sources":["../../src/Hooks/useSendMessage.ts"],"names":[],"mappings":"
|
|
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,4 +1,4 @@
|
|
|
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 START_LIVE_LOG = "START_LIVE_LOG";
|
|
2
|
+
export interface StartLiveLog {
|
|
3
|
+
type: typeof START_LIVE_LOG;
|
|
4
|
+
}
|
package/dist/Log/StartLiveLog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
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
5
|
//# sourceMappingURL=StartLiveLog.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const STOP_LIVE_LOG = "STOP_LIVE_LOG";
|
|
2
|
-
export interface StopLiveLog {
|
|
3
|
-
type: typeof STOP_LIVE_LOG;
|
|
4
|
-
}
|
|
5
|
-
export declare function liveLogStopped(): boolean;
|
|
1
|
+
export declare const STOP_LIVE_LOG = "STOP_LIVE_LOG";
|
|
2
|
+
export interface StopLiveLog {
|
|
3
|
+
type: typeof STOP_LIVE_LOG;
|
|
4
|
+
}
|
|
5
|
+
export declare function liveLogStopped(): boolean;
|
package/dist/Log/StopLiveLog.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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() {
|
|
7
|
+
return !!localStorage.getItem('liveLogStopped');
|
|
8
|
+
}
|
|
9
9
|
//# sourceMappingURL=StopLiveLog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StopLiveLog.js","sourceRoot":"","sources":["../../src/Log/StopLiveLog.ts"],"names":[],"mappings":";;;
|
|
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"}
|
package/dist/Log/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './useLogControls';
|
|
2
|
-
export * from './StartLiveLog';
|
|
3
|
-
export * from './StopLiveLog';
|
|
4
|
-
export * from './useLogControls';
|
|
1
|
+
export * from './useLogControls';
|
|
2
|
+
export * from './StartLiveLog';
|
|
3
|
+
export * from './StopLiveLog';
|
|
4
|
+
export * from './useLogControls';
|
package/dist/Log/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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
|
+
"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);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type UseLogControls = {
|
|
2
|
-
start: () => void;
|
|
3
|
-
stop: () => void;
|
|
4
|
-
stopped: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare function useLogControls(): UseLogControls;
|
|
7
|
-
export {};
|
|
1
|
+
type UseLogControls = {
|
|
2
|
+
start: () => void;
|
|
3
|
+
stop: () => void;
|
|
4
|
+
stopped: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function useLogControls(): UseLogControls;
|
|
7
|
+
export {};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.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)();
|
|
10
|
-
return {
|
|
11
|
-
stop: function () {
|
|
12
|
-
dispatch({ type: StopLiveLog_1.STOP_LIVE_LOG });
|
|
13
|
-
localStorage.setItem('liveLogStopped', 'true');
|
|
14
|
-
},
|
|
15
|
-
start: function () {
|
|
16
|
-
dispatch({ type: StartLiveLog_1.START_LIVE_LOG });
|
|
17
|
-
localStorage.removeItem('liveLogStopped');
|
|
18
|
-
},
|
|
19
|
-
stopped: stopped
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
exports.useLogControls = useLogControls;
|
|
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)();
|
|
10
|
+
return {
|
|
11
|
+
stop: function () {
|
|
12
|
+
dispatch({ type: StopLiveLog_1.STOP_LIVE_LOG });
|
|
13
|
+
localStorage.setItem('liveLogStopped', 'true');
|
|
14
|
+
},
|
|
15
|
+
start: function () {
|
|
16
|
+
dispatch({ type: StartLiveLog_1.START_LIVE_LOG });
|
|
17
|
+
localStorage.removeItem('liveLogStopped');
|
|
18
|
+
},
|
|
19
|
+
stopped: stopped
|
|
20
|
+
};
|
|
21
|
+
}
|
|
23
22
|
//# sourceMappingURL=useLogControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogControls.js","sourceRoot":"","sources":["../../src/Log/useLogControls.ts"],"names":[],"mappings":"
|
|
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,11 +1,11 @@
|
|
|
1
|
-
export type PlayerTime = {
|
|
2
|
-
playing: boolean;
|
|
3
|
-
lastChange: string;
|
|
4
|
-
availableTime: number | null;
|
|
5
|
-
highestPlayTime: number;
|
|
6
|
-
highestDownTime: number;
|
|
7
|
-
cumulatedPlayTime: number;
|
|
8
|
-
cumulatedDownTime: number;
|
|
9
|
-
cumulatedWaitForMeTime: number;
|
|
10
|
-
weightedWaitForMeTime: number;
|
|
11
|
-
};
|
|
1
|
+
export type PlayerTime = {
|
|
2
|
+
playing: boolean;
|
|
3
|
+
lastChange: string;
|
|
4
|
+
availableTime: number | null;
|
|
5
|
+
highestPlayTime: number;
|
|
6
|
+
highestDownTime: number;
|
|
7
|
+
cumulatedPlayTime: number;
|
|
8
|
+
cumulatedDownTime: number;
|
|
9
|
+
cumulatedWaitForMeTime: number;
|
|
10
|
+
weightedWaitForMeTime: number;
|
|
11
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=PlayerTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './PlayerTime';
|
|
1
|
+
export * from './PlayerTime';
|