@sensiblestats/widget-react 0.130.0 → 0.130.1
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 +8 -0
- package/dist/index.cjs +46 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.130.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- NBA and NFL prop insight cards now put the player and the stat in the add-to-slip `display`, so a host can tell two players' "Over 24.5" picks apart. NBA "Add both" legs name each leg's own player and stat instead of the card title. The `SlipDisplay.selection` doc now says that an insight card's label can carry the team name and the line.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @sensiblestats/widget-sdk@0.93.1
|
|
10
|
+
|
|
3
11
|
## 0.130.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1323,7 +1323,7 @@ function parseOddsFormat(value) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
|
|
1325
1325
|
// src/version.generated.ts
|
|
1326
|
-
var WIDGET_REACT_VERSION = "0.130.
|
|
1326
|
+
var WIDGET_REACT_VERSION = "0.130.1";
|
|
1327
1327
|
|
|
1328
1328
|
// src/config.ts
|
|
1329
1329
|
function hostTag(cfg) {
|
|
@@ -2192,7 +2192,7 @@ function comboLegToSlipSelection(leg, conversationId) {
|
|
|
2192
2192
|
if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
|
|
2193
2193
|
if (leg.sport !== void 0) selection.sport = leg.sport;
|
|
2194
2194
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2195
|
-
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
|
|
2195
|
+
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market, player: leg.player });
|
|
2196
2196
|
}
|
|
2197
2197
|
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
2198
2198
|
var isObj = (v) => typeof v === "object" && v !== null;
|
|
@@ -2325,7 +2325,37 @@ function toNbaSlipSelection(vm, key, conversationId) {
|
|
|
2325
2325
|
sport: "basketball"
|
|
2326
2326
|
};
|
|
2327
2327
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2328
|
-
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2328
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nbaPropOf(vm.evidence, key) });
|
|
2329
|
+
}
|
|
2330
|
+
function nbaPropOf(evidence, key) {
|
|
2331
|
+
switch (evidence.kind) {
|
|
2332
|
+
case "prop_reason":
|
|
2333
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.statLabel };
|
|
2334
|
+
case "vs_opponent":
|
|
2335
|
+
return { player: evidence.vsOpponent.playerName, marketLabel: evidence.vsOpponent.statLabel };
|
|
2336
|
+
case "teammate_out": {
|
|
2337
|
+
const row = evidence.teammateOut.rows.find((r) => r.selectionKey === key);
|
|
2338
|
+
return row ? { player: row.playerName, marketLabel: row.statLabel } : null;
|
|
2339
|
+
}
|
|
2340
|
+
case "co_hit": {
|
|
2341
|
+
const leg = evidence.coHit.legs.find((l) => l.selectionKey === key);
|
|
2342
|
+
return leg ? { player: leg.playerName, marketLabel: leg.statLabel } : null;
|
|
2343
|
+
}
|
|
2344
|
+
case "ladder": {
|
|
2345
|
+
const stat = evidence.ladder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2346
|
+
return stat ? { player: evidence.ladder.playerName, marketLabel: stat.statLabel } : null;
|
|
2347
|
+
}
|
|
2348
|
+
case "quarter_ladder": {
|
|
2349
|
+
const stat = evidence.quarterLadder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2350
|
+
return stat ? { player: evidence.quarterLadder.playerName, marketLabel: stat.statLabel } : null;
|
|
2351
|
+
}
|
|
2352
|
+
case "matchup": {
|
|
2353
|
+
const pos = evidence.matchup.position;
|
|
2354
|
+
return pos?.playerName && (pos.overSelectionKey === key || pos.underSelectionKey === key) ? { player: pos.playerName, marketLabel: pos.statLabel } : null;
|
|
2355
|
+
}
|
|
2356
|
+
default:
|
|
2357
|
+
return null;
|
|
2358
|
+
}
|
|
2329
2359
|
}
|
|
2330
2360
|
function nbaCoHitLegs(vm, conversationId) {
|
|
2331
2361
|
if (vm.evidence.kind !== "co_hit") return [];
|
|
@@ -2339,7 +2369,8 @@ function nbaCoHitLegs(vm, conversationId) {
|
|
|
2339
2369
|
homeTeamName: vm.homeTeamName ?? "",
|
|
2340
2370
|
awayTeamName: vm.awayTeamName ?? "",
|
|
2341
2371
|
kickoffUtc: vm.kickoffUtc ?? void 0,
|
|
2342
|
-
market:
|
|
2372
|
+
market: leg.statLabel,
|
|
2373
|
+
player: leg.playerName,
|
|
2343
2374
|
marketDeveloperName: s.marketDeveloperName,
|
|
2344
2375
|
selection: s.selectionLabel,
|
|
2345
2376
|
selectionLabel: s.selectionLabel,
|
|
@@ -2445,7 +2476,17 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
|
|
|
2445
2476
|
sport: "americanfootball"
|
|
2446
2477
|
};
|
|
2447
2478
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2448
|
-
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2479
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nflPropOf(vm.evidence) });
|
|
2480
|
+
}
|
|
2481
|
+
function nflPropOf(evidence) {
|
|
2482
|
+
switch (evidence.kind) {
|
|
2483
|
+
case "prop_reason":
|
|
2484
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.propLabel };
|
|
2485
|
+
case "ladder":
|
|
2486
|
+
return { player: evidence.ladder.playerName, marketLabel: evidence.ladder.propLabel };
|
|
2487
|
+
default:
|
|
2488
|
+
return null;
|
|
2489
|
+
}
|
|
2449
2490
|
}
|
|
2450
2491
|
|
|
2451
2492
|
// src/slipKey.ts
|