@sensiblestats/widget-react 0.95.0 → 0.95.1

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,11 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.95.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d7807c3: NBA line score shows OT columns only once a game reaches overtime, and dashes quarters not yet played instead of the feed's 0.
8
+
3
9
  ## 0.95.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1137,7 +1137,7 @@ function isEnglishLocale(locale) {
1137
1137
  }
1138
1138
 
1139
1139
  // src/version.generated.ts
1140
- var WIDGET_REACT_VERSION = "0.95.0";
1140
+ var WIDGET_REACT_VERSION = "0.95.1";
1141
1141
 
1142
1142
  // src/config.ts
1143
1143
  function normalizeUi(cfg) {
@@ -7634,6 +7634,12 @@ function Side({ abbreviation, nickname, teamName, away }) {
7634
7634
  ] })
7635
7635
  ] });
7636
7636
  }
7637
+ function lastScored(scores) {
7638
+ for (let i = scores.length - 1; i >= 0; i--) {
7639
+ if (typeof scores[i] === "number") return i + 1;
7640
+ }
7641
+ return 0;
7642
+ }
7637
7643
  function cell(value) {
7638
7644
  return typeof value === "number" ? String(value) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ss-w-nbamon-dash", children: "\u2013" });
7639
7645
  }
@@ -7662,8 +7668,9 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
7662
7668
  const inPlay = live && !atBreak(match);
7663
7669
  const scored = live || match.phase === "fullTime";
7664
7670
  const kickoff = match.phase === "preMatch" && match.kickoffUtc ? ui.bettingKickoff(match.kickoffUtc) : void 0;
7665
- const periods = Math.max(REGULATION_PERIODS, b.homePeriods.length, b.awayPeriods.length);
7671
+ const periods = Math.max(REGULATION_PERIODS, b.period, lastScored(b.homePeriods), lastScored(b.awayPeriods));
7666
7672
  const columns = Array.from({ length: periods }, (_, i) => i);
7673
+ const played = (i) => !live || i < b.period;
7667
7674
  const timeouts = [
7668
7675
  { key: "away", value: b.awayTimeoutsLeft },
7669
7676
  { key: "home", value: b.homeTimeoutsLeft }
@@ -7710,7 +7717,7 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
7710
7717
  { abbreviation: b.homeAbbreviation, scores: b.homePeriods, total: match.homeScore }
7711
7718
  ].map((row) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("tr", { children: [
7712
7719
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("th", { scope: "row", children: row.abbreviation }),
7713
- columns.map((i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { className: inPlay && i === b.period - 1 ? "ss-w-nbamon-cur" : void 0, children: cell(row.scores[i]) }, i)),
7720
+ columns.map((i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { className: inPlay && i === b.period - 1 ? "ss-w-nbamon-cur" : void 0, children: cell(played(i) ? row.scores[i] : null) }, i)),
7714
7721
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { className: "ss-w-nbamon-total", children: row.total ?? 0 })
7715
7722
  ] }, row.abbreviation)) })
7716
7723
  ] }),