@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/dist/index.js CHANGED
@@ -968,6 +968,9 @@ function isEnglishLocale(locale) {
968
968
  return lang === "en" || !Object.prototype.hasOwnProperty.call(STRINGS, lang);
969
969
  }
970
970
 
971
+ // src/version.generated.ts
972
+ var WIDGET_REACT_VERSION = "0.89.0";
973
+
971
974
  // src/config.ts
972
975
  function normalizeUi(cfg) {
973
976
  const strings = resolveLocaleStrings(cfg.locale);
@@ -1200,7 +1203,7 @@ function normalizeUi(cfg) {
1200
1203
  };
1201
1204
  }
1202
1205
  function toClientOptions(cfg) {
1203
- const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey };
1206
+ const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client: `widget-react/${WIDGET_REACT_VERSION}` };
1204
1207
  if (cfg.baseUrl !== void 0) opts.baseUrl = cfg.baseUrl;
1205
1208
  return opts;
1206
1209
  }
@@ -6288,10 +6291,12 @@ function FormDots({ form, ui }) {
6288
6291
  }
6289
6292
  function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
6290
6293
  const [expanded, setExpanded] = useState32(false);
6291
- const { homeForm, awayForm, h2h } = formAndH2H;
6294
+ const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
6292
6295
  if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
6293
6296
  return /* @__PURE__ */ jsx53(Fragment8, {});
6294
6297
  }
6298
+ const homeLabel = homeShortCode || homeTeamName;
6299
+ const awayLabel = awayShortCode || awayTeamName;
6295
6300
  const total = h2h ? h2h.wins + h2h.draws + h2h.losses : 0;
6296
6301
  const winsPct = total > 0 && h2h ? h2h.wins / total * 100 : 0;
6297
6302
  const drawsPct = total > 0 && h2h ? h2h.draws / total * 100 : 0;
@@ -6322,11 +6327,11 @@ function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
6322
6327
  expanded && /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-body", children: [
6323
6328
  /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-forms", children: [
6324
6329
  /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-form-col", children: [
6325
- /* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: homeTeamName }),
6330
+ /* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: homeLabel }),
6326
6331
  /* @__PURE__ */ jsx53(FormDots, { form: homeForm, ui })
6327
6332
  ] }),
6328
6333
  /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-form-col ss-w-h2h-form-col--away", children: [
6329
- /* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: awayTeamName }),
6334
+ /* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: awayLabel }),
6330
6335
  /* @__PURE__ */ jsx53(FormDots, { form: awayForm, ui })
6331
6336
  ] })
6332
6337
  ] }),