@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 +6 -0
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1099,7 +1099,7 @@ function isEnglishLocale(locale) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
// src/version.generated.ts
|
|
1102
|
-
var WIDGET_REACT_VERSION = "0.95.
|
|
1102
|
+
var WIDGET_REACT_VERSION = "0.95.1";
|
|
1103
1103
|
|
|
1104
1104
|
// src/config.ts
|
|
1105
1105
|
function normalizeUi(cfg) {
|
|
@@ -7596,6 +7596,12 @@ function Side({ abbreviation, nickname, teamName, away }) {
|
|
|
7596
7596
|
] })
|
|
7597
7597
|
] });
|
|
7598
7598
|
}
|
|
7599
|
+
function lastScored(scores) {
|
|
7600
|
+
for (let i = scores.length - 1; i >= 0; i--) {
|
|
7601
|
+
if (typeof scores[i] === "number") return i + 1;
|
|
7602
|
+
}
|
|
7603
|
+
return 0;
|
|
7604
|
+
}
|
|
7599
7605
|
function cell(value) {
|
|
7600
7606
|
return typeof value === "number" ? String(value) : /* @__PURE__ */ jsx57("span", { className: "ss-w-nbamon-dash", children: "\u2013" });
|
|
7601
7607
|
}
|
|
@@ -7624,8 +7630,9 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
|
|
|
7624
7630
|
const inPlay = live && !atBreak(match);
|
|
7625
7631
|
const scored = live || match.phase === "fullTime";
|
|
7626
7632
|
const kickoff = match.phase === "preMatch" && match.kickoffUtc ? ui.bettingKickoff(match.kickoffUtc) : void 0;
|
|
7627
|
-
const periods = Math.max(REGULATION_PERIODS, b.homePeriods
|
|
7633
|
+
const periods = Math.max(REGULATION_PERIODS, b.period, lastScored(b.homePeriods), lastScored(b.awayPeriods));
|
|
7628
7634
|
const columns = Array.from({ length: periods }, (_, i) => i);
|
|
7635
|
+
const played = (i) => !live || i < b.period;
|
|
7629
7636
|
const timeouts = [
|
|
7630
7637
|
{ key: "away", value: b.awayTimeoutsLeft },
|
|
7631
7638
|
{ key: "home", value: b.homeTimeoutsLeft }
|
|
@@ -7672,7 +7679,7 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
|
|
|
7672
7679
|
{ abbreviation: b.homeAbbreviation, scores: b.homePeriods, total: match.homeScore }
|
|
7673
7680
|
].map((row) => /* @__PURE__ */ jsxs52("tr", { children: [
|
|
7674
7681
|
/* @__PURE__ */ jsx57("th", { scope: "row", children: row.abbreviation }),
|
|
7675
|
-
columns.map((i) => /* @__PURE__ */ jsx57("td", { className: inPlay && i === b.period - 1 ? "ss-w-nbamon-cur" : void 0, children: cell(row.scores[i]) }, i)),
|
|
7682
|
+
columns.map((i) => /* @__PURE__ */ jsx57("td", { className: inPlay && i === b.period - 1 ? "ss-w-nbamon-cur" : void 0, children: cell(played(i) ? row.scores[i] : null) }, i)),
|
|
7676
7683
|
/* @__PURE__ */ jsx57("td", { className: "ss-w-nbamon-total", children: row.total ?? 0 })
|
|
7677
7684
|
] }, row.abbreviation)) })
|
|
7678
7685
|
] }),
|