@sensiblestats/widget-react 0.165.2 → 0.166.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
@@ -1383,7 +1383,7 @@ function parseCustomTotal(text2, format2) {
1383
1383
  }
1384
1384
 
1385
1385
  // src/version.generated.ts
1386
- var WIDGET_REACT_VERSION = "0.165.2";
1386
+ var WIDGET_REACT_VERSION = "0.166.0";
1387
1387
 
1388
1388
  // src/config.ts
1389
1389
  var COLOR_KEYS = ["accent", "cta", "surface", "ink"];
@@ -2278,6 +2278,8 @@ function toComboLegVM(leg) {
2278
2278
  const hasStat = !!insightId && !!statText;
2279
2279
  if (price === void 0 || matchOddsId === void 0 || matchId === void 0 || !home || !away || !selectionLabel) return null;
2280
2280
  const line = str(leg.line);
2281
+ const sport = slipSportOf(str(leg.sport));
2282
+ const player = str(leg.player);
2281
2283
  const rawFact = leg.fact && typeof leg.fact === "object" ? leg.fact : void 0;
2282
2284
  const direction2 = leg.direction === "over" || leg.direction === "under" ? leg.direction : void 0;
2283
2285
  const fact = rawFact && direction2 && Number.isInteger(rawFact.hits) && Number.isInteger(rawFact.games) && Number.isInteger(rawFact.window) && rawFact.games >= 5 && rawFact.hits >= 0 && rawFact.hits <= rawFact.games && rawFact.games <= rawFact.window ? { hits: rawFact.hits, games: rawFact.games, window: rawFact.window, direction: direction2 } : void 0;
@@ -2302,6 +2304,8 @@ function toComboLegVM(leg) {
2302
2304
  quotedAtUtc: str(leg.quotedAtUtc),
2303
2305
  ...hasStat ? { insightId, statText } : {},
2304
2306
  ...fact ? { fact } : {},
2307
+ ...sport ? { sport } : {},
2308
+ ...player ? { player } : {},
2305
2309
  pinEnabled: leg.pinEnabled === true
2306
2310
  };
2307
2311
  }
@@ -17881,13 +17885,14 @@ function MatchdayPredictorGame({
17881
17885
  ] });
17882
17886
  }
17883
17887
  const r = clientState.result;
17888
+ const finalScore = r.homeScore !== void 0 && r.awayScore !== void 0 ? { h: r.homeScore, a: r.awayScore } : null;
17884
17889
  return /* @__PURE__ */ jsxs119("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
17885
17890
  header,
17886
17891
  /* @__PURE__ */ jsxs119("div", { className: "ss-g-body", children: [
17887
- config && /* @__PURE__ */ jsx137(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
17888
- /* @__PURE__ */ jsx137(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
17892
+ config && finalScore && /* @__PURE__ */ jsx137(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: finalScore.h, a: finalScore.a, t }),
17893
+ /* @__PURE__ */ jsx137(ResultCard, { tone: "neutral", title: finalScore ? t.fullTime(finalScore.h, finalScore.a) : t.outcome, onBack, ui }),
17889
17894
  /* @__PURE__ */ jsxs119("ul", { className: "ss-g-mp-rows", children: [
17890
- /* @__PURE__ */ jsx137(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
17895
+ clientState.exactScoreCorrect !== void 0 && /* @__PURE__ */ jsx137(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
17891
17896
  /* @__PURE__ */ jsx137(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
17892
17897
  !clientState.firstScorerVoid && /* @__PURE__ */ jsx137(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
17893
17898
  ] })
@@ -20131,7 +20136,9 @@ function MatchRow({ ui, row }) {
20131
20136
  row.yellowCards > 0 ? `${row.yellowCards}${ui.statHeadYellow}` : null,
20132
20137
  row.sentOff ? ui.statHeadRed : null
20133
20138
  ].filter((x) => x !== null);
20134
- const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
20139
+ const letter = row.result == null ? null : ui.resultLetter[row.result];
20140
+ const score = `${row.goalsFor}\u2013${row.goalsAgainst}`;
20141
+ const sub = [letter === null ? score : `${letter} ${score}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
20135
20142
  const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
20136
20143
  const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
20137
20144
  return /* @__PURE__ */ jsxs138("div", { className: "ss-w-pd-match", children: [
@@ -20140,7 +20147,7 @@ function MatchRow({ ui, row }) {
20140
20147
  /* @__PURE__ */ jsx161("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
20141
20148
  /* @__PURE__ */ jsx161("div", { className: "ss-w-pd-match-sub", children: sub })
20142
20149
  ] }),
20143
- /* @__PURE__ */ jsx161("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
20150
+ letter !== null && /* @__PURE__ */ jsx161("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: letter }),
20144
20151
  rating === null ? /* @__PURE__ */ jsx161("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ jsx161("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: formatFixed(rating, ui.locale, 1) })
20145
20152
  ] });
20146
20153
  }