@sensiblestats/widget-react 0.42.0 → 0.43.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,24 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.43.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Don't offer a tap on a suspended accordion market. Its card is unservable — the odds lookup drops every suspended/stopped row, so the detail request answers 404 and the panel lands on a tap-to-retry that can never succeed. The row stays listed and labelled; it just isn't expandable, and a market that suspends while open now collapses instead of leaving stale rows up.
8
+
9
+ ## 0.43.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Betting cards (insight, market-odds, odds-movement) now render a server-supplied `kickoffLabel`
14
+ in the operator's timezone and language when present, falling back to browser-zone formatting of
15
+ `kickoffUtc` for older servers.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+ - @sensiblestats/widget-sdk@0.31.0
21
+
3
22
  ## 0.42.0
4
23
 
5
24
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -534,7 +534,8 @@ function toInsightVM(insight) {
534
534
  homeCrest: str(insight.homeTeamImagePath),
535
535
  awayCrest: str(insight.awayTeamImagePath),
536
536
  competitionCrest: str(insight.competitionImagePath),
537
- kickoffUtc: str(insight.kickoffUtc)
537
+ kickoffUtc: str(insight.kickoffUtc),
538
+ kickoffLabel: str(insight.kickoffLabel)
538
539
  };
539
540
  }
540
541
  function toSlipSelection(vm, conversationId) {
@@ -583,6 +584,7 @@ function toMarketOddsVM(card) {
583
584
  competitionCrest: str(card.competitionImagePath),
584
585
  competition: str(card.competitionName),
585
586
  kickoffUtc: str(card.kickoffUtc),
587
+ kickoffLabel: str(card.kickoffLabel),
586
588
  bookmaker: rows.map((r) => str(r.bookmakerName)).find(Boolean),
587
589
  updatedAt: updated.length > 0 ? updated[updated.length - 1] : void 0,
588
590
  isLive: rows.some((r) => r.isLive === true),
@@ -1937,7 +1939,8 @@ function CardFixture({ it }) {
1937
1939
  }
1938
1940
  function InsightCard({ it, ui, slip, monitor }) {
1939
1941
  const live = it.isLive || it.phase === "live";
1940
- const kickoff = it.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(it.kickoffUtc) : void 0;
1942
+ const kickoffFallback = it.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(it.kickoffUtc) : void 0;
1943
+ const kickoff = it.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
1941
1944
  const hasNamedTeams = !!it.homeTeamName && !!it.awayTeamName;
1942
1945
  const leftIsFixture = hasNamedTeams || !!it.fixture;
1943
1946
  const showPin = !!monitor && it.pinEnabled;
@@ -1947,11 +1950,7 @@ function InsightCard({ it, ui, slip, monitor }) {
1947
1950
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
1948
1951
  ui?.liveLabel ?? "Live"
1949
1952
  ] }) : null,
1950
- kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-kick", children: [
1951
- kickoff.dayLabel,
1952
- " ",
1953
- kickoff.time
1954
- ] }) : null,
1953
+ kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-kick", children: kickoff }) : null,
1955
1954
  showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: it.matchId } }) : null
1956
1955
  ] });
1957
1956
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-binsight", children: [
@@ -2024,7 +2023,8 @@ function OddsRow({ vm, row, ui, slip, inSlipIds }) {
2024
2023
  }
2025
2024
  function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }) {
2026
2025
  const [open, setOpen] = (0, import_react13.useState)(false);
2027
- const kickoff = vm.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
2026
+ const kickoffFallback = vm.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
2027
+ const kickoff = vm.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
2028
2028
  const hasNamedTeams = !!vm.homeTeamName && !!vm.awayTeamName;
2029
2029
  const showPin = !!monitor && vm.pinEnabled;
2030
2030
  const showMarketPin = showPin && !pinRef;
@@ -2041,11 +2041,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
2041
2041
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
2042
2042
  ui?.liveLabel ?? "Live"
2043
2043
  ] }) : null,
2044
- kickoff ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "ss-w-bi-kick", children: [
2045
- kickoff.dayLabel,
2046
- " ",
2047
- kickoff.time
2048
- ] }) : null,
2044
+ kickoff ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-bi-kick", children: kickoff }) : null,
2049
2045
  showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2050
2046
  PinToggle,
2051
2047
  {
@@ -3208,7 +3204,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
3208
3204
  if (markets.length === 0) return null;
3209
3205
  const open = monitor.openMarket[match.matchId] ?? null;
3210
3206
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ss-w-acc", children: markets.map((m) => {
3211
- const isOpen = open === m.marketDeveloperName;
3207
+ const isOpen = open === m.marketDeveloperName && !m.suspended;
3212
3208
  const key = `${match.matchId}:${m.marketDeveloperName}`;
3213
3209
  const entry = monitor.marketOdds[key];
3214
3210
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: isOpen ? "ss-w-acc-row ss-w-acc-row-open" : "ss-w-acc-row", children: [
@@ -3217,11 +3213,12 @@ function MarketAccordion({ match, monitor, ui, slip }) {
3217
3213
  "button",
3218
3214
  {
3219
3215
  type: "button",
3220
- className: "ss-w-acc-toggle",
3216
+ className: m.suspended ? "ss-w-acc-toggle ss-w-acc-toggle--susp" : "ss-w-acc-toggle",
3221
3217
  "aria-expanded": isOpen,
3218
+ disabled: m.suspended,
3222
3219
  onClick: () => monitor.toggleMarket(match.matchId, m.marketDeveloperName),
3223
3220
  children: [
3224
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-chevron", children: isOpen ? "\u25BE" : "\u25B8" }),
3221
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-chevron", children: m.suspended ? "" : isOpen ? "\u25BE" : "\u25B8" }),
3225
3222
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-label", children: m.marketLabel }),
3226
3223
  m.hasInsight && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-badge", children: "\u2605" }),
3227
3224
  m.suspended && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-susp", children: ui.accordionSuspended })
@@ -4328,6 +4325,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
4328
4325
  /* Row header: expand toggle (flex:1) + the market PinToggle as a sibling (no nested buttons). */
4329
4326
  .ss-w-acc-head { display: flex; align-items: center; gap: 8px; padding: 6px 9px 6px 11px; }
4330
4327
  .ss-w-acc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: var(--ss-w-ink); padding: 5px 0; }
4328
+ /* Suspended: the row stays listed (knowing a market is off is useful) but is not tappable --
4329
+ its card is unservable, so a pointer cursor would promise something that cannot load. */
4330
+ .ss-w-acc-toggle--susp { cursor: default; color: var(--ss-w-faint); }
4331
4331
  .ss-w-acc-chevron { color: var(--ss-w-faint); font-size: 11px; flex: none; }
4332
4332
  .ss-w-acc-label { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
4333
4333
  .ss-w-acc-badge { font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); flex: none; }