valtech-components 4.0.442 → 4.0.444
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-challenge-progress.service.mjs +145 -0
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +533 -6
- package/esm2022/lib/components/organisms/mini-games/christianity-game.component.mjs +176 -30
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +81 -1
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/services/firebase/analytics.service.mjs +6 -4
- package/esm2022/lib/services/preferences/preferences.service.mjs +2 -2
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +932 -39
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-challenge-progress.service.d.ts +30 -0
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +36 -2
- package/lib/components/organisms/mini-games/christianity-game.component.d.ts +2 -0
- package/lib/components/organisms/mini-games/types.d.ts +65 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -2
- package/src/lib/services/firebase/scripts/generate-sw-config.js +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ChessimalsChallengeRoundStats, ChessimalsChallengeRun, ChessimalsChallengeStats } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ChessimalsChallengeProgressService {
|
|
5
|
+
private readonly firebaseAuth;
|
|
6
|
+
private readonly firestore;
|
|
7
|
+
private readonly firebase;
|
|
8
|
+
get currentUid(): string | undefined;
|
|
9
|
+
watchStats(): Observable<ChessimalsChallengeStats | undefined>;
|
|
10
|
+
watchRecentRuns(limitCount?: number): Observable<ChessimalsChallengeRun[]>;
|
|
11
|
+
saveRun(run: ChessimalsChallengeRun): Promise<void>;
|
|
12
|
+
recordChallengeStarted(run: ChessimalsChallengeRun): Promise<void>;
|
|
13
|
+
applyRoundResult(args: {
|
|
14
|
+
run: ChessimalsChallengeRun;
|
|
15
|
+
roundReached: number;
|
|
16
|
+
won: boolean;
|
|
17
|
+
completed: boolean;
|
|
18
|
+
roundStats: ChessimalsChallengeRoundStats;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
emptyStats(): ChessimalsChallengeStats;
|
|
21
|
+
private readStats;
|
|
22
|
+
private normalizeStats;
|
|
23
|
+
private ensureUser;
|
|
24
|
+
private statsRef;
|
|
25
|
+
private runRef;
|
|
26
|
+
private runsPath;
|
|
27
|
+
private withoutUndefined;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChessimalsChallengeProgressService, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChessimalsChallengeProgressService>;
|
|
30
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBotProfile, ChessimalsBotProfileId, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
3
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBotProfile, ChessimalsBotProfileId, ChessimalsBoardSize, ChessimalsChallengeBot, ChessimalsChallengeRoundStats, ChessimalsChallengeRun, ChessimalsChallengeStats, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
4
4
|
import { RangeInputMetadata, RangeValue } from '../../molecules/range-input/types';
|
|
5
5
|
import { ToggleInputMetadata } from '../../molecules/toggle-input/types';
|
|
6
6
|
import { UserAvatarMetadata } from '../../atoms/user-avatar/types';
|
|
@@ -13,6 +13,7 @@ interface ChessimalsAnimalView {
|
|
|
13
13
|
}
|
|
14
14
|
type ChessimalsConfirmAction = 'restart' | 'mode' | 'games' | 'resign';
|
|
15
15
|
type ChessimalsRematchState = 'none' | 'requested' | 'incoming';
|
|
16
|
+
type ChessimalsChallengePhase = 'idle' | 'playing' | 'between' | 'completed' | 'failed';
|
|
16
17
|
interface ChessimalsMovingPieceView {
|
|
17
18
|
color: ChessimalsPlayerColor;
|
|
18
19
|
fromRow: number;
|
|
@@ -38,6 +39,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
38
39
|
private readonly i18n;
|
|
39
40
|
private readonly audio;
|
|
40
41
|
private readonly online;
|
|
42
|
+
private readonly challengeProgress;
|
|
41
43
|
private readonly router;
|
|
42
44
|
private readonly toast;
|
|
43
45
|
private readonly auth;
|
|
@@ -50,6 +52,8 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
50
52
|
private readonly routeSubscription;
|
|
51
53
|
private onlineSubscription;
|
|
52
54
|
private historySubscription;
|
|
55
|
+
private challengeStatsSubscription;
|
|
56
|
+
private challengeRunsSubscription;
|
|
53
57
|
private historyUid;
|
|
54
58
|
private historyWatchTimer;
|
|
55
59
|
private moveEffectStartTimer;
|
|
@@ -59,13 +63,15 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
59
63
|
private openingOnlineGameId;
|
|
60
64
|
private openedOnlineGameId;
|
|
61
65
|
private lastOutcomeSoundKey;
|
|
66
|
+
private lastChallengeHandledKey;
|
|
62
67
|
private boardAnchor?;
|
|
63
68
|
readonly boardSizes: ChessimalsBoardSize[];
|
|
64
69
|
readonly localModes: ChessimalsLocalMode[];
|
|
65
70
|
readonly botDifficulties: ChessimalsBotDifficulty[];
|
|
66
71
|
readonly botProfiles: ChessimalsBotProfile[];
|
|
72
|
+
readonly challengeLadder: ChessimalsChallengeBot[];
|
|
67
73
|
readonly animals: ChessimalsAnimalView[];
|
|
68
|
-
readonly valtechComponentsVersion = "4.0.
|
|
74
|
+
readonly valtechComponentsVersion = "4.0.444";
|
|
69
75
|
readonly screen: import("@angular/core").WritableSignal<"home" | "game">;
|
|
70
76
|
readonly selectedBoardSize: import("@angular/core").WritableSignal<ChessimalsBoardSize>;
|
|
71
77
|
readonly selectedLocalMode: import("@angular/core").WritableSignal<ChessimalsLocalMode>;
|
|
@@ -73,6 +79,14 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
73
79
|
readonly selectedBotProfileId: import("@angular/core").WritableSignal<ChessimalsBotProfileId>;
|
|
74
80
|
readonly gameBotProfileId: import("@angular/core").WritableSignal<ChessimalsBotProfileId>;
|
|
75
81
|
readonly game: import("@angular/core").WritableSignal<ChessimalsGameState>;
|
|
82
|
+
readonly challengePhase: import("@angular/core").WritableSignal<ChessimalsChallengePhase>;
|
|
83
|
+
readonly challengeRun: import("@angular/core").WritableSignal<ChessimalsChallengeRun>;
|
|
84
|
+
readonly challengeStats: import("@angular/core").WritableSignal<ChessimalsChallengeStats>;
|
|
85
|
+
readonly challengeHistory: import("@angular/core").WritableSignal<ChessimalsChallengeRun[]>;
|
|
86
|
+
readonly challengeLastWon: import("@angular/core").WritableSignal<boolean>;
|
|
87
|
+
readonly challengeLastBot: import("@angular/core").WritableSignal<ChessimalsChallengeBot>;
|
|
88
|
+
readonly challengeLastRoundStats: import("@angular/core").WritableSignal<ChessimalsChallengeRoundStats>;
|
|
89
|
+
readonly challengeNewRecord: import("@angular/core").WritableSignal<boolean>;
|
|
76
90
|
readonly selectedPieceId: import("@angular/core").WritableSignal<string>;
|
|
77
91
|
readonly selectedAnimal: import("@angular/core").WritableSignal<ChessimalsAnimalType>;
|
|
78
92
|
readonly isRulesModalOpen: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -115,6 +129,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
115
129
|
readonly availableBotProfiles: import("@angular/core").Signal<ChessimalsBotProfile[]>;
|
|
116
130
|
readonly selectedBotProfile: import("@angular/core").Signal<ChessimalsBotProfile>;
|
|
117
131
|
readonly gameBotProfile: import("@angular/core").Signal<ChessimalsBotProfile>;
|
|
132
|
+
readonly activeChallengeBot: import("@angular/core").Signal<ChessimalsChallengeBot>;
|
|
118
133
|
set onlineGameId(value: string | null | undefined);
|
|
119
134
|
miniGamesRoute: string;
|
|
120
135
|
projectionMode: boolean;
|
|
@@ -186,7 +201,12 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
186
201
|
protected t(key: string): string;
|
|
187
202
|
private shortUserId;
|
|
188
203
|
private rangeValueToNumber;
|
|
204
|
+
startChallenge(): void;
|
|
205
|
+
continueChallenge(): void;
|
|
206
|
+
private startChallengeRound;
|
|
189
207
|
startGame(): void;
|
|
208
|
+
private handleChallengeRoundFinished;
|
|
209
|
+
private abandonChallengeIfNeeded;
|
|
190
210
|
startTutorial(): void;
|
|
191
211
|
createOnlineGame(): Promise<void>;
|
|
192
212
|
joinOnlineGameByCode(): Promise<void>;
|
|
@@ -293,6 +313,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
293
313
|
requestOnlineRematch(): Promise<void>;
|
|
294
314
|
private queueHistoryWatch;
|
|
295
315
|
private watchOnlineHistory;
|
|
316
|
+
private watchChallengeStats;
|
|
296
317
|
unlockedLabel(color: ChessimalsPlayerColor): string;
|
|
297
318
|
localModeLabel(mode: ChessimalsLocalMode): string;
|
|
298
319
|
localModeDescription(mode: ChessimalsLocalMode): string;
|
|
@@ -301,6 +322,19 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
301
322
|
botProfileLabel(profile: ChessimalsBotProfile): string;
|
|
302
323
|
botProfileDescription(profile: ChessimalsBotProfile): string;
|
|
303
324
|
botProfileTendency(profile: ChessimalsBotProfile): string;
|
|
325
|
+
botProfileAvatar(profileId: ChessimalsBotProfileId): string;
|
|
326
|
+
challengeOpeningBot(): ChessimalsChallengeBot;
|
|
327
|
+
challengeBotName(bot: ChessimalsChallengeBot): string;
|
|
328
|
+
challengeRunStatusLabel(run: ChessimalsChallengeRun): string;
|
|
329
|
+
challengeRunLine(run: ChessimalsChallengeRun): string;
|
|
330
|
+
isChallengeActive(): boolean;
|
|
331
|
+
challengeRoundLabel(): string;
|
|
332
|
+
challengeLivesLabel(): string;
|
|
333
|
+
challengeOutcomeTitle(): string;
|
|
334
|
+
challengeOutcomeBody(): string;
|
|
335
|
+
challengeHasNewRecord(): boolean;
|
|
336
|
+
totalChallengePowers(stats?: ChessimalsChallengeRoundStats): number;
|
|
337
|
+
private createChallengeRoundStats;
|
|
304
338
|
animalLabel(type: ChessimalsAnimalType): string;
|
|
305
339
|
canReviewPrevious(): boolean;
|
|
306
340
|
canReviewNext(): boolean;
|
|
@@ -35,10 +35,12 @@ export declare class ChristianityGameComponent {
|
|
|
35
35
|
protected readonly hasOpponentGuards: import("@angular/core").Signal<boolean>;
|
|
36
36
|
protected readonly opponentHandCount: import("@angular/core").Signal<number>;
|
|
37
37
|
protected readonly selectedCardDefinition: import("@angular/core").Signal<ChristianityCardDefinition>;
|
|
38
|
+
protected readonly selectedPreviewCard: import("@angular/core").Signal<ChristianityCardDefinition>;
|
|
38
39
|
protected readonly statusText: import("@angular/core").Signal<string>;
|
|
39
40
|
constructor();
|
|
40
41
|
protected t(key: string): string;
|
|
41
42
|
protected cardDefinition(cardId: string): ChristianityCardDefinition;
|
|
43
|
+
protected cardTypeLabel(card: ChristianityCardDefinition): string;
|
|
42
44
|
protected battleSlots(seat: ChristianitySeat): Array<{
|
|
43
45
|
trackId: string;
|
|
44
46
|
card?: ChristianityCharacterInstance;
|
|
@@ -61,6 +61,62 @@ export interface ChessimalsBotProfile {
|
|
|
61
61
|
labelKey: string;
|
|
62
62
|
descriptionKey: string;
|
|
63
63
|
}
|
|
64
|
+
export type ChessimalsChallengeStatus = 'active' | 'completed' | 'failed' | 'abandoned';
|
|
65
|
+
export interface ChessimalsChallengeBot {
|
|
66
|
+
id: string;
|
|
67
|
+
round: number;
|
|
68
|
+
profileId: ChessimalsBotProfileId;
|
|
69
|
+
difficulty: ChessimalsBotDifficulty;
|
|
70
|
+
boardSize: ChessimalsBoardSize;
|
|
71
|
+
introKey: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ChessimalsChallengeRoundStats {
|
|
74
|
+
powersUsed: Record<ChessimalsAnimalType, number>;
|
|
75
|
+
powerCaptures: number;
|
|
76
|
+
promotions: number;
|
|
77
|
+
captures: number;
|
|
78
|
+
moves: number;
|
|
79
|
+
}
|
|
80
|
+
export interface ChessimalsChallengeRoundResult {
|
|
81
|
+
round: number;
|
|
82
|
+
botId: string;
|
|
83
|
+
profileId: ChessimalsBotProfileId;
|
|
84
|
+
won: boolean;
|
|
85
|
+
livesRemaining: number;
|
|
86
|
+
stats: ChessimalsChallengeRoundStats;
|
|
87
|
+
finishedAt: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ChessimalsChallengeRun {
|
|
90
|
+
id: string;
|
|
91
|
+
userId?: string;
|
|
92
|
+
status: ChessimalsChallengeStatus;
|
|
93
|
+
livesStart: 3;
|
|
94
|
+
livesRemaining: number;
|
|
95
|
+
currentRound: number;
|
|
96
|
+
wins: number;
|
|
97
|
+
losses: number;
|
|
98
|
+
bestStreakInRun: number;
|
|
99
|
+
currentStreak: number;
|
|
100
|
+
botLadder: string[];
|
|
101
|
+
roundResults: ChessimalsChallengeRoundResult[];
|
|
102
|
+
startedAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
finishedAt?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface ChessimalsChallengeStats {
|
|
107
|
+
userId?: string;
|
|
108
|
+
challengesPlayed: number;
|
|
109
|
+
challengesCompleted: number;
|
|
110
|
+
bestWinStreak: number;
|
|
111
|
+
bestRoundReached: number;
|
|
112
|
+
totalWins: number;
|
|
113
|
+
totalLosses: number;
|
|
114
|
+
botsDefeated: number;
|
|
115
|
+
powersUsed: Record<ChessimalsAnimalType, number>;
|
|
116
|
+
powerCaptures: number;
|
|
117
|
+
promotions: number;
|
|
118
|
+
updatedAt?: string;
|
|
119
|
+
}
|
|
64
120
|
export interface ChessimalsPosition {
|
|
65
121
|
row: number;
|
|
66
122
|
col: number;
|
|
@@ -181,6 +237,7 @@ export type ChristianitySeat = 'P1' | 'P2';
|
|
|
181
237
|
export type ChristianityGameStatus = 'in_progress' | 'finished';
|
|
182
238
|
export type ChristianityGameMode = 'solo_bot' | 'two_player' | 'local_pass';
|
|
183
239
|
export type ChristianityCardType = 'character' | 'offering';
|
|
240
|
+
export type ChristianityCardRarity = 'normal' | 'uncommon' | 'rare' | 'legendary';
|
|
184
241
|
export interface ChristianityCardDefinition {
|
|
185
242
|
id: string;
|
|
186
243
|
name: string;
|
|
@@ -191,6 +248,14 @@ export interface ChristianityCardDefinition {
|
|
|
191
248
|
abilityName?: string;
|
|
192
249
|
abilityText?: string;
|
|
193
250
|
abilityCost?: number;
|
|
251
|
+
imageUrl?: string;
|
|
252
|
+
verseText?: string;
|
|
253
|
+
scripture?: string;
|
|
254
|
+
edition?: string;
|
|
255
|
+
collectorNumber?: string;
|
|
256
|
+
author?: string;
|
|
257
|
+
year?: string;
|
|
258
|
+
rarity?: ChristianityCardRarity;
|
|
194
259
|
}
|
|
195
260
|
export interface ChristianityCharacterInstance {
|
|
196
261
|
instanceId: string;
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valtech-components",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.444",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@angular/common": "^18.0.0",
|
|
15
|
-
"@angular/cdk": "^18.2.14",
|
|
16
15
|
"@angular/core": "^18.0.0",
|
|
17
16
|
"@angular/fire": "^18.0.1",
|
|
18
17
|
"@angular/service-worker": "^18.0.0",
|
|
File without changes
|