valtech-components 4.0.580 → 4.0.582

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.
@@ -0,0 +1,4 @@
1
+ import { ChessimalsAdventureAct } from './types';
2
+ export declare const CHESSIMALS_ADVENTURE_ACTS: ChessimalsAdventureAct[];
3
+ export declare function adventureActIsUnlocked(actId: string, completedNodes: Record<string, unknown>): boolean;
4
+ export declare function adventureNodeIsAvailable(nodeId: string, completedNodes: Record<string, unknown>): boolean;
@@ -0,0 +1,16 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ChessimalsAdventureProgress } from './types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ChessimalsAdventureProgressService {
5
+ private readonly firebaseAuth;
6
+ private readonly firestore;
7
+ private readonly firebase;
8
+ get currentUid(): string | undefined;
9
+ watchProgress(): Observable<ChessimalsAdventureProgress | undefined>;
10
+ recordNodeCompleted(nodeId: string, stars: number): Promise<void>;
11
+ empty(): ChessimalsAdventureProgress;
12
+ private normalize;
13
+ private progressRef;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChessimalsAdventureProgressService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChessimalsAdventureProgressService>;
16
+ }
@@ -0,0 +1,30 @@
1
+ import { ChessimalsAdventureAct, ChessimalsAdventureNode, ChessimalsAdventureNodeStatus } from './types';
2
+ import * as i0 from "@angular/core";
3
+ interface AdventureNodeView {
4
+ node: ChessimalsAdventureNode;
5
+ status: ChessimalsAdventureNodeStatus;
6
+ stars: number;
7
+ }
8
+ interface AdventureActView {
9
+ act: ChessimalsAdventureAct;
10
+ unlocked: boolean;
11
+ nodes: AdventureNodeView[];
12
+ completedCount: number;
13
+ totalCount: number;
14
+ }
15
+ export declare class ChessimalsAdventureComponent {
16
+ private readonly i18n;
17
+ private readonly router;
18
+ private readonly progressService;
19
+ private readonly progress;
20
+ readonly selectedActId: import("@angular/core").WritableSignal<string>;
21
+ readonly totalStars: import("@angular/core").Signal<number>;
22
+ readonly actViews: import("@angular/core").Signal<AdventureActView[]>;
23
+ constructor();
24
+ t(key: string): string;
25
+ nodeIcon(type: ChessimalsAdventureNode['type']): string;
26
+ onNodeTap(nodeView: AdventureNodeView): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChessimalsAdventureComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChessimalsAdventureComponent, "val-chessimals-adventure", never, {}, {}, never, never, true, never>;
29
+ }
30
+ export {};
@@ -53,6 +53,7 @@ interface ChessimalsAchievementView {
53
53
  interface ChessimalsProgressMetricView {
54
54
  label: string;
55
55
  value: string | number;
56
+ percent: string;
56
57
  }
57
58
  interface ChessimalsProgressRingView {
58
59
  label: string;
@@ -129,7 +130,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
129
130
  readonly botProfiles: ChessimalsBotProfile[];
130
131
  readonly challengeLadder: ChessimalsChallengeBot[];
131
132
  readonly animals: ChessimalsAnimalView[];
132
- readonly valtechComponentsVersion = "4.0.580";
133
+ readonly valtechComponentsVersion = "4.0.582";
133
134
  readonly screen: import("@angular/core").WritableSignal<"home" | "challenge" | "path" | "game">;
134
135
  readonly selectedBoardSize: import("@angular/core").WritableSignal<ChessimalsBoardSize>;
135
136
  readonly selectedLocalMode: import("@angular/core").WritableSignal<ChessimalsLocalMode>;
@@ -257,6 +257,42 @@ export interface ChessimalsGameState {
257
257
  moveHistory?: ChessimalsMoveHistoryEntry[];
258
258
  online?: ChessimalsOnlineState;
259
259
  }
260
+ export type ChessimalsAdventureNodeType = 'battle' | 'boss' | 'rest' | 'mystery';
261
+ export type ChessimalsAdventureNodeStatus = 'locked' | 'available' | 'completed' | 'failed';
262
+ export interface ChessimalsAdventurePosition {
263
+ x: number;
264
+ y: number;
265
+ }
266
+ export interface ChessimalsAdventureNode {
267
+ id: string;
268
+ actId: string;
269
+ type: ChessimalsAdventureNodeType;
270
+ profileId?: ChessimalsBotProfileId;
271
+ difficulty?: ChessimalsBotDifficulty;
272
+ boardSize?: ChessimalsBoardSize;
273
+ position: ChessimalsAdventurePosition;
274
+ connectsTo: string[];
275
+ titleKey: string;
276
+ descriptionKey: string;
277
+ specialRule?: string;
278
+ }
279
+ export interface ChessimalsAdventureAct {
280
+ id: string;
281
+ titleKey: string;
282
+ descriptionKey: string;
283
+ emoji: string;
284
+ nodes: ChessimalsAdventureNode[];
285
+ }
286
+ export interface ChessimalsAdventureNodeResult {
287
+ stars: number;
288
+ completedAt: string;
289
+ }
290
+ export interface ChessimalsAdventureProgress {
291
+ userId?: string;
292
+ completedNodes: Record<string, ChessimalsAdventureNodeResult>;
293
+ totalStars: number;
294
+ updatedAt: string;
295
+ }
260
296
  export type ChristianitySeat = 'P1' | 'P2';
261
297
  export type ChristianityGameStatus = 'in_progress' | 'finished';
262
298
  export type ChristianityGameMode = 'solo_bot' | 'two_player' | 'local_pass';
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.580";
5
+ export declare const VERSION = "4.0.582";
@@ -54,3 +54,7 @@ export declare class ChessimalsProjectionGamePageComponent {
54
54
  static ɵfac: i0.ɵɵFactoryDeclaration<ChessimalsProjectionGamePageComponent, never>;
55
55
  static ɵcmp: i0.ɵɵComponentDeclaration<ChessimalsProjectionGamePageComponent, "val-chessimals-projection-game-page", never, {}, {}, never, never, true, never>;
56
56
  }
57
+ export declare class ChessimalsAdventurePageComponent {
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChessimalsAdventurePageComponent, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChessimalsAdventurePageComponent, "val-chessimals-adventure-page", never, {}, {}, never, never, true, never>;
60
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.580",
3
+ "version": "4.0.582",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -341,6 +341,9 @@ export * from './lib/components/organisms/invite-member-modal/invite-member-moda
341
341
  export * from './lib/components/organisms/member-detail-modal/member-detail-modal.component';
342
342
  export * from './lib/components/organisms/member-detail-modal/types';
343
343
  export * from './lib/components/organisms/member-import-modal/member-import-modal.component';
344
+ export * from './lib/components/organisms/mini-games/chessimals-adventure.component';
345
+ export * from './lib/components/organisms/mini-games/chessimals-adventure-data';
346
+ export * from './lib/components/organisms/mini-games/chessimals-adventure-progress.service';
344
347
  export * from './lib/components/organisms/mini-games/chessimals-engine';
345
348
  export * from './lib/components/organisms/mini-games/chessimals-game.component';
346
349
  export * from './lib/components/organisms/mini-games/chessimals-online.service';