@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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.108.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Rename the widget's internal Odds tab id, dot, count and panel to Trends. No visible change.
8
+
9
+ ## 0.108.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Show the chart icon instead of a star on Following markets that have facts
14
+
3
15
  ## 0.108.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -155,7 +155,7 @@ var STRINGS = {
155
155
  nbaTimeoutsLeft: "Timeouts left",
156
156
  priceHistoryLabel: "Price history",
157
157
  emptyMatchesTab: "No pinned matches yet. Pin a match from the conversation to track it live.",
158
- emptyOddsTab: "No odds followed yet. Tap Price history on a price that moved to follow it here.",
158
+ emptyTrendsTab: "No odds followed yet. Tap Price history on a price that moved to follow it here.",
159
159
  asOf: (time) => `Prices as of ${time}`,
160
160
  graceNote: "Unpins on next open \xB7 or in 2 h",
161
161
  suspendedLabel: "Suspended",
@@ -831,7 +831,7 @@ var STRINGS = {
831
831
  nbaTimeoutsLeft: "Kalan mola",
832
832
  priceHistoryLabel: "Oran ge\xE7mi\u015Fi",
833
833
  emptyMatchesTab: "Hen\xFCz sabitlenmi\u015F ma\xE7 yok. Canl\u0131 takip i\xE7in sohbetteki bir ma\xE7\u0131 sabitle.",
834
- emptyOddsTab: "Hen\xFCz takip edilen oran yok. De\u011Fi\u015Fen bir oranda Oran ge\xE7mi\u015Fi d\xFC\u011Fmesine dokunarak burada takip et.",
834
+ emptyTrendsTab: "Hen\xFCz takip edilen oran yok. De\u011Fi\u015Fen bir oranda Oran ge\xE7mi\u015Fi d\xFC\u011Fmesine dokunarak burada takip et.",
835
835
  asOf: (time) => `Fiyatlar ${time} itibar\u0131yla`,
836
836
  graceNote: "Bir sonraki a\xE7\u0131l\u0131\u015Fta kald\u0131r\u0131l\u0131r \xB7 en ge\xE7 2 saat",
837
837
  suspendedLabel: "Ask\u0131da",
@@ -1449,7 +1449,7 @@ function isEnglishLocale(locale) {
1449
1449
  }
1450
1450
 
1451
1451
  // src/version.generated.ts
1452
- var WIDGET_REACT_VERSION = "0.108.2";
1452
+ var WIDGET_REACT_VERSION = "0.108.4";
1453
1453
 
1454
1454
  // src/config.ts
1455
1455
  function normalizeUi(cfg) {
@@ -1649,7 +1649,7 @@ function normalizeUi(cfg) {
1649
1649
  nbaTimeoutsLeft: strings.nbaTimeoutsLeft,
1650
1650
  priceHistoryLabel: strings.priceHistoryLabel,
1651
1651
  emptyMatchesTab: strings.emptyMatchesTab,
1652
- emptyOddsTab: strings.emptyOddsTab,
1652
+ emptyTrendsTab: strings.emptyTrendsTab,
1653
1653
  asOf: strings.asOf,
1654
1654
  graceNote: strings.graceNote,
1655
1655
  suspendedLabel: strings.suspendedLabel,
@@ -4000,7 +4000,7 @@ function useLiveMonitor(opts) {
4000
4000
  const { activeTab, setActiveTab: setActiveTabState } = useTabs("chat");
4001
4001
  const [chatDot, setChatDot] = (0, import_react6.useState)(false);
4002
4002
  const [matchesDot, setMatchesDot] = (0, import_react6.useState)(false);
4003
- const [oddsDot, setOddsDot] = (0, import_react6.useState)(false);
4003
+ const [trendsDot, setTrendsDot] = (0, import_react6.useState)(false);
4004
4004
  const [todayDot, setTodayDot] = (0, import_react6.useState)(false);
4005
4005
  const [lastViewedPrices, setLastViewedPrices] = (0, import_react6.useState)({});
4006
4006
  const [openMarket, setOpenMarket] = (0, import_react6.useState)({});
@@ -4141,7 +4141,7 @@ function useLiveMonitor(opts) {
4141
4141
  openSelectedDefault(next);
4142
4142
  refreshMissingInsight(next);
4143
4143
  const marketPins = currentPins.filter((p) => p.kind !== "match");
4144
- if (activeTabRef.current === "odds") {
4144
+ if (activeTabRef.current === "trends") {
4145
4145
  setLastViewedPrices((prevMap) => {
4146
4146
  let changed = false;
4147
4147
  const out = { ...prevMap };
@@ -4164,7 +4164,7 @@ function useLiveMonitor(opts) {
4164
4164
  break;
4165
4165
  }
4166
4166
  }
4167
- if (sawPriceMove) setOddsDot(true);
4167
+ if (sawPriceMove) setTrendsDot(true);
4168
4168
  }
4169
4169
  const graceKeys = currentPins.filter((p) => {
4170
4170
  const phase = phaseForPin(next, p);
@@ -4261,14 +4261,14 @@ function useLiveMonitor(opts) {
4261
4261
  chooseSelection(orderTiles(matchPins, snapshotRef.current)[0]?.pin.key ?? null);
4262
4262
  }, [pins, chooseSelection]);
4263
4263
  (0, import_react6.useEffect)(() => {
4264
- if (clubEnabled && (activeTab === "today" || activeTab === "following" || activeTab === "odds")) {
4264
+ if (clubEnabled && (activeTab === "today" || activeTab === "following" || activeTab === "trends")) {
4265
4265
  setActiveTabState("chat");
4266
4266
  return;
4267
4267
  }
4268
4268
  const matchPins = pins.filter((p) => p.kind === "match").length;
4269
4269
  const marketPins = pins.length - matchPins;
4270
4270
  if (activeTab === "following" && matchPins === 0) setActiveTabState(hasToday ? "today" : "chat");
4271
- if (activeTab === "odds" && marketPins === 0) setActiveTabState(hasToday ? "today" : "chat");
4271
+ if (activeTab === "trends" && marketPins === 0) setActiveTabState(hasToday ? "today" : "chat");
4272
4272
  if (activeTab === "today" && !hasToday) setActiveTabState("chat");
4273
4273
  }, [pins, activeTab, hasToday, clubEnabled]);
4274
4274
  const prevIsOpenRef = (0, import_react6.useRef)(false);
@@ -4296,8 +4296,8 @@ function useLiveMonitor(opts) {
4296
4296
  setMatchesDot(false);
4297
4297
  void tick();
4298
4298
  }
4299
- if (tab === "odds") {
4300
- setOddsDot(false);
4299
+ if (tab === "trends") {
4300
+ setTrendsDot(false);
4301
4301
  setLastViewedPrices((prevMap) => {
4302
4302
  const out = { ...prevMap };
4303
4303
  for (const pin of pinsRef.current.filter((p) => p.kind !== "match")) {
@@ -4371,7 +4371,7 @@ function useLiveMonitor(opts) {
4371
4371
  chatDot,
4372
4372
  markChatActivity,
4373
4373
  matchesDot,
4374
- oddsDot,
4374
+ trendsDot,
4375
4375
  todayDot,
4376
4376
  markTodayActivity,
4377
4377
  lastViewedPrices,
@@ -5991,7 +5991,7 @@ function PriceHistoryButton({ selection, monitor, ui, displayLabel }) {
5991
5991
  log?.log({ name: "pin_add", entityType: "market", entityId: pin.marketDeveloperName, marketDeveloperName: pin.marketDeveloperName });
5992
5992
  }
5993
5993
  }
5994
- monitor.setActiveTab("odds");
5994
+ monitor.setActiveTab("trends");
5995
5995
  };
5996
5996
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ss-w-pin-wrap", children: [
5997
5997
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "ss-w-hist", "aria-label": label, title: label, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" }) }) }),
@@ -9341,7 +9341,7 @@ var ChatInput = (0, import_react53.forwardRef)(function ChatInput2({ placeholder
9341
9341
  var import_react54 = require("react");
9342
9342
  var import_jsx_runtime66 = require("react/jsx-runtime");
9343
9343
  var FIT_STEPS = [[0, false], [1, false], [1, true], [2, true], [3, true]];
9344
- function TabBar({ monitor, ui, matchCount, oddsCount, todayCount, hasToday, gamesEnabled, clubEnabled, favouritesEnabled }) {
9344
+ function TabBar({ monitor, ui, matchCount, trendsCount, todayCount, hasToday, gamesEnabled, clubEnabled, favouritesEnabled }) {
9345
9345
  const tabs = [
9346
9346
  { tab: "chat", label: ui.tabChat, count: 0, dot: monitor.chatDot },
9347
9347
  ...clubEnabled ? [
@@ -9351,7 +9351,7 @@ function TabBar({ monitor, ui, matchCount, oddsCount, todayCount, hasToday, game
9351
9351
  ] : [
9352
9352
  ...hasToday ? [{ tab: "today", label: ui.tabToday, count: todayCount, dot: monitor.todayDot }] : [],
9353
9353
  ...matchCount > 0 ? [{ tab: "following", label: ui.tabFollowing, count: matchCount, dot: monitor.matchesDot }] : [],
9354
- ...oddsCount > 0 ? [{ tab: "odds", label: ui.tabTrends, count: oddsCount, dot: monitor.oddsDot }] : []
9354
+ ...trendsCount > 0 ? [{ tab: "trends", label: ui.tabTrends, count: trendsCount, dot: monitor.trendsDot }] : []
9355
9355
  ],
9356
9356
  ...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : [],
9357
9357
  ...favouritesEnabled && !clubEnabled ? [{ tab: "favourites", label: ui.tabFavourites, count: 0, dot: false }] : []
@@ -9445,7 +9445,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
9445
9445
  children: [
9446
9446
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-w-acc-chevron", children: m.suspended ? "" : isOpen ? "\u25BE" : "\u25B8" }),
9447
9447
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-w-acc-label", children: m.marketLabel }),
9448
- m.hasInsight && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-w-acc-badge", children: "\u2605" }),
9448
+ m.hasInsight && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-w-bi-chart ss-w-acc-badge", "aria-hidden": "true" }),
9449
9449
  m.suspended && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-w-acc-susp", children: ui.accordionSuspended })
9450
9450
  ]
9451
9451
  }
@@ -10676,10 +10676,10 @@ function withSinceViewMovement(vm, prev) {
10676
10676
  };
10677
10677
  return { ...vm, mainRows: [updatedPrimary, ...vm.mainRows.slice(1)] };
10678
10678
  }
10679
- function OddsPanel({ monitor, ui, slip }) {
10679
+ function TrendsPanel({ monitor, ui, slip }) {
10680
10680
  const slipState = useSlipState();
10681
10681
  const markets = (monitor.snapshot?.markets ?? []).filter((m) => monitor.pins.some((p) => p.key === m.key));
10682
- if (markets.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-w-mon-empty", children: ui.emptyOddsTab });
10682
+ if (markets.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-w-mon-empty", children: ui.emptyTrendsTab });
10683
10683
  return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-w-mon-list", children: markets.map((m) => {
10684
10684
  const pin = monitor.pins.find((p) => p.key === m.key);
10685
10685
  return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "ss-w-mon-oddspin", "data-settled": m.isSettled || void 0, children: [
@@ -15606,7 +15606,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
15606
15606
  monitor,
15607
15607
  ui,
15608
15608
  matchCount: monitor.pins.filter((p) => p.kind === "match").length,
15609
- oddsCount: monitor.pins.filter((p) => p.kind !== "match").length,
15609
+ trendsCount: monitor.pins.filter((p) => p.kind !== "match").length,
15610
15610
  todayCount: discovery?.liveCount ?? 0,
15611
15611
  hasToday: discovery ? visibleGroupsOf(discovery.groups, discovery.states).length > 0 : false,
15612
15612
  gamesEnabled: gamesResult?.enabled ?? false,
@@ -15632,7 +15632,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
15632
15632
  ] }),
15633
15633
  monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(TodayPanel, { discovery, ui, monitor }),
15634
15634
  monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
15635
- monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(OddsPanel, { monitor, ui, slip }),
15635
+ monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(TrendsPanel, { monitor, ui, slip }),
15636
15636
  monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
15637
15637
  monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
15638
15638
  monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
@@ -15928,7 +15928,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
15928
15928
  .ss-w-menu-item svg { color: var(--ss-w-faint); font-size: 15px; flex: none; }
15929
15929
 
15930
15930
  /* messages */
15931
- /* .ss-w-mon-list (Matches/Odds tab scrollers) shares .ss-w-list's box/scroll rules by design --
15931
+ /* .ss-w-mon-list (Matches/Trends tab scrollers) shares .ss-w-list's box/scroll rules by design --
15932
15932
  same visual rhythm as the chat message list -- but gets its own class so it isn't the same DOM
15933
15933
  landmark as the chat list when both exist in the panel at once (Task 16 fix round, M4). */
15934
15934
  /* Children of this scrolling column flex container must NOT shrink. The default flex-shrink:1
@@ -17361,7 +17361,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
17361
17361
  .ss-w-mon-asof { display: block; font-size: 10.5px; font-weight: 600; color: var(--ss-w-cta); }
17362
17362
  .ss-w-mon-grace { font-size: 11px; color: var(--ss-w-faint); border-top: 1px solid var(--ss-w-line); padding-top: 8px; }
17363
17363
 
17364
- /* Matches/Odds tab panels (MonitorTabs): the shared per-market-pin context line, the empty
17364
+ /* Matches/Trends tab panels (MonitorTabs): the shared per-market-pin context line, the empty
17365
17365
  state shown when the snapshot carries no matches/markets yet, the persistent D5 in-slip badge,
17366
17366
  and the per-market-pin wrapper card (struck price on settlement is a pure CSS hook off its
17367
17367
  [data-settled] attribute -- no separate class on the price element itself). */
@@ -17492,7 +17492,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
17492
17492
  a bare context line with nothing under it. */
17493
17493
  .ss-w-mon-empty-card { padding: 8px 0 2px; font-size: 12px; color: var(--ss-w-faint); }
17494
17494
  .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); }
17495
- /* Odds-tab item is bare: the visible card is the market-odds card itself (no outer wrapper card),
17495
+ /* Trends-tab item is bare: the visible card is the market-odds card itself (no outer wrapper card),
17496
17496
  with an optional slim live strip above it. */
17497
17497
  .ss-w-mon-oddspin { display: flex; flex-direction: column; gap: 8px; }
17498
17498
  .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); }
@@ -17514,7 +17514,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
17514
17514
  .ss-w-acc-toggle--susp { cursor: default; color: var(--ss-w-faint); }
17515
17515
  .ss-w-acc-chevron { color: var(--ss-w-faint); font-size: 11px; flex: none; }
17516
17516
  .ss-w-acc-label { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
17517
- .ss-w-acc-badge { font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); flex: none; }
17517
+ .ss-w-acc-badge { margin-top: 0; }
17518
17518
  .ss-w-acc-susp { margin-left: auto; font-size: 10.5px; color: var(--ss-w-faint); flex: none; }
17519
17519
  .ss-w-acc-panel { padding: 0 11px 10px; display: flex; flex-direction: column; gap: 8px; }
17520
17520
  .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; }
@@ -18393,7 +18393,7 @@ function StatsWidget(props) {
18393
18393
  const handler = props.config?.onAddToSlip;
18394
18394
  return {
18395
18395
  // I3: the D5 persistent in-slip badge must arm from ANY add path -- a chat-message
18396
- // insight/market card, not just the ones rendered inside the Odds tab itself -- so the
18396
+ // insight/market card, not just the ones rendered inside the Trends tab itself -- so the
18397
18397
  // wasAdded->markAdded wrap lives here (once), not duplicated per consumer. It awaits the
18398
18398
  // operator's handler itself, so a result that lands after the button's own timeout still
18399
18399
  // arms the badge.