@sensiblestats/widget-react 0.108.2 → 0.108.4
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 +12 -0
- package/dist/index.cjs +25 -25
- 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 +25 -25
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@ var STRINGS = {
|
|
|
117
117
|
nbaTimeoutsLeft: "Timeouts left",
|
|
118
118
|
priceHistoryLabel: "Price history",
|
|
119
119
|
emptyMatchesTab: "No pinned matches yet. Pin a match from the conversation to track it live.",
|
|
120
|
-
|
|
120
|
+
emptyTrendsTab: "No odds followed yet. Tap Price history on a price that moved to follow it here.",
|
|
121
121
|
asOf: (time) => `Prices as of ${time}`,
|
|
122
122
|
graceNote: "Unpins on next open \xB7 or in 2 h",
|
|
123
123
|
suspendedLabel: "Suspended",
|
|
@@ -793,7 +793,7 @@ var STRINGS = {
|
|
|
793
793
|
nbaTimeoutsLeft: "Kalan mola",
|
|
794
794
|
priceHistoryLabel: "Oran ge\xE7mi\u015Fi",
|
|
795
795
|
emptyMatchesTab: "Hen\xFCz sabitlenmi\u015F ma\xE7 yok. Canl\u0131 takip i\xE7in sohbetteki bir ma\xE7\u0131 sabitle.",
|
|
796
|
-
|
|
796
|
+
emptyTrendsTab: "Hen\xFCz takip edilen oran yok. De\u011Fi\u015Fen bir oranda Oran ge\xE7mi\u015Fi d\xFC\u011Fmesine dokunarak burada takip et.",
|
|
797
797
|
asOf: (time) => `Fiyatlar ${time} itibar\u0131yla`,
|
|
798
798
|
graceNote: "Bir sonraki a\xE7\u0131l\u0131\u015Fta kald\u0131r\u0131l\u0131r \xB7 en ge\xE7 2 saat",
|
|
799
799
|
suspendedLabel: "Ask\u0131da",
|
|
@@ -1411,7 +1411,7 @@ function isEnglishLocale(locale) {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
|
|
1413
1413
|
// src/version.generated.ts
|
|
1414
|
-
var WIDGET_REACT_VERSION = "0.108.
|
|
1414
|
+
var WIDGET_REACT_VERSION = "0.108.4";
|
|
1415
1415
|
|
|
1416
1416
|
// src/config.ts
|
|
1417
1417
|
function normalizeUi(cfg) {
|
|
@@ -1611,7 +1611,7 @@ function normalizeUi(cfg) {
|
|
|
1611
1611
|
nbaTimeoutsLeft: strings.nbaTimeoutsLeft,
|
|
1612
1612
|
priceHistoryLabel: strings.priceHistoryLabel,
|
|
1613
1613
|
emptyMatchesTab: strings.emptyMatchesTab,
|
|
1614
|
-
|
|
1614
|
+
emptyTrendsTab: strings.emptyTrendsTab,
|
|
1615
1615
|
asOf: strings.asOf,
|
|
1616
1616
|
graceNote: strings.graceNote,
|
|
1617
1617
|
suspendedLabel: strings.suspendedLabel,
|
|
@@ -3962,7 +3962,7 @@ function useLiveMonitor(opts) {
|
|
|
3962
3962
|
const { activeTab, setActiveTab: setActiveTabState } = useTabs("chat");
|
|
3963
3963
|
const [chatDot, setChatDot] = useState4(false);
|
|
3964
3964
|
const [matchesDot, setMatchesDot] = useState4(false);
|
|
3965
|
-
const [
|
|
3965
|
+
const [trendsDot, setTrendsDot] = useState4(false);
|
|
3966
3966
|
const [todayDot, setTodayDot] = useState4(false);
|
|
3967
3967
|
const [lastViewedPrices, setLastViewedPrices] = useState4({});
|
|
3968
3968
|
const [openMarket, setOpenMarket] = useState4({});
|
|
@@ -4103,7 +4103,7 @@ function useLiveMonitor(opts) {
|
|
|
4103
4103
|
openSelectedDefault(next);
|
|
4104
4104
|
refreshMissingInsight(next);
|
|
4105
4105
|
const marketPins = currentPins.filter((p) => p.kind !== "match");
|
|
4106
|
-
if (activeTabRef.current === "
|
|
4106
|
+
if (activeTabRef.current === "trends") {
|
|
4107
4107
|
setLastViewedPrices((prevMap) => {
|
|
4108
4108
|
let changed = false;
|
|
4109
4109
|
const out = { ...prevMap };
|
|
@@ -4126,7 +4126,7 @@ function useLiveMonitor(opts) {
|
|
|
4126
4126
|
break;
|
|
4127
4127
|
}
|
|
4128
4128
|
}
|
|
4129
|
-
if (sawPriceMove)
|
|
4129
|
+
if (sawPriceMove) setTrendsDot(true);
|
|
4130
4130
|
}
|
|
4131
4131
|
const graceKeys = currentPins.filter((p) => {
|
|
4132
4132
|
const phase = phaseForPin(next, p);
|
|
@@ -4223,14 +4223,14 @@ function useLiveMonitor(opts) {
|
|
|
4223
4223
|
chooseSelection(orderTiles(matchPins, snapshotRef.current)[0]?.pin.key ?? null);
|
|
4224
4224
|
}, [pins, chooseSelection]);
|
|
4225
4225
|
useEffect5(() => {
|
|
4226
|
-
if (clubEnabled && (activeTab === "today" || activeTab === "following" || activeTab === "
|
|
4226
|
+
if (clubEnabled && (activeTab === "today" || activeTab === "following" || activeTab === "trends")) {
|
|
4227
4227
|
setActiveTabState("chat");
|
|
4228
4228
|
return;
|
|
4229
4229
|
}
|
|
4230
4230
|
const matchPins = pins.filter((p) => p.kind === "match").length;
|
|
4231
4231
|
const marketPins = pins.length - matchPins;
|
|
4232
4232
|
if (activeTab === "following" && matchPins === 0) setActiveTabState(hasToday ? "today" : "chat");
|
|
4233
|
-
if (activeTab === "
|
|
4233
|
+
if (activeTab === "trends" && marketPins === 0) setActiveTabState(hasToday ? "today" : "chat");
|
|
4234
4234
|
if (activeTab === "today" && !hasToday) setActiveTabState("chat");
|
|
4235
4235
|
}, [pins, activeTab, hasToday, clubEnabled]);
|
|
4236
4236
|
const prevIsOpenRef = useRef5(false);
|
|
@@ -4258,8 +4258,8 @@ function useLiveMonitor(opts) {
|
|
|
4258
4258
|
setMatchesDot(false);
|
|
4259
4259
|
void tick();
|
|
4260
4260
|
}
|
|
4261
|
-
if (tab === "
|
|
4262
|
-
|
|
4261
|
+
if (tab === "trends") {
|
|
4262
|
+
setTrendsDot(false);
|
|
4263
4263
|
setLastViewedPrices((prevMap) => {
|
|
4264
4264
|
const out = { ...prevMap };
|
|
4265
4265
|
for (const pin of pinsRef.current.filter((p) => p.kind !== "match")) {
|
|
@@ -4333,7 +4333,7 @@ function useLiveMonitor(opts) {
|
|
|
4333
4333
|
chatDot,
|
|
4334
4334
|
markChatActivity,
|
|
4335
4335
|
matchesDot,
|
|
4336
|
-
|
|
4336
|
+
trendsDot,
|
|
4337
4337
|
todayDot,
|
|
4338
4338
|
markTodayActivity,
|
|
4339
4339
|
lastViewedPrices,
|
|
@@ -5953,7 +5953,7 @@ function PriceHistoryButton({ selection, monitor, ui, displayLabel }) {
|
|
|
5953
5953
|
log?.log({ name: "pin_add", entityType: "market", entityId: pin.marketDeveloperName, marketDeveloperName: pin.marketDeveloperName });
|
|
5954
5954
|
}
|
|
5955
5955
|
}
|
|
5956
|
-
monitor.setActiveTab("
|
|
5956
|
+
monitor.setActiveTab("trends");
|
|
5957
5957
|
};
|
|
5958
5958
|
return /* @__PURE__ */ jsxs13("div", { className: "ss-w-pin-wrap", children: [
|
|
5959
5959
|
/* @__PURE__ */ jsx15("button", { type: "button", className: "ss-w-hist", "aria-label": label, title: label, onClick, children: /* @__PURE__ */ jsx15("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ jsx15("path", { d: "M2 13.5h12M3 10.5l3.2-3.4 2.6 2.2L13 4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
@@ -9303,7 +9303,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
9303
9303
|
import { useEffect as useEffect29, useLayoutEffect, useRef as useRef26 } from "react";
|
|
9304
9304
|
import { Fragment as Fragment14, jsx as jsx66, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
9305
9305
|
var FIT_STEPS = [[0, false], [1, false], [1, true], [2, true], [3, true]];
|
|
9306
|
-
function TabBar({ monitor, ui, matchCount,
|
|
9306
|
+
function TabBar({ monitor, ui, matchCount, trendsCount, todayCount, hasToday, gamesEnabled, clubEnabled, favouritesEnabled }) {
|
|
9307
9307
|
const tabs = [
|
|
9308
9308
|
{ tab: "chat", label: ui.tabChat, count: 0, dot: monitor.chatDot },
|
|
9309
9309
|
...clubEnabled ? [
|
|
@@ -9313,7 +9313,7 @@ function TabBar({ monitor, ui, matchCount, oddsCount, todayCount, hasToday, game
|
|
|
9313
9313
|
] : [
|
|
9314
9314
|
...hasToday ? [{ tab: "today", label: ui.tabToday, count: todayCount, dot: monitor.todayDot }] : [],
|
|
9315
9315
|
...matchCount > 0 ? [{ tab: "following", label: ui.tabFollowing, count: matchCount, dot: monitor.matchesDot }] : [],
|
|
9316
|
-
...
|
|
9316
|
+
...trendsCount > 0 ? [{ tab: "trends", label: ui.tabTrends, count: trendsCount, dot: monitor.trendsDot }] : []
|
|
9317
9317
|
],
|
|
9318
9318
|
...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : [],
|
|
9319
9319
|
...favouritesEnabled && !clubEnabled ? [{ tab: "favourites", label: ui.tabFavourites, count: 0, dot: false }] : []
|
|
@@ -9407,7 +9407,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
9407
9407
|
children: [
|
|
9408
9408
|
/* @__PURE__ */ jsx67("span", { className: "ss-w-acc-chevron", children: m.suspended ? "" : isOpen ? "\u25BE" : "\u25B8" }),
|
|
9409
9409
|
/* @__PURE__ */ jsx67("span", { className: "ss-w-acc-label", children: m.marketLabel }),
|
|
9410
|
-
m.hasInsight && /* @__PURE__ */ jsx67("span", { className: "ss-w-acc-badge",
|
|
9410
|
+
m.hasInsight && /* @__PURE__ */ jsx67("span", { className: "ss-w-bi-chart ss-w-acc-badge", "aria-hidden": "true" }),
|
|
9411
9411
|
m.suspended && /* @__PURE__ */ jsx67("span", { className: "ss-w-acc-susp", children: ui.accordionSuspended })
|
|
9412
9412
|
]
|
|
9413
9413
|
}
|
|
@@ -10638,10 +10638,10 @@ function withSinceViewMovement(vm, prev) {
|
|
|
10638
10638
|
};
|
|
10639
10639
|
return { ...vm, mainRows: [updatedPrimary, ...vm.mainRows.slice(1)] };
|
|
10640
10640
|
}
|
|
10641
|
-
function
|
|
10641
|
+
function TrendsPanel({ monitor, ui, slip }) {
|
|
10642
10642
|
const slipState = useSlipState();
|
|
10643
10643
|
const markets = (monitor.snapshot?.markets ?? []).filter((m) => monitor.pins.some((p) => p.key === m.key));
|
|
10644
|
-
if (markets.length === 0) return /* @__PURE__ */ jsx79("div", { className: "ss-w-mon-empty", children: ui.
|
|
10644
|
+
if (markets.length === 0) return /* @__PURE__ */ jsx79("div", { className: "ss-w-mon-empty", children: ui.emptyTrendsTab });
|
|
10645
10645
|
return /* @__PURE__ */ jsx79("div", { className: "ss-w-mon-list", children: markets.map((m) => {
|
|
10646
10646
|
const pin = monitor.pins.find((p) => p.key === m.key);
|
|
10647
10647
|
return /* @__PURE__ */ jsxs74("div", { className: "ss-w-mon-oddspin", "data-settled": m.isSettled || void 0, children: [
|
|
@@ -15568,7 +15568,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15568
15568
|
monitor,
|
|
15569
15569
|
ui,
|
|
15570
15570
|
matchCount: monitor.pins.filter((p) => p.kind === "match").length,
|
|
15571
|
-
|
|
15571
|
+
trendsCount: monitor.pins.filter((p) => p.kind !== "match").length,
|
|
15572
15572
|
todayCount: discovery?.liveCount ?? 0,
|
|
15573
15573
|
hasToday: discovery ? visibleGroupsOf(discovery.groups, discovery.states).length > 0 : false,
|
|
15574
15574
|
gamesEnabled: gamesResult?.enabled ?? false,
|
|
@@ -15594,7 +15594,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15594
15594
|
] }),
|
|
15595
15595
|
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ jsx133(TodayPanel, { discovery, ui, monitor }),
|
|
15596
15596
|
monitor && monitor.activeTab === "following" && /* @__PURE__ */ jsx133(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
|
|
15597
|
-
monitor && monitor.activeTab === "
|
|
15597
|
+
monitor && monitor.activeTab === "trends" && /* @__PURE__ */ jsx133(TrendsPanel, { monitor, ui, slip }),
|
|
15598
15598
|
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ jsx133(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
|
|
15599
15599
|
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ jsx133(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
|
|
15600
15600
|
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ jsxs117(Fragment41, { children: [
|
|
@@ -15890,7 +15890,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
15890
15890
|
.ss-w-menu-item svg { color: var(--ss-w-faint); font-size: 15px; flex: none; }
|
|
15891
15891
|
|
|
15892
15892
|
/* messages */
|
|
15893
|
-
/* .ss-w-mon-list (Matches/
|
|
15893
|
+
/* .ss-w-mon-list (Matches/Trends tab scrollers) shares .ss-w-list's box/scroll rules by design --
|
|
15894
15894
|
same visual rhythm as the chat message list -- but gets its own class so it isn't the same DOM
|
|
15895
15895
|
landmark as the chat list when both exist in the panel at once (Task 16 fix round, M4). */
|
|
15896
15896
|
/* Children of this scrolling column flex container must NOT shrink. The default flex-shrink:1
|
|
@@ -17323,7 +17323,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
17323
17323
|
.ss-w-mon-asof { display: block; font-size: 10.5px; font-weight: 600; color: var(--ss-w-cta); }
|
|
17324
17324
|
.ss-w-mon-grace { font-size: 11px; color: var(--ss-w-faint); border-top: 1px solid var(--ss-w-line); padding-top: 8px; }
|
|
17325
17325
|
|
|
17326
|
-
/* Matches/
|
|
17326
|
+
/* Matches/Trends tab panels (MonitorTabs): the shared per-market-pin context line, the empty
|
|
17327
17327
|
state shown when the snapshot carries no matches/markets yet, the persistent D5 in-slip badge,
|
|
17328
17328
|
and the per-market-pin wrapper card (struck price on settlement is a pure CSS hook off its
|
|
17329
17329
|
[data-settled] attribute -- no separate class on the price element itself). */
|
|
@@ -17454,7 +17454,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
17454
17454
|
a bare context line with nothing under it. */
|
|
17455
17455
|
.ss-w-mon-empty-card { padding: 8px 0 2px; font-size: 12px; color: var(--ss-w-faint); }
|
|
17456
17456
|
.ss-w-mon-inslip { display: inline-flex; flex: none; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--ss-w-pos); }
|
|
17457
|
-
/*
|
|
17457
|
+
/* Trends-tab item is bare: the visible card is the market-odds card itself (no outer wrapper card),
|
|
17458
17458
|
with an optional slim live strip above it. */
|
|
17459
17459
|
.ss-w-mon-oddspin { display: flex; flex-direction: column; gap: 8px; }
|
|
17460
17460
|
.ss-w-mk-live { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 2px; font-size: 11.5px; color: var(--ss-w-faint); }
|
|
@@ -17476,7 +17476,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
17476
17476
|
.ss-w-acc-toggle--susp { cursor: default; color: var(--ss-w-faint); }
|
|
17477
17477
|
.ss-w-acc-chevron { color: var(--ss-w-faint); font-size: 11px; flex: none; }
|
|
17478
17478
|
.ss-w-acc-label { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
17479
|
-
.ss-w-acc-badge {
|
|
17479
|
+
.ss-w-acc-badge { margin-top: 0; }
|
|
17480
17480
|
.ss-w-acc-susp { margin-left: auto; font-size: 10.5px; color: var(--ss-w-faint); flex: none; }
|
|
17481
17481
|
.ss-w-acc-panel { padding: 0 11px 10px; display: flex; flex-direction: column; gap: 8px; }
|
|
17482
17482
|
.ss-w-acc-insight { font-size: 12px; color: var(--ss-w-ink); background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 7px 9px; }
|
|
@@ -18355,7 +18355,7 @@ function StatsWidget(props) {
|
|
|
18355
18355
|
const handler = props.config?.onAddToSlip;
|
|
18356
18356
|
return {
|
|
18357
18357
|
// I3: the D5 persistent in-slip badge must arm from ANY add path -- a chat-message
|
|
18358
|
-
// insight/market card, not just the ones rendered inside the
|
|
18358
|
+
// insight/market card, not just the ones rendered inside the Trends tab itself -- so the
|
|
18359
18359
|
// wasAdded->markAdded wrap lives here (once), not duplicated per consumer. It awaits the
|
|
18360
18360
|
// operator's handler itself, so a result that lands after the button's own timeout still
|
|
18361
18361
|
// arms the badge.
|