@sensiblestats/widget-react 0.45.0 → 0.46.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 +13 -0
- package/dist/index.cjs +20 -2
- 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 +20 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.46.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fixes the Today tab collapsing to blank bars: children of the monitor scroller no longer shrink,
|
|
8
|
+
so the list scrolls instead of compressing 27 competition groups to fit. Also disambiguates
|
|
9
|
+
same-named competitions with their country, which the schedule response now carries.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @sensiblestats/widget-sdk@0.34.0
|
|
15
|
+
|
|
3
16
|
## 0.45.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3753,14 +3753,21 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
|
3753
3753
|
|
|
3754
3754
|
// src/components/CompetitionGroup.tsx
|
|
3755
3755
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3756
|
-
function CompetitionGroup({ group, open, onToggle, states, stale, ui, monitor }) {
|
|
3756
|
+
function CompetitionGroup({ group, open, onToggle, states, stale, ui, monitor, disambiguate = false }) {
|
|
3757
3757
|
const own = group.matches.filter((m) => states[m.matchId]?.phase !== "live" || stale);
|
|
3758
3758
|
const hasLive = own.length !== group.matches.length;
|
|
3759
3759
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "ss-w-grp", children: [
|
|
3760
3760
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { type: "button", className: "ss-w-grp-head", "aria-expanded": open, onClick: onToggle, children: [
|
|
3761
3761
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "ss-w-grp-chev", children: open ? "\u25BE" : "\u25B8" }),
|
|
3762
3762
|
hasLive && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "ss-w-sec-dot", "aria-hidden": "true" }),
|
|
3763
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "ss-w-grp-name", children: [
|
|
3764
|
+
group.competitionName,
|
|
3765
|
+
disambiguate && group.competitionCountry ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "ss-w-grp-country", children: [
|
|
3766
|
+
" (",
|
|
3767
|
+
group.competitionCountry,
|
|
3768
|
+
")"
|
|
3769
|
+
] }) : null
|
|
3770
|
+
] }),
|
|
3764
3771
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "ss-w-grp-count", children: own.length })
|
|
3765
3772
|
] }),
|
|
3766
3773
|
open && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ss-w-grp-body", children: own.map((m) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FixtureRow, { match: m, state: states[m.matchId], stale, ui, monitor }, m.matchId)) })
|
|
@@ -3772,6 +3779,10 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
3772
3779
|
function TodayPanel({ discovery, ui, monitor }) {
|
|
3773
3780
|
const { groups, states, stale, expanded, toggleGroup } = discovery;
|
|
3774
3781
|
const liveRows = stale ? [] : groups.flatMap((group) => group.matches.filter((m) => states[m.matchId]?.phase === "live").map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
|
|
3782
|
+
const nameCounts = groups.reduce((acc, g) => {
|
|
3783
|
+
acc[g.competitionName] = (acc[g.competitionName] ?? 0) + 1;
|
|
3784
|
+
return acc;
|
|
3785
|
+
}, {});
|
|
3775
3786
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ss-w-mon-list", children: [
|
|
3776
3787
|
stale && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ss-w-stale", children: ui.staleStates }),
|
|
3777
3788
|
liveRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
@@ -3797,6 +3808,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
3797
3808
|
group,
|
|
3798
3809
|
open: expanded[group.competitionId] ?? group.expandedByDefault,
|
|
3799
3810
|
onToggle: () => toggleGroup(group.competitionId),
|
|
3811
|
+
disambiguate: (nameCounts[group.competitionName] ?? 0) > 1,
|
|
3800
3812
|
states,
|
|
3801
3813
|
stale,
|
|
3802
3814
|
ui,
|
|
@@ -3983,6 +3995,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
3983
3995
|
/* .ss-w-mon-list (Matches/Odds tab scrollers) shares .ss-w-list's box/scroll rules by design --
|
|
3984
3996
|
same visual rhythm as the chat message list -- but gets its own class so it isn't the same DOM
|
|
3985
3997
|
landmark as the chat list when both exist in the panel at once (Task 16 fix round, M4). */
|
|
3998
|
+
/* Children of this scrolling column flex container must NOT shrink. The default flex-shrink:1
|
|
3999
|
+
compresses every child to fit the panel instead of letting the container scroll, and
|
|
4000
|
+
.ss-w-grp's own overflow:hidden then clips the compressed content away entirely \u2014 27
|
|
4001
|
+
competition groups rendered as blank bars on a phone. Applies to the pinned cards too. */
|
|
4002
|
+
.ss-w-mon-list > * { flex: none; }
|
|
3986
4003
|
.ss-w-list, .ss-w-mon-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-padding-top: 14px; }
|
|
3987
4004
|
/* Transient bottom spacer: reserves a viewport of room below a new turn so its
|
|
3988
4005
|
top can be scrolled into view while the reply is still streaming in. Height is
|
|
@@ -4714,6 +4731,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
4714
4731
|
.ss-w-grp-head:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: -2px; }
|
|
4715
4732
|
.ss-w-grp-chev { color: var(--ss-w-faint); font-size: 10px; flex: none; }
|
|
4716
4733
|
.ss-w-grp-name { font-size: 12px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
4734
|
+
.ss-w-grp-country { font-weight: 600; color: var(--ss-w-faint); }
|
|
4717
4735
|
.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; }
|
|
4718
4736
|
.ss-w-grp-body { display: flex; flex-direction: column; padding: 2px 11px 6px; }
|
|
4719
4737
|
|