@sensiblestats/widget-react 0.23.0 → 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 +19 -0
- package/dist/index.cjs +160 -49
- 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 +160 -49
- package/dist/index.js.map +1 -1
- package/dist/styles.css +30 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -322,8 +322,9 @@ function toCardVM(card) {
|
|
|
322
322
|
function toActionVM(action) {
|
|
323
323
|
const label = str(action.actionLabel) ?? str(action.label) ?? str(action.text) ?? str(action.title) ?? "Continue";
|
|
324
324
|
const actionId = str(action.actionId) ?? str(action.id);
|
|
325
|
+
const actionRef = str(action.actionRef);
|
|
325
326
|
const message = str(action.actionValue) ?? str(action.message) ?? str(action.query) ?? label;
|
|
326
|
-
return { label, actionId, message };
|
|
327
|
+
return { label, actionId, actionRef, message };
|
|
327
328
|
}
|
|
328
329
|
function toChipVM(intent) {
|
|
329
330
|
const text = str(intent.text) ?? str(intent.label) ?? str(intent.title);
|
|
@@ -1520,67 +1521,147 @@ function LinksCard({ card }) {
|
|
|
1520
1521
|
] });
|
|
1521
1522
|
}
|
|
1522
1523
|
|
|
1523
|
-
// src/components/dashboard/
|
|
1524
|
+
// src/components/dashboard/PostMatchResultCard.tsx
|
|
1524
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/ClubFanDashboard.tsx
|
|
1595
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1525
1596
|
function ClubFanDashboard({ dashboard, onTap, ui }) {
|
|
1526
1597
|
const orderedCards = [
|
|
1527
1598
|
...dashboard.cards.filter((c) => c.cardType === "countdown"),
|
|
1528
1599
|
...dashboard.cards.filter((c) => c.cardType !== "countdown")
|
|
1529
1600
|
];
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
dashboard.greeting ? /* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ jsxs26("div", { className: "ss-w-fandash", children: [
|
|
1602
|
+
dashboard.greeting ? /* @__PURE__ */ jsx30("span", { className: "ss-w-fandash-greeting", children: dashboard.greeting }) : null,
|
|
1603
|
+
/* @__PURE__ */ jsx30("div", { className: "ss-w-fandash-cards", children: orderedCards.map((card, i) => /* @__PURE__ */ jsx30(FanDashboardCard, { card, onTap, ui }, `${card.cardType}-${i}`)) })
|
|
1533
1604
|
] });
|
|
1534
1605
|
}
|
|
1535
1606
|
function FanDashboardCard({ card, onTap, ui }) {
|
|
1536
1607
|
switch (card.cardType) {
|
|
1537
1608
|
case "fixture":
|
|
1538
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx30(FixtureCard, { card, onTap });
|
|
1539
1610
|
case "countdown":
|
|
1540
|
-
return /* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ jsx30(CountdownCard, { card });
|
|
1541
1612
|
case "injuries":
|
|
1542
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ jsx30(InjuriesCard, { card });
|
|
1543
1614
|
case "reasonToBet":
|
|
1544
|
-
return /* @__PURE__ */
|
|
1615
|
+
return /* @__PURE__ */ jsx30(ReasonToBetCard, { card });
|
|
1545
1616
|
case "whereToWatch":
|
|
1546
|
-
return /* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ jsx30(WhereToWatchCard, { card });
|
|
1547
1618
|
case "congestedWeek":
|
|
1548
|
-
return /* @__PURE__ */
|
|
1619
|
+
return /* @__PURE__ */ jsx30(CongestedWeekCard, { card, onTap });
|
|
1549
1620
|
case "transfers":
|
|
1550
|
-
return /* @__PURE__ */
|
|
1621
|
+
return /* @__PURE__ */ jsx30(TransfersCard, { card });
|
|
1551
1622
|
case "links":
|
|
1552
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ jsx30(LinksCard, { card });
|
|
1624
|
+
case "postMatchResult":
|
|
1625
|
+
return /* @__PURE__ */ jsx30(PostMatchResultCard, { card });
|
|
1626
|
+
case "postMatchGoals":
|
|
1627
|
+
return /* @__PURE__ */ jsx30(PostMatchGoalsCard, { card, onTap });
|
|
1628
|
+
case "postMatchStats":
|
|
1629
|
+
return /* @__PURE__ */ jsx30(PostMatchStatsCard, { card, onTap });
|
|
1630
|
+
case "postMatchTopPerformer":
|
|
1631
|
+
return /* @__PURE__ */ jsx30(PostMatchTopPerformerCard, { card, onTap });
|
|
1632
|
+
case "postMatchNext":
|
|
1633
|
+
return /* @__PURE__ */ jsx30(PostMatchNextCard, { card });
|
|
1553
1634
|
default:
|
|
1554
1635
|
return null;
|
|
1555
1636
|
}
|
|
1556
1637
|
}
|
|
1557
1638
|
|
|
1558
1639
|
// src/components/ChatMessage.tsx
|
|
1559
|
-
import { jsx as
|
|
1640
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1560
1641
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
1561
1642
|
if (message.role === "user") {
|
|
1562
|
-
return /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsx31("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ jsx31("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1563
1644
|
}
|
|
1564
1645
|
const onFanDashboardTap = (card) => {
|
|
1565
|
-
onAct({ message: card.
|
|
1646
|
+
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1566
1647
|
};
|
|
1567
|
-
return /* @__PURE__ */
|
|
1568
|
-
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */
|
|
1569
|
-
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */
|
|
1570
|
-
message.clubFanDashboard ? /* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ jsxs27("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1649
|
+
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx31(Markdown, { text: message.text }) : null,
|
|
1650
|
+
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx31(GreetingDashboard, { dashboard: message.greetingDashboard, onTap }) : null,
|
|
1651
|
+
message.clubFanDashboard ? /* @__PURE__ */ jsx31(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
|
|
1652
|
+
/* @__PURE__ */ jsx31(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
1653
|
+
/* @__PURE__ */ jsx31(BettingInsightList, { insights: message.insights, ui, slip }),
|
|
1654
|
+
/* @__PURE__ */ jsx31(MarketOddsCardList, { cards: message.marketOdds, ui, slip }),
|
|
1655
|
+
/* @__PURE__ */ jsx31(OddsMovementCardList, { cards: message.oddsMovement, ui }),
|
|
1656
|
+
/* @__PURE__ */ jsx31(ActionButtons, { actions: message.actions, loading: false, disabled, onAct })
|
|
1576
1657
|
] });
|
|
1577
1658
|
}
|
|
1578
1659
|
|
|
1579
1660
|
// src/components/IntentChips.tsx
|
|
1580
|
-
import { jsx as
|
|
1661
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1581
1662
|
function IntentChips({ chips, onPick }) {
|
|
1582
1663
|
if (chips.length === 0) return null;
|
|
1583
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsx32("div", { className: "ss-w-chips", children: chips.map((c, i) => /* @__PURE__ */ jsx32("button", { type: "button", className: "ss-w-chip", onClick: () => onPick(c.text), children: c.text }, `${c.text}-${i}`)) });
|
|
1584
1665
|
}
|
|
1585
1666
|
|
|
1586
1667
|
// src/scroll.ts
|
|
@@ -1590,7 +1671,7 @@ function isPinnedToBottom(el, threshold = PIN_THRESHOLD) {
|
|
|
1590
1671
|
}
|
|
1591
1672
|
|
|
1592
1673
|
// src/components/MessageList.tsx
|
|
1593
|
-
import { jsx as
|
|
1674
|
+
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1594
1675
|
function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
1595
1676
|
const { state, send } = controller;
|
|
1596
1677
|
const listRef = useRef2(null);
|
|
@@ -1601,7 +1682,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1601
1682
|
}, [state.messages, state.status]);
|
|
1602
1683
|
const hasUserMessage = state.messages.some((m) => m.role === "user");
|
|
1603
1684
|
const hasDashboard = state.messages.some((m) => m.role === "assistant" && (m.greetingDashboard || m.clubFanDashboard));
|
|
1604
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsxs28(
|
|
1605
1686
|
"div",
|
|
1606
1687
|
{
|
|
1607
1688
|
className: "ss-w-list",
|
|
@@ -1611,12 +1692,12 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1611
1692
|
if (listRef.current) pinnedRef.current = isPinnedToBottom(listRef.current);
|
|
1612
1693
|
},
|
|
1613
1694
|
children: [
|
|
1614
|
-
state.messages.map((m) => /* @__PURE__ */
|
|
1695
|
+
state.messages.map((m) => /* @__PURE__ */ jsx33(
|
|
1615
1696
|
ChatMessage,
|
|
1616
1697
|
{
|
|
1617
1698
|
message: m,
|
|
1618
1699
|
disabled: state.isStreaming,
|
|
1619
|
-
onAct: (a) => send(a.message, { actionId: a.actionId, displayText: a.label }),
|
|
1700
|
+
onAct: (a) => send(a.message, { actionId: a.actionId, actionRef: a.actionRef, displayText: a.label }),
|
|
1620
1701
|
onTap: (tile, index) => {
|
|
1621
1702
|
send(tile.actionValue, { displayText: tile.title });
|
|
1622
1703
|
if (m.role === "assistant" && m.greetingDashboard) onDashboardTap?.(tile, index, m.greetingDashboard.layout);
|
|
@@ -1626,15 +1707,15 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1626
1707
|
},
|
|
1627
1708
|
m.id
|
|
1628
1709
|
)),
|
|
1629
|
-
state.isStreaming && state.actionsLoading ? /* @__PURE__ */
|
|
1710
|
+
state.isStreaming && state.actionsLoading ? /* @__PURE__ */ jsx33(ActionButtons, { actions: [], loading: true, onAct: () => {
|
|
1630
1711
|
} }) : null,
|
|
1631
|
-
state.status ? /* @__PURE__ */
|
|
1632
|
-
state.error ? /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1712
|
+
state.status ? /* @__PURE__ */ jsx33("div", { className: "ss-w-status", children: state.status }) : null,
|
|
1713
|
+
state.error ? /* @__PURE__ */ jsxs28("div", { className: "ss-w-error", role: "alert", children: [
|
|
1714
|
+
/* @__PURE__ */ jsx33("span", { children: "message" in state.error ? state.error.message : ui.somethingWentWrong }),
|
|
1715
|
+
/* @__PURE__ */ jsx33("button", { type: "button", className: "ss-w-retry", onClick: () => controller.retry(), children: ui.retry })
|
|
1635
1716
|
] }) : null,
|
|
1636
|
-
!hasUserMessage && !hasDashboard ? /* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1717
|
+
!hasUserMessage && !hasDashboard ? /* @__PURE__ */ jsx33(IntentChips, { chips: state.starters, onPick: (t) => send(t) }) : null,
|
|
1718
|
+
/* @__PURE__ */ jsx33("div", { ref: endRef })
|
|
1638
1719
|
]
|
|
1639
1720
|
}
|
|
1640
1721
|
);
|
|
@@ -1642,7 +1723,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1642
1723
|
|
|
1643
1724
|
// src/components/ChatInput.tsx
|
|
1644
1725
|
import { useState as useState7 } from "react";
|
|
1645
|
-
import { jsx as
|
|
1726
|
+
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1646
1727
|
function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message" }) {
|
|
1647
1728
|
const [value, setValue] = useState7("");
|
|
1648
1729
|
const submit = () => {
|
|
@@ -1657,14 +1738,14 @@ function ChatInput({ placeholder, streaming, onSend, onStop, stopLabel = "Stop r
|
|
|
1657
1738
|
submit();
|
|
1658
1739
|
}
|
|
1659
1740
|
};
|
|
1660
|
-
return /* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
streaming ? /* @__PURE__ */
|
|
1741
|
+
return /* @__PURE__ */ jsxs29("div", { className: "ss-w-input", children: [
|
|
1742
|
+
/* @__PURE__ */ jsx34("textarea", { className: "ss-w-textarea", rows: 1, placeholder, value, disabled: streaming, onChange: (e) => setValue(e.target.value), onKeyDown }),
|
|
1743
|
+
streaming ? /* @__PURE__ */ jsx34("button", { type: "button", className: "ss-w-send ss-w-stop", "aria-label": stopLabel, onClick: onStop, children: /* @__PURE__ */ jsx34("span", { className: "ss-w-stop-glyph" }) }) : /* @__PURE__ */ jsx34("button", { type: "button", className: "ss-w-send", "aria-label": sendLabel, onClick: submit, children: /* @__PURE__ */ jsx34(SendIcon, {}) })
|
|
1663
1744
|
] });
|
|
1664
1745
|
}
|
|
1665
1746
|
|
|
1666
1747
|
// src/components/ChatPanel.tsx
|
|
1667
|
-
import { jsx as
|
|
1748
|
+
import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1668
1749
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
1669
1750
|
function useIsModal() {
|
|
1670
1751
|
const [modal, setModal] = useState8(false);
|
|
@@ -1688,10 +1769,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap }) {
|
|
|
1688
1769
|
window.addEventListener("keydown", onKey);
|
|
1689
1770
|
return () => window.removeEventListener("keydown", onKey);
|
|
1690
1771
|
}, [close]);
|
|
1691
|
-
return /* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1772
|
+
return /* @__PURE__ */ jsxs30("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
1773
|
+
/* @__PURE__ */ jsx35(ChatHeader, { onClose: close, closeLabel: ui.closeChat }),
|
|
1774
|
+
/* @__PURE__ */ jsx35(MessageList, { controller, ui, slip, onDashboardTap }),
|
|
1775
|
+
/* @__PURE__ */ jsx35(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: (t) => send(t), onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
1695
1776
|
] });
|
|
1696
1777
|
}
|
|
1697
1778
|
|
|
@@ -2156,10 +2237,40 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
2156
2237
|
.ss-w-fandash-link-tile:hover { background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
|
|
2157
2238
|
.ss-w-fandash-link-label { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2158
2239
|
.ss-w-fandash-link-chevron { flex: none; width: 12px; height: 12px; color: var(--ss-w-accent); }
|
|
2240
|
+
|
|
2241
|
+
/* post-match result: full-time scoreboard -- team names flank the score, meta line underneath */
|
|
2242
|
+
.ss-w-fandash-postmatch-scoreboard { display: flex; align-items: center; gap: 8px; }
|
|
2243
|
+
.ss-w-fandash-postmatch-team { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
|
|
2244
|
+
.ss-w-fandash-postmatch-team--away { text-align: right; }
|
|
2245
|
+
.ss-w-fandash-postmatch-score { flex: none; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2246
|
+
.ss-w-fandash-postmatch-sep { flex: none; font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
2247
|
+
.ss-w-fandash-postmatch-meta { font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2248
|
+
|
|
2249
|
+
/* post-match goals: a plain list, the club's own goals picked out in the accent color */
|
|
2250
|
+
.ss-w-fandash-postmatch-goal-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
|
|
2251
|
+
.ss-w-fandash-postmatch-goal { font-size: 12.5px; color: var(--ss-w-faint); }
|
|
2252
|
+
.ss-w-fandash-postmatch-goal--club { color: var(--ss-w-ink); font-weight: 650; }
|
|
2253
|
+
|
|
2254
|
+
/* post-match stats: club value / stat label / opponent value, three columns per row */
|
|
2255
|
+
.ss-w-fandash-postmatch-stat-rows { display: flex; flex-direction: column; gap: 5px; }
|
|
2256
|
+
.ss-w-fandash-postmatch-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
|
|
2257
|
+
.ss-w-fandash-postmatch-stat-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
2258
|
+
.ss-w-fandash-postmatch-stat-row .ss-w-fandash-postmatch-stat-value:last-child { text-align: right; }
|
|
2259
|
+
.ss-w-fandash-postmatch-stat-label { font-size: 10.5px; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .03em; }
|
|
2260
|
+
|
|
2261
|
+
/* post-match top performer: player name left, rating pill right */
|
|
2262
|
+
.ss-w-fandash-postmatch-performer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2263
|
+
.ss-w-fandash-postmatch-performer-name { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2264
|
+
.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; }
|
|
2265
|
+
|
|
2266
|
+
/* post-match next: the upcoming fixture teaser -- opponent left, when-label right */
|
|
2267
|
+
.ss-w-fandash-postmatch-next-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
2268
|
+
.ss-w-fandash-postmatch-next-opponent { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
|
|
2269
|
+
.ss-w-fandash-postmatch-next-when { flex: none; font-size: 11.5px; color: var(--ss-w-faint); }
|
|
2159
2270
|
`;
|
|
2160
2271
|
|
|
2161
2272
|
// src/StatsWidget.tsx
|
|
2162
|
-
import { jsx as
|
|
2273
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2163
2274
|
function buildClient(props) {
|
|
2164
2275
|
try {
|
|
2165
2276
|
if ("client" in props && props.client) {
|
|
@@ -2212,7 +2323,7 @@ function StatsWidget(props) {
|
|
|
2212
2323
|
}, [built, ui.injectStyles]);
|
|
2213
2324
|
if (!built) return null;
|
|
2214
2325
|
const attrs = themeAttrs(ui);
|
|
2215
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ jsx36("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__ */ jsx36(ChatPanel, { controller, ui, slip, onDashboardTap }) : /* @__PURE__ */ jsx36(
|
|
2216
2327
|
ChatFab,
|
|
2217
2328
|
{
|
|
2218
2329
|
label: ui.launcherLabel,
|