@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
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
|
+
|
|
14
|
+
## 0.24.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 04c6e5b: Add post-match club dashboard cards (result, goals, stats, top performer, what's next); the three interactive cards tap through via actionRef.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [04c6e5b]
|
|
23
|
+
- @sensiblestats/widget-sdk@0.22.0
|
|
24
|
+
|
|
3
25
|
## 0.23.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1558,67 +1558,214 @@ 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/RestingNextCard.tsx
|
|
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");
|
|
1563
1692
|
function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
1564
1693
|
const orderedCards = [
|
|
1565
1694
|
...dashboard.cards.filter((c) => c.cardType === "countdown"),
|
|
1566
1695
|
...dashboard.cards.filter((c) => c.cardType !== "countdown")
|
|
1567
1696
|
];
|
|
1568
|
-
return /* @__PURE__ */ (0,
|
|
1569
|
-
dashboard.greeting ? /* @__PURE__ */ (0,
|
|
1570
|
-
/* @__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}`)) })
|
|
1571
1700
|
] });
|
|
1572
1701
|
}
|
|
1573
1702
|
function FanDashboardCard({ card, onTap, ui }) {
|
|
1574
1703
|
switch (card.cardType) {
|
|
1575
1704
|
case "fixture":
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FixtureCard, { card, onTap });
|
|
1577
1706
|
case "countdown":
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CountdownCard, { card });
|
|
1579
1708
|
case "injuries":
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(InjuriesCard, { card });
|
|
1581
1710
|
case "reasonToBet":
|
|
1582
|
-
return /* @__PURE__ */ (0,
|
|
1711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ReasonToBetCard, { card });
|
|
1583
1712
|
case "whereToWatch":
|
|
1584
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WhereToWatchCard, { card });
|
|
1585
1714
|
case "congestedWeek":
|
|
1586
|
-
return /* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CongestedWeekCard, { card, onTap });
|
|
1587
1716
|
case "transfers":
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TransfersCard, { card });
|
|
1589
1718
|
case "links":
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LinksCard, { card });
|
|
1720
|
+
case "postMatchResult":
|
|
1721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchResultCard, { card });
|
|
1722
|
+
case "postMatchGoals":
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchGoalsCard, { card, onTap });
|
|
1724
|
+
case "postMatchStats":
|
|
1725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchStatsCard, { card, onTap });
|
|
1726
|
+
case "postMatchTopPerformer":
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PostMatchTopPerformerCard, { card, onTap });
|
|
1728
|
+
case "postMatchNext":
|
|
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 });
|
|
1591
1738
|
default:
|
|
1592
1739
|
return null;
|
|
1593
1740
|
}
|
|
1594
1741
|
}
|
|
1595
1742
|
|
|
1596
1743
|
// src/components/ChatMessage.tsx
|
|
1597
|
-
var
|
|
1744
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1598
1745
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
1599
1746
|
if (message.role === "user") {
|
|
1600
|
-
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 }) });
|
|
1601
1748
|
}
|
|
1602
1749
|
const onFanDashboardTap = (card) => {
|
|
1603
1750
|
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1604
1751
|
};
|
|
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,
|
|
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 })
|
|
1614
1761
|
] });
|
|
1615
1762
|
}
|
|
1616
1763
|
|
|
1617
1764
|
// src/components/IntentChips.tsx
|
|
1618
|
-
var
|
|
1765
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1619
1766
|
function IntentChips({ chips, onPick }) {
|
|
1620
1767
|
if (chips.length === 0) return null;
|
|
1621
|
-
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}`)) });
|
|
1622
1769
|
}
|
|
1623
1770
|
|
|
1624
1771
|
// src/scroll.ts
|
|
@@ -1628,7 +1775,7 @@ function isPinnedToBottom(el, threshold = PIN_THRESHOLD) {
|
|
|
1628
1775
|
}
|
|
1629
1776
|
|
|
1630
1777
|
// src/components/MessageList.tsx
|
|
1631
|
-
var
|
|
1778
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1632
1779
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
1633
1780
|
const { state, send } = controller;
|
|
1634
1781
|
const listRef = (0, import_react9.useRef)(null);
|
|
@@ -1639,7 +1786,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1639
1786
|
}, [state.messages, state.status]);
|
|
1640
1787
|
const hasUserMessage = state.messages.some((m) => m.role === "user");
|
|
1641
1788
|
const hasDashboard = state.messages.some((m) => m.role === "assistant" && (m.greetingDashboard || m.clubFanDashboard));
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
1789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1643
1790
|
"div",
|
|
1644
1791
|
{
|
|
1645
1792
|
className: "ss-w-list",
|
|
@@ -1649,7 +1796,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1649
1796
|
if (listRef.current) pinnedRef.current = isPinnedToBottom(listRef.current);
|
|
1650
1797
|
},
|
|
1651
1798
|
children: [
|
|
1652
|
-
state.messages.map((m) => /* @__PURE__ */ (0,
|
|
1799
|
+
state.messages.map((m) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1653
1800
|
ChatMessage,
|
|
1654
1801
|
{
|
|
1655
1802
|
message: m,
|
|
@@ -1664,15 +1811,15 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1664
1811
|
},
|
|
1665
1812
|
m.id
|
|
1666
1813
|
)),
|
|
1667
|
-
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0,
|
|
1814
|
+
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ActionButtons, { actions: [], loading: true, onAct: () => {
|
|
1668
1815
|
} }) : null,
|
|
1669
|
-
state.status ? /* @__PURE__ */ (0,
|
|
1670
|
-
state.error ? /* @__PURE__ */ (0,
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
/* @__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 })
|
|
1673
1820
|
] }) : null,
|
|
1674
|
-
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ (0,
|
|
1675
|
-
/* @__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 })
|
|
1676
1823
|
]
|
|
1677
1824
|
}
|
|
1678
1825
|
);
|
|
@@ -1680,7 +1827,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1680
1827
|
|
|
1681
1828
|
// src/components/ChatInput.tsx
|
|
1682
1829
|
var import_react10 = require("react");
|
|
1683
|
-
var
|
|
1830
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1684
1831
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
1685
1832
|
const [value, setValue] = (0, import_react10.useState)("");
|
|
1686
1833
|
const submit = () => {
|
|
@@ -1695,14 +1842,14 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
1695
1842
|
submit();
|
|
1696
1843
|
}
|
|
1697
1844
|
};
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
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, {}) })
|
|
1701
1848
|
] });
|
|
1702
1849
|
}
|
|
1703
1850
|
|
|
1704
1851
|
// src/components/ChatPanel.tsx
|
|
1705
|
-
var
|
|
1852
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1706
1853
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
1707
1854
|
function useIsModal() {
|
|
1708
1855
|
const [modal, setModal] = (0, import_react11.useState)(false);
|
|
@@ -1726,10 +1873,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
|
1726
1873
|
window.addEventListener("keydown", onKey);
|
|
1727
1874
|
return () => window.removeEventListener("keydown", onKey);
|
|
1728
1875
|
}, [close]);
|
|
1729
|
-
return /* @__PURE__ */ (0,
|
|
1730
|
-
/* @__PURE__ */ (0,
|
|
1731
|
-
/* @__PURE__ */ (0,
|
|
1732
|
-
/* @__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 })
|
|
1733
1880
|
] });
|
|
1734
1881
|
}
|
|
1735
1882
|
|
|
@@ -2194,10 +2341,57 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2194
2341
|
.ss-w-fandash-link-tile:hover { background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
|
|
2195
2342
|
.ss-w-fandash-link-label { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2196
2343
|
.ss-w-fandash-link-chevron { flex: none; width: 12px; height: 12px; color: var(--ss-w-accent); }
|
|
2344
|
+
|
|
2345
|
+
/* post-match result: full-time scoreboard -- team names flank the score, meta line underneath */
|
|
2346
|
+
.ss-w-fandash-postmatch-scoreboard { display: flex; align-items: center; gap: 8px; }
|
|
2347
|
+
.ss-w-fandash-postmatch-team { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2348
|
+
.ss-w-fandash-postmatch-team--away { text-align: right; }
|
|
2349
|
+
.ss-w-fandash-postmatch-score { flex: none; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2350
|
+
.ss-w-fandash-postmatch-sep { flex: none; font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
2351
|
+
.ss-w-fandash-postmatch-meta { font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2352
|
+
|
|
2353
|
+
/* post-match goals: a plain list, the club's own goals picked out in the accent color */
|
|
2354
|
+
.ss-w-fandash-postmatch-goal-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
|
|
2355
|
+
.ss-w-fandash-postmatch-goal { font-size: 12.5px; color: var(--ss-w-faint); }
|
|
2356
|
+
.ss-w-fandash-postmatch-goal--club { color: var(--ss-w-ink); font-weight: 650; }
|
|
2357
|
+
|
|
2358
|
+
/* post-match stats: club value / stat label / opponent value, three columns per row */
|
|
2359
|
+
.ss-w-fandash-postmatch-stat-rows { display: flex; flex-direction: column; gap: 5px; }
|
|
2360
|
+
.ss-w-fandash-postmatch-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
|
|
2361
|
+
.ss-w-fandash-postmatch-stat-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2362
|
+
.ss-w-fandash-postmatch-stat-row .ss-w-fandash-postmatch-stat-value:last-child { text-align: right; }
|
|
2363
|
+
.ss-w-fandash-postmatch-stat-label { font-size: 10.5px; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .03em; }
|
|
2364
|
+
|
|
2365
|
+
/* post-match top performer: player name left, rating pill right */
|
|
2366
|
+
.ss-w-fandash-postmatch-performer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2367
|
+
.ss-w-fandash-postmatch-performer-name { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2368
|
+
.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; }
|
|
2369
|
+
|
|
2370
|
+
/* post-match next: the upcoming fixture teaser -- opponent left, when-label right */
|
|
2371
|
+
.ss-w-fandash-postmatch-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2372
|
+
.ss-w-fandash-postmatch-next-opponent { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
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; }
|
|
2197
2391
|
`;
|
|
2198
2392
|
|
|
2199
2393
|
// src/StatsWidget.tsx
|
|
2200
|
-
var
|
|
2394
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2201
2395
|
function buildClient(props) {
|
|
2202
2396
|
try {
|
|
2203
2397
|
if ("client" in props && props.client) {
|
|
@@ -2250,7 +2444,7 @@ function StatsWidget(props) {
|
|
|
2250
2444
|
}, [built, ui.injectStyles]);
|
|
2251
2445
|
if (!built) return null;
|
|
2252
2446
|
const attrs = themeAttrs(ui);
|
|
2253
|
-
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)(
|
|
2254
2448
|
ChatFab,
|
|
2255
2449
|
{
|
|
2256
2450
|
label: ui.launcherLabel,
|