@sensiblestats/widget-react 0.158.0 → 0.160.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,30 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.160.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d46ece9: Client events for load, availability, launcher, open and close: widget_loaded, strings_state, widget_unavailable, slip_unavailable, storage_blocked, identity_change, language_change, request_failed, widget_error, widget_open source and first, widget_close method, tab and openMs, bubble_suppressed, bubble_intro_played, visibility_change and widget_init_failed. The sdk client now reports response statuses to listeners.
8
+ - 26cf4e0: Client events for panel navigation, the greeting, asking, answers and chat impressions (tab_redirect, tab_view, tab_dot_shown, sheet_open/close, greeting_loaded/failed, greeting_section_view, market_rechoose, question_asked fields, firstByteMs, input_start/blocked, draft_abandoned, answer_link_click, card_view, chips_shown, card_scope_change, cards_expand, fact_history_expand, monitor_section_toggle, conversation_restored/reset).
9
+ - 0c61e95: Odds cards, the slip, pins and the sentence builder record their client events: slip origin (surface and turn id) on slip and pin events, refusals, add-all results, stale and closed card states, market load failures, price updates, toasts and every builder choice.
10
+ - f560423: Client events for tabs, match and player sheets, games, favourites, settings, failures, limits and empty states.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [d46ece9]
15
+ - @sensiblestats/widget-sdk@0.117.0
16
+
17
+ ## 0.159.0
18
+
19
+ ### Minor Changes
20
+
21
+ - Wire events v2: event ids, a session that survives reloads within 30 minutes, batch context, delivery classes and size-aware batching. The 13 public-only events, host calls, page changes and mobile bridge commands now reach the server. Needs ChatAssistantAPI and WidgetGateway from u676 Plan A.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @sensiblestats/widget-sdk@0.116.0
27
+
3
28
  ## 0.158.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -63,7 +63,7 @@ Common `config` fields:
63
63
  SensibleStats look.
64
64
  - `page` — the page the widget sits on, `{ sport, kind?, matchId?, competitionId? }`, so the
65
65
  first greeting can lead with it. Football ids are bare (`'4820113'`); NBA ids are
66
- `'nba:game:{id}'` or digits. `sport` is `'football'` or `'nba'`; the server answers any other
66
+ `'nba:game:{id}'` or digits. `sport` is `'football'`, `'basketball'`, `'americanfootball'` or `'tennis'`; the server answers any other
67
67
  value with `unsupported_sport` and the visitor sees today's greeting, so check your spelling
68
68
  rather than expecting a client-side error. The page rides on greeting requests only, never on a
69
69
  typed or tapped turn. Omit it and the request is unchanged.
@@ -245,7 +245,6 @@ Rules:
245
245
  | `dashboard_tile_click` | `entityType`, `entityId` | A dashboard tile is tapped |
246
246
  | `sport_switch` | `sport` | The visitor switches sport on the dashboard |
247
247
  | `new_conversation` | | The visitor starts a new conversation |
248
- | `league_star` | `competitionId`, `starred` | A league star changes and the request succeeds. A failed star is silent |
249
248
  | `favourite_change` | `kind`, `id`, `outcome` | A favourite is added or removed. Failures show in `outcome` |
250
249
 
251
250
  `add_to_slip_result.outcome` is `added`, `duplicate`, `price_changed`, `timeout`, or the
@@ -254,14 +253,14 @@ covers any failure of the add, not only a real timeout.
254
253
 
255
254
  ## Integration: persisting the conversation across SPA navigation
256
255
 
257
- The conversation (messages, conversation id, open/closed state) lives in the
258
- component's in-memory React state. It survives for exactly as long as the
259
- `<StatsWidget>` instance stays mounted:
256
+ The conversation (the last 30 messages and the conversation id) is saved in
257
+ `localStorage` per operator, visitor and language, and is restored for one hour
258
+ after the visitor's last activity:
260
259
 
261
- - **In-app (client-side) navigation** keeps it — as long as the component is not
260
+ - **In-app (client-side) navigation** keeps it, as long as the component is not
262
261
  unmounted.
263
- - **A hard page refresh** tears down the React tree and remounts the widget, so
264
- the conversation starts fresh. This is intentional.
262
+ - **A hard page refresh** remounts the widget, which restores the saved
263
+ conversation if it is less than an hour old; after that it starts fresh.
265
264
 
266
265
  To keep the active conversation across route changes in a single-page app,
267
266
  **mount `<StatsWidget>` once in a component that stays mounted across