@sensiblestats/widget-react 0.120.1 → 0.122.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 +22 -0
- package/README.md +17 -15
- package/dist/index.cjs +2354 -2694
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2283 -2623
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.122.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Read the Continue label, the countdown title and the Mystery Tiger position tiles from the server's strings rows. A widget whose non-English strings cannot load stays hidden: a 4xx other than 429 is final, anything else recovers through a 5-minute retry, the browser coming back online, or the tab becoming visible. The SDK's getWidgetStrings errors now carry the HTTP status and Retry-After, which the gateway forwards.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @sensiblestats/widget-sdk@0.86.0
|
|
13
|
+
|
|
14
|
+
## 0.121.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Widget chrome strings now come from the server for the host's language tag, with a bundled en-GB fallback. `locale` accepts any registry tag and wins over `userContext.defaultLanguage`; a host with no language sends none and gets the operator default. English hosts see dates as "1 Nov", Turkish numbers use the decimal comma, and the panel opens once the strings are ready.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @sensiblestats/widget-sdk@0.85.0
|
|
24
|
+
|
|
3
25
|
## 0.120.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ export function App() {
|
|
|
21
21
|
operatorId: 'sandbox1',
|
|
22
22
|
publicKey: 'wgk_…',
|
|
23
23
|
baseUrl: 'https://widget.sensiblestats.com',
|
|
24
|
-
locale: 'en',
|
|
24
|
+
locale: 'en-GB',
|
|
25
25
|
}}
|
|
26
26
|
/>
|
|
27
27
|
)
|
|
@@ -33,26 +33,28 @@ 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` —
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
The
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
the
|
|
36
|
+
- `locale` — any language tag in the server's registry (`'en-GB'`, `'en-US'`, `'tr-TR'`, `'de'`, ...). It is
|
|
37
|
+
sent whole to the server as the language (`defaultLanguage`) and picks the widget's own chrome text. A host
|
|
38
|
+
with no `locale` sends no language and gets the operator's default (en-GB when the operator has none).
|
|
39
|
+
`locale` wins over `userContext.defaultLanguage`.
|
|
40
|
+
The chrome strings come from the gateway (`/v1/<operatorId>/strings`) for the resolved tag, so a wording
|
|
41
|
+
fix or a new language is a server change. The table is cached in `localStorage` per operator and tag and
|
|
42
|
+
revalidated on every load, so a returning visitor sees chrome at once. Only en-GB is bundled: an English
|
|
43
|
+
or unset tag with an empty cache falls back to it if the request fails; any other tag with a cold cache
|
|
44
|
+
shows a busy launcher and no panel until the strings arrive, then retries with backoff.
|
|
45
|
+
The chat thread is kept per language family of the host's tag: the thread key carries `:lang=<family>`
|
|
46
|
+
(`'tr-TR'` and `'tr'` are one thread, `'de'` has its own), and a change of language starts that
|
|
47
|
+
language's own thread. With no host tag the plain key is used. Changing the language while an answer is
|
|
48
|
+
streaming drops that turn. With an injected `client`, `locale` sets the chrome only; the client keeps its
|
|
49
|
+
own conversation context.
|
|
48
50
|
- `oddsFormat` — `'decimal'`, `'american'` or `'fractional'`: how the widget shows every price
|
|
49
51
|
until the visitor picks their own in the widget's settings. Anything else, or none, is
|
|
50
52
|
decimal. The script embed reads it from `data-odds-format`. The built-in client sends the
|
|
51
53
|
format in effect with every chat request, so the server writes its sentences in it too. An
|
|
52
54
|
injected `client` sends only the visitor's own pick, and nothing until they make one.
|
|
53
55
|
- `userContext` — `{ operatorUserId, defaultLanguage }` to tie the conversation
|
|
54
|
-
and personalization to your signed-in user. A `
|
|
55
|
-
over `
|
|
56
|
+
and personalization to your signed-in user. A `locale` set on the config wins
|
|
57
|
+
over this `defaultLanguage`. `operatorUserId` travels from the browser, so make it a random,
|
|
56
58
|
non-guessable value you map to the user on your side (a UUID works): never an
|
|
57
59
|
account number, email, username or sequential id.
|
|
58
60
|
- White-label branding — `logoUrl`, `headerTitle`, `accent`, `cta`, `surface`,
|