@sensiblestats/widget-sdk 0.24.0 → 0.25.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/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @sensiblestats/widget-sdk
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f3f845c: Auto-transition the club fan dashboard from preMatch to live without a reload.
8
+
9
+ Widget SDK: mirror the live dashboard's server contracts — `LiveScoreData` gains
10
+ `minute`/`clockRunning`/crest URLs, `LiveEventLine` gains a typed `minute`/`type`/`side`
11
+ (plus optional `player`/`playerOff`), `LiveStatRow` gains numeric `clubNum`/`oppNum`,
12
+ and `LiveStatsData` gains a typed `momentum: MomentumPoint[]` series plus a
13
+ `clubIsHome`/`homeName`/`awayName` venue signal (mirroring the existing `ClubIsHome`
14
+ pattern on `RestingNextData`/`PostMatchNextData`).
15
+
16
+ Widget React: adds a `useLiveClock` hook that ticks the displayed live minute forward
17
+ once per real minute between 60s polls, so the clock doesn't look frozen. The tick is
18
+ capped at minute+15 so a stuck `clockRunning:true` (no live→postMatch transition landed)
19
+ holds instead of climbing past stoppage time.
20
+
21
+ Widget React: redesigns the live score card — team crests (falling back to a coloured
22
+ initials chip when a crest URL is missing or fails to load), a pulsing Live pill wired
23
+ to the ticking clock, and a scorers line derived from the timeline's goal events.
24
+ Introduces the shared `--ss-w-home`/`--ss-w-away`/`--ss-w-track` colour tokens the
25
+ timeline and stats cards will also use.
26
+
27
+ Widget React: redesigns the live events timeline into a compact two-sided view — each
28
+ club's events sit on their own side of a centre spine, most-recent 3 shown with a "See
29
+ more" toggle for the rest. Goals get a bold name and an accented minute badge, yellow/red
30
+ cards get a coloured card mark, substitutions show both players, and unrecognised event
31
+ types fall back to a neutral dot instead of breaking.
32
+
33
+ Widget React: redesigns the live stats card — every row is now a home/away split bar
34
+ (guarded against a 0/0 stat, which renders an even split rather than a NaN width) plus
35
+ a new `MomentumWave` component that plots the per-minute momentum series as a filled
36
+ area wave with a dashed baseline and a "now" dot, falling back to the plain-text
37
+ momentum label when no series is available. Both the split bars and the wave now
38
+ colour by VENUE (`--ss-w-home`/`--ss-w-away`, keyed off the new `clubIsHome` field) so
39
+ the same team reads as the same colour across the score, timeline, and stats cards —
40
+ club-positive momentum fills with the club's own venue colour rather than always
41
+ painting the club as "home". The colour legend uses the real home/away team names.
42
+
43
+ Widget React: the 60s live poll now refreshes the dashboard's greeting/lead line
44
+ alongside its cards, so it no longer goes stale (e.g. reading "0–0" while the score
45
+ card already shows "0–2"). A poll response without a greeting leaves the existing
46
+ one in place rather than clearing it.
47
+
3
48
  ## 0.24.0
4
49
 
5
50
  ### Minor Changes
package/dist/index.d.cts CHANGED
@@ -322,11 +322,20 @@ interface LiveScoreData {
322
322
  competition?: string | null;
323
323
  minuteLabel: string;
324
324
  statusLabel: string;
325
+ minute: number;
326
+ clockRunning: boolean;
327
+ homeCrestUrl?: string | null;
328
+ awayCrestUrl?: string | null;
325
329
  }
326
330
  interface LiveEventLine {
327
331
  minuteLabel: string;
328
332
  text: string;
329
333
  scoredByClub: boolean;
334
+ minute: number;
335
+ type: 'goal' | 'yellow' | 'red' | 'sub' | 'other';
336
+ side: 'home' | 'away';
337
+ player?: string | null;
338
+ playerOff?: string | null;
330
339
  }
331
340
  interface LiveTimelineData {
332
341
  events: LiveEventLine[];
@@ -335,10 +344,20 @@ interface LiveStatRow {
335
344
  label: string;
336
345
  clubValue: string;
337
346
  oppValue: string;
347
+ clubNum: number;
348
+ oppNum: number;
349
+ }
350
+ interface MomentumPoint {
351
+ minute: number;
352
+ value: number;
338
353
  }
339
354
  interface LiveStatsData {
340
355
  rows: LiveStatRow[];
341
356
  momentumLabel?: string | null;
357
+ momentum: MomentumPoint[];
358
+ clubIsHome: boolean;
359
+ homeName: string;
360
+ awayName: string;
342
361
  }
343
362
  interface LiveScoreCard extends ClubFanDashboardCardBase {
344
363
  cardType: 'liveScore';
package/dist/index.d.ts CHANGED
@@ -322,11 +322,20 @@ interface LiveScoreData {
322
322
  competition?: string | null;
323
323
  minuteLabel: string;
324
324
  statusLabel: string;
325
+ minute: number;
326
+ clockRunning: boolean;
327
+ homeCrestUrl?: string | null;
328
+ awayCrestUrl?: string | null;
325
329
  }
326
330
  interface LiveEventLine {
327
331
  minuteLabel: string;
328
332
  text: string;
329
333
  scoredByClub: boolean;
334
+ minute: number;
335
+ type: 'goal' | 'yellow' | 'red' | 'sub' | 'other';
336
+ side: 'home' | 'away';
337
+ player?: string | null;
338
+ playerOff?: string | null;
330
339
  }
331
340
  interface LiveTimelineData {
332
341
  events: LiveEventLine[];
@@ -335,10 +344,20 @@ interface LiveStatRow {
335
344
  label: string;
336
345
  clubValue: string;
337
346
  oppValue: string;
347
+ clubNum: number;
348
+ oppNum: number;
349
+ }
350
+ interface MomentumPoint {
351
+ minute: number;
352
+ value: number;
338
353
  }
339
354
  interface LiveStatsData {
340
355
  rows: LiveStatRow[];
341
356
  momentumLabel?: string | null;
357
+ momentum: MomentumPoint[];
358
+ clubIsHome: boolean;
359
+ homeName: string;
360
+ awayName: string;
342
361
  }
343
362
  interface LiveScoreCard extends ClubFanDashboardCardBase {
344
363
  cardType: 'liveScore';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sensiblestats/widget-sdk",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Headless browser SDK for the SensibleStats chat widget gateway.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",