@oddsmith/ui 1.0.7 → 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 CHANGED
@@ -2,12 +2,8 @@
2
2
 
3
3
  Deploy a fully brandable casino leaderboard, ready to match your brand. Your data, our UI.
4
4
 
5
- A frontend engineer mounts the leaderboard on your site in any frontend stack. There is no Oddsmith backend to connect. You push the data into the component.
6
-
7
- Create as many custom leaderboards that you need.
8
-
9
- **Time to a live board: 1 day**
5
+ There is no Oddsmith backend to connect. You push your data into the component.
10
6
 
11
7
  Try it: [oddsmith.io](https://oddsmith.io)
12
8
 
13
- [Integration docs](https://app.notion.com/p/Client-integration-3c9437e762d68075b87ff9fd358678dd)
9
+ Docs: [Engineer setup](https://app.notion.com/p/1-Engineer-Setup-3cb437e762d680b5829af8bd55593840)
@@ -3,8 +3,8 @@ export default {
3
3
  hero: {
4
4
  title: "Midnight Millions",
5
5
  description: "Climb the board before the timer hits zero.",
6
- startsAt: "2026-08-19T11:05:30.077Z",
7
- endsAt: "2026-08-30T01:05:30.077Z",
6
+ startsAt: "2026-08-23T14:15:31.035Z",
7
+ endsAt: "2026-09-03T04:15:31.035Z",
8
8
  prizePool: 128450
9
9
  },
10
10
  currency: "USD",
@@ -1,8 +1,8 @@
1
- import { LeaderboardData } from '../types';
1
+ import { ResolvedLeaderboardData } from '../types';
2
2
  /**
3
3
  * Hardcoded campaign used when the host omits `.data`, and as the mix
4
4
  * fallback for omitted keys on a partial bag.
5
5
  *
6
6
  * Clocks are computed at call time so a mounted instance with no `.data` stays live.
7
7
  */
8
- export declare function buildDefaultData(now?: number): LeaderboardData;
8
+ export declare function buildDefaultData(now?: number): ResolvedLeaderboardData;
@@ -1,43 +1,53 @@
1
1
  import { LitElement, nothing, PropertyValues } from 'lit';
2
2
  import { LitTemplate } from '../.shared/lib/lit/template.js';
3
- import { LeaderboardDataInput, LeaderboardHostProps, LeaderboardLabels, LeaderboardTheme, SectionId } from '../types';
3
+ import { LeaderboardData, LeaderboardHostProps, LeaderboardLabels, LeaderboardTheme, SectionId } from '../types';
4
4
  import { CasinoStore } from '../store';
5
5
  import { OsLeaderboardCasinoHost } from './os-leaderboard-casino.host.js';
6
6
  /**
7
7
  * Free-tier casino leaderboard.
8
8
  *
9
- * Construct the class, {@link setProps} with {@link LeaderboardHostProps},
10
- * then {@link mount} it into a host node. Layout is built-in
11
- * ({@link DEFAULT_LAYOUT}). Omit `.labels` / `.theme` / `.data` for the
12
- * hardcoded campaign, English labels, and glam theme.
9
+ * Pass {@link LeaderboardHostProps} to the constructor, then {@link mount}
10
+ * into a host node. Layout is built-in ({@link DEFAULT_LAYOUT}). Omit
11
+ * `.labels` / `.theme` / `.data` for the hardcoded campaign, English
12
+ * labels, and glam theme. Call {@link destroy} when the page goes away.
13
13
  *
14
14
  * ```ts
15
- * const board = new OsLeaderboardCasino();
16
- * board.setProps({ labels, theme, data });
15
+ * const board = new OsLeaderboardCasino({ labels, theme, data });
17
16
  * board.mount(document.getElementById('app')!);
17
+ * board.destroy();
18
18
  * ```
19
19
  */
20
20
  export declare class OsLeaderboardCasino extends LitElement implements OsLeaderboardCasinoHost {
21
21
  static styles: import('lit').CSSResult[];
22
22
  labels: LeaderboardLabels | null;
23
23
  theme: Partial<LeaderboardTheme> | null;
24
- data: LeaderboardDataInput | null;
24
+ data: LeaderboardData | null;
25
25
  /**
26
26
  * Oddsmith demo surfaces only. Rolls an expired countdown forward
27
27
  * if the campaign was still live at hydrate. Operator embeds omit this.
28
28
  */
29
29
  demo: boolean;
30
30
  private now;
31
+ private hostListeners;
31
32
  private readonly bootstrap;
32
33
  private ready;
34
+ private destroyed;
33
35
  private clock?;
36
+ constructor(props?: LeaderboardHostProps);
34
37
  get store(): CasinoStore;
35
- /** Stamp host props. Pass the bag with shorthand: `{ labels, theme, data }`. */
36
- setProps(props: LeaderboardHostProps): this;
38
+ /** ContextProvider registers on the host during field init list must exist first. */
39
+ private trackedListeners;
37
40
  /** Append this instance into `host`. Props stay on the instance. */
38
41
  mount(host: ParentNode): this;
39
- /** Remove this instance from the document. */
42
+ /** Remove this instance from the document. Listeners stay until {@link destroy}. */
40
43
  unmount(): this;
44
+ /**
45
+ * Tear down for good: strip instance event listeners and remove from the
46
+ * document. Do not reuse. Drop your host reference after this.
47
+ */
48
+ destroy(): void;
49
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
50
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
41
51
  connectedCallback(): void;
42
52
  protected willUpdate(changed: PropertyValues<this>): void;
43
53
  private load;