@sensiblestats/widget-react 0.23.1 → 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 +22 -0
- package/dist/index.cjs +240 -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 +240 -46
- package/dist/index.js.map +1 -1
- package/dist/styles.css +47 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1521,67 +1521,214 @@ function LinksCard({ card }) {
|
|
|
1521
1521
|
] });
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
|
-
// src/components/dashboard/
|
|
1524
|
+
// src/components/dashboard/PostMatchResultCard.tsx
|
|
1525
1525
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1526
|
+
function PostMatchResultCard({ card }) {
|
|
1527
|
+
const { data } = card;
|
|
1528
|
+
return /* @__PURE__ */ jsxs21("div", { className: "ss-w-fandash-card ss-w-fandash-postmatch-result", children: [
|
|
1529
|
+
card.title ? /* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1530
|
+
/* @__PURE__ */ jsxs21("div", { className: "ss-w-fandash-postmatch-scoreboard", children: [
|
|
1531
|
+
/* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-postmatch-team", children: data.homeName }),
|
|
1532
|
+
/* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-postmatch-score", children: data.homeScore }),
|
|
1533
|
+
/* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-postmatch-sep", children: "\u2013" }),
|
|
1534
|
+
/* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-postmatch-score", children: data.awayScore }),
|
|
1535
|
+
/* @__PURE__ */ jsx25("span", { className: "ss-w-fandash-postmatch-team ss-w-fandash-postmatch-team--away", children: data.awayName })
|
|
1536
|
+
] }),
|
|
1537
|
+
/* @__PURE__ */ jsxs21("div", { className: "ss-w-fandash-postmatch-meta", children: [
|
|
1538
|
+
data.resultLabel,
|
|
1539
|
+
" \xB7 ",
|
|
1540
|
+
data.kickoffLabel,
|
|
1541
|
+
data.competition ? ` \xB7 ${data.competition}` : ""
|
|
1542
|
+
] })
|
|
1543
|
+
] });
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
// src/components/dashboard/PostMatchGoalsCard.tsx
|
|
1547
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1548
|
+
function PostMatchGoalsCard({ card, onTap }) {
|
|
1549
|
+
return /* @__PURE__ */ jsxs22("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-goals", onClick: () => onTap(card), children: [
|
|
1550
|
+
card.title ? /* @__PURE__ */ jsx26("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1551
|
+
/* @__PURE__ */ jsx26("ul", { className: "ss-w-fandash-postmatch-goal-list", children: card.data.goals.map((g, i) => /* @__PURE__ */ jsx26("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}`)) }),
|
|
1552
|
+
/* @__PURE__ */ jsx26("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1553
|
+
] });
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// src/components/dashboard/PostMatchStatsCard.tsx
|
|
1557
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1558
|
+
function PostMatchStatsCard({ card, onTap }) {
|
|
1559
|
+
return /* @__PURE__ */ jsxs23("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-stats", onClick: () => onTap(card), children: [
|
|
1560
|
+
card.title ? /* @__PURE__ */ jsx27("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1561
|
+
/* @__PURE__ */ jsx27("div", { className: "ss-w-fandash-postmatch-stat-rows", children: card.data.rows.map((r, i) => /* @__PURE__ */ jsxs23("div", { className: "ss-w-fandash-postmatch-stat-row", children: [
|
|
1562
|
+
/* @__PURE__ */ jsx27("span", { className: "ss-w-fandash-postmatch-stat-value", children: r.clubValue }),
|
|
1563
|
+
/* @__PURE__ */ jsx27("span", { className: "ss-w-fandash-postmatch-stat-label", children: r.label }),
|
|
1564
|
+
/* @__PURE__ */ jsx27("span", { className: "ss-w-fandash-postmatch-stat-value", children: r.oppValue })
|
|
1565
|
+
] }, `${r.label}-${i}`)) }),
|
|
1566
|
+
/* @__PURE__ */ jsx27("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1567
|
+
] });
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// src/components/dashboard/PostMatchTopPerformerCard.tsx
|
|
1571
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1572
|
+
function PostMatchTopPerformerCard({ card, onTap }) {
|
|
1573
|
+
const { data } = card;
|
|
1574
|
+
return /* @__PURE__ */ jsxs24("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-postmatch-performer", onClick: () => onTap(card), children: [
|
|
1575
|
+
card.title ? /* @__PURE__ */ jsx28("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1576
|
+
/* @__PURE__ */ jsxs24("div", { className: "ss-w-fandash-postmatch-performer-row", children: [
|
|
1577
|
+
/* @__PURE__ */ jsx28("span", { className: "ss-w-fandash-postmatch-performer-name", children: data.playerName }),
|
|
1578
|
+
/* @__PURE__ */ jsx28("span", { className: "ss-w-fandash-postmatch-performer-rating", children: data.ratingLabel })
|
|
1579
|
+
] }),
|
|
1580
|
+
/* @__PURE__ */ jsx28("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1581
|
+
] });
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// src/components/dashboard/PostMatchNextCard.tsx
|
|
1585
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1586
|
+
function PostMatchNextCard({ card }) {
|
|
1587
|
+
const { data } = card;
|
|
1588
|
+
return /* @__PURE__ */ jsxs25("div", { className: "ss-w-fandash-card ss-w-fandash-postmatch-next", children: [
|
|
1589
|
+
card.title ? /* @__PURE__ */ jsx29("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1590
|
+
/* @__PURE__ */ jsx29("div", { className: "ss-w-fandash-postmatch-next-row", children: /* @__PURE__ */ jsx29("span", { className: "ss-w-fandash-postmatch-next-when", children: data.whenLabel }) })
|
|
1591
|
+
] });
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
// src/components/dashboard/RestingNextCard.tsx
|
|
1595
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1596
|
+
function RestingNextCard({ card, onTap }) {
|
|
1597
|
+
const { data } = card;
|
|
1598
|
+
return /* @__PURE__ */ jsxs26("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-next", onClick: () => onTap(card), children: [
|
|
1599
|
+
card.title ? /* @__PURE__ */ jsx30("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1600
|
+
/* @__PURE__ */ jsxs26("div", { className: "ss-w-fandash-resting-next-row", children: [
|
|
1601
|
+
/* @__PURE__ */ jsx30("span", { className: "ss-w-fandash-resting-next-when", children: data.whenLabel }),
|
|
1602
|
+
data.competition ? /* @__PURE__ */ jsx30("span", { className: "ss-w-fandash-resting-next-competition", children: data.competition }) : null
|
|
1603
|
+
] }),
|
|
1604
|
+
/* @__PURE__ */ jsx30("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1605
|
+
] });
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
// src/components/dashboard/RestingStandingsCard.tsx
|
|
1609
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1610
|
+
function RestingStandingsCard({ card, onTap }) {
|
|
1611
|
+
const { data } = card;
|
|
1612
|
+
return /* @__PURE__ */ jsxs27("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-standings", onClick: () => onTap(card), children: [
|
|
1613
|
+
card.title ? /* @__PURE__ */ jsx31("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1614
|
+
/* @__PURE__ */ jsxs27("div", { className: "ss-w-fandash-resting-standings-row", children: [
|
|
1615
|
+
/* @__PURE__ */ jsx31("span", { className: "ss-w-fandash-resting-standings-position", children: data.positionLabel }),
|
|
1616
|
+
/* @__PURE__ */ jsx31("span", { className: "ss-w-fandash-resting-standings-record", children: data.recordLabel })
|
|
1617
|
+
] }),
|
|
1618
|
+
/* @__PURE__ */ jsx31("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1619
|
+
] });
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
// src/components/dashboard/RestingSeasonCard.tsx
|
|
1623
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1624
|
+
function RestingSeasonCard({ card, onTap }) {
|
|
1625
|
+
const { data } = card;
|
|
1626
|
+
return /* @__PURE__ */ jsxs28("button", { type: "button", className: "ss-w-fandash-card ss-w-fandash-card--tap ss-w-fandash-resting-season", onClick: () => onTap(card), children: [
|
|
1627
|
+
card.title ? /* @__PURE__ */ jsx32("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1628
|
+
/* @__PURE__ */ jsxs28("div", { className: "ss-w-fandash-resting-season-rows", children: [
|
|
1629
|
+
data.scorerLabel ? /* @__PURE__ */ jsx32("span", { className: "ss-w-fandash-resting-season-row", children: data.scorerLabel }) : null,
|
|
1630
|
+
data.playerLabel ? /* @__PURE__ */ jsx32("span", { className: "ss-w-fandash-resting-season-row", children: data.playerLabel }) : null,
|
|
1631
|
+
/* @__PURE__ */ jsx32("span", { className: "ss-w-fandash-resting-season-row", children: data.tallyLabel })
|
|
1632
|
+
] }),
|
|
1633
|
+
/* @__PURE__ */ jsx32("span", { className: "ss-w-fandash-card-cta", children: card.actionLabel })
|
|
1634
|
+
] });
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
// src/components/dashboard/RestingFormCard.tsx
|
|
1638
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1639
|
+
function resultClass2(result) {
|
|
1640
|
+
const upper = result.toUpperCase();
|
|
1641
|
+
if (upper === "W") return "ss-w-fandash-form-pill--win";
|
|
1642
|
+
if (upper === "L") return "ss-w-fandash-form-pill--loss";
|
|
1643
|
+
return "ss-w-fandash-form-pill--draw";
|
|
1644
|
+
}
|
|
1645
|
+
function RestingFormCard({ card }) {
|
|
1646
|
+
const { data } = card;
|
|
1647
|
+
return /* @__PURE__ */ jsxs29("div", { className: "ss-w-fandash-card ss-w-fandash-resting-form", children: [
|
|
1648
|
+
card.title ? /* @__PURE__ */ jsx33("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
1649
|
+
/* @__PURE__ */ jsx33("span", { className: "ss-w-fandash-form", children: data.letters.map((r, i) => /* @__PURE__ */ jsx33("span", { className: `ss-w-fandash-form-pill ${resultClass2(r)}`, children: r }, `${r}-${i}`)) })
|
|
1650
|
+
] });
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
// src/components/dashboard/ClubFanDashboard.tsx
|
|
1654
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1526
1655
|
function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
1527
1656
|
const orderedCards = [
|
|
1528
1657
|
...dashboard.cards.filter((c) => c.cardType === "countdown"),
|
|
1529
1658
|
...dashboard.cards.filter((c) => c.cardType !== "countdown")
|
|
1530
1659
|
];
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
dashboard.greeting ? /* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ jsxs30("div", { className: "ss-w-fandash", children: [
|
|
1661
|
+
dashboard.greeting ? /* @__PURE__ */ jsx34("span", { className: "ss-w-fandash-greeting", children: dashboard.greeting }) : null,
|
|
1662
|
+
/* @__PURE__ */ jsx34("div", { className: "ss-w-fandash-cards", children: orderedCards.map((card, i) => /* @__PURE__ */ jsx34(FanDashboardCard, { card, onTap, ui }, `${card.cardType}-${i}`)) })
|
|
1534
1663
|
] });
|
|
1535
1664
|
}
|
|
1536
1665
|
function FanDashboardCard({ card, onTap, ui }) {
|
|
1537
1666
|
switch (card.cardType) {
|
|
1538
1667
|
case "fixture":
|
|
1539
|
-
return /* @__PURE__ */
|
|
1668
|
+
return /* @__PURE__ */ jsx34(FixtureCard, { card, onTap });
|
|
1540
1669
|
case "countdown":
|
|
1541
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ jsx34(CountdownCard, { card });
|
|
1542
1671
|
case "injuries":
|
|
1543
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx34(InjuriesCard, { card });
|
|
1544
1673
|
case "reasonToBet":
|
|
1545
|
-
return /* @__PURE__ */
|
|
1674
|
+
return /* @__PURE__ */ jsx34(ReasonToBetCard, { card });
|
|
1546
1675
|
case "whereToWatch":
|
|
1547
|
-
return /* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ jsx34(WhereToWatchCard, { card });
|
|
1548
1677
|
case "congestedWeek":
|
|
1549
|
-
return /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ jsx34(CongestedWeekCard, { card, onTap });
|
|
1550
1679
|
case "transfers":
|
|
1551
|
-
return /* @__PURE__ */
|
|
1680
|
+
return /* @__PURE__ */ jsx34(TransfersCard, { card });
|
|
1552
1681
|
case "links":
|
|
1553
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ jsx34(LinksCard, { card });
|
|
1683
|
+
case "postMatchResult":
|
|
1684
|
+
return /* @__PURE__ */ jsx34(PostMatchResultCard, { card });
|
|
1685
|
+
case "postMatchGoals":
|
|
1686
|
+
return /* @__PURE__ */ jsx34(PostMatchGoalsCard, { card, onTap });
|
|
1687
|
+
case "postMatchStats":
|
|
1688
|
+
return /* @__PURE__ */ jsx34(PostMatchStatsCard, { card, onTap });
|
|
1689
|
+
case "postMatchTopPerformer":
|
|
1690
|
+
return /* @__PURE__ */ jsx34(PostMatchTopPerformerCard, { card, onTap });
|
|
1691
|
+
case "postMatchNext":
|
|
1692
|
+
return /* @__PURE__ */ jsx34(PostMatchNextCard, { card });
|
|
1693
|
+
case "restingNext":
|
|
1694
|
+
return /* @__PURE__ */ jsx34(RestingNextCard, { card, onTap });
|
|
1695
|
+
case "restingStandings":
|
|
1696
|
+
return /* @__PURE__ */ jsx34(RestingStandingsCard, { card, onTap });
|
|
1697
|
+
case "restingSeason":
|
|
1698
|
+
return /* @__PURE__ */ jsx34(RestingSeasonCard, { card, onTap });
|
|
1699
|
+
case "restingForm":
|
|
1700
|
+
return /* @__PURE__ */ jsx34(RestingFormCard, { card });
|
|
1554
1701
|
default:
|
|
1555
1702
|
return null;
|
|
1556
1703
|
}
|
|
1557
1704
|
}
|
|
1558
1705
|
|
|
1559
1706
|
// src/components/ChatMessage.tsx
|
|
1560
|
-
import { jsx as
|
|
1707
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1561
1708
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
1562
1709
|
if (message.role === "user") {
|
|
1563
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsx35("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ jsx35("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1564
1711
|
}
|
|
1565
1712
|
const onFanDashboardTap = (card) => {
|
|
1566
1713
|
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1567
1714
|
};
|
|
1568
|
-
return /* @__PURE__ */
|
|
1569
|
-
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */
|
|
1570
|
-
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */
|
|
1571
|
-
message.clubFanDashboard ? /* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsxs31("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1716
|
+
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx35(Markdown, { text: message.text }) : null,
|
|
1717
|
+
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx35(GreetingDashboard, { dashboard: message.greetingDashboard, onTap }) : null,
|
|
1718
|
+
message.clubFanDashboard ? /* @__PURE__ */ jsx35(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
|
|
1719
|
+
/* @__PURE__ */ jsx35(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
1720
|
+
/* @__PURE__ */ jsx35(BettingInsightList, { insights: message.insights, ui, slip }),
|
|
1721
|
+
/* @__PURE__ */ jsx35(MarketOddsCardList, { cards: message.marketOdds, ui, slip }),
|
|
1722
|
+
/* @__PURE__ */ jsx35(OddsMovementCardList, { cards: message.oddsMovement, ui }),
|
|
1723
|
+
/* @__PURE__ */ jsx35(ActionButtons, { actions: message.actions, loading: false, disabled, onAct })
|
|
1577
1724
|
] });
|
|
1578
1725
|
}
|
|
1579
1726
|
|
|
1580
1727
|
// src/components/IntentChips.tsx
|
|
1581
|
-
import { jsx as
|
|
1728
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1582
1729
|
function IntentChips({ chips, onPick }) {
|
|
1583
1730
|
if (chips.length === 0) return null;
|
|
1584
|
-
return /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ jsx36("div", { className: "ss-w-chips", children: chips.map((c, i) => /* @__PURE__ */ jsx36("button", { type: "button", className: "ss-w-chip", onClick: () => onPick(c.text), children: c.text }, `${c.text}-${i}`)) });
|
|
1585
1732
|
}
|
|
1586
1733
|
|
|
1587
1734
|
// src/scroll.ts
|
|
@@ -1591,7 +1738,7 @@ function isPinnedToBottom(el, threshold = PIN_THRESHOLD) {
|
|
|
1591
1738
|
}
|
|
1592
1739
|
|
|
1593
1740
|
// src/components/MessageList.tsx
|
|
1594
|
-
import { jsx as
|
|
1741
|
+
import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1595
1742
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
1596
1743
|
const { state, send } = controller;
|
|
1597
1744
|
const listRef = useRef2(null);
|
|
@@ -1602,7 +1749,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1602
1749
|
}, [state.messages, state.status]);
|
|
1603
1750
|
const hasUserMessage = state.messages.some((m) => m.role === "user");
|
|
1604
1751
|
const hasDashboard = state.messages.some((m) => m.role === "assistant" && (m.greetingDashboard || m.clubFanDashboard));
|
|
1605
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ jsxs32(
|
|
1606
1753
|
"div",
|
|
1607
1754
|
{
|
|
1608
1755
|
className: "ss-w-list",
|
|
@@ -1612,7 +1759,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1612
1759
|
if (listRef.current) pinnedRef.current = isPinnedToBottom(listRef.current);
|
|
1613
1760
|
},
|
|
1614
1761
|
children: [
|
|
1615
|
-
state.messages.map((m) => /* @__PURE__ */
|
|
1762
|
+
state.messages.map((m) => /* @__PURE__ */ jsx37(
|
|
1616
1763
|
ChatMessage,
|
|
1617
1764
|
{
|
|
1618
1765
|
message: m,
|
|
@@ -1627,15 +1774,15 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1627
1774
|
},
|
|
1628
1775
|
m.id
|
|
1629
1776
|
)),
|
|
1630
|
-
state.isStreaming && state.actionsLoading ? /* @__PURE__ */
|
|
1777
|
+
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ jsx37(ActionButtons, { actions: [], loading: true, onAct: () => {
|
|
1631
1778
|
} }) : null,
|
|
1632
|
-
state.status ? /* @__PURE__ */
|
|
1633
|
-
state.error ? /* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1779
|
+
state.status ? /* @__PURE__ */ jsx37("div", { className: "ss-w-status", children: state.status }) : null,
|
|
1780
|
+
state.error ? /* @__PURE__ */ jsxs32("div", { className: "ss-w-error", role: "alert", children: [
|
|
1781
|
+
/* @__PURE__ */ jsx37("span", { children: "message" in state.error ? state.error.message : ui.somethingWentWrong }),
|
|
1782
|
+
/* @__PURE__ */ jsx37("button", { type: "button", className: "ss-w-retry", onClick: () => controller.retry(), children: ui.retry })
|
|
1636
1783
|
] }) : null,
|
|
1637
|
-
!hasUserMessage && !hasDashboard ? /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1784
|
+
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ jsx37(IntentChips, { chips: state.starters, onPick: (t) => send(t) }) : null,
|
|
1785
|
+
/* @__PURE__ */ jsx37("div", { ref: endRef })
|
|
1639
1786
|
]
|
|
1640
1787
|
}
|
|
1641
1788
|
);
|
|
@@ -1643,7 +1790,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1643
1790
|
|
|
1644
1791
|
// src/components/ChatInput.tsx
|
|
1645
1792
|
import { useState as useState7 } from "react";
|
|
1646
|
-
import { jsx as
|
|
1793
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1647
1794
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
1648
1795
|
const [value, setValue] = useState7("");
|
|
1649
1796
|
const submit = () => {
|
|
@@ -1658,14 +1805,14 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
1658
1805
|
submit();
|
|
1659
1806
|
}
|
|
1660
1807
|
};
|
|
1661
|
-
return /* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
streaming ? /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ jsxs33("div", { className: "ss-w-input", children: [
|
|
1809
|
+
/* @__PURE__ */ jsx38("textarea", { className: "ss-w-textarea", rows: 1, placeholder, value, disabled: streaming, onChange: (e) => setValue(e.target.value), onKeyDown }),
|
|
1810
|
+
streaming ? /* @__PURE__ */ jsx38("button", { type: "button", className: "ss-w-send ss-w-stop", "aria-label": stopLabel, onClick: onStop, children: /* @__PURE__ */ jsx38("span", { className: "ss-w-stop-glyph" }) }) : /* @__PURE__ */ jsx38("button", { type: "button", className: "ss-w-send", "aria-label": sendLabel, onClick: submit, children: /* @__PURE__ */ jsx38(SendIcon, {}) })
|
|
1664
1811
|
] });
|
|
1665
1812
|
}
|
|
1666
1813
|
|
|
1667
1814
|
// src/components/ChatPanel.tsx
|
|
1668
|
-
import { jsx as
|
|
1815
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1669
1816
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
1670
1817
|
function useIsModal() {
|
|
1671
1818
|
const [modal, setModal] = useState8(false);
|
|
@@ -1689,10 +1836,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
|
1689
1836
|
window.addEventListener("keydown", onKey);
|
|
1690
1837
|
return () => window.removeEventListener("keydown", onKey);
|
|
1691
1838
|
}, [close]);
|
|
1692
|
-
return /* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ jsxs34("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
1840
|
+
/* @__PURE__ */ jsx39(ChatHeader, { onClose: close, closeLabel: ui.closeChat }),
|
|
1841
|
+
/* @__PURE__ */ jsx39(MessageList, { controller, ui, slip, onDashboardTap }),
|
|
1842
|
+
/* @__PURE__ */ jsx39(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: (t) => send(t), onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
1696
1843
|
] });
|
|
1697
1844
|
}
|
|
1698
1845
|
|
|
@@ -2157,10 +2304,57 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2157
2304
|
.ss-w-fandash-link-tile:hover { background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
|
|
2158
2305
|
.ss-w-fandash-link-label { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2159
2306
|
.ss-w-fandash-link-chevron { flex: none; width: 12px; height: 12px; color: var(--ss-w-accent); }
|
|
2307
|
+
|
|
2308
|
+
/* post-match result: full-time scoreboard -- team names flank the score, meta line underneath */
|
|
2309
|
+
.ss-w-fandash-postmatch-scoreboard { display: flex; align-items: center; gap: 8px; }
|
|
2310
|
+
.ss-w-fandash-postmatch-team { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2311
|
+
.ss-w-fandash-postmatch-team--away { text-align: right; }
|
|
2312
|
+
.ss-w-fandash-postmatch-score { flex: none; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2313
|
+
.ss-w-fandash-postmatch-sep { flex: none; font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
2314
|
+
.ss-w-fandash-postmatch-meta { font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2315
|
+
|
|
2316
|
+
/* post-match goals: a plain list, the club's own goals picked out in the accent color */
|
|
2317
|
+
.ss-w-fandash-postmatch-goal-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
|
|
2318
|
+
.ss-w-fandash-postmatch-goal { font-size: 12.5px; color: var(--ss-w-faint); }
|
|
2319
|
+
.ss-w-fandash-postmatch-goal--club { color: var(--ss-w-ink); font-weight: 650; }
|
|
2320
|
+
|
|
2321
|
+
/* post-match stats: club value / stat label / opponent value, three columns per row */
|
|
2322
|
+
.ss-w-fandash-postmatch-stat-rows { display: flex; flex-direction: column; gap: 5px; }
|
|
2323
|
+
.ss-w-fandash-postmatch-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
|
|
2324
|
+
.ss-w-fandash-postmatch-stat-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2325
|
+
.ss-w-fandash-postmatch-stat-row .ss-w-fandash-postmatch-stat-value:last-child { text-align: right; }
|
|
2326
|
+
.ss-w-fandash-postmatch-stat-label { font-size: 10.5px; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .03em; }
|
|
2327
|
+
|
|
2328
|
+
/* post-match top performer: player name left, rating pill right */
|
|
2329
|
+
.ss-w-fandash-postmatch-performer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2330
|
+
.ss-w-fandash-postmatch-performer-name { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2331
|
+
.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; }
|
|
2332
|
+
|
|
2333
|
+
/* post-match next: the upcoming fixture teaser -- opponent left, when-label right */
|
|
2334
|
+
.ss-w-fandash-postmatch-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2335
|
+
.ss-w-fandash-postmatch-next-opponent { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2336
|
+
.ss-w-fandash-postmatch-next-when { flex: none; font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2337
|
+
|
|
2338
|
+
/* resting next: the between-matches fixture teaser -- when-label left, competition badge right */
|
|
2339
|
+
.ss-w-fandash-resting-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2340
|
+
.ss-w-fandash-resting-next-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2341
|
+
.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); }
|
|
2342
|
+
|
|
2343
|
+
/* resting standings: position figure left, W-D-L/points record right */
|
|
2344
|
+
.ss-w-fandash-resting-standings-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
|
|
2345
|
+
.ss-w-fandash-resting-standings-position { font-size: 15px; font-weight: 750; color: var(--ss-w-ink); }
|
|
2346
|
+
.ss-w-fandash-resting-standings-record { font-size: 11.5px; color: var(--ss-w-faint); text-align: right; }
|
|
2347
|
+
|
|
2348
|
+
/* resting season: top scorer / key player / season tally as stacked rows */
|
|
2349
|
+
.ss-w-fandash-resting-season-rows { display: flex; flex-direction: column; gap: 4px; }
|
|
2350
|
+
.ss-w-fandash-resting-season-row { font-size: 12.5px; color: var(--ss-w-ink); }
|
|
2351
|
+
|
|
2352
|
+
/* resting form: reuses the fixture last-five pill classes (ss-w-fandash-form / -form-pill) */
|
|
2353
|
+
.ss-w-fandash-resting-form .ss-w-fandash-form { margin-top: 2px; }
|
|
2160
2354
|
`;
|
|
2161
2355
|
|
|
2162
2356
|
// src/StatsWidget.tsx
|
|
2163
|
-
import { jsx as
|
|
2357
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
2164
2358
|
function buildClient(props) {
|
|
2165
2359
|
try {
|
|
2166
2360
|
if ("client" in props && props.client) {
|
|
@@ -2213,7 +2407,7 @@ function StatsWidget(props) {
|
|
|
2213
2407
|
}, [built, ui.injectStyles]);
|
|
2214
2408
|
if (!built) return null;
|
|
2215
2409
|
const attrs = themeAttrs(ui);
|
|
2216
|
-
return /* @__PURE__ */
|
|
2410
|
+
return /* @__PURE__ */ jsx40("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__ */ jsx40(ChatPanel, { controller, ui, slip, onDashboardTap }) : /* @__PURE__ */ jsx40(
|
|
2217
2411
|
ChatFab,
|
|
2218
2412
|
{
|
|
2219
2413
|
label: ui.launcherLabel,
|