@sensiblestats/widget-react 0.29.3 → 0.29.4
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 +82 -61
- 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 +63 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.29.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2740025: Refine three pre-match dashboard cards: the Next-up fixture card drops the DATE/VENUE labels for a single centred kickoff·venue line and no longer shows a Compare-form CTA or acts as a tap target (the greeting chips already own that action); the Last-five rows gain a team crest beside each name; and the Injuries card caps each side at three with a See-more toggle so a long list can't push the input off-screen.
|
|
8
|
+
|
|
3
9
|
## 0.29.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/StatsWidget.tsx
|
|
39
|
-
var
|
|
39
|
+
var import_react19 = require("react");
|
|
40
40
|
var import_widget_sdk5 = require("@sensiblestats/widget-sdk");
|
|
41
41
|
|
|
42
42
|
// src/kickoff.ts
|
|
@@ -876,7 +876,7 @@ function ChatFab({ label, greeting, popupText, onOpen, onDismissPopup, dismissLa
|
|
|
876
876
|
}
|
|
877
877
|
|
|
878
878
|
// src/components/ChatPanel.tsx
|
|
879
|
-
var
|
|
879
|
+
var import_react18 = require("react");
|
|
880
880
|
|
|
881
881
|
// src/components/ChatHeader.tsx
|
|
882
882
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -889,7 +889,7 @@ function ChatHeader({ onClose, closeLabel = "Close chat" }) {
|
|
|
889
889
|
}
|
|
890
890
|
|
|
891
891
|
// src/components/MessageList.tsx
|
|
892
|
-
var
|
|
892
|
+
var import_react16 = require("react");
|
|
893
893
|
|
|
894
894
|
// src/components/Markdown.tsx
|
|
895
895
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
@@ -1469,17 +1469,20 @@ function resultClass(result) {
|
|
|
1469
1469
|
function FormStrip({ form }) {
|
|
1470
1470
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-form", children: form.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: `ss-w-fandash-form-pill ${resultClass(r)}`, children: r }, `${r}-${i}`)) });
|
|
1471
1471
|
}
|
|
1472
|
-
function FormRow({ name, form }) {
|
|
1472
|
+
function FormRow({ name, form, crestUrl }) {
|
|
1473
1473
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-formrow", children: [
|
|
1474
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "ss-w-fandash-formrow-team", children: [
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Crest2, { url: crestUrl ?? void 0, name, kind: "team" }),
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-formrow-name", children: name })
|
|
1477
|
+
] }),
|
|
1475
1478
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormStrip, { form })
|
|
1476
1479
|
] });
|
|
1477
1480
|
}
|
|
1478
|
-
function FixtureCard({ card
|
|
1481
|
+
function FixtureCard({ card }) {
|
|
1479
1482
|
const { data } = card;
|
|
1480
1483
|
const h2h = data.h2H;
|
|
1481
1484
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1482
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-fixture", children: [
|
|
1483
1486
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "ss-w-fandash-eyebrow", children: [
|
|
1484
1487
|
card.title,
|
|
1485
1488
|
" \xB7 ",
|
|
@@ -1497,22 +1500,18 @@ function FixtureCard({ card, onTap }) {
|
|
|
1497
1500
|
] })
|
|
1498
1501
|
] }),
|
|
1499
1502
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-fixture-meta", children: [
|
|
1500
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
data.venue ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-fixture-metarow", children: [
|
|
1505
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-fixture-metakey", children: data.venueLabel }),
|
|
1506
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-fixture-metaval", children: data.venue })
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-fixture-kickoff", children: data.kickoffLabel }),
|
|
1504
|
+
data.venue ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "ss-w-fandash-fixture-venue", children: [
|
|
1505
|
+
" \xB7 ",
|
|
1506
|
+
data.venue
|
|
1507
1507
|
] }) : null
|
|
1508
|
-
] })
|
|
1509
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1508
|
+
] })
|
|
1510
1509
|
] }),
|
|
1511
1510
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-lastfive", children: [
|
|
1512
1511
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ss-w-fandash-eyebrow", children: data.formLabel }),
|
|
1513
1512
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-fixture-form", children: [
|
|
1514
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormRow, { name: data.homeName, form: data.homeForm }),
|
|
1515
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormRow, { name: data.awayName, form: data.awayForm })
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormRow, { name: data.homeName, form: data.homeForm, crestUrl: data.homeCrestUrl }),
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormRow, { name: data.awayName, form: data.awayForm, crestUrl: data.awayCrestUrl })
|
|
1516
1515
|
] })
|
|
1517
1516
|
] }),
|
|
1518
1517
|
h2h || data.fact ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-h2h", children: [
|
|
@@ -1582,16 +1581,19 @@ function CountdownCard({ card }) {
|
|
|
1582
1581
|
}
|
|
1583
1582
|
|
|
1584
1583
|
// src/components/dashboard/InjuriesCard.tsx
|
|
1584
|
+
var import_react10 = require("react");
|
|
1585
1585
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1586
|
+
var SHOWN = 3;
|
|
1586
1587
|
function ColHead({ name, crestUrl }) {
|
|
1587
1588
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ss-w-fandash-injuries-col-head", children: [
|
|
1588
1589
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Crest2, { url: crestUrl ?? void 0, name, kind: "team" }),
|
|
1589
1590
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-fandash-injuries-col-head-name", children: name })
|
|
1590
1591
|
] });
|
|
1591
1592
|
}
|
|
1592
|
-
function InjuryList({ rows, emptyLabel }) {
|
|
1593
|
+
function InjuryList({ rows, emptyLabel, limit }) {
|
|
1593
1594
|
if (rows.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-fandash-injuries-empty", children: emptyLabel });
|
|
1594
|
-
|
|
1595
|
+
const shown = limit === void 0 ? rows : rows.slice(0, limit);
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "ss-w-fandash-injury-list", children: shown.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { className: "ss-w-fandash-injury-row", children: [
|
|
1595
1597
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-fandash-injury-name", children: r.playerName }),
|
|
1596
1598
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ss-w-fandash-injury-meta", children: [
|
|
1597
1599
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-fandash-injury-status", children: r.status }),
|
|
@@ -1600,21 +1602,36 @@ function InjuryList({ rows, emptyLabel }) {
|
|
|
1600
1602
|
] })
|
|
1601
1603
|
] }, `${r.playerName}-${i}`)) });
|
|
1602
1604
|
}
|
|
1603
|
-
function InjuriesCard({ card }) {
|
|
1605
|
+
function InjuriesCard({ card, ui }) {
|
|
1604
1606
|
const { data } = card;
|
|
1607
|
+
const [expanded, setExpanded] = (0, import_react10.useState)(false);
|
|
1608
|
+
const hidden = Math.max(0, data.ours.length - SHOWN) + Math.max(0, data.theirs.length - SHOWN);
|
|
1609
|
+
const limit = expanded ? void 0 : SHOWN;
|
|
1610
|
+
const showMore = ui?.showMore ?? ((n) => `Show ${n} more`);
|
|
1611
|
+
const showLess = ui?.showLess ?? "Show less";
|
|
1605
1612
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-injuries", children: [
|
|
1606
1613
|
card.title ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1607
1614
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ss-w-fandash-injuries-cols", children: [
|
|
1608
1615
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ss-w-fandash-injuries-col", children: [
|
|
1609
1616
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ColHead, { name: data.oursName, crestUrl: data.oursCrestUrl }),
|
|
1610
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InjuryList, { rows: data.ours, emptyLabel: data.emptyLabel })
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InjuryList, { rows: data.ours, emptyLabel: data.emptyLabel, limit })
|
|
1611
1618
|
] }),
|
|
1612
1619
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "ss-w-fandash-injuries-divider" }),
|
|
1613
1620
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ss-w-fandash-injuries-col", children: [
|
|
1614
1621
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ColHead, { name: data.theirsName, crestUrl: data.theirsCrestUrl }),
|
|
1615
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InjuryList, { rows: data.theirs, emptyLabel: data.emptyLabel })
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InjuryList, { rows: data.theirs, emptyLabel: data.emptyLabel, limit })
|
|
1616
1623
|
] })
|
|
1617
|
-
] })
|
|
1624
|
+
] }),
|
|
1625
|
+
hidden > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1626
|
+
"button",
|
|
1627
|
+
{
|
|
1628
|
+
type: "button",
|
|
1629
|
+
className: "ss-w-fandash-injuries-more",
|
|
1630
|
+
"aria-expanded": expanded,
|
|
1631
|
+
onClick: () => setExpanded((v) => !v),
|
|
1632
|
+
children: expanded ? showLess : showMore(hidden)
|
|
1633
|
+
}
|
|
1634
|
+
) : null
|
|
1618
1635
|
] });
|
|
1619
1636
|
}
|
|
1620
1637
|
|
|
@@ -1691,7 +1708,7 @@ function LinksCard({ card }) {
|
|
|
1691
1708
|
}
|
|
1692
1709
|
|
|
1693
1710
|
// src/components/dashboard/PostMatchResultCard.tsx
|
|
1694
|
-
var
|
|
1711
|
+
var import_react11 = require("react");
|
|
1695
1712
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1696
1713
|
function initials3(name) {
|
|
1697
1714
|
return name.trim().slice(0, 3).toUpperCase();
|
|
@@ -1701,7 +1718,7 @@ function PostMatchCrest({
|
|
|
1701
1718
|
name,
|
|
1702
1719
|
side
|
|
1703
1720
|
}) {
|
|
1704
|
-
const [failed, setFailed] = (0,
|
|
1721
|
+
const [failed, setFailed] = (0, import_react11.useState)(false);
|
|
1705
1722
|
const cls = `ss-w-fandash-postmatch-crest ss-w-fandash-postmatch-crest--${side}`;
|
|
1706
1723
|
if (url && !failed) {
|
|
1707
1724
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -1900,10 +1917,10 @@ function RestingFormCard({ card }) {
|
|
|
1900
1917
|
}
|
|
1901
1918
|
|
|
1902
1919
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
1903
|
-
var
|
|
1920
|
+
var import_react13 = require("react");
|
|
1904
1921
|
|
|
1905
1922
|
// src/useLiveClock.ts
|
|
1906
|
-
var
|
|
1923
|
+
var import_react12 = require("react");
|
|
1907
1924
|
var TICK_MS = 6e4;
|
|
1908
1925
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
1909
1926
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -1912,10 +1929,10 @@ function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
|
1912
1929
|
return minute + Math.min(Math.max(0, elapsedMinutes), MAX_LIVE_TICK_MINUTES);
|
|
1913
1930
|
}
|
|
1914
1931
|
function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
1915
|
-
const [displayMinute, setDisplayMinute] = (0,
|
|
1932
|
+
const [displayMinute, setDisplayMinute] = (0, import_react12.useState)(
|
|
1916
1933
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
1917
1934
|
);
|
|
1918
|
-
(0,
|
|
1935
|
+
(0, import_react12.useEffect)(() => {
|
|
1919
1936
|
setDisplayMinute(computeDisplayMinute(minute, clockRunning, receivedAtMs));
|
|
1920
1937
|
if (!clockRunning) return;
|
|
1921
1938
|
const id = window.setInterval(() => {
|
|
@@ -1932,7 +1949,7 @@ function initials5(name) {
|
|
|
1932
1949
|
return name.trim().slice(0, 3).toUpperCase();
|
|
1933
1950
|
}
|
|
1934
1951
|
function LiveCrest({ url, name, side }) {
|
|
1935
|
-
const [failed, setFailed] = (0,
|
|
1952
|
+
const [failed, setFailed] = (0, import_react13.useState)(false);
|
|
1936
1953
|
const cls = `ss-w-fandash-live-crest ss-w-fandash-live-crest--${side}`;
|
|
1937
1954
|
if (url && !failed) {
|
|
1938
1955
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -1951,7 +1968,7 @@ function LiveScoreCard({
|
|
|
1951
1968
|
}) {
|
|
1952
1969
|
const { data } = card;
|
|
1953
1970
|
const seedKey = `${data.minute}:${data.homeScore}:${data.awayScore}`;
|
|
1954
|
-
const seedRef = (0,
|
|
1971
|
+
const seedRef = (0, import_react13.useRef)(null);
|
|
1955
1972
|
if (!seedRef.current || seedRef.current.key !== seedKey) {
|
|
1956
1973
|
seedRef.current = { key: seedKey, receivedAtMs: Date.now() };
|
|
1957
1974
|
}
|
|
@@ -1991,9 +2008,9 @@ function LiveScoreCard({
|
|
|
1991
2008
|
}
|
|
1992
2009
|
|
|
1993
2010
|
// src/components/dashboard/LiveTimelineCard.tsx
|
|
1994
|
-
var
|
|
2011
|
+
var import_react14 = require("react");
|
|
1995
2012
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1996
|
-
var
|
|
2013
|
+
var SHOWN2 = 3;
|
|
1997
2014
|
function EventIcon({ type }) {
|
|
1998
2015
|
if (type === "goal") {
|
|
1999
2016
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-fandash-live-tl-ico ss-w-fandash-live-tl-ico--goal", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-fandash-live-tl-ball" }) });
|
|
@@ -2033,12 +2050,12 @@ function EventRow({ e }) {
|
|
|
2033
2050
|
] });
|
|
2034
2051
|
}
|
|
2035
2052
|
function LiveTimelineCard({ card, ui }) {
|
|
2036
|
-
const [expanded, setExpanded] = (0,
|
|
2053
|
+
const [expanded, setExpanded] = (0, import_react14.useState)(false);
|
|
2037
2054
|
const events = card.data.events;
|
|
2038
2055
|
if (!events || events.length === 0) return null;
|
|
2039
2056
|
const sorted = [...events].sort((a, b) => b.minute - a.minute);
|
|
2040
|
-
const rest = sorted.length -
|
|
2041
|
-
const shown = expanded ? sorted : sorted.slice(0,
|
|
2057
|
+
const rest = sorted.length - SHOWN2;
|
|
2058
|
+
const shown = expanded ? sorted : sorted.slice(0, SHOWN2);
|
|
2042
2059
|
const showMore = ui?.showMore ?? ((n) => `Show ${n} more`);
|
|
2043
2060
|
const showLess = ui?.showLess ?? "Show less";
|
|
2044
2061
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-live-timeline", children: [
|
|
@@ -2058,7 +2075,7 @@ function LiveTimelineCard({ card, ui }) {
|
|
|
2058
2075
|
}
|
|
2059
2076
|
|
|
2060
2077
|
// src/components/dashboard/MomentumWave.tsx
|
|
2061
|
-
var
|
|
2078
|
+
var import_react15 = require("react");
|
|
2062
2079
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2063
2080
|
var WIDTH = 270;
|
|
2064
2081
|
var HEIGHT = 56;
|
|
@@ -2081,7 +2098,7 @@ function MomentumWave({
|
|
|
2081
2098
|
}) {
|
|
2082
2099
|
if (points.length === 0) return null;
|
|
2083
2100
|
const { area, line, lastX, lastY } = buildPaths(points);
|
|
2084
|
-
const clipId = (0,
|
|
2101
|
+
const clipId = (0, import_react15.useId)();
|
|
2085
2102
|
const topClipId = `${clipId}-top`;
|
|
2086
2103
|
const bottomClipId = `${clipId}-bottom`;
|
|
2087
2104
|
const topClass = clubIsHome ? "ss-w-fandash-live-mom-home" : "ss-w-fandash-live-mom-away";
|
|
@@ -2175,11 +2192,11 @@ function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
|
2175
2192
|
function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
2176
2193
|
switch (card.cardType) {
|
|
2177
2194
|
case "fixture":
|
|
2178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FixtureCard, { card
|
|
2195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FixtureCard, { card });
|
|
2179
2196
|
case "countdown":
|
|
2180
2197
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CountdownCard, { card });
|
|
2181
2198
|
case "injuries":
|
|
2182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(InjuriesCard, { card });
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(InjuriesCard, { card, ui });
|
|
2183
2200
|
case "reasonToBet":
|
|
2184
2201
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ReasonToBetCard, { card });
|
|
2185
2202
|
case "whereToWatch":
|
|
@@ -2263,11 +2280,11 @@ function turnAnchor(messages) {
|
|
|
2263
2280
|
}
|
|
2264
2281
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
2265
2282
|
const { state, send } = controller;
|
|
2266
|
-
const listRef = (0,
|
|
2267
|
-
const endRef = (0,
|
|
2268
|
-
const pinnedRef = (0,
|
|
2269
|
-
const anchoredTurnRef = (0,
|
|
2270
|
-
(0,
|
|
2283
|
+
const listRef = (0, import_react16.useRef)(null);
|
|
2284
|
+
const endRef = (0, import_react16.useRef)(null);
|
|
2285
|
+
const pinnedRef = (0, import_react16.useRef)(true);
|
|
2286
|
+
const anchoredTurnRef = (0, import_react16.useRef)(null);
|
|
2287
|
+
(0, import_react16.useEffect)(() => {
|
|
2271
2288
|
const anchor = turnAnchor(state.messages);
|
|
2272
2289
|
const list = listRef.current;
|
|
2273
2290
|
if (anchor && anchor.turnId !== anchoredTurnRef.current) {
|
|
@@ -2322,10 +2339,10 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
2322
2339
|
}
|
|
2323
2340
|
|
|
2324
2341
|
// src/components/ChatInput.tsx
|
|
2325
|
-
var
|
|
2342
|
+
var import_react17 = require("react");
|
|
2326
2343
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2327
2344
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
2328
|
-
const [value, setValue] = (0,
|
|
2345
|
+
const [value, setValue] = (0, import_react17.useState)("");
|
|
2329
2346
|
const submit = () => {
|
|
2330
2347
|
const t = value.trim();
|
|
2331
2348
|
if (!t) return;
|
|
@@ -2348,8 +2365,8 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
2348
2365
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2349
2366
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
2350
2367
|
function useIsModal() {
|
|
2351
|
-
const [modal, setModal] = (0,
|
|
2352
|
-
(0,
|
|
2368
|
+
const [modal, setModal] = (0, import_react18.useState)(false);
|
|
2369
|
+
(0, import_react18.useEffect)(() => {
|
|
2353
2370
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
2354
2371
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
2355
2372
|
const sync = () => setModal(mql.matches);
|
|
@@ -2362,7 +2379,7 @@ function useIsModal() {
|
|
|
2362
2379
|
function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
2363
2380
|
const { state, close, stop, send } = controller;
|
|
2364
2381
|
const isModal = useIsModal();
|
|
2365
|
-
(0,
|
|
2382
|
+
(0, import_react18.useEffect)(() => {
|
|
2366
2383
|
const onKey = (e) => {
|
|
2367
2384
|
if (e.key === "Escape") close();
|
|
2368
2385
|
};
|
|
@@ -2775,10 +2792,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2775
2792
|
.ss-w-fandash-fixture-team--away .ss-w-fandash-fixture-name { text-align: right; }
|
|
2776
2793
|
.ss-w-fandash-fixture-vs { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ss-w-faint); }
|
|
2777
2794
|
/* date + venue as labelled rows, so a long stadium name gets its own line to ellipsis in */
|
|
2778
|
-
.ss-w-fandash-fixture-meta {
|
|
2779
|
-
.ss-w-fandash-fixture-
|
|
2780
|
-
.ss-w-fandash-fixture-
|
|
2781
|
-
.ss-w-fandash-fixture-metaval { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ss-w-ink); }
|
|
2795
|
+
.ss-w-fandash-fixture-meta { border-top: 1px solid var(--ss-w-line); padding-top: 10px; text-align: center; font-size: 12.5px; color: var(--ss-w-faint); }
|
|
2796
|
+
.ss-w-fandash-fixture-kickoff { font-weight: 700; color: var(--ss-w-ink); }
|
|
2797
|
+
.ss-w-fandash-fixture-venue { font-weight: 600; }
|
|
2782
2798
|
.ss-w-fandash-fact { font-size: 12px; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 8px; }
|
|
2783
2799
|
/* each head-to-head figure sits on its own shaded tile, so the grid gap separates wins/draws/losses */
|
|
2784
2800
|
.ss-w-fandash-h2h .ss-w-fandash-split-cell { background: var(--ss-w-bubble); border-radius: 10px; padding: 12px 6px; }
|
|
@@ -2788,7 +2804,12 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2788
2804
|
/* last-five: one row per side, team name left, form pills right */
|
|
2789
2805
|
.ss-w-fandash-fixture-form { display: flex; flex-direction: column; gap: 5px; }
|
|
2790
2806
|
.ss-w-fandash-formrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2807
|
+
.ss-w-fandash-formrow-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
2808
|
+
.ss-w-fandash-formrow-team .ss-w-bi-crest { width: 20px; height: 20px; }
|
|
2809
|
+
.ss-w-fandash-formrow-team .ss-w-bi-crest-mono { font-size: 9px; }
|
|
2791
2810
|
.ss-w-fandash-formrow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
|
|
2811
|
+
.ss-w-fandash-injuries-more { margin-top: 10px; width: 100%; background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); border-radius: 9px; padding: 7px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--ss-w-accent); cursor: pointer; }
|
|
2812
|
+
.ss-w-fandash-injuries-more:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
2792
2813
|
.ss-w-fandash-form { display: inline-flex; gap: 3px; flex: none; }
|
|
2793
2814
|
.ss-w-fandash-form-pill {
|
|
2794
2815
|
display: inline-grid; place-items: center; width: 16px; height: 16px;
|
|
@@ -3048,11 +3069,11 @@ function injectStyles(root) {
|
|
|
3048
3069
|
function StatsWidget(props) {
|
|
3049
3070
|
const injectedClient = "client" in props ? props.client : void 0;
|
|
3050
3071
|
const cfg = props.config;
|
|
3051
|
-
const built = (0,
|
|
3052
|
-
const ui = (0,
|
|
3053
|
-
const rootRef = (0,
|
|
3072
|
+
const built = (0, import_react19.useMemo)(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
|
|
3073
|
+
const ui = (0, import_react19.useMemo)(() => normalizeUi(props.config ?? { operatorId: "", publicKey: "" }), [props.config]);
|
|
3074
|
+
const rootRef = (0, import_react19.useRef)(null);
|
|
3054
3075
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0);
|
|
3055
|
-
const slip = (0,
|
|
3076
|
+
const slip = (0, import_react19.useMemo)(
|
|
3056
3077
|
() => ({
|
|
3057
3078
|
onAddToSlip: props.config?.onAddToSlip,
|
|
3058
3079
|
conversationId: controller.state.conversationId ?? void 0,
|
|
@@ -3065,11 +3086,11 @@ function StatsWidget(props) {
|
|
|
3065
3086
|
}),
|
|
3066
3087
|
[props.config?.onAddToSlip, controller.state.conversationId, built]
|
|
3067
3088
|
);
|
|
3068
|
-
const onDashboardTap = (0,
|
|
3089
|
+
const onDashboardTap = (0, import_react19.useMemo)(
|
|
3069
3090
|
() => built ? createDashboardTapSignal((input) => built.conversation.sendSignal(input)) : void 0,
|
|
3070
3091
|
[built]
|
|
3071
3092
|
);
|
|
3072
|
-
(0,
|
|
3093
|
+
(0, import_react19.useEffect)(() => {
|
|
3073
3094
|
if (!built || !ui.injectStyles) return;
|
|
3074
3095
|
const node = rootRef.current?.getRootNode();
|
|
3075
3096
|
if (node) injectStyles(node);
|