@sensiblestats/widget-react 0.118.0 → 0.118.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 +29 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -22
- package/dist/index.js.map +1 -1
- package/dist/styles.css +6 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.118.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- NBA Following card: the home team's form dots and rest chip line up under the home team, and Form & rest is a collapsible row like Moneyline/Spread/Total, placed under Total with each side's last-5 record and the same team switch as Player props.
|
|
8
|
+
|
|
3
9
|
## 0.118.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1566,7 +1566,7 @@ function parseOddsFormat(value) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
|
|
1568
1568
|
// src/version.generated.ts
|
|
1569
|
-
var WIDGET_REACT_VERSION = "0.118.
|
|
1569
|
+
var WIDGET_REACT_VERSION = "0.118.1";
|
|
1570
1570
|
|
|
1571
1571
|
// src/config.ts
|
|
1572
1572
|
function normalizeUi(cfg) {
|
|
@@ -10327,12 +10327,13 @@ function useNbaForm(match, monitor) {
|
|
|
10327
10327
|
return monitor.playerProps?.[monitorMatchKey(void 0, match.matchId)]?.bundle?.nbaForm ?? null;
|
|
10328
10328
|
}
|
|
10329
10329
|
var won = (g) => g.teamScore > g.opponentScore;
|
|
10330
|
-
function Cell2({ abbr, team, ui }) {
|
|
10331
|
-
|
|
10330
|
+
function Cell2({ abbr, team, home, ui }) {
|
|
10331
|
+
const cls = home ? "ss-w-nbaform-cell ss-w-nbaform-cell--home" : "ss-w-nbaform-cell";
|
|
10332
|
+
if (!team) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: cls });
|
|
10332
10333
|
const games = [...team.last5].reverse();
|
|
10333
10334
|
const chip = restChip(ui, team);
|
|
10334
10335
|
const letters = games.map((g) => won(g) ? ui.nba.formWin : ui.nba.formLoss).join(", ");
|
|
10335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className:
|
|
10336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: cls, children: [
|
|
10336
10337
|
games.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-w-nbaform-dots", role: "img", "aria-label": ui.nba.formDotsAria(abbr, letters), children: games.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10337
10338
|
"span",
|
|
10338
10339
|
{
|
|
@@ -10349,7 +10350,7 @@ function NbaFormStrip({ match, monitor, ui }) {
|
|
|
10349
10350
|
if (!form || !b || !form.home && !form.away) return null;
|
|
10350
10351
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-w-nbaform-strip", children: [
|
|
10351
10352
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Cell2, { abbr: b.awayAbbreviation, team: form.away, ui }),
|
|
10352
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Cell2, { abbr: b.homeAbbreviation, team: form.home, ui })
|
|
10353
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Cell2, { abbr: b.homeAbbreviation, team: form.home, home: true, ui })
|
|
10353
10354
|
] });
|
|
10354
10355
|
}
|
|
10355
10356
|
|
|
@@ -10416,16 +10417,24 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
10416
10417
|
if (!active) return null;
|
|
10417
10418
|
const { team, abbr } = active;
|
|
10418
10419
|
const isHome = active.key === "home";
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10420
|
+
const record = (t) => {
|
|
10421
|
+
const w = t.last5.filter((g) => g.teamScore > g.opponentScore).length;
|
|
10422
|
+
return `${w}\u2013${t.last5.length - w}`;
|
|
10423
|
+
};
|
|
10424
|
+
const summary = sides.map((s) => `${s.abbr} ${record(s.team)}`).join(" \xB7 ");
|
|
10425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("section", { className: "ss-w-acc-row ss-w-nbaform-section", lang: ui.locale, children: [
|
|
10426
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ss-w-acc-head", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("button", { type: "button", className: "ss-w-acc-toggle", "aria-expanded": open, onClick: () => setOpen((o) => !o), children: [
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-w-acc-chevron", "aria-hidden": "true", children: open ? "\u25BE" : "\u25B8" }),
|
|
10428
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-w-acc-label", children: ui.nba.formTitle }),
|
|
10429
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-w-nbaform-sum", children: summary })
|
|
10430
|
+
] }) }),
|
|
10431
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-w-acc-panel ss-w-nbaform-body", children: [
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: `ss-w-props-seg ss-w-nbaform-seg--${sides.length}`, children: sides.map((s) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
10423
10433
|
"button",
|
|
10424
10434
|
{
|
|
10425
10435
|
type: "button",
|
|
10426
|
-
|
|
10427
|
-
"aria-
|
|
10428
|
-
className: s.key === active.key ? "ss-w-nbaform-tab ss-w-nbaform-tab--on" : "ss-w-nbaform-tab",
|
|
10436
|
+
className: "ss-w-props-side",
|
|
10437
|
+
"aria-pressed": s.key === active.key,
|
|
10429
10438
|
onClick: () => setSide(s.key),
|
|
10430
10439
|
children: ui.nba.formTab(s.abbr)
|
|
10431
10440
|
},
|
|
@@ -10842,8 +10851,8 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
|
|
|
10842
10851
|
] })
|
|
10843
10852
|
] }),
|
|
10844
10853
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(MarketAccordion, { match, monitor, ui, slip }),
|
|
10845
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
10846
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
10854
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(NbaFormSection, { match, monitor, ui }, `form-${match.matchId}`),
|
|
10855
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(NbaPropsSection, { match, monitor, ui, slip }, match.matchId)
|
|
10847
10856
|
] });
|
|
10848
10857
|
}
|
|
10849
10858
|
|
|
@@ -18423,6 +18432,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18423
18432
|
.ss-w-nflform-wbadge--tie { background: var(--ss-w-track); color: var(--ss-w-ink); }
|
|
18424
18433
|
.ss-w-nbaform-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 6px 0 2px; }
|
|
18425
18434
|
.ss-w-nbaform-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; min-height: 0; }
|
|
18435
|
+
.ss-w-nbaform-cell--home { align-items: flex-end; }
|
|
18426
18436
|
.ss-w-nbaform-dots { display: inline-flex; gap: 4px; align-items: center; }
|
|
18427
18437
|
.ss-w-nbaform-dot { width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; }
|
|
18428
18438
|
.ss-w-nbaform-dot--w { background: var(--ss-w-pos); }
|
|
@@ -18431,14 +18441,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18431
18441
|
.ss-w-nbaform-chip { padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
|
|
18432
18442
|
.ss-w-nbaform-chip--dark { background: var(--ss-w-nav); color: #fff; }
|
|
18433
18443
|
.ss-w-nbaform-chip--light { background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); }
|
|
18434
|
-
.ss-w-nbaform-section {
|
|
18435
|
-
.ss-w-nbaform-
|
|
18436
|
-
.ss-w-nbaform-
|
|
18437
|
-
.ss-w-nbaform-
|
|
18438
|
-
.ss-w-nbaform-
|
|
18439
|
-
.ss-w-nbaform-tab { flex: 1; min-height: 36px; border: 1px solid var(--ss-w-line); border-radius: 8px; background: var(--ss-w-bubble); font: inherit; font-size: 12px; font-weight: 700; color: var(--ss-w-ink); cursor: pointer; }
|
|
18440
|
-
.ss-w-nbaform-tab--on { background: var(--ss-w-nav); border-color: var(--ss-w-nav); color: #fff; }
|
|
18441
|
-
.ss-w-nbaform-tab:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 1px; }
|
|
18444
|
+
.ss-w-nbaform-section { min-width: 0; }
|
|
18445
|
+
.ss-w-nbaform-sum { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; color: var(--ss-w-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
18446
|
+
.ss-w-nbaform-body { gap: 6px; min-width: 0; }
|
|
18447
|
+
.ss-w-nbaform-seg--1 { grid-template-columns: minmax(0, 1fr); }
|
|
18448
|
+
.ss-w-nbaform-seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
18442
18449
|
.ss-w-nbaform-rest { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ss-w-ink); }
|
|
18443
18450
|
.ss-w-nbaform-row { display: flex; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--ss-w-line); min-width: 0; }
|
|
18444
18451
|
.ss-w-nbaform-badge { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; font-size: 10.5px; font-weight: 800; color: #fff; }
|