@sensiblestats/widget-react 0.48.2 → 0.48.3

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/dist/index.js CHANGED
@@ -92,7 +92,6 @@ var STRINGS = {
92
92
  tabToday: "Today",
93
93
  sectionLive: "Live",
94
94
  halfTime: "HT",
95
- fullTime: "FT",
96
95
  staleStates: "Live scores can't be updated \u2014 showing the last known state."
97
96
  },
98
97
  tr: {
@@ -171,7 +170,6 @@ var STRINGS = {
171
170
  tabToday: "Bug\xFCn",
172
171
  sectionLive: "Canl\u0131",
173
172
  halfTime: "\u0130Y",
174
- fullTime: "MS",
175
173
  staleStates: "Canl\u0131 skorlar g\xFCncellenemiyor \u2014 son bilinen durum g\xF6steriliyor."
176
174
  }
177
175
  };
@@ -251,7 +249,6 @@ function normalizeUi(cfg) {
251
249
  tabToday: strings.tabToday,
252
250
  sectionLive: strings.sectionLive,
253
251
  halfTime: strings.halfTime,
254
- fullTime: strings.fullTime,
255
252
  staleStates: strings.staleStates,
256
253
  pinLabel: strings.pinLabel,
257
254
  unpinLabel: strings.unpinLabel,
@@ -3709,10 +3706,7 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
3709
3706
  const isLive = state?.phase === "live" && !stale;
3710
3707
  const hasScore = (state?.phase === "live" || state?.phase === "fullTime") && typeof state.homeScore === "number" && typeof state.awayScore === "number";
3711
3708
  const ticked = state?.phase === "live" ? state.minuteLabel ?? null : null;
3712
- const isFinished = state?.phase === "fullTime";
3713
- const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : isFinished ? ui.fullTime : kickoffLabel(match.kickoffUnix);
3714
- const pin = { kind: "match", matchId: match.matchId };
3715
- const showPin = !isFinished || monitor.isPinned(pinKey(pin));
3709
+ const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : kickoffLabel(match.kickoffUnix);
3716
3710
  return /* @__PURE__ */ jsxs44("div", { className: isLive || state?.isHalfTime ? "ss-w-drow ss-w-drow--live" : "ss-w-drow", children: [
3717
3711
  /* @__PURE__ */ jsx49("span", { className: isLive || state?.isHalfTime ? "ss-w-drow-when ss-w-drow-when--live" : "ss-w-drow-when", children: when }),
3718
3712
  /* @__PURE__ */ jsxs44("span", { className: "ss-w-drow-fx", children: [
@@ -3720,7 +3714,7 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
3720
3714
  /* @__PURE__ */ jsx49("span", { className: hasScore ? "ss-w-drow-sc" : "ss-w-drow-sc ss-w-drow-sc--idle", children: hasScore ? `${state.homeScore}\u2013${state.awayScore}` : "\u2013" }),
3721
3715
  /* @__PURE__ */ jsx49(Side, { name: match.awayTeamName, crest: match.awayTeamImagePath })
3722
3716
  ] }),
3723
- showPin ? /* @__PURE__ */ jsx49(PinToggle, { ui, monitor, pin }) : null
3717
+ /* @__PURE__ */ jsx49(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
3724
3718
  ] });
3725
3719
  }
3726
3720
 
@@ -3728,6 +3722,9 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
3728
3722
  function isTreatedLive(state, pollStale) {
3729
3723
  return state?.phase === "live" && !pollStale;
3730
3724
  }
3725
+ function isFinished(state) {
3726
+ return state?.phase === "fullTime";
3727
+ }
3731
3728
 
3732
3729
  // src/components/CompetitionGroup.tsx
3733
3730
  import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
@@ -3759,8 +3756,9 @@ function CompetitionGroup({ group, open, onToggle, states, stale, ui, monitor, d
3759
3756
  import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
3760
3757
  function TodayPanel({ discovery, ui, monitor }) {
3761
3758
  const { groups, states, stale, expanded, toggleGroup } = discovery;
3762
- const liveRows = stale ? [] : groups.flatMap((group) => group.matches.filter((m) => isTreatedLive(states[m.matchId], stale)).map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
3763
- const nameCounts = groups.reduce((acc, g) => {
3759
+ const visibleGroups = groups.map((group) => ({ ...group, matches: group.matches.filter((m) => !isFinished(states[m.matchId])) })).filter((group) => group.matches.length > 0);
3760
+ const liveRows = stale ? [] : visibleGroups.flatMap((group) => group.matches.filter((m) => isTreatedLive(states[m.matchId], stale)).map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
3761
+ const nameCounts = visibleGroups.reduce((acc, g) => {
3764
3762
  acc[g.competitionName] = (acc[g.competitionName] ?? 0) + 1;
3765
3763
  return acc;
3766
3764
  }, {});
@@ -3783,7 +3781,7 @@ function TodayPanel({ discovery, ui, monitor }) {
3783
3781
  match.matchId
3784
3782
  )) })
3785
3783
  ] }),
3786
- groups.map((group) => /* @__PURE__ */ jsx51(
3784
+ visibleGroups.map((group) => /* @__PURE__ */ jsx51(
3787
3785
  CompetitionGroup,
3788
3786
  {
3789
3787
  group,