@sensiblestats/widget-react 0.87.0 → 0.89.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/dist/index.cjs +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.89.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3b75853: The widget sends its version in an X-SS-Client header (widget-react/<version>) so the operator panel can show which version each brand runs. The SDK takes an optional `client` option and sends no header without it.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [3b75853]
|
|
12
|
+
- @sensiblestats/widget-sdk@0.59.0
|
|
13
|
+
|
|
14
|
+
## 0.88.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 8973968: Show team short codes in the Form & H2H block's column headers and win labels instead of repeating the full team name, falling back to the full name when no short code is known.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [8973968]
|
|
23
|
+
- @sensiblestats/widget-sdk@0.58.0
|
|
24
|
+
|
|
3
25
|
## 0.87.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1006,6 +1006,9 @@ function isEnglishLocale(locale) {
|
|
|
1006
1006
|
return lang === "en" || !Object.prototype.hasOwnProperty.call(STRINGS, lang);
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
|
+
// src/version.generated.ts
|
|
1010
|
+
var WIDGET_REACT_VERSION = "0.89.0";
|
|
1011
|
+
|
|
1009
1012
|
// src/config.ts
|
|
1010
1013
|
function normalizeUi(cfg) {
|
|
1011
1014
|
const strings = resolveLocaleStrings(cfg.locale);
|
|
@@ -1238,7 +1241,7 @@ function normalizeUi(cfg) {
|
|
|
1238
1241
|
};
|
|
1239
1242
|
}
|
|
1240
1243
|
function toClientOptions(cfg) {
|
|
1241
|
-
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey };
|
|
1244
|
+
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client: `widget-react/${WIDGET_REACT_VERSION}` };
|
|
1242
1245
|
if (cfg.baseUrl !== void 0) opts.baseUrl = cfg.baseUrl;
|
|
1243
1246
|
return opts;
|
|
1244
1247
|
}
|
|
@@ -6326,10 +6329,12 @@ function FormDots({ form, ui }) {
|
|
|
6326
6329
|
}
|
|
6327
6330
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
6328
6331
|
const [expanded, setExpanded] = (0, import_react44.useState)(false);
|
|
6329
|
-
const { homeForm, awayForm, h2h } = formAndH2H;
|
|
6332
|
+
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
6330
6333
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
6331
6334
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, {});
|
|
6332
6335
|
}
|
|
6336
|
+
const homeLabel = homeShortCode || homeTeamName;
|
|
6337
|
+
const awayLabel = awayShortCode || awayTeamName;
|
|
6333
6338
|
const total = h2h ? h2h.wins + h2h.draws + h2h.losses : 0;
|
|
6334
6339
|
const winsPct = total > 0 && h2h ? h2h.wins / total * 100 : 0;
|
|
6335
6340
|
const drawsPct = total > 0 && h2h ? h2h.draws / total * 100 : 0;
|
|
@@ -6360,11 +6365,11 @@ function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
|
6360
6365
|
expanded && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ss-w-h2h-body", children: [
|
|
6361
6366
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ss-w-h2h-forms", children: [
|
|
6362
6367
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ss-w-h2h-form-col", children: [
|
|
6363
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "ss-w-h2h-form-team", children:
|
|
6368
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "ss-w-h2h-form-team", children: homeLabel }),
|
|
6364
6369
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FormDots, { form: homeForm, ui })
|
|
6365
6370
|
] }),
|
|
6366
6371
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ss-w-h2h-form-col ss-w-h2h-form-col--away", children: [
|
|
6367
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "ss-w-h2h-form-team", children:
|
|
6372
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "ss-w-h2h-form-team", children: awayLabel }),
|
|
6368
6373
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FormDots, { form: awayForm, ui })
|
|
6369
6374
|
] })
|
|
6370
6375
|
] }),
|