@sensiblestats/widget-react 0.150.0 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.151.0
4
+
5
+ ### Minor Changes
6
+
7
+ - The NBA greeting's price pills and the bubble's pill reprice as NBA, and an alternative row can name its own market.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.110.0
13
+
14
+ ## 0.150.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Send the greeting's sport on the `hook_view` event so the hook report can split by sport.
19
+
3
20
  ## 0.150.0
4
21
 
5
22
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1386,7 +1386,7 @@ function parseCustomTotal(text2, format2) {
1386
1386
  }
1387
1387
 
1388
1388
  // src/version.generated.ts
1389
- var WIDGET_REACT_VERSION = "0.150.0";
1389
+ var WIDGET_REACT_VERSION = "0.151.0";
1390
1390
 
1391
1391
  // src/config.ts
1392
1392
  function hostTag(cfg) {
@@ -5770,6 +5770,7 @@ function sendGreetingOnce(log, owner, meta, surface) {
5770
5770
  name: "hook_view",
5771
5771
  entityType: "match",
5772
5772
  ...meta.matchId ? { entityId: meta.matchId } : {},
5773
+ sport: meta.sport,
5773
5774
  hook: meta.hook ?? "none",
5774
5775
  ...meta.hookFact ? { factKey: meta.hookFact } : {},
5775
5776
  outcome: surface
@@ -6199,7 +6200,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
6199
6200
  {
6200
6201
  className: "ss-w-v8-card ss-w-v2-alt-row",
6201
6202
  "data-match-id": r.matchId,
6202
- "aria-label": ui.v2CardLabel(r.home, r.away, marketLabel),
6203
+ "aria-label": ui.v2CardLabel(r.home, r.away, r.marketLabel ?? marketLabel),
6203
6204
  onClickCapture: logRowTap(events, slotBase + i),
6204
6205
  children: [
6205
6206
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "ss-w-v8-card-head", children: [
@@ -6210,6 +6211,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
6210
6211
  ] }),
6211
6212
  sub ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v8-card-sub", children: sub }) : null
6212
6213
  ] }),
6214
+ r.marketLabel ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ss-w-v2-head", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v2-market", children: r.marketLabel }) }) : null,
6213
6215
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriceButtons, { selections: r.selections, ui, onAdd: add ? (s) => add(r.matchId, market, s) : void 0 }),
6214
6216
  r.stat ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "ss-w-v2-stat", children: r.stat }) : null
6215
6217
  ]
@@ -6411,7 +6413,7 @@ function oldestQuote(legs) {
6411
6413
 
6412
6414
  // src/components/dashboard/v2/useRepriceAdd.ts
6413
6415
  var NO_SLIP = {};
6414
- function useRepriceAdd({ conversation, locale, slip, ui }) {
6416
+ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
6415
6417
  const scope = useSportScope();
6416
6418
  const operatorUserId = scope?.operatorUserId;
6417
6419
  const anonymousUserId = scope?.anonymousUserId;
@@ -6430,7 +6432,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6430
6432
  if (!conversation || !slip) return { outcome: "failed" };
6431
6433
  try {
6432
6434
  const grid = await conversation.getBuilderGrid(locale, {
6433
- sport: "football",
6435
+ sport,
6434
6436
  matchIds: [matchId],
6435
6437
  marketKey: market,
6436
6438
  legs: 1,
@@ -6441,8 +6443,8 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6441
6443
  ...anonymousUserId ? { anonymousUserId } : {}
6442
6444
  });
6443
6445
  if (grid === null) return { outcome: "cool_off" };
6444
- if (grid.status !== "ok" || grid.legs.length !== 1) return { outcome: "gone" };
6445
- const leg = legsOf(grid, "football")?.[0];
6446
+ if (grid.status !== "ok" || grid.sport !== sport || grid.legs.length !== 1) return { outcome: "gone" };
6447
+ const leg = legsOf(grid, sport)?.[0];
6446
6448
  if (!leg) return { outcome: "gone" };
6447
6449
  kickoffs.current.set(leg.matchId, leg.kickoffUtc);
6448
6450
  const outcome = await addToSlip(comboLegToSlipSelection(leg, slip.conversationId), {
@@ -6456,7 +6458,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
6456
6458
  } catch {
6457
6459
  return { outcome: "failed" };
6458
6460
  }
6459
- }, [conversation, locale, slip, ui, addToSlip, operatorUserId, anonymousUserId]);
6461
+ }, [conversation, locale, slip, ui, sport, addToSlip, operatorUserId, anonymousUserId]);
6460
6462
  return canAdd2 ? add : void 0;
6461
6463
  }
6462
6464
 
@@ -6470,11 +6472,11 @@ var CHIP_LABEL = {
6470
6472
  build_combo: (ui) => ui.v2ChipBuildCombo
6471
6473
  };
6472
6474
  var chipsFor = (section2) => section2.chips.filter((c) => Object.prototype.hasOwnProperty.call(CHIP_LABEL, c) && (!section2.coolOff || c === "live_games"));
6473
- function MarketFirstGreeting({ section: section2, ui, slip, onAct }) {
6475
+ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
6474
6476
  const log = useEventLog();
6475
6477
  const personal = usePersonalGreeting();
6476
6478
  const openTab = personal?.openTab;
6477
- const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui });
6479
+ const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui, sport });
6478
6480
  const [chosen, setChosen] = (0, import_react34.useState)(null);
6479
6481
  const [open, setOpen] = (0, import_react34.useState)(false);
6480
6482
  const base = section2.coolOff ? void 0 : section2.featured;
@@ -7999,7 +8001,7 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
7999
8001
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-title", children: shown2.title }),
8000
8002
  shown2.subtitle && !shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-subtitle", children: shown2.subtitle }) : null
8001
8003
  ] }),
8002
- shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MarketFirstGreeting, { section: shown2.marketFirst, ui, slip, sport: active?.sport ?? (defaultSport || "football"), onAct }, active?.sport ?? "") : personal && slip ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PersonalGreeting, { personal, ui, slip, sport: active?.sport ?? (defaultSport || "football"), starsElsewhere, onAct }, active?.sport ?? "") : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ss-w-dash-grid", children: shown2.tiles.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8004
+ shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MarketFirstGreeting, { section: shown2.marketFirst, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), onAct }, active?.sport ?? "") : personal && slip ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PersonalGreeting, { personal, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), starsElsewhere, onAct }, active?.sport ?? "") : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ss-w-dash-grid", children: shown2.tiles.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8003
8005
  DashboardTile,
8004
8006
  {
8005
8007
  tile: tileForFormat(t, oddsFormat),
@@ -8361,9 +8363,9 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
8361
8363
  // src/components/BubblePrice.tsx
8362
8364
  var import_react59 = require("react");
8363
8365
  var import_jsx_runtime37 = require("react/jsx-runtime");
8364
- function BubblePrice({ matchId, price, conversation, slip, ui, hook }) {
8366
+ function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
8365
8367
  const selections = (0, import_react59.useMemo)(() => [price.selection], [price.selection]);
8366
- const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui });
8368
+ const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
8367
8369
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ss-w-greeting-price", children: [
8368
8370
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ss-w-v2-market", children: price.marketLabel }),
8369
8371
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PriceButtons, { selections, ui, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 })
@@ -22500,7 +22502,8 @@ function StatsWidget(props) {
22500
22502
  conversation: built?.conversation ?? null,
22501
22503
  slip,
22502
22504
  ui,
22503
- hook: hookOf(greetingMeta)
22505
+ hook: hookOf(greetingMeta),
22506
+ sport: greetingBubble.sport
22504
22507
  }
22505
22508
  ) : void 0
22506
22509
  }