@sensiblestats/widget-react 0.160.0 → 0.161.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 +11 -0
- package/README.md +3 -3
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.161.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `baseUrl` is now required. The SDK no longer falls back to a default gateway host, because every operator box has its own gateway. `new StatsWidgetClient` throws when `baseUrl` is missing or blank, and `StatsWidgetConfig.baseUrl` is a required string. The embed script still infers it from its own `src`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @sensiblestats/widget-sdk@0.118.0
|
|
13
|
+
|
|
3
14
|
## 0.160.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ export function App() {
|
|
|
20
20
|
config={{
|
|
21
21
|
operatorId: 'sandbox1',
|
|
22
22
|
publicKey: 'wgk_…',
|
|
23
|
-
baseUrl: 'https
|
|
23
|
+
baseUrl: 'https://<your-box-gateway-host>',
|
|
24
24
|
locale: 'en-GB',
|
|
25
25
|
}}
|
|
26
26
|
/>
|
|
@@ -32,7 +32,7 @@ Common `config` fields:
|
|
|
32
32
|
|
|
33
33
|
- `operatorId`, `publicKey` — your gateway credentials (both browser-safe; the
|
|
34
34
|
public key is origin-gated at the gateway).
|
|
35
|
-
- `baseUrl` —
|
|
35
|
+
- `baseUrl` — required. The widget gateway URL of your operator box; there is no default host, and omitting it is a type error.
|
|
36
36
|
- `locale` — any language tag in the server's registry (`'en-GB'`, `'en-US'`, `'tr-TR'`, `'de'`, ...). It is
|
|
37
37
|
sent whole to the server as the language (`defaultLanguage`) and picks the widget's own chrome text. A host
|
|
38
38
|
with no `locale` sends no language and gets the operator's default (en-GB when the operator has none).
|
|
@@ -280,7 +280,7 @@ import { StatsWidget } from '@sensiblestats/widget-react'
|
|
|
280
280
|
const widgetConfig = {
|
|
281
281
|
operatorId: 'sandbox1',
|
|
282
282
|
publicKey: 'wgk_…',
|
|
283
|
-
baseUrl: 'https
|
|
283
|
+
baseUrl: 'https://<your-box-gateway-host>',
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
export function AppLayout() {
|
package/dist/index.cjs
CHANGED
|
@@ -1422,7 +1422,7 @@ function parseCustomTotal(text2, format2) {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
1424
|
// src/version.generated.ts
|
|
1425
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1425
|
+
var WIDGET_REACT_VERSION = "0.161.0";
|
|
1426
1426
|
|
|
1427
1427
|
// src/config.ts
|
|
1428
1428
|
var COLOR_KEYS = ["accent", "cta", "surface", "ink"];
|
|
@@ -1829,8 +1829,7 @@ function normalizeUi(cfg, loaded) {
|
|
|
1829
1829
|
};
|
|
1830
1830
|
}
|
|
1831
1831
|
function toClientOptions(cfg) {
|
|
1832
|
-
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client: `${cfg.transport?.client ?? "widget-react"}/${WIDGET_REACT_VERSION}` };
|
|
1833
|
-
if (cfg.baseUrl !== void 0) opts.baseUrl = cfg.baseUrl;
|
|
1832
|
+
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, baseUrl: cfg.baseUrl, client: `${cfg.transport?.client ?? "widget-react"}/${WIDGET_REACT_VERSION}` };
|
|
1834
1833
|
if (cfg.transport?.fetch !== void 0) opts.fetch = cfg.transport.fetch;
|
|
1835
1834
|
const timeZone = validZone(cfg.timeZone);
|
|
1836
1835
|
if (timeZone !== void 0) opts.timeZone = timeZone;
|