valtech-components 4.0.494 → 4.0.496
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 +36 -11
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +36 -11
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +4 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/esm2022/lib/version.mjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Current version of valtech-components.
|
|
3
3
|
* This is automatically updated during the publish process.
|
|
4
4
|
*/
|
|
5
|
-
export const VERSION = '4.0.
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export const VERSION = '4.0.496';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC40OTYnO1xuIl19
|
|
@@ -59,7 +59,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
59
59
|
* Current version of valtech-components.
|
|
60
60
|
* This is automatically updated during the publish process.
|
|
61
61
|
*/
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.496';
|
|
63
63
|
|
|
64
64
|
// Control de estado de refresco (singleton a nivel de módulo)
|
|
65
65
|
let isRefreshing = false;
|
|
@@ -66079,6 +66079,10 @@ class ChessimalsGameComponent {
|
|
|
66079
66079
|
return false;
|
|
66080
66080
|
if (run.currentRound < 1 || run.currentRound > this.challengeLadder.length)
|
|
66081
66081
|
return false;
|
|
66082
|
+
if (run.wins >= this.challengeLadder.length)
|
|
66083
|
+
return false;
|
|
66084
|
+
if (run.currentRound !== run.wins + 1)
|
|
66085
|
+
return false;
|
|
66082
66086
|
return !!this.challengeLadder[run.currentRound - 1];
|
|
66083
66087
|
}
|
|
66084
66088
|
startGame() {
|
|
@@ -66146,6 +66150,7 @@ class ChessimalsGameComponent {
|
|
|
66146
66150
|
finishedAt: completed || failed ? finishedAt : undefined,
|
|
66147
66151
|
};
|
|
66148
66152
|
this.challengeRun.set(nextRun);
|
|
66153
|
+
this.activeStoredChallengeRun.set(nextRun.status === 'active' ? nextRun : undefined);
|
|
66149
66154
|
this.challengeLastWon.set(won);
|
|
66150
66155
|
this.challengeLastBot.set(bot);
|
|
66151
66156
|
this.challengeLastRoundStats.set(roundStats);
|
|
@@ -67504,7 +67509,7 @@ class ChessimalsGameComponent {
|
|
|
67504
67509
|
error: () => this.challengeHistory.set([]),
|
|
67505
67510
|
});
|
|
67506
67511
|
this.challengeActiveRunSubscription = this.challengeProgress.watchActiveRun().subscribe({
|
|
67507
|
-
next: (run) => this.activeStoredChallengeRun.set(run),
|
|
67512
|
+
next: (run) => this.activeStoredChallengeRun.set(this.isResumableChallengeRun(run) ? run : undefined),
|
|
67508
67513
|
error: () => this.activeStoredChallengeRun.set(undefined),
|
|
67509
67514
|
});
|
|
67510
67515
|
}
|
|
@@ -67549,6 +67554,10 @@ class ChessimalsGameComponent {
|
|
|
67549
67554
|
return this.challengeLadder[0];
|
|
67550
67555
|
}
|
|
67551
67556
|
challengeMenuBot() {
|
|
67557
|
+
const activeRun = this.challengeMenuRun();
|
|
67558
|
+
if (activeRun) {
|
|
67559
|
+
return this.challengeLadder[Math.max(0, activeRun.currentRound - 1)] ?? this.challengeLadder[0];
|
|
67560
|
+
}
|
|
67552
67561
|
const bestRound = this.challengeStats().bestRoundReached;
|
|
67553
67562
|
const nextRoundIndex = Math.min(Math.max(bestRound, 0), this.challengeLadder.length - 1);
|
|
67554
67563
|
return this.challengeLadder[nextRoundIndex];
|
|
@@ -67556,6 +67565,21 @@ class ChessimalsGameComponent {
|
|
|
67556
67565
|
challengeMenuRoundLabel() {
|
|
67557
67566
|
return `${this.challengeMenuBot().round}/${this.challengeLadder.length}`;
|
|
67558
67567
|
}
|
|
67568
|
+
challengeMenuLivesLabel() {
|
|
67569
|
+
return String(this.challengeMenuRun()?.livesRemaining ?? 3);
|
|
67570
|
+
}
|
|
67571
|
+
challengeMenuClearedRound() {
|
|
67572
|
+
const activeRun = this.challengeMenuRun();
|
|
67573
|
+
if (activeRun)
|
|
67574
|
+
return Math.max(0, activeRun.currentRound - 1);
|
|
67575
|
+
return this.challengeStats().bestRoundReached;
|
|
67576
|
+
}
|
|
67577
|
+
challengeMenuRun() {
|
|
67578
|
+
const currentRun = this.challengeRun();
|
|
67579
|
+
if (this.isResumableChallengeRun(currentRun))
|
|
67580
|
+
return currentRun;
|
|
67581
|
+
return this.resumableChallengeRun();
|
|
67582
|
+
}
|
|
67559
67583
|
challengeBotName(bot) {
|
|
67560
67584
|
const profile = this.challengeBotProfile(bot);
|
|
67561
67585
|
return profile ? this.botProfileLabel(profile) : this.t('chessimalsBotName');
|
|
@@ -67568,10 +67592,11 @@ class ChessimalsGameComponent {
|
|
|
67568
67592
|
return profile ? this.botProfileTendency(profile) : this.t(bot.introKey);
|
|
67569
67593
|
}
|
|
67570
67594
|
challengeBotStatusLabel(bot) {
|
|
67571
|
-
const
|
|
67572
|
-
|
|
67595
|
+
const clearedRound = this.challengeMenuClearedRound();
|
|
67596
|
+
const currentRound = this.challengeMenuBot().round;
|
|
67597
|
+
if (clearedRound >= bot.round)
|
|
67573
67598
|
return this.t('chessimalsChallengeRivalCleared');
|
|
67574
|
-
if (
|
|
67599
|
+
if (currentRound === bot.round)
|
|
67575
67600
|
return this.t('chessimalsChallengeRivalCurrent');
|
|
67576
67601
|
if (bot.round === this.challengeLadder.length)
|
|
67577
67602
|
return this.t('chessimalsChallengeRivalFinal');
|
|
@@ -68208,7 +68233,7 @@ class ChessimalsGameComponent {
|
|
|
68208
68233
|
<div class="chessimals-challenge-cta__meta">
|
|
68209
68234
|
<span>
|
|
68210
68235
|
<small>{{ t('chessimalsChallengeLives') }}</small>
|
|
68211
|
-
<strong>
|
|
68236
|
+
<strong>{{ challengeMenuLivesLabel() }}</strong>
|
|
68212
68237
|
</span>
|
|
68213
68238
|
<span>
|
|
68214
68239
|
<small>{{ t('chessimalsChallengeRound') }}</small>
|
|
@@ -68441,7 +68466,7 @@ class ChessimalsGameComponent {
|
|
|
68441
68466
|
<div class="chessimals-challenge-path" [attr.aria-label]="t('chessimalsChallengePath')">
|
|
68442
68467
|
@for (bot of challengeLadder; track bot.id) {
|
|
68443
68468
|
<span
|
|
68444
|
-
[class.is-cleared]="
|
|
68469
|
+
[class.is-cleared]="challengeMenuClearedRound() >= bot.round"
|
|
68445
68470
|
[class.is-current]="challengeMenuBot().round === bot.round"
|
|
68446
68471
|
[class.is-final]="bot.round === challengeLadder.length"
|
|
68447
68472
|
[attr.title]="challengeBotName(bot)"
|
|
@@ -68508,7 +68533,7 @@ class ChessimalsGameComponent {
|
|
|
68508
68533
|
<div class="chessimals-challenge-roster" [attr.aria-label]="t('chessimalsChallengeRivals')">
|
|
68509
68534
|
@for (bot of challengeLadder; track bot.id) {
|
|
68510
68535
|
<article
|
|
68511
|
-
[class.is-cleared]="
|
|
68536
|
+
[class.is-cleared]="challengeMenuClearedRound() >= bot.round"
|
|
68512
68537
|
[class.is-current]="challengeMenuBot().round === bot.round"
|
|
68513
68538
|
[class.is-final]="bot.round === challengeLadder.length"
|
|
68514
68539
|
>
|
|
@@ -69598,7 +69623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
69598
69623
|
<div class="chessimals-challenge-cta__meta">
|
|
69599
69624
|
<span>
|
|
69600
69625
|
<small>{{ t('chessimalsChallengeLives') }}</small>
|
|
69601
|
-
<strong>
|
|
69626
|
+
<strong>{{ challengeMenuLivesLabel() }}</strong>
|
|
69602
69627
|
</span>
|
|
69603
69628
|
<span>
|
|
69604
69629
|
<small>{{ t('chessimalsChallengeRound') }}</small>
|
|
@@ -69831,7 +69856,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
69831
69856
|
<div class="chessimals-challenge-path" [attr.aria-label]="t('chessimalsChallengePath')">
|
|
69832
69857
|
@for (bot of challengeLadder; track bot.id) {
|
|
69833
69858
|
<span
|
|
69834
|
-
[class.is-cleared]="
|
|
69859
|
+
[class.is-cleared]="challengeMenuClearedRound() >= bot.round"
|
|
69835
69860
|
[class.is-current]="challengeMenuBot().round === bot.round"
|
|
69836
69861
|
[class.is-final]="bot.round === challengeLadder.length"
|
|
69837
69862
|
[attr.title]="challengeBotName(bot)"
|
|
@@ -69898,7 +69923,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
69898
69923
|
<div class="chessimals-challenge-roster" [attr.aria-label]="t('chessimalsChallengeRivals')">
|
|
69899
69924
|
@for (bot of challengeLadder; track bot.id) {
|
|
69900
69925
|
<article
|
|
69901
|
-
[class.is-cleared]="
|
|
69926
|
+
[class.is-cleared]="challengeMenuClearedRound() >= bot.round"
|
|
69902
69927
|
[class.is-current]="challengeMenuBot().round === bot.round"
|
|
69903
69928
|
[class.is-final]="bot.round === challengeLadder.length"
|
|
69904
69929
|
>
|