@sensiblestats/widget-react 0.24.0 → 0.25.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 +11 -0
- package/dist/index.cjs +135 -51
- 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 +135 -51
- package/dist/index.js.map +1 -1
- package/dist/styles.css +17 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 57112ca: Add resting (between-matches) club dashboard cards: next up, standings, season so far, recent form.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [57112ca]
|
|
12
|
+
- @sensiblestats/widget-sdk@0.23.0
|
|
13
|
+
|
|
3
14
|
## 0.24.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1628,77 +1628,144 @@ function PostMatchNextCard({ card }) {
|
|
|
1628
1628
|
] });
|
|
1629
1629
|
}
|
|
1630
1630
|
|
|
1631
|
-
// src/components/dashboard/
|
|
1631
|
+
// src/components/dashboard/RestingNextCard.tsx
|
|
1632
1632
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1633
|
+
function RestingNextCard({ card, onTap }) {
|
|
1634
|
+
const { data } = card;
|
|
1635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-next", onClick: () => onTap(card), children: [
|
|
1636
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ss-w-fandash-resting-next-row", children: [
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ss-w-fandash-resting-next-when", children: data.whenLabel }),
|
|
1639
|
+
data.competition ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ss-w-fandash-resting-next-competition", children: data.competition }) : null
|
|
1640
|
+
] }),
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1642
|
+
] });
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
// src/components/dashboard/RestingStandingsCard.tsx
|
|
1646
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1647
|
+
function RestingStandingsCard({ card, onTap }) {
|
|
1648
|
+
const { data } = card;
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-standings", onClick: () => onTap(card), children: [
|
|
1650
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ss-w-fandash-resting-standings-row", children: [
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ss-w-fandash-resting-standings-position", children: data.positionLabel }),
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ss-w-fandash-resting-standings-record", children: data.recordLabel })
|
|
1654
|
+
] }),
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1656
|
+
] });
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// src/components/dashboard/RestingSeasonCard.tsx
|
|
1660
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1661
|
+
function RestingSeasonCard({ card, onTap }) {
|
|
1662
|
+
const { data } = card;
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-season", onClick: () => onTap(card), children: [
|
|
1664
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "ss-w-fandash-resting-season-rows", children: [
|
|
1666
|
+
data.scorerLabel ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ss-w-fandash-resting-season-row", children: data.scorerLabel }) : null,
|
|
1667
|
+
data.playerLabel ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ss-w-fandash-resting-season-row", children: data.playerLabel }) : null,
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ss-w-fandash-resting-season-row", children: data.tallyLabel })
|
|
1669
|
+
] }),
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1671
|
+
] });
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// src/components/dashboard/RestingFormCard.tsx
|
|
1675
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1676
|
+
function resultClass2(result) {
|
|
1677
|
+
const upper = result.toUpperCase();
|
|
1678
|
+
if (upper === "W") return "ss-w-fandash-form-pill--win";
|
|
1679
|
+
if (upper === "L") return "ss-w-fandash-form-pill--loss";
|
|
1680
|
+
return "ss-w-fandash-form-pill--draw";
|
|
1681
|
+
}
|
|
1682
|
+
function RestingFormCard({ card }) {
|
|
1683
|
+
const { data } = card;
|
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-resting-form", children: [
|
|
1685
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-fandash-form", children: data.letters.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: `ss-w-fandash-form-pill ${resultClass2(r)}`, children: r }, `${r}-${i}`)) })
|
|
1687
|
+
] });
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
// src/components/dashboard/ClubFanDashboard.tsx
|
|
1691
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1633
1692
|
function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
1634
1693
|
const orderedCards = [
|
|
1635
1694
|
...dashboard.cards.filter((c) => c.cardType === "countdown"),
|
|
1636
1695
|
...dashboard.cards.filter((c) => c.cardType !== "countdown")
|
|
1637
1696
|
];
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1639
|
-
dashboard.greeting ? /* @__PURE__ */ (0,
|
|
1640
|
-
/* @__PURE__ */ (0,
|
|
1697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ss-w-fandash", children: [
|
|
1698
|
+
dashboard.greeting ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "ss-w-fandash-greeting", children: dashboard.greeting }) : null,
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ss-w-fandash-cards", children: orderedCards.map((card, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FanDashboardCard, { card, onTap, ui }, `${card.cardType}-${i}`)) })
|
|
1641
1700
|
] });
|
|
1642
1701
|
}
|
|
1643
1702
|
function FanDashboardCard({ card, onTap, ui }) {
|
|
1644
1703
|
switch (card.cardType) {
|
|
1645
1704
|
case "fixture":
|
|
1646
|
-
return /* @__PURE__ */ (0,
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FixtureCard, { card, onTap });
|
|
1647
1706
|
case "countdown":
|
|
1648
|
-
return /* @__PURE__ */ (0,
|
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CountdownCard, { card });
|
|
1649
1708
|
case "injuries":
|
|
1650
|
-
return /* @__PURE__ */ (0,
|
|
1709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(InjuriesCard, { card });
|
|
1651
1710
|
case "reasonToBet":
|
|
1652
|
-
return /* @__PURE__ */ (0,
|
|
1711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ReasonToBetCard, { card });
|
|
1653
1712
|
case "whereToWatch":
|
|
1654
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WhereToWatchCard, { card });
|
|
1655
1714
|
case "congestedWeek":
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CongestedWeekCard, { card, onTap });
|
|
1657
1716
|
case "transfers":
|
|
1658
|
-
return /* @__PURE__ */ (0,
|
|
1717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TransfersCard, { card });
|
|
1659
1718
|
case "links":
|
|
1660
|
-
return /* @__PURE__ */ (0,
|
|
1719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LinksCard, { card });
|
|
1661
1720
|
case "postMatchResult":
|
|
1662
|
-
return /* @__PURE__ */ (0,
|
|
1721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchResultCard, { card });
|
|
1663
1722
|
case "postMatchGoals":
|
|
1664
|
-
return /* @__PURE__ */ (0,
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchGoalsCard, { card, onTap });
|
|
1665
1724
|
case "postMatchStats":
|
|
1666
|
-
return /* @__PURE__ */ (0,
|
|
1725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchStatsCard, { card, onTap });
|
|
1667
1726
|
case "postMatchTopPerformer":
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchTopPerformerCard, { card, onTap });
|
|
1669
1728
|
case "postMatchNext":
|
|
1670
|
-
return /* @__PURE__ */ (0,
|
|
1729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchNextCard, { card });
|
|
1730
|
+
case "restingNext":
|
|
1731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RestingNextCard, { card, onTap });
|
|
1732
|
+
case "restingStandings":
|
|
1733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RestingStandingsCard, { card, onTap });
|
|
1734
|
+
case "restingSeason":
|
|
1735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RestingSeasonCard, { card, onTap });
|
|
1736
|
+
case "restingForm":
|
|
1737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RestingFormCard, { card });
|
|
1671
1738
|
default:
|
|
1672
1739
|
return null;
|
|
1673
1740
|
}
|
|
1674
1741
|
}
|
|
1675
1742
|
|
|
1676
1743
|
// src/components/ChatMessage.tsx
|
|
1677
|
-
var
|
|
1744
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1678
1745
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
1679
1746
|
if (message.role === "user") {
|
|
1680
|
-
return /* @__PURE__ */ (0,
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1681
1748
|
}
|
|
1682
1749
|
const onFanDashboardTap = (card) => {
|
|
1683
1750
|
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1684
1751
|
};
|
|
1685
|
-
return /* @__PURE__ */ (0,
|
|
1686
|
-
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1687
|
-
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1688
|
-
message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1691
|
-
/* @__PURE__ */ (0,
|
|
1692
|
-
/* @__PURE__ */ (0,
|
|
1693
|
-
/* @__PURE__ */ (0,
|
|
1752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1753
|
+
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Markdown, { text: message.text }) : null,
|
|
1754
|
+
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(GreetingDashboard, { dashboard: message.greetingDashboard, onTap }) : null,
|
|
1755
|
+
message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
|
|
1756
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
1757
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BettingInsightList, { insights: message.insights, ui, slip }),
|
|
1758
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MarketOddsCardList, { cards: message.marketOdds, ui, slip }),
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OddsMovementCardList, { cards: message.oddsMovement, ui }),
|
|
1760
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ActionButtons, { actions: message.actions, loading: false, disabled, onAct })
|
|
1694
1761
|
] });
|
|
1695
1762
|
}
|
|
1696
1763
|
|
|
1697
1764
|
// src/components/IntentChips.tsx
|
|
1698
|
-
var
|
|
1765
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1699
1766
|
function IntentChips({ chips, onPick }) {
|
|
1700
1767
|
if (chips.length === 0) return null;
|
|
1701
|
-
return /* @__PURE__ */ (0,
|
|
1768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ss-w-chips", children: chips.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: "ss-w-chip", onClick: () => onPick(c.text), children: c.text }, `${c.text}-${i}`)) });
|
|
1702
1769
|
}
|
|
1703
1770
|
|
|
1704
1771
|
// src/scroll.ts
|
|
@@ -1708,7 +1775,7 @@ function isPinnedToBottom(el, threshold = PIN_THRESHOLD) {
|
|
|
1708
1775
|
}
|
|
1709
1776
|
|
|
1710
1777
|
// src/components/MessageList.tsx
|
|
1711
|
-
var
|
|
1778
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1712
1779
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
1713
1780
|
const { state, send } = controller;
|
|
1714
1781
|
const listRef = (0, import_react9.useRef)(null);
|
|
@@ -1719,7 +1786,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1719
1786
|
}, [state.messages, state.status]);
|
|
1720
1787
|
const hasUserMessage = state.messages.some((m) => m.role === "user");
|
|
1721
1788
|
const hasDashboard = state.messages.some((m) => m.role === "assistant" && (m.greetingDashboard || m.clubFanDashboard));
|
|
1722
|
-
return /* @__PURE__ */ (0,
|
|
1789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1723
1790
|
"div",
|
|
1724
1791
|
{
|
|
1725
1792
|
className: "ss-w-list",
|
|
@@ -1729,7 +1796,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1729
1796
|
if (listRef.current) pinnedRef.current = isPinnedToBottom(listRef.current);
|
|
1730
1797
|
},
|
|
1731
1798
|
children: [
|
|
1732
|
-
state.messages.map((m) => /* @__PURE__ */ (0,
|
|
1799
|
+
state.messages.map((m) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1733
1800
|
ChatMessage,
|
|
1734
1801
|
{
|
|
1735
1802
|
message: m,
|
|
@@ -1744,15 +1811,15 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1744
1811
|
},
|
|
1745
1812
|
m.id
|
|
1746
1813
|
)),
|
|
1747
|
-
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0,
|
|
1814
|
+
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ActionButtons, { actions: [], loading: true, onAct: () => {
|
|
1748
1815
|
} }) : null,
|
|
1749
|
-
state.status ? /* @__PURE__ */ (0,
|
|
1750
|
-
state.error ? /* @__PURE__ */ (0,
|
|
1751
|
-
/* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1816
|
+
state.status ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ss-w-status", children: state.status }) : null,
|
|
1817
|
+
state.error ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ss-w-error", role: "alert", children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "message" in state.error ? state.error.message : ui.somethingWentWrong }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("button", { type: "button", className: "ss-w-retry", onClick: () => controller.retry(), children: ui.retry })
|
|
1753
1820
|
] }) : null,
|
|
1754
|
-
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ (0,
|
|
1755
|
-
/* @__PURE__ */ (0,
|
|
1821
|
+
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IntentChips, { chips: state.starters, onPick: (t) => send(t) }) : null,
|
|
1822
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref: endRef })
|
|
1756
1823
|
]
|
|
1757
1824
|
}
|
|
1758
1825
|
);
|
|
@@ -1760,7 +1827,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1760
1827
|
|
|
1761
1828
|
// src/components/ChatInput.tsx
|
|
1762
1829
|
var import_react10 = require("react");
|
|
1763
|
-
var
|
|
1830
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1764
1831
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
1765
1832
|
const [value, setValue] = (0, import_react10.useState)("");
|
|
1766
1833
|
const submit = () => {
|
|
@@ -1775,14 +1842,14 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
1775
1842
|
submit();
|
|
1776
1843
|
}
|
|
1777
1844
|
};
|
|
1778
|
-
return /* @__PURE__ */ (0,
|
|
1779
|
-
/* @__PURE__ */ (0,
|
|
1780
|
-
streaming ? /* @__PURE__ */ (0,
|
|
1845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ss-w-input", children: [
|
|
1846
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("textarea", { className: "ss-w-textarea", rows: 1, placeholder, value, disabled: streaming, onChange: (e) => setValue(e.target.value), onKeyDown }),
|
|
1847
|
+
streaming ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "ss-w-send ss-w-stop", "aria-label": stopLabel, onClick: onStop, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ss-w-stop-glyph" }) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "ss-w-send", "aria-label": sendLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SendIcon, {}) })
|
|
1781
1848
|
] });
|
|
1782
1849
|
}
|
|
1783
1850
|
|
|
1784
1851
|
// src/components/ChatPanel.tsx
|
|
1785
|
-
var
|
|
1852
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1786
1853
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
1787
1854
|
function useIsModal() {
|
|
1788
1855
|
const [modal, setModal] = (0, import_react11.useState)(false);
|
|
@@ -1806,10 +1873,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
|
1806
1873
|
window.addEventListener("keydown", onKey);
|
|
1807
1874
|
return () => window.removeEventListener("keydown", onKey);
|
|
1808
1875
|
}, [close]);
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1810
|
-
/* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChatHeader, { onClose: close, closeLabel: ui.closeChat }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MessageList, { controller, ui, slip, onDashboardTap }),
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: (t) => send(t), onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
1813
1880
|
] });
|
|
1814
1881
|
}
|
|
1815
1882
|
|
|
@@ -2304,10 +2371,27 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2304
2371
|
.ss-w-fandash-postmatch-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2305
2372
|
.ss-w-fandash-postmatch-next-opponent { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2306
2373
|
.ss-w-fandash-postmatch-next-when { flex: none; font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2374
|
+
|
|
2375
|
+
/* resting next: the between-matches fixture teaser -- when-label left, competition badge right */
|
|
2376
|
+
.ss-w-fandash-resting-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2377
|
+
.ss-w-fandash-resting-next-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2378
|
+
.ss-w-fandash-resting-next-competition { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ss-w-faint); }
|
|
2379
|
+
|
|
2380
|
+
/* resting standings: position figure left, W-D-L/points record right */
|
|
2381
|
+
.ss-w-fandash-resting-standings-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
|
|
2382
|
+
.ss-w-fandash-resting-standings-position { font-size: 15px; font-weight: 750; color: var(--ss-w-ink); }
|
|
2383
|
+
.ss-w-fandash-resting-standings-record { font-size: 11.5px; color: var(--ss-w-faint); text-align: right; }
|
|
2384
|
+
|
|
2385
|
+
/* resting season: top scorer / key player / season tally as stacked rows */
|
|
2386
|
+
.ss-w-fandash-resting-season-rows { display: flex; flex-direction: column; gap: 4px; }
|
|
2387
|
+
.ss-w-fandash-resting-season-row { font-size: 12.5px; color: var(--ss-w-ink); }
|
|
2388
|
+
|
|
2389
|
+
/* resting form: reuses the fixture last-five pill classes (ss-w-fandash-form / -form-pill) */
|
|
2390
|
+
.ss-w-fandash-resting-form .ss-w-fandash-form { margin-top: 2px; }
|
|
2307
2391
|
`;
|
|
2308
2392
|
|
|
2309
2393
|
// src/StatsWidget.tsx
|
|
2310
|
-
var
|
|
2394
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2311
2395
|
function buildClient(props) {
|
|
2312
2396
|
try {
|
|
2313
2397
|
if ("client" in props && props.client) {
|
|
@@ -2360,7 +2444,7 @@ function StatsWidget(props) {
|
|
|
2360
2444
|
}, [built, ui.injectStyles]);
|
|
2361
2445
|
if (!built) return null;
|
|
2362
2446
|
const attrs = themeAttrs(ui);
|
|
2363
|
-
return /* @__PURE__ */ (0,
|
|
2447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref: rootRef, className: "ss-w-root", "data-ss-w-theme": attrs["data-ss-w-theme"], "data-ss-w-pos": attrs["data-ss-w-pos"], style: attrs.style, children: controller.state.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChatPanel, { controller, ui, slip, onDashboardTap }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2364
2448
|
ChatFab,
|
|
2365
2449
|
{
|
|
2366
2450
|
label: ui.launcherLabel,
|