@sensiblestats/widget-react 0.150.1 → 0.151.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/dist/index.js CHANGED
@@ -1347,7 +1347,7 @@ function parseCustomTotal(text2, format2) {
1347
1347
  }
1348
1348
 
1349
1349
  // src/version.generated.ts
1350
- var WIDGET_REACT_VERSION = "0.150.1";
1350
+ var WIDGET_REACT_VERSION = "0.151.0";
1351
1351
 
1352
1352
  // src/config.ts
1353
1353
  function hostTag(cfg) {
@@ -6161,7 +6161,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
6161
6161
  {
6162
6162
  className: "ss-w-v8-card ss-w-v2-alt-row",
6163
6163
  "data-match-id": r.matchId,
6164
- "aria-label": ui.v2CardLabel(r.home, r.away, marketLabel),
6164
+ "aria-label": ui.v2CardLabel(r.home, r.away, r.marketLabel ?? marketLabel),
6165
6165
  onClickCapture: logRowTap(events, slotBase + i),
6166
6166
  children: [
6167
6167
  /* @__PURE__ */ jsxs9("header", { className: "ss-w-v8-card-head", children: [
@@ -6172,6 +6172,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
6172
6172
  ] }),
6173
6173
  sub ? /* @__PURE__ */ jsx10("span", { className: "ss-w-v8-card-sub", children: sub }) : null
6174
6174
  ] }),
6175
+ r.marketLabel ? /* @__PURE__ */ jsx10("div", { className: "ss-w-v2-head", children: /* @__PURE__ */ jsx10("span", { className: "ss-w-v2-market", children: r.marketLabel }) }) : null,
6175
6176
  /* @__PURE__ */ jsx10(PriceButtons, { selections: r.selections, ui, onAdd: add ? (s) => add(r.matchId, market, s) : void 0 }),
6176
6177
  r.stat ? /* @__PURE__ */ jsx10("p", { className: "ss-w-v2-stat", children: r.stat }) : null
6177
6178
  ]
@@ -6373,7 +6374,7 @@ function oldestQuote(legs) {
6373
6374
 
6374
6375
  // src/components/dashboard/v2/useRepriceAdd.ts
6375
6376
  var NO_SLIP = {};
6376
- function useRepriceAdd({ conversation, locale, slip, ui }) {
6377
+ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
6377
6378
  const scope = useSportScope();
6378
6379
  const operatorUserId = scope?.operatorUserId;
6379
6380
  const anonymousUserId = scope?.anonymousUserId;
@@ -6392,7 +6393,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6392
6393
  if (!conversation || !slip) return { outcome: "failed" };
6393
6394
  try {
6394
6395
  const grid = await conversation.getBuilderGrid(locale, {
6395
- sport: "football",
6396
+ sport,
6396
6397
  matchIds: [matchId],
6397
6398
  marketKey: market,
6398
6399
  legs: 1,
@@ -6403,8 +6404,8 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6403
6404
  ...anonymousUserId ? { anonymousUserId } : {}
6404
6405
  });
6405
6406
  if (grid === null) return { outcome: "cool_off" };
6406
- if (grid.status !== "ok" || grid.legs.length !== 1) return { outcome: "gone" };
6407
- const leg = legsOf(grid, "football")?.[0];
6407
+ if (grid.status !== "ok" || grid.sport !== sport || grid.legs.length !== 1) return { outcome: "gone" };
6408
+ const leg = legsOf(grid, sport)?.[0];
6408
6409
  if (!leg) return { outcome: "gone" };
6409
6410
  kickoffs.current.set(leg.matchId, leg.kickoffUtc);
6410
6411
  const outcome = await addToSlip(comboLegToSlipSelection(leg, slip.conversationId), {
@@ -6418,7 +6419,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6418
6419
  } catch {
6419
6420
  return { outcome: "failed" };
6420
6421
  }
6421
- }, [conversation, locale, slip, ui, addToSlip, operatorUserId, anonymousUserId]);
6422
+ }, [conversation, locale, slip, ui, sport, addToSlip, operatorUserId, anonymousUserId]);
6422
6423
  return canAdd2 ? add : void 0;
6423
6424
  }
6424
6425
 
@@ -6432,11 +6433,11 @@ var CHIP_LABEL = {
6432
6433
  build_combo: (ui) => ui.v2ChipBuildCombo
6433
6434
  };
6434
6435
  var chipsFor = (section2) => section2.chips.filter((c) => Object.prototype.hasOwnProperty.call(CHIP_LABEL, c) && (!section2.coolOff || c === "live_games"));
6435
- function MarketFirstGreeting({ section: section2, ui, slip, onAct }) {
6436
+ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
6436
6437
  const log = useEventLog();
6437
6438
  const personal = usePersonalGreeting();
6438
6439
  const openTab = personal?.openTab;
6439
- const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui });
6440
+ const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui, sport });
6440
6441
  const [chosen, setChosen] = useState20(null);
6441
6442
  const [open, setOpen] = useState20(false);
6442
6443
  const base = section2.coolOff ? void 0 : section2.featured;
@@ -7961,7 +7962,7 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
7961
7962
  /* @__PURE__ */ jsx33("span", { className: "ss-w-dash-title", children: shown2.title }),
7962
7963
  shown2.subtitle && !shown2.marketFirst ? /* @__PURE__ */ jsx33("span", { className: "ss-w-dash-subtitle", children: shown2.subtitle }) : null
7963
7964
  ] }),
7964
- shown2.marketFirst ? /* @__PURE__ */ jsx33(MarketFirstGreeting, { section: shown2.marketFirst, ui, slip, sport: active?.sport ?? (defaultSport || "football"), onAct }, active?.sport ?? "") : personal && slip ? /* @__PURE__ */ jsx33(PersonalGreeting, { personal, ui, slip, sport: active?.sport ?? (defaultSport || "football"), starsElsewhere, onAct }, active?.sport ?? "") : /* @__PURE__ */ jsx33("div", { className: "ss-w-dash-grid", children: shown2.tiles.map((t, i) => /* @__PURE__ */ jsx33(
7965
+ shown2.marketFirst ? /* @__PURE__ */ jsx33(MarketFirstGreeting, { section: shown2.marketFirst, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), onAct }, active?.sport ?? "") : personal && slip ? /* @__PURE__ */ jsx33(PersonalGreeting, { personal, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), starsElsewhere, onAct }, active?.sport ?? "") : /* @__PURE__ */ jsx33("div", { className: "ss-w-dash-grid", children: shown2.tiles.map((t, i) => /* @__PURE__ */ jsx33(
7965
7966
  DashboardTile,
7966
7967
  {
7967
7968
  tile: tileForFormat(t, oddsFormat),
@@ -8323,9 +8324,9 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
8323
8324
  // src/components/BubblePrice.tsx
8324
8325
  import { useMemo as useMemo11 } from "react";
8325
8326
  import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
8326
- function BubblePrice({ matchId, price, conversation, slip, ui, hook }) {
8327
+ function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
8327
8328
  const selections = useMemo11(() => [price.selection], [price.selection]);
8328
- const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui });
8329
+ const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
8329
8330
  return /* @__PURE__ */ jsxs33("div", { className: "ss-w-greeting-price", children: [
8330
8331
  /* @__PURE__ */ jsx37("span", { className: "ss-w-v2-market", children: price.marketLabel }),
8331
8332
  /* @__PURE__ */ jsx37(PriceButtons, { selections, ui, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 })
@@ -22462,7 +22463,8 @@ function StatsWidget(props) {
22462
22463
  conversation: built?.conversation ?? null,
22463
22464
  slip,
22464
22465
  ui,
22465
- hook: hookOf(greetingMeta)
22466
+ hook: hookOf(greetingMeta),
22467
+ sport: greetingBubble.sport
22466
22468
  }
22467
22469
  ) : void 0
22468
22470
  }