@sensiblestats/widget-react 0.47.1 → 0.48.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,17 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.48.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Today-tab fixture rows now read like a scoreboard: the score sits between the two teams instead of after them, a finished match shows FT (MS in Turkish) in place of its kickoff time, and a finished match no longer offers a pin unless it is already pinned.
8
+
9
+ ## 0.47.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Hide a Today-tab competition group whose every match has been hoisted into the live band, instead of rendering an empty header with a count of 0.
14
+
3
15
  ## 0.47.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -129,6 +129,7 @@ var STRINGS = {
129
129
  tabToday: "Today",
130
130
  sectionLive: "Live",
131
131
  halfTime: "HT",
132
+ fullTime: "FT",
132
133
  staleStates: "Live scores can't be updated \u2014 showing the last known state."
133
134
  },
134
135
  tr: {
@@ -207,6 +208,7 @@ var STRINGS = {
207
208
  tabToday: "Bug\xFCn",
208
209
  sectionLive: "Canl\u0131",
209
210
  halfTime: "\u0130Y",
211
+ fullTime: "MS",
210
212
  staleStates: "Canl\u0131 skorlar g\xFCncellenemiyor \u2014 son bilinen durum g\xF6steriliyor."
211
213
  }
212
214
  };
@@ -286,6 +288,7 @@ function normalizeUi(cfg) {
286
288
  tabToday: strings.tabToday,
287
289
  sectionLive: strings.sectionLive,
288
290
  halfTime: strings.halfTime,
291
+ fullTime: strings.fullTime,
289
292
  staleStates: strings.staleStates,
290
293
  pinLabel: strings.pinLabel,
291
294
  unpinLabel: strings.unpinLabel,
@@ -3784,16 +3787,18 @@ function FixtureRow({ match, state, stale, nowMs, ui, monitor }) {
3784
3787
  const isLive = state?.phase === "live" && !stale && !readingStale;
3785
3788
  const hasScore = (state?.phase === "live" || state?.phase === "fullTime") && typeof state.homeScore === "number" && typeof state.awayScore === "number";
3786
3789
  const ticked = displayMinute(state, nowMs);
3787
- const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : kickoffLabel(match.kickoffUnix);
3790
+ const isFinished = state?.phase === "fullTime";
3791
+ const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : isFinished ? ui.fullTime : kickoffLabel(match.kickoffUnix);
3792
+ const pin = { kind: "match", matchId: match.matchId };
3793
+ const showPin = !isFinished || monitor.isPinned(pinKey(pin));
3788
3794
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: isLive || state?.isHalfTime ? "ss-w-drow ss-w-drow--live" : "ss-w-drow", children: [
3789
3795
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: isLive || state?.isHalfTime ? "ss-w-drow-when ss-w-drow-when--live" : "ss-w-drow-when", children: when }),
3790
3796
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "ss-w-drow-fx", children: [
3791
3797
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Side, { name: match.homeTeamName, crest: match.homeTeamImagePath }),
3792
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ss-w-drow-dash", children: "\u2013" }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: hasScore ? "ss-w-drow-sc" : "ss-w-drow-sc ss-w-drow-sc--idle", children: hasScore ? `${state.homeScore}\u2013${state.awayScore}` : "\u2013" }),
3793
3799
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Side, { name: match.awayTeamName, crest: match.awayTeamImagePath })
3794
3800
  ] }),
3795
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: hasScore ? "ss-w-drow-sc" : "ss-w-drow-sc ss-w-drow-sc--idle", children: hasScore ? `${state.homeScore}\u2013${state.awayScore}` : "\u2013" }),
3796
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
3801
+ showPin ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PinToggle, { ui, monitor, pin }) : null
3797
3802
  ] });
3798
3803
  }
3799
3804
 
@@ -3802,6 +3807,9 @@ var import_jsx_runtime50 = require("react/jsx-runtime");
3802
3807
  function CompetitionGroup({ group, open, onToggle, states, stale, nowMs, ui, monitor, disambiguate = false }) {
3803
3808
  const own = group.matches.filter((m) => !isTreatedLive(states[m.matchId], stale, nowMs));
3804
3809
  const hasLive = own.length !== group.matches.length;
3810
+ if (own.length === 0) {
3811
+ return null;
3812
+ }
3805
3813
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "ss-w-grp", children: [
3806
3814
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { type: "button", className: "ss-w-grp-head", "aria-expanded": open, onClick: onToggle, children: [
3807
3815
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "ss-w-grp-chev", children: open ? "\u25BE" : "\u25B8" }),
@@ -4783,7 +4791,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
4783
4791
  .ss-w-grp-count { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; color: var(--ss-w-faint); background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
4784
4792
  .ss-w-grp-body { display: flex; flex-direction: column; padding: 2px 11px 6px; }
4785
4793
 
4786
- .ss-w-drow { display: grid; grid-template-columns: 42px minmax(0,1fr) auto 22px; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--ss-w-line); }
4794
+ .ss-w-drow { display: grid; grid-template-columns: 42px minmax(0,1fr) 22px; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--ss-w-line); }
4787
4795
  .ss-w-drow:last-child { border-bottom: none; }
4788
4796
  .ss-w-drow-when { font-size: 11px; font-weight: 700; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; }
4789
4797
  .ss-w-drow-when--live { color: var(--ss-w-neg); }
@@ -4792,8 +4800,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
4792
4800
  .ss-w-drow-fx { display: flex; align-items: center; gap: 6px; min-width: 0; }
4793
4801
  .ss-w-drow-side { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 0; }
4794
4802
  .ss-w-drow-nm { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
4795
- .ss-w-drow-dash { flex: none; color: var(--ss-w-faint); font-size: 11px; }
4796
- .ss-w-drow-sc { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
4803
+ /* Centre slot of .ss-w-drow-fx, between the two sides: flex:none so a widening score never
4804
+ steals width the team names need to avoid ellipsis. min-width holds the slot at the width of a
4805
+ one-digit scoreline so an unscored row's bare dash does not pull the column out of line -- the
4806
+ scores read as a column down the list, not a jitter. */
4807
+ .ss-w-drow-sc { flex: none; min-width: 26px; text-align: center; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
4797
4808
  .ss-w-drow-sc--idle { color: var(--ss-w-faint); font-weight: 600; }
4798
4809
  .ss-w-drow--live { background: color-mix(in srgb, var(--ss-w-neg) 5%, transparent); border-radius: 8px; padding: 7px 6px; margin: 0 -6px; border-bottom: none; }
4799
4810
  .ss-w-drow-crest { width: 16px; height: 16px; flex: none; border-radius: 50%; object-fit: contain; background: var(--ss-w-bubble); }