valtech-components 4.0.376 → 4.0.377
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/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +221 -20
- package/esm2022/lib/components/organisms/mini-games/chessimals-online.service.mjs +129 -9
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +41 -1
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +387 -26
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +16 -2
- package/lib/components/organisms/mini-games/chessimals-online.service.d.ts +10 -1
- package/lib/components/organisms/mini-games/types.d.ts +22 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameState, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
2
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
3
3
|
import { UserAvatarMetadata } from '../../atoms/user-avatar/types';
|
|
4
4
|
import { ButtonMetadata } from '../../types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -29,6 +29,9 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
29
29
|
private botTurnTimer;
|
|
30
30
|
private readonly routeSubscription;
|
|
31
31
|
private onlineSubscription;
|
|
32
|
+
private historySubscription;
|
|
33
|
+
private historyUid;
|
|
34
|
+
private historyWatchTimer;
|
|
32
35
|
private pendingOnlineGameId;
|
|
33
36
|
private openingOnlineGameId;
|
|
34
37
|
private openedOnlineGameId;
|
|
@@ -53,6 +56,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
53
56
|
readonly onlineLoading: import("@angular/core").WritableSignal<boolean>;
|
|
54
57
|
readonly onlineError: import("@angular/core").WritableSignal<string>;
|
|
55
58
|
readonly onlineUid: import("@angular/core").WritableSignal<string>;
|
|
59
|
+
readonly onlineHistory: import("@angular/core").WritableSignal<ChessimalsHistoryEntry[]>;
|
|
56
60
|
readonly resumeSplashVisible: import("@angular/core").WritableSignal<boolean>;
|
|
57
61
|
readonly loggedInUser: import("@angular/core").Signal<import("valtech-components").AuthUser>;
|
|
58
62
|
readonly localPlayerProfile: import("@angular/core").Signal<import("./types").MiniGamePlayerProfile>;
|
|
@@ -71,7 +75,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
71
75
|
readonly displayRows: import("@angular/core").Signal<number[]>;
|
|
72
76
|
readonly displayCols: import("@angular/core").Signal<number[]>;
|
|
73
77
|
readonly boardOrientationColor: import("@angular/core").Signal<ChessimalsPlayerColor>;
|
|
74
|
-
readonly onlineRole: import("@angular/core").Signal<"waiting" | ChessimalsPlayerColor | "spectator">;
|
|
78
|
+
readonly onlineRole: import("@angular/core").Signal<"waiting" | "pending" | ChessimalsPlayerColor | "spectator">;
|
|
75
79
|
readonly canPlayCurrentTurn: import("@angular/core").Signal<boolean>;
|
|
76
80
|
readonly currentTurnTitle: import("@angular/core").Signal<string>;
|
|
77
81
|
readonly winTitle: import("@angular/core").Signal<string>;
|
|
@@ -128,7 +132,17 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
128
132
|
normalizeGameId(value: string): string;
|
|
129
133
|
copyOnlineLink(): Promise<void>;
|
|
130
134
|
shareOnlineLink(): Promise<void>;
|
|
135
|
+
canReviewPendingGuest(): boolean;
|
|
136
|
+
pendingGuestName(): string;
|
|
137
|
+
waitingTitle(): string;
|
|
138
|
+
waitingBody(): string;
|
|
139
|
+
acceptOnlineGuest(): Promise<void>;
|
|
140
|
+
rejectOnlineGuest(): Promise<void>;
|
|
141
|
+
openHistoryGame(entry: ChessimalsHistoryEntry): void;
|
|
142
|
+
historyOutcomeLabel(entry: ChessimalsHistoryEntry): string;
|
|
131
143
|
requestOnlineRematch(): Promise<void>;
|
|
144
|
+
private queueHistoryWatch;
|
|
145
|
+
private watchOnlineHistory;
|
|
132
146
|
unlockedLabel(color: ChessimalsPlayerColor): string;
|
|
133
147
|
localModeLabel(mode: ChessimalsLocalMode): string;
|
|
134
148
|
localModeDescription(mode: ChessimalsLocalMode): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ChessimalsBoardSize, ChessimalsGameState, ChessimalsMove, ChessimalsPlayerColor } from './types';
|
|
2
|
+
import { ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsMove, ChessimalsPlayerColor } from './types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ChessimalsOnlineService {
|
|
5
5
|
private readonly auth;
|
|
@@ -11,7 +11,10 @@ export declare class ChessimalsOnlineService {
|
|
|
11
11
|
isValidGameId(value: string): boolean;
|
|
12
12
|
createGame(boardSize: ChessimalsBoardSize): Promise<ChessimalsGameState>;
|
|
13
13
|
watchGame(gameId: string): Observable<ChessimalsGameState | null>;
|
|
14
|
+
watchHistory(limitCount?: number): Observable<ChessimalsHistoryEntry[]>;
|
|
14
15
|
joinGame(gameId: string): Promise<void>;
|
|
16
|
+
acceptGuest(gameId: string): Promise<void>;
|
|
17
|
+
rejectGuest(gameId: string): Promise<void>;
|
|
15
18
|
move(gameId: string, move: ChessimalsMove): Promise<void>;
|
|
16
19
|
resign(gameId: string): Promise<void>;
|
|
17
20
|
requestRematch(gameId: string): Promise<void>;
|
|
@@ -19,11 +22,17 @@ export declare class ChessimalsOnlineService {
|
|
|
19
22
|
isParticipant(state: ChessimalsGameState, uid?: string): boolean;
|
|
20
23
|
isHostWaiting(state: ChessimalsGameState, uid?: string): boolean;
|
|
21
24
|
shareUrl(gameId: string, baseRoute?: string): string;
|
|
25
|
+
saveCurrentUserHistory(state: ChessimalsGameState): Promise<void>;
|
|
22
26
|
private gameRef;
|
|
27
|
+
private historyPath;
|
|
28
|
+
private historyRef;
|
|
23
29
|
private ensureUser;
|
|
24
30
|
private decodeInput;
|
|
25
31
|
private createParticipant;
|
|
26
32
|
private withUpdatedAt;
|
|
33
|
+
private createHistoryEntry;
|
|
34
|
+
private withoutUndefined;
|
|
35
|
+
private historyOutcome;
|
|
27
36
|
private assertNotExpired;
|
|
28
37
|
private createGameId;
|
|
29
38
|
private randomIndex;
|
|
@@ -85,10 +85,32 @@ export interface ChessimalsOnlineState {
|
|
|
85
85
|
expiresAt: string;
|
|
86
86
|
expiresAtMs: number;
|
|
87
87
|
round: number;
|
|
88
|
+
rematchOf?: string;
|
|
88
89
|
lobby?: ChessimalsOnlineParticipant;
|
|
90
|
+
pendingGuest?: ChessimalsOnlineParticipant;
|
|
89
91
|
participants?: Partial<Record<ChessimalsPlayerColor, ChessimalsOnlineParticipant>>;
|
|
90
92
|
rematchRequests?: string[];
|
|
91
93
|
}
|
|
94
|
+
export type ChessimalsHistoryOutcome = 'waiting' | 'pending' | 'in_progress' | 'won' | 'lost' | 'declined';
|
|
95
|
+
export interface ChessimalsHistoryEntry {
|
|
96
|
+
gameId: string;
|
|
97
|
+
mode: 'online';
|
|
98
|
+
boardSize: ChessimalsBoardSize;
|
|
99
|
+
status: ChessimalsGameStatus;
|
|
100
|
+
outcome: ChessimalsHistoryOutcome;
|
|
101
|
+
side?: ChessimalsPlayerColor;
|
|
102
|
+
opponentUid?: string;
|
|
103
|
+
opponentName?: string;
|
|
104
|
+
winner?: ChessimalsPlayerColor;
|
|
105
|
+
winnerReason?: ChessimalsWinReason;
|
|
106
|
+
moveCount: number;
|
|
107
|
+
round: number;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
finishedAt?: string;
|
|
111
|
+
expiresAt?: string;
|
|
112
|
+
rematchOf?: string;
|
|
113
|
+
}
|
|
92
114
|
export interface ChessimalsGameState {
|
|
93
115
|
id: string;
|
|
94
116
|
mode: ChessimalsGameMode;
|
package/lib/version.d.ts
CHANGED