@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/CHANGELOG.md +11 -0
- package/dist/index.cjs +15 -13
- 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 +15 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
3
14
|
## 0.150.1
|
|
4
15
|
|
|
5
16
|
### Patch 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.
|
|
1389
|
+
var WIDGET_REACT_VERSION = "0.151.0";
|
|
1390
1390
|
|
|
1391
1391
|
// src/config.ts
|
|
1392
1392
|
function hostTag(cfg) {
|
|
@@ -6200,7 +6200,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
|
|
|
6200
6200
|
{
|
|
6201
6201
|
className: "ss-w-v8-card ss-w-v2-alt-row",
|
|
6202
6202
|
"data-match-id": r.matchId,
|
|
6203
|
-
"aria-label": ui.v2CardLabel(r.home, r.away, marketLabel),
|
|
6203
|
+
"aria-label": ui.v2CardLabel(r.home, r.away, r.marketLabel ?? marketLabel),
|
|
6204
6204
|
onClickCapture: logRowTap(events, slotBase + i),
|
|
6205
6205
|
children: [
|
|
6206
6206
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "ss-w-v8-card-head", children: [
|
|
@@ -6211,6 +6211,7 @@ function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
|
|
|
6211
6211
|
] }),
|
|
6212
6212
|
sub ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v8-card-sub", children: sub }) : null
|
|
6213
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,
|
|
6214
6215
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriceButtons, { selections: r.selections, ui, onAdd: add ? (s) => add(r.matchId, market, s) : void 0 }),
|
|
6215
6216
|
r.stat ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "ss-w-v2-stat", children: r.stat }) : null
|
|
6216
6217
|
]
|
|
@@ -6412,7 +6413,7 @@ function oldestQuote(legs) {
|
|
|
6412
6413
|
|
|
6413
6414
|
// src/components/dashboard/v2/useRepriceAdd.ts
|
|
6414
6415
|
var NO_SLIP = {};
|
|
6415
|
-
function useRepriceAdd({ conversation, locale, slip, ui }) {
|
|
6416
|
+
function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
|
|
6416
6417
|
const scope = useSportScope();
|
|
6417
6418
|
const operatorUserId = scope?.operatorUserId;
|
|
6418
6419
|
const anonymousUserId = scope?.anonymousUserId;
|
|
@@ -6431,7 +6432,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
|
|
|
6431
6432
|
if (!conversation || !slip) return { outcome: "failed" };
|
|
6432
6433
|
try {
|
|
6433
6434
|
const grid = await conversation.getBuilderGrid(locale, {
|
|
6434
|
-
sport
|
|
6435
|
+
sport,
|
|
6435
6436
|
matchIds: [matchId],
|
|
6436
6437
|
marketKey: market,
|
|
6437
6438
|
legs: 1,
|
|
@@ -6442,8 +6443,8 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
|
|
|
6442
6443
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
6443
6444
|
});
|
|
6444
6445
|
if (grid === null) return { outcome: "cool_off" };
|
|
6445
|
-
if (grid.status !== "ok" || grid.legs.length !== 1) return { outcome: "gone" };
|
|
6446
|
-
const leg = legsOf(grid,
|
|
6446
|
+
if (grid.status !== "ok" || grid.sport !== sport || grid.legs.length !== 1) return { outcome: "gone" };
|
|
6447
|
+
const leg = legsOf(grid, sport)?.[0];
|
|
6447
6448
|
if (!leg) return { outcome: "gone" };
|
|
6448
6449
|
kickoffs.current.set(leg.matchId, leg.kickoffUtc);
|
|
6449
6450
|
const outcome = await addToSlip(comboLegToSlipSelection(leg, slip.conversationId), {
|
|
@@ -6457,7 +6458,7 @@ function useRepriceAdd({ conversation, locale, slip, ui }) {
|
|
|
6457
6458
|
} catch {
|
|
6458
6459
|
return { outcome: "failed" };
|
|
6459
6460
|
}
|
|
6460
|
-
}, [conversation, locale, slip, ui, addToSlip, operatorUserId, anonymousUserId]);
|
|
6461
|
+
}, [conversation, locale, slip, ui, sport, addToSlip, operatorUserId, anonymousUserId]);
|
|
6461
6462
|
return canAdd2 ? add : void 0;
|
|
6462
6463
|
}
|
|
6463
6464
|
|
|
@@ -6471,11 +6472,11 @@ var CHIP_LABEL = {
|
|
|
6471
6472
|
build_combo: (ui) => ui.v2ChipBuildCombo
|
|
6472
6473
|
};
|
|
6473
6474
|
var chipsFor = (section2) => section2.chips.filter((c) => Object.prototype.hasOwnProperty.call(CHIP_LABEL, c) && (!section2.coolOff || c === "live_games"));
|
|
6474
|
-
function MarketFirstGreeting({ section: section2, ui, slip, onAct }) {
|
|
6475
|
+
function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
6475
6476
|
const log = useEventLog();
|
|
6476
6477
|
const personal = usePersonalGreeting();
|
|
6477
6478
|
const openTab = personal?.openTab;
|
|
6478
|
-
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 });
|
|
6479
6480
|
const [chosen, setChosen] = (0, import_react34.useState)(null);
|
|
6480
6481
|
const [open, setOpen] = (0, import_react34.useState)(false);
|
|
6481
6482
|
const base = section2.coolOff ? void 0 : section2.featured;
|
|
@@ -8000,7 +8001,7 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
|
|
|
8000
8001
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-title", children: shown2.title }),
|
|
8001
8002
|
shown2.subtitle && !shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-subtitle", children: shown2.subtitle }) : null
|
|
8002
8003
|
] }),
|
|
8003
|
-
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)(
|
|
8004
8005
|
DashboardTile,
|
|
8005
8006
|
{
|
|
8006
8007
|
tile: tileForFormat(t, oddsFormat),
|
|
@@ -8362,9 +8363,9 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
8362
8363
|
// src/components/BubblePrice.tsx
|
|
8363
8364
|
var import_react59 = require("react");
|
|
8364
8365
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
8365
|
-
function BubblePrice({ matchId, price, conversation, slip, ui, hook }) {
|
|
8366
|
+
function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
|
|
8366
8367
|
const selections = (0, import_react59.useMemo)(() => [price.selection], [price.selection]);
|
|
8367
|
-
const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui });
|
|
8368
|
+
const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
|
|
8368
8369
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ss-w-greeting-price", children: [
|
|
8369
8370
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ss-w-v2-market", children: price.marketLabel }),
|
|
8370
8371
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PriceButtons, { selections, ui, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 })
|
|
@@ -22501,7 +22502,8 @@ function StatsWidget(props) {
|
|
|
22501
22502
|
conversation: built?.conversation ?? null,
|
|
22502
22503
|
slip,
|
|
22503
22504
|
ui,
|
|
22504
|
-
hook: hookOf(greetingMeta)
|
|
22505
|
+
hook: hookOf(greetingMeta),
|
|
22506
|
+
sport: greetingBubble.sport
|
|
22505
22507
|
}
|
|
22506
22508
|
) : void 0
|
|
22507
22509
|
}
|