@sensiblestats/widget-react 0.107.2 → 0.108.1

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,23 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.108.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Show a market's insight in the Following tab when it arrives after the market was first fetched.
8
+
9
+ ## 0.108.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Personal greeting sections, a Favourites tab, and a combo_add event when a builder combo is added to the slip.
14
+ - A `locale` the host sets is now also sent as the conversation's server language (`userContext.defaultLanguage`), so the answers and the greeting follow the widget's language. Only `en` and `tr` are sent, reduced to the primary subtag (`tr-TR` and `tr_TR` send `tr`, `tr-TR` gets Turkish chrome and presets); any other locale sends nothing, so the operator's default stands and NBA and NFL stay. A `defaultLanguage` the host sets in `userContext` still wins, and a host that sets no `locale` sends none. When the language sent is `en` or `tr` (from `locale` or from `userContext.defaultLanguage` alone) the stored chat thread is keyed by it (`:lang=en` / `:lang=tr`, reduced and trimmed, so `'TR '` and `'tr'` are one thread), so changing `locale` (on a reload or a mounted widget) starts that language's thread and greets in it; any other language, or none, keeps the plain key. A visitor whose host already sets `en` or `tr` moves once to the `:lang=` thread on upgrade (threads expire after an hour). A language change while an answer streams drops that turn. A non-text `locale` no longer throws, `tr-` reads as Turkish everywhere, and the live monitor is asked in the reduced language. A slip click refused after kick-off by the widget's own check says the game has started instead of Try again; a `closed` refusal from the host with no `message` says "This selection can't be added." (`closed` is not defined as "game started"); "Add all" says the same when every leg is refused as `closed` and keeps "Try again" for a mix.
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+ - @sensiblestats/widget-sdk@0.75.0
20
+
3
21
  ## 0.107.2
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -33,11 +33,23 @@ Common `config` fields:
33
33
  - `operatorId`, `publicKey` — your gateway credentials (both browser-safe; the
34
34
  public key is origin-gated at the gateway).
35
35
  - `baseUrl` — the widget gateway URL.
36
- - `locale` — `'en'` or `'tr'` for the widget's own chrome text.
36
+ - `locale` — `'en'` or `'tr'` for the widget's own chrome text; a region (`'tr-TR'`) or
37
+ an underscore (`'tr_TR'`) counts as its language. It is also sent as the server
38
+ language (`userContext.defaultLanguage`) when it is one of those two; any other
39
+ value, or none, sends nothing and the operator's own default language applies.
40
+ The chat thread is kept per language: when the language sent to the server is
41
+ `en` or `tr` (from `locale`, or from `userContext.defaultLanguage` alone), the thread
42
+ key carries `:lang=<language>`, so `'TR '` and `'tr'` are one thread and a change
43
+ of language starts that language's own thread. Any other value, or none, keeps the
44
+ plain key. A visitor of a host that already sets one of those two languages moves
45
+ once to the `:lang=` thread when the host upgrades (threads expire after an hour).
46
+ Changing the language while an answer is streaming drops that turn. With an injected `client`, `locale` sets the chrome only;
47
+ the client keeps its own conversation context.
37
48
  - `userContext` — `{ operatorUserId, defaultLanguage }` to tie the conversation
38
- and personalization to your signed-in user. `operatorUserId` travels from the
39
- browser, so make it a random, non-guessable value you map to the user on your
40
- side (a UUID works): never an account number, email, username or sequential id.
49
+ and personalization to your signed-in user. A `defaultLanguage` set here wins
50
+ over `locale`. `operatorUserId` travels from the browser, so make it a random,
51
+ non-guessable value you map to the user on your side (a UUID works): never an
52
+ account number, email, username or sequential id.
41
53
  - White-label branding — `logoUrl`, `headerTitle`, `accent`, `cta`, `surface`,
42
54
  `ink`. Absent → the default SensibleStats look.
43
55
  - `page` — the page the widget sits on, `{ sport, kind?, matchId?, competitionId? }`, so the
@@ -97,6 +109,12 @@ What each one does:
97
109
  `{ status: 'duplicate' }` or `{ status: 'rejected', reason }`. The widget shows "In slip" for an
98
110
  added or duplicate selection. Answer within 10 seconds. Without a `host`, an "In slip" button
99
111
  stays that way until the page reloads; with one, `slipRemoved` and `betPlaced` clear it.
112
+ - A `{ status: 'rejected', reason: 'closed' }` result is shown with your `message` when you send
113
+ one, and as "This selection can't be added." otherwise. `closed` is not defined as "game started",
114
+ so the widget says that only for its own kick-off check ("This game has started."). Send a
115
+ `message` for a market that is suspended or closed on your side. "Add all" follows the same rule
116
+ when every leg comes back `closed` (your first `message`, else the neutral line); a mix of `closed`
117
+ and any other refusal keeps "Couldn't add to slip. Try again." because a retry may help.
100
118
  - `slipSports`. Sports your `onAddToSlip` understands beyond football. An NBA price is an "Add to
101
119
  slip" button only when all three hold: the card arrives with the slip enabled for your operator
102
120
  account (`addToSlipEnabled`), you set `onAddToSlip`, and `slipSports` includes `'basketball'`.