@oddsmith/ui 1.0.8 → 1.1.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/README.md +2 -6
- package/dist/assets/config/data.js +2 -2
- package/dist/container/os-leaderboard-casino.d.ts +19 -9
- package/dist/index.js +228 -215
- package/dist/index.js.map +1 -1
- package/dist/sections/table-section/table-section.d.ts +3 -2
- package/dist/sections/table-section/table-section.host.d.ts +1 -1
- package/dist/sections/table-section/types/events.d.ts +6 -1
- package/dist/store/casino.store.d.ts +6 -0
- package/dist/types/host.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/public.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from 'lit';
|
|
2
2
|
import { CasinoStore } from '../../store';
|
|
3
|
-
import { TableView } from './types/view.js';
|
|
3
|
+
import { TablePlayer, TableView } from './types/view.js';
|
|
4
4
|
import { TableSectionHost } from './table-section.host.js';
|
|
5
5
|
/** Top-players preview — pinned current user, golden CTA. */
|
|
6
6
|
export declare class OsLeaderboardCasinoTable extends LitElement implements TableSectionHost {
|
|
@@ -30,7 +30,8 @@ export declare class OsLeaderboardCasinoTable extends LitElement implements Tabl
|
|
|
30
30
|
get emptyMessage(): string;
|
|
31
31
|
get showPinned(): boolean;
|
|
32
32
|
get yourPositionLabel(): string;
|
|
33
|
-
|
|
33
|
+
onCtaClick(): void;
|
|
34
|
+
onPlayerClick(player: TablePlayer): void;
|
|
34
35
|
private resolvePlayerPrizeLabel;
|
|
35
36
|
private renderRankChange;
|
|
36
37
|
private renderMedal;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/** Custom events from the table section. */
|
|
2
2
|
export declare const TableEvents: {
|
|
3
|
-
/** Table CTA —
|
|
3
|
+
/** Table CTA — `players[].id` of the first `isYou: true`. */
|
|
4
|
+
readonly cta: "cta-click";
|
|
5
|
+
/** Table row — that player's `players[].id`. */
|
|
4
6
|
readonly open: "leaderboard-player-open";
|
|
5
7
|
};
|
|
6
8
|
export type TableEventName = (typeof TableEvents)[keyof typeof TableEvents];
|
|
9
|
+
export interface TableCtaDetail {
|
|
10
|
+
playerId: string;
|
|
11
|
+
}
|
|
7
12
|
export interface TableOpenDetail {
|
|
8
13
|
playerId: string;
|
|
9
14
|
}
|
|
@@ -11,11 +11,16 @@ export declare class CasinoStore {
|
|
|
11
11
|
private demo;
|
|
12
12
|
/** Demo countdown roll — only if the campaign was not already over at hydrate. */
|
|
13
13
|
private demoRollClock;
|
|
14
|
+
/** First `isYou: true` in `players[]`, resolved once per hydrate. */
|
|
15
|
+
private you;
|
|
16
|
+
private youIndex;
|
|
14
17
|
hydrate(data: ResolvedLeaderboardData, demo?: boolean): void;
|
|
15
18
|
clear(): void;
|
|
16
19
|
isReady(): boolean;
|
|
17
20
|
isDemo(): boolean;
|
|
18
21
|
getData(): ResolvedLeaderboardData;
|
|
22
|
+
/** `players[].id` of the first `isYou: true`. Empty string if none. */
|
|
23
|
+
getCurrentUserId(): string;
|
|
19
24
|
/**
|
|
20
25
|
* Derived from data.hero startsAt / endsAt / cancelled.
|
|
21
26
|
* Demo boards that loaded already finished stay finished.
|
|
@@ -33,5 +38,6 @@ export declare class CasinoStore {
|
|
|
33
38
|
getEventsBannerView(): EventsBannerView | undefined;
|
|
34
39
|
getFooterView(): FooterView;
|
|
35
40
|
getLegalsView(): LegalsView | undefined;
|
|
41
|
+
private cacheCurrentUser;
|
|
36
42
|
private requireData;
|
|
37
43
|
}
|
package/dist/types/host.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LeaderboardData } from './data.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Host input — the only props the public TypeScript contract accepts.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Pass these to `new OsLeaderboardCasino({ labels, theme, data })`, then `mount(host)`.
|
|
8
8
|
* Omit all three for the hardcoded campaign, labels, and theme.
|
|
9
9
|
*
|
|
10
10
|
* `.labels`: omit for defaults. If set, the full bag is required.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type { ClimbView } from '../sections/climb-section/types/view.js';
|
|
|
28
28
|
export type { ClimbLabels } from '../sections/climb-section/types/labels.js';
|
|
29
29
|
export type { TablePlayer, TableView } from '../sections/table-section/types/view.js';
|
|
30
30
|
export type { TableLabels } from '../sections/table-section/types/labels.js';
|
|
31
|
-
export type { TableEventName, TableOpenDetail, } from '../sections/table-section/types/events.js';
|
|
31
|
+
export type { TableEventName, TableCtaDetail, TableOpenDetail, } from '../sections/table-section/types/events.js';
|
|
32
32
|
export { TableEvents } from '../sections/table-section/types/events.js';
|
|
33
33
|
export type { FooterView } from '../sections/footer-section/types/view.js';
|
|
34
34
|
export type { LegalLink, LegalsView } from '../sections/legals-section/types/view.js';
|
package/dist/types/public.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export type { LeaderboardData, HeroData, PrizeData, StatsData, GameData, PlayerD
|
|
|
18
18
|
export { PrizeEvents } from '../sections/prize-section/types/events.js';
|
|
19
19
|
export type { PrizeClickDetail } from '../sections/prize-section/types/events.js';
|
|
20
20
|
export { TableEvents } from '../sections/table-section/types/events.js';
|
|
21
|
-
export type { TableOpenDetail } from '../sections/table-section/types/events.js';
|
|
21
|
+
export type { TableCtaDetail, TableOpenDetail } from '../sections/table-section/types/events.js';
|
|
22
22
|
export { EventsEvents } from '../sections/events-banner/types/events.js';
|
|
23
23
|
export type { EventsClickDetail } from '../sections/events-banner/types/events.js';
|