@sensiblestats/widget-react 0.23.1 → 0.24.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 +156 -46
- 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 +156 -46
- package/dist/index.js.map +1 -1
- package/dist/styles.css +30 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 04c6e5b: Add post-match club dashboard cards (result, goals, stats, top performer, what's next); the three interactive cards tap through via actionRef.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [04c6e5b]
|
|
12
|
+
- @sensiblestats/widget-sdk@0.22.0
|
|
13
|
+
|
|
3
14
|
## 0.23.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1558,67 +1558,147 @@ function LinksCard({ card }) {
|
|
|
1558
1558
|
] });
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
-
// src/components/dashboard/
|
|
1561
|
+
// src/components/dashboard/PostMatchResultCard.tsx
|
|
1562
1562
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1563
|
+
function PostMatchResultCard({ card }) {
|
|
1564
|
+
const { data } = card;
|
|
1565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-postmatch-result", children: [
|
|
1566
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ss-w-fandash-postmatch-scoreboard", children: [
|
|
1568
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-postmatch-team", children: data.homeName }),
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-postmatch-score", children: data.homeScore }),
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-postmatch-sep", children: "\u2013" }),
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-postmatch-score", children: data.awayScore }),
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ss-w-fandash-postmatch-team ss-w-fandash-postmatch-team--away", children: data.awayName })
|
|
1573
|
+
] }),
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ss-w-fandash-postmatch-meta", children: [
|
|
1575
|
+
data.resultLabel,
|
|
1576
|
+
" \xB7 ",
|
|
1577
|
+
data.kickoffLabel,
|
|
1578
|
+
data.competition ? ` \xB7 ${data.competition}` : ""
|
|
1579
|
+
] })
|
|
1580
|
+
] });
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
// src/components/dashboard/PostMatchGoalsCard.tsx
|
|
1584
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1585
|
+
function PostMatchGoalsCard({ card, onTap }) {
|
|
1586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-goals", onClick: () => onTap(card), children: [
|
|
1587
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1588
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { className: "ss-w-fandash-postmatch-goal-list", children: card.data.goals.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { className: g.scoredByClub ? "ss-w-fandash-postmatch-goal ss-w-fandash-postmatch-goal--club" : "ss-w-fandash-postmatch-goal", children: g.text }, `${g.text}-${i}`)) }),
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1590
|
+
] });
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// src/components/dashboard/PostMatchStatsCard.tsx
|
|
1594
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1595
|
+
function PostMatchStatsCard({ card, onTap }) {
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-stats", onClick: () => onTap(card), children: [
|
|
1597
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ss-w-fandash-postmatch-stat-rows", children: card.data.rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ss-w-fandash-postmatch-stat-row", children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "ss-w-fandash-postmatch-stat-value", children: r.clubValue }),
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "ss-w-fandash-postmatch-stat-label", children: r.label }),
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "ss-w-fandash-postmatch-stat-value", children: r.oppValue })
|
|
1602
|
+
] }, `${r.label}-${i}`)) }),
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1604
|
+
] });
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
// src/components/dashboard/PostMatchTopPerformerCard.tsx
|
|
1608
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1609
|
+
function PostMatchTopPerformerCard({ card, onTap }) {
|
|
1610
|
+
const { data } = card;
|
|
1611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-performer", onClick: () => onTap(card), children: [
|
|
1612
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "ss-w-fandash-postmatch-performer-row", children: [
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ss-w-fandash-postmatch-performer-name", children: data.playerName }),
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ss-w-fandash-postmatch-performer-rating", children: data.ratingLabel })
|
|
1616
|
+
] }),
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1618
|
+
] });
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
// src/components/dashboard/PostMatchNextCard.tsx
|
|
1622
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1623
|
+
function PostMatchNextCard({ card }) {
|
|
1624
|
+
const { data } = card;
|
|
1625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-postmatch-next", children: [
|
|
1626
|
+
card.title ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1627
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ss-w-fandash-postmatch-next-row", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ss-w-fandash-postmatch-next-when", children: data.whenLabel }) })
|
|
1628
|
+
] });
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
// src/components/dashboard/ClubFanDashboard.tsx
|
|
1632
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1563
1633
|
function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
1564
1634
|
const orderedCards = [
|
|
1565
1635
|
...dashboard.cards.filter((c) => c.cardType === "countdown"),
|
|
1566
1636
|
...dashboard.cards.filter((c) => c.cardType !== "countdown")
|
|
1567
1637
|
];
|
|
1568
|
-
return /* @__PURE__ */ (0,
|
|
1569
|
-
dashboard.greeting ? /* @__PURE__ */ (0,
|
|
1570
|
-
/* @__PURE__ */ (0,
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ss-w-fandash", children: [
|
|
1639
|
+
dashboard.greeting ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ss-w-fandash-greeting", children: dashboard.greeting }) : null,
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ss-w-fandash-cards", children: orderedCards.map((card, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FanDashboardCard, { card, onTap, ui }, `${card.cardType}-${i}`)) })
|
|
1571
1641
|
] });
|
|
1572
1642
|
}
|
|
1573
1643
|
function FanDashboardCard({ card, onTap, ui }) {
|
|
1574
1644
|
switch (card.cardType) {
|
|
1575
1645
|
case "fixture":
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FixtureCard, { card, onTap });
|
|
1577
1647
|
case "countdown":
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CountdownCard, { card });
|
|
1579
1649
|
case "injuries":
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InjuriesCard, { card });
|
|
1581
1651
|
case "reasonToBet":
|
|
1582
|
-
return /* @__PURE__ */ (0,
|
|
1652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ReasonToBetCard, { card });
|
|
1583
1653
|
case "whereToWatch":
|
|
1584
|
-
return /* @__PURE__ */ (0,
|
|
1654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WhereToWatchCard, { card });
|
|
1585
1655
|
case "congestedWeek":
|
|
1586
|
-
return /* @__PURE__ */ (0,
|
|
1656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CongestedWeekCard, { card, onTap });
|
|
1587
1657
|
case "transfers":
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TransfersCard, { card });
|
|
1589
1659
|
case "links":
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinksCard, { card });
|
|
1661
|
+
case "postMatchResult":
|
|
1662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PostMatchResultCard, { card });
|
|
1663
|
+
case "postMatchGoals":
|
|
1664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PostMatchGoalsCard, { card, onTap });
|
|
1665
|
+
case "postMatchStats":
|
|
1666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PostMatchStatsCard, { card, onTap });
|
|
1667
|
+
case "postMatchTopPerformer":
|
|
1668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PostMatchTopPerformerCard, { card, onTap });
|
|
1669
|
+
case "postMatchNext":
|
|
1670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PostMatchNextCard, { card });
|
|
1591
1671
|
default:
|
|
1592
1672
|
return null;
|
|
1593
1673
|
}
|
|
1594
1674
|
}
|
|
1595
1675
|
|
|
1596
1676
|
// src/components/ChatMessage.tsx
|
|
1597
|
-
var
|
|
1677
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1598
1678
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
1599
1679
|
if (message.role === "user") {
|
|
1600
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1601
1681
|
}
|
|
1602
1682
|
const onFanDashboardTap = (card) => {
|
|
1603
1683
|
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1604
1684
|
};
|
|
1605
|
-
return /* @__PURE__ */ (0,
|
|
1606
|
-
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1607
|
-
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1608
|
-
message.clubFanDashboard ? /* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1612
|
-
/* @__PURE__ */ (0,
|
|
1613
|
-
/* @__PURE__ */ (0,
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1686
|
+
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Markdown, { text: message.text }) : null,
|
|
1687
|
+
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GreetingDashboard, { dashboard: message.greetingDashboard, onTap }) : null,
|
|
1688
|
+
message.clubFanDashboard ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(BettingInsightList, { insights: message.insights, ui, slip }),
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MarketOddsCardList, { cards: message.marketOdds, ui, slip }),
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OddsMovementCardList, { cards: message.oddsMovement, ui }),
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ActionButtons, { actions: message.actions, loading: false, disabled, onAct })
|
|
1614
1694
|
] });
|
|
1615
1695
|
}
|
|
1616
1696
|
|
|
1617
1697
|
// src/components/IntentChips.tsx
|
|
1618
|
-
var
|
|
1698
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1619
1699
|
function IntentChips({ chips, onPick }) {
|
|
1620
1700
|
if (chips.length === 0) return null;
|
|
1621
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "ss-w-chips", children: chips.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: "ss-w-chip", onClick: () => onPick(c.text), children: c.text }, `${c.text}-${i}`)) });
|
|
1622
1702
|
}
|
|
1623
1703
|
|
|
1624
1704
|
// src/scroll.ts
|
|
@@ -1628,7 +1708,7 @@ function isPinnedToBottom(el, threshold = PIN_THRESHOLD) {
|
|
|
1628
1708
|
}
|
|
1629
1709
|
|
|
1630
1710
|
// src/components/MessageList.tsx
|
|
1631
|
-
var
|
|
1711
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1632
1712
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
1633
1713
|
const { state, send } = controller;
|
|
1634
1714
|
const listRef = (0, import_react9.useRef)(null);
|
|
@@ -1639,7 +1719,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1639
1719
|
}, [state.messages, state.status]);
|
|
1640
1720
|
const hasUserMessage = state.messages.some((m) => m.role === "user");
|
|
1641
1721
|
const hasDashboard = state.messages.some((m) => m.role === "assistant" && (m.greetingDashboard || m.clubFanDashboard));
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
1722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1643
1723
|
"div",
|
|
1644
1724
|
{
|
|
1645
1725
|
className: "ss-w-list",
|
|
@@ -1649,7 +1729,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1649
1729
|
if (listRef.current) pinnedRef.current = isPinnedToBottom(listRef.current);
|
|
1650
1730
|
},
|
|
1651
1731
|
children: [
|
|
1652
|
-
state.messages.map((m) => /* @__PURE__ */ (0,
|
|
1732
|
+
state.messages.map((m) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1653
1733
|
ChatMessage,
|
|
1654
1734
|
{
|
|
1655
1735
|
message: m,
|
|
@@ -1664,15 +1744,15 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1664
1744
|
},
|
|
1665
1745
|
m.id
|
|
1666
1746
|
)),
|
|
1667
|
-
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0,
|
|
1747
|
+
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ActionButtons, { actions: [], loading: true, onAct: () => {
|
|
1668
1748
|
} }) : null,
|
|
1669
|
-
state.status ? /* @__PURE__ */ (0,
|
|
1670
|
-
state.error ? /* @__PURE__ */ (0,
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1749
|
+
state.status ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ss-w-status", children: state.status }) : null,
|
|
1750
|
+
state.error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ss-w-error", role: "alert", children: [
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "message" in state.error ? state.error.message : ui.somethingWentWrong }),
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "ss-w-retry", onClick: () => controller.retry(), children: ui.retry })
|
|
1673
1753
|
] }) : null,
|
|
1674
|
-
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ (0,
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(IntentChips, { chips: state.starters, onPick: (t) => send(t) }) : null,
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: endRef })
|
|
1676
1756
|
]
|
|
1677
1757
|
}
|
|
1678
1758
|
);
|
|
@@ -1680,7 +1760,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1680
1760
|
|
|
1681
1761
|
// src/components/ChatInput.tsx
|
|
1682
1762
|
var import_react10 = require("react");
|
|
1683
|
-
var
|
|
1763
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1684
1764
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
1685
1765
|
const [value, setValue] = (0, import_react10.useState)("");
|
|
1686
1766
|
const submit = () => {
|
|
@@ -1695,14 +1775,14 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
1695
1775
|
submit();
|
|
1696
1776
|
}
|
|
1697
1777
|
};
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
streaming ? /* @__PURE__ */ (0,
|
|
1778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ss-w-input", children: [
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("textarea", { className: "ss-w-textarea", rows: 1, placeholder, value, disabled: streaming, onChange: (e) => setValue(e.target.value), onKeyDown }),
|
|
1780
|
+
streaming ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", className: "ss-w-send ss-w-stop", "aria-label": stopLabel, onClick: onStop, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "ss-w-stop-glyph" }) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", className: "ss-w-send", "aria-label": sendLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SendIcon, {}) })
|
|
1701
1781
|
] });
|
|
1702
1782
|
}
|
|
1703
1783
|
|
|
1704
1784
|
// src/components/ChatPanel.tsx
|
|
1705
|
-
var
|
|
1785
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1706
1786
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
1707
1787
|
function useIsModal() {
|
|
1708
1788
|
const [modal, setModal] = (0, import_react11.useState)(false);
|
|
@@ -1726,10 +1806,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
|
1726
1806
|
window.addEventListener("keydown", onKey);
|
|
1727
1807
|
return () => window.removeEventListener("keydown", onKey);
|
|
1728
1808
|
}, [close]);
|
|
1729
|
-
return /* @__PURE__ */ (0,
|
|
1730
|
-
/* @__PURE__ */ (0,
|
|
1731
|
-
/* @__PURE__ */ (0,
|
|
1732
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChatHeader, { onClose: close, closeLabel: ui.closeChat }),
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MessageList, { controller, ui, slip, onDashboardTap }),
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: (t) => send(t), onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
1733
1813
|
] });
|
|
1734
1814
|
}
|
|
1735
1815
|
|
|
@@ -2194,10 +2274,40 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2194
2274
|
.ss-w-fandash-link-tile:hover { background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
|
|
2195
2275
|
.ss-w-fandash-link-label { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2196
2276
|
.ss-w-fandash-link-chevron { flex: none; width: 12px; height: 12px; color: var(--ss-w-accent); }
|
|
2277
|
+
|
|
2278
|
+
/* post-match result: full-time scoreboard -- team names flank the score, meta line underneath */
|
|
2279
|
+
.ss-w-fandash-postmatch-scoreboard { display: flex; align-items: center; gap: 8px; }
|
|
2280
|
+
.ss-w-fandash-postmatch-team { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2281
|
+
.ss-w-fandash-postmatch-team--away { text-align: right; }
|
|
2282
|
+
.ss-w-fandash-postmatch-score { flex: none; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2283
|
+
.ss-w-fandash-postmatch-sep { flex: none; font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
2284
|
+
.ss-w-fandash-postmatch-meta { font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2285
|
+
|
|
2286
|
+
/* post-match goals: a plain list, the club's own goals picked out in the accent color */
|
|
2287
|
+
.ss-w-fandash-postmatch-goal-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
|
|
2288
|
+
.ss-w-fandash-postmatch-goal { font-size: 12.5px; color: var(--ss-w-faint); }
|
|
2289
|
+
.ss-w-fandash-postmatch-goal--club { color: var(--ss-w-ink); font-weight: 650; }
|
|
2290
|
+
|
|
2291
|
+
/* post-match stats: club value / stat label / opponent value, three columns per row */
|
|
2292
|
+
.ss-w-fandash-postmatch-stat-rows { display: flex; flex-direction: column; gap: 5px; }
|
|
2293
|
+
.ss-w-fandash-postmatch-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
|
|
2294
|
+
.ss-w-fandash-postmatch-stat-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2295
|
+
.ss-w-fandash-postmatch-stat-row .ss-w-fandash-postmatch-stat-value:last-child { text-align: right; }
|
|
2296
|
+
.ss-w-fandash-postmatch-stat-label { font-size: 10.5px; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .03em; }
|
|
2297
|
+
|
|
2298
|
+
/* post-match top performer: player name left, rating pill right */
|
|
2299
|
+
.ss-w-fandash-postmatch-performer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2300
|
+
.ss-w-fandash-postmatch-performer-name { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2301
|
+
.ss-w-fandash-postmatch-performer-rating { flex: none; font-size: 12px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 13%, var(--ss-w-panel)); border-radius: 999px; padding: 2px 9px; }
|
|
2302
|
+
|
|
2303
|
+
/* post-match next: the upcoming fixture teaser -- opponent left, when-label right */
|
|
2304
|
+
.ss-w-fandash-postmatch-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2305
|
+
.ss-w-fandash-postmatch-next-opponent { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2306
|
+
.ss-w-fandash-postmatch-next-when { flex: none; font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2197
2307
|
`;
|
|
2198
2308
|
|
|
2199
2309
|
// src/StatsWidget.tsx
|
|
2200
|
-
var
|
|
2310
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2201
2311
|
function buildClient(props) {
|
|
2202
2312
|
try {
|
|
2203
2313
|
if ("client" in props && props.client) {
|
|
@@ -2250,7 +2360,7 @@ function StatsWidget(props) {
|
|
|
2250
2360
|
}, [built, ui.injectStyles]);
|
|
2251
2361
|
if (!built) return null;
|
|
2252
2362
|
const attrs = themeAttrs(ui);
|
|
2253
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.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_runtime36.jsx)(ChatPanel, { controller, ui, slip, onDashboardTap }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2254
2364
|
ChatFab,
|
|
2255
2365
|
{
|
|
2256
2366
|
label: ui.launcherLabel,
|