@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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.166.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6ce80c5: Combo card legs carry their sport and player; an NBA, NFL or tennis leg goes to the slip under its own sport.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [6ce80c5]
12
+ - @sensiblestats/widget-sdk@0.122.0
13
+
14
+ ## 0.165.3
15
+
16
+ ### Patch Changes
17
+
18
+ - d97b383: A match log row and a matchday predictor game with no result show no letter, pill or grade.
19
+ - Updated dependencies [d97b383]
20
+ - @sensiblestats/widget-sdk@0.121.1
21
+
3
22
  ## 0.165.2
4
23
 
5
24
  ### Patch Changes
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.165.2";
1425
+ var WIDGET_REACT_VERSION = "0.166.0";
1426
1426
 
1427
1427
  // src/config.ts
1428
1428
  var COLOR_KEYS = ["accent", "cta", "surface", "ink"];
@@ -2317,6 +2317,8 @@ function toComboLegVM(leg) {
2317
2317
  const hasStat = !!insightId && !!statText;
2318
2318
  if (price === void 0 || matchOddsId === void 0 || matchId === void 0 || !home || !away || !selectionLabel) return null;
2319
2319
  const line = str(leg.line);
2320
+ const sport = (0, import_widget_sdk.slipSportOf)(str(leg.sport));
2321
+ const player = str(leg.player);
2320
2322
  const rawFact = leg.fact && typeof leg.fact === "object" ? leg.fact : void 0;
2321
2323
  const direction2 = leg.direction === "over" || leg.direction === "under" ? leg.direction : void 0;
2322
2324
  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;
@@ -2341,6 +2343,8 @@ function toComboLegVM(leg) {
2341
2343
  quotedAtUtc: str(leg.quotedAtUtc),
2342
2344
  ...hasStat ? { insightId, statText } : {},
2343
2345
  ...fact ? { fact } : {},
2346
+ ...sport ? { sport } : {},
2347
+ ...player ? { player } : {},
2344
2348
  pinEnabled: leg.pinEnabled === true
2345
2349
  };
2346
2350
  }
@@ -17920,13 +17924,14 @@ function MatchdayPredictorGame({
17920
17924
  ] });
17921
17925
  }
17922
17926
  const r = clientState.result;
17927
+ const finalScore = r.homeScore !== void 0 && r.awayScore !== void 0 ? { h: r.homeScore, a: r.awayScore } : null;
17923
17928
  return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
17924
17929
  header,
17925
17930
  /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "ss-g-body", children: [
17926
- config && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
17927
- /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
17931
+ config && finalScore && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: finalScore.h, a: finalScore.a, t }),
17932
+ /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ResultCard, { tone: "neutral", title: finalScore ? t.fullTime(finalScore.h, finalScore.a) : t.outcome, onBack, ui }),
17928
17933
  /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("ul", { className: "ss-g-mp-rows", children: [
17929
- /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
17934
+ clientState.exactScoreCorrect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
17930
17935
  /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
17931
17936
  !clientState.firstScorerVoid && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
17932
17937
  ] })
@@ -20170,7 +20175,9 @@ function MatchRow({ ui, row }) {
20170
20175
  row.yellowCards > 0 ? `${row.yellowCards}${ui.statHeadYellow}` : null,
20171
20176
  row.sentOff ? ui.statHeadRed : null
20172
20177
  ].filter((x) => x !== null);
20173
- const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
20178
+ const letter = row.result == null ? null : ui.resultLetter[row.result];
20179
+ const score = `${row.goalsFor}\u2013${row.goalsAgainst}`;
20180
+ const sub = [letter === null ? score : `${letter} ${score}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
20174
20181
  const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
20175
20182
  const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
20176
20183
  return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "ss-w-pd-match", children: [
@@ -20179,7 +20186,7 @@ function MatchRow({ ui, row }) {
20179
20186
  /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
20180
20187
  /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "ss-w-pd-match-sub", children: sub })
20181
20188
  ] }),
20182
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
20189
+ letter !== null && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: letter }),
20183
20190
  rating === null ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: formatFixed(rating, ui.locale, 1) })
20184
20191
  ] });
20185
20192
  }