@sensiblestats/widget-react 0.124.1 → 0.124.2

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,13 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.124.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Tennis followed card: live prices can be added to the slip; each side is one row with the short name left and the price right (plain text without button chrome when it cannot be added); head to head shows the server tally beside the title and up to three meetings (year, tournament, round, surface, winner and score) from the new optional `headToHead.meetings`; the players are separated by `tennis.vs`.
8
+ - Updated dependencies
9
+ - @sensiblestats/widget-sdk@0.89.0
10
+
3
11
  ## 0.124.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1217,7 +1217,7 @@ function parseOddsFormat(value) {
1217
1217
  }
1218
1218
 
1219
1219
  // src/version.generated.ts
1220
- var WIDGET_REACT_VERSION = "0.124.1";
1220
+ var WIDGET_REACT_VERSION = "0.124.2";
1221
1221
 
1222
1222
  // src/config.ts
1223
1223
  function hostTag(cfg) {
@@ -5885,7 +5885,10 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
5885
5885
  children: [
5886
5886
  settled ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ss-w-mol-tick", "aria-hidden": "true", children: "\u2713" }) : null,
5887
5887
  price.label ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ss-w-mol-lab", children: price.label }) : null,
5888
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: formatOdds(selection.forms, oddsFormat) })
5888
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: price.valueClass, children: [
5889
+ price.lead,
5890
+ formatOdds(selection.forms, oddsFormat)
5891
+ ] })
5889
5892
  ]
5890
5893
  }
5891
5894
  ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
@@ -6005,6 +6008,9 @@ var import_jsx_runtime7 = (
6005
6008
  // on one aria-label and the visual glyphs are hidden from the accessibility tree.
6006
6009
  require("react/jsx-runtime")
6007
6010
  );
6011
+ function oddsMovedLabel(previous, current, direction2, ui) {
6012
+ return ui.oddsMoved(previous, current, direction2 === "shortened" ? ui.oddsShortened : ui.oddsDrifted);
6013
+ }
6008
6014
  function OddsMovementBadge({
6009
6015
  previous,
6010
6016
  current,
@@ -11353,10 +11359,10 @@ function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
11353
11359
 
11354
11360
  // src/components/TennisFixtureRow.tsx
11355
11361
  var import_jsx_runtime84 = require("react/jsx-runtime");
11356
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip }) {
11362
+ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11357
11363
  const { oddsFormat } = useOddsSettings();
11358
11364
  const added = useSlipState()?.added;
11359
- const slipAllowed = !!slip && price.addToSlipEnabled && !price.isLive && slipOpenFor(slip, "tennis");
11365
+ const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11360
11366
  const label = formatOdds(forms, oddsFormat);
11361
11367
  const selection = slipAllowed && oddsId != null ? {
11362
11368
  matchOddsId: oddsId,
@@ -11369,17 +11375,32 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11369
11375
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11370
11376
  } : null;
11371
11377
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11372
- return selection ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
11373
- SlipButton,
11374
- {
11375
- selection,
11376
- marketDeveloperName: "match_winner",
11377
- selectionLabel: player.slice(0, 64),
11378
- slip,
11379
- ui,
11380
- price: { ariaLabel: `${player} ${label}` }
11381
- }
11382
- ) : /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: inSlip ? "ss-w-trow-price ss-w-trow-price--in" : "ss-w-trow-price", children: [
11378
+ const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11379
+ if (selection) {
11380
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
11381
+ SlipButton,
11382
+ {
11383
+ selection,
11384
+ marketDeveloperName: "match_winner",
11385
+ selectionLabel: player.slice(0, 64),
11386
+ slip,
11387
+ ui,
11388
+ price: name !== void 0 ? { ariaLabel, label: name, valueClass: "ss-w-tn-pv", lead } : { ariaLabel }
11389
+ }
11390
+ );
11391
+ }
11392
+ const cls = inSlip ? "ss-w-trow-price ss-w-trow-price--in" : "ss-w-trow-price";
11393
+ return name !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: cls, children: [
11394
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "ss-w-vh", children: [
11395
+ player,
11396
+ " "
11397
+ ] }),
11398
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-w-mol-lab", "aria-hidden": "true", children: name }),
11399
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "ss-w-tn-pv", children: [
11400
+ lead,
11401
+ label
11402
+ ] })
11403
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: cls, children: [
11383
11404
  /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "ss-w-vh", children: [
11384
11405
  player,
11385
11406
  " "
@@ -11454,19 +11475,24 @@ function WinnerPrice({ match, t, price, ui, slip }) {
11454
11475
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("section", { className: "ss-w-tn-sec", children: [
11455
11476
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h4", { className: "ss-w-tn-h", children: t.labels.matchWinner }),
11456
11477
  price && common ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
11457
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-tn-prices", children: sides.map((s) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-tn-pside", children: [
11458
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-pname", children: s.player.shortName }),
11459
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: s.forms, value: s.value, oddsId: s.oddsId, player: s.player.name }) }),
11460
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
11461
- OddsMovementBadge,
11478
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-tn-prices", children: sides.map((s) => {
11479
+ const previous = s.previous ? formatOdds(s.previous, oddsFormat) : void 0;
11480
+ const current = formatOdds(s.forms, oddsFormat);
11481
+ const hasMove = previous !== void 0 && s.dir !== void 0;
11482
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-tn-pside", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
11483
+ TennisSidePrice,
11462
11484
  {
11463
- previous: s.previous ? formatOdds(s.previous, oddsFormat) : void 0,
11464
- current: formatOdds(s.forms, oddsFormat),
11465
- direction: s.dir,
11466
- ui
11485
+ ...common,
11486
+ forms: s.forms,
11487
+ value: s.value,
11488
+ oddsId: s.oddsId,
11489
+ player: s.player.name,
11490
+ name: s.player.shortName,
11491
+ lead: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(OddsMovementBadge, { previous, current, direction: s.dir, ui }),
11492
+ movedLabel: hasMove ? oddsMovedLabel(previous, current, s.dir, ui) : void 0
11467
11493
  }
11468
- )
11469
- ] }, s.player.playerId)) }),
11494
+ ) }) }, s.player.playerId);
11495
+ }) }),
11470
11496
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("p", { className: "ss-w-tn-note", children: [
11471
11497
  since ? `${moved ? ui.tennis.movedSince(since) : ui.tennis.unchangedSince(since)} \xB7 ` : "",
11472
11498
  ui.tennis.updated(ui.bettingKickoff(price.quotedAtUtc).time)
@@ -11503,12 +11529,32 @@ var SCORE = /(\d+[-–]\d+(?:\(\d+\))?)/;
11503
11529
  function wholeScores(text2) {
11504
11530
  return text2.split(SCORE).map((part, i) => i % 2 === 1 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-set", children: part }, i) : part);
11505
11531
  }
11532
+ function Meeting({ m, t, ui }) {
11533
+ const where = [
11534
+ String(m.year),
11535
+ m.tournamentName,
11536
+ m.round ? ui.tennis.round[m.round] ?? m.round : null,
11537
+ m.surface ? surfaceLabel(ui, m.surface) : null
11538
+ ].filter(Boolean).join(" \xB7 ");
11539
+ const winner = m.winnerId === t.p1.playerId ? t.p1.shortName : m.winnerId === t.p2.playerId ? t.p2.shortName : null;
11540
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("li", { className: "ss-w-tn-meeting", children: [
11541
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-mwhere", children: where }),
11542
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-tn-mwho", children: [
11543
+ winner ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-mname", children: winner }) : null,
11544
+ m.score ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-set", children: m.score }) : null
11545
+ ] })
11546
+ ] });
11547
+ }
11506
11548
  function HeadToHead({ t, ui }) {
11507
11549
  if (!t.labels.headToHead) return null;
11550
+ const h = t.headToHead;
11551
+ const meetings = (h?.meetings?.length ? h.meetings : h?.last ? [h.last] : []).slice(0, 3);
11508
11552
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("section", { className: "ss-w-tn-sec", children: [
11509
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h4", { className: "ss-w-tn-h", children: ui.tennis.headToHead }),
11510
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "ss-w-tn-leader", children: wholeScores(t.labels.headToHead) }),
11511
- t.labels.lastMeeting && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "ss-w-tn-last", children: wholeScores(t.labels.lastMeeting) })
11553
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-tn-h2h-head", children: [
11554
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h4", { className: "ss-w-tn-h", children: ui.tennis.headToHead }),
11555
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-tn-leader", children: wholeScores(t.labels.headToHead) })
11556
+ ] }),
11557
+ meetings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("ul", { className: "ss-w-tn-meetings", role: "list", children: meetings.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Meeting, { m, t, ui }, i)) })
11512
11558
  ] });
11513
11559
  }
11514
11560
  function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
@@ -11528,7 +11574,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
11528
11574
  };
11529
11575
  onAsk(t.askPrompt, grounding, "match_sheet");
11530
11576
  };
11531
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-mon-item", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-mon ss-w-tn-card", children: [
11577
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-mon-item", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-mon ss-w-tn-card", lang: ui.locale, children: [
11532
11578
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-mon-top", children: [
11533
11579
  match.phase === "live" && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-fandash-live-pill", children: [
11534
11580
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-fandash-live-dot", "aria-hidden": "true" }),
@@ -11548,7 +11594,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
11548
11594
  (round || surface) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "ss-w-tn-meta", children: [round, surface].filter(Boolean).join(" \xB7 ") }),
11549
11595
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-w-tn-players", children: [
11550
11596
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Player2, { side: t.p1, rankRace: t.labels.p1RankRace }),
11551
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-mon-vs", children: ui.venue.home }),
11597
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-mon-vs", children: ui.tennis.vs }),
11552
11598
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Player2, { side: t.p2, rankRace: t.labels.p2RankRace })
11553
11599
  ] }),
11554
11600
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(WinnerPrice, { match, t, price: t.price, ui, slip }),
@@ -18448,14 +18494,18 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18448
18494
  .ss-w-tn-rank { font-size: 10.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18449
18495
  .ss-w-tn-sec { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--ss-w-line); min-width: 0; }
18450
18496
  .ss-w-tn-h { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18451
- .ss-w-tn-prices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
18452
- .ss-w-tn-pside { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
18453
- .ss-w-tn-pname { font-size: 11px; font-weight: 650; color: var(--ss-w-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
18454
- .ss-w-tn-pside .ss-w-trow-prices { flex-direction: row; }
18455
- .ss-w-tn-pside .ss-w-trow-price, .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip-btn.ss-w-slip-btn--price { padding: 7px 0; font-size: 14px; }
18456
- .ss-w-tn-pside .ss-w-trow-price { border: none; background: none; }
18457
- .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip { flex: 1; }
18458
- .ss-w-tn-pside .ss-w-move { justify-content: center; }
18497
+ .ss-w-tn-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
18498
+ .ss-w-tn-pside { display: flex; min-width: 0; }
18499
+ .ss-w-tn-pside .ss-w-trow-prices { flex: 1; min-width: 0; }
18500
+ .ss-w-tn-pside .ss-w-trow-price, .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip-btn.ss-w-slip-btn--price { box-sizing: border-box; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: left; white-space: nowrap; overflow: hidden; }
18501
+ .ss-w-tn-pside .ss-w-trow-price { padding: 9px 11px; border: none; background: none; }
18502
+ .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip { flex: 1; min-width: 0; }
18503
+ .ss-w-tn-pside .ss-w-trow-prices .ss-w-toast { top: calc(100% + 6px); right: 0; transform: none; }
18504
+ .ss-w-tn-pside .ss-w-mol-lab { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13px; font-weight: 600; color: var(--ss-w-ink); }
18505
+ .ss-w-tn-pside .ss-w-mol-tick { flex: none; margin-right: -2px; }
18506
+ .ss-w-tn-pside .ss-w-tn-pv { flex: none; display: inline-flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
18507
+ .ss-w-tn-pside .ss-w-move { gap: 3px; font-weight: 600; }
18508
+ .ss-w-tn-pside .ss-w-move-prev { font-size: 11px; }
18459
18509
  .ss-w-tn-note { margin: 0; font-size: 10.5px; font-weight: 600; line-height: 1.35; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18460
18510
  .ss-w-tn-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,auto) minmax(0,1fr); align-items: center; gap: 6px 8px; }
18461
18511
  .ss-w-tn-row { display: contents; }
@@ -18468,8 +18518,13 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18468
18518
  .ss-w-tn-fchip { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 4px; font-size: 9px; font-weight: 800; color: #fff; background: var(--ss-w-faint); }
18469
18519
  .ss-w-tn-fchip--l { background: var(--ss-w-neg); }
18470
18520
  .ss-w-tn-fchip--w { background: var(--ss-w-pos); }
18471
- .ss-w-tn-leader { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; color: var(--ss-w-ink); overflow-wrap: anywhere; }
18472
- .ss-w-tn-last { margin: 0; min-width: 0; font-size: 11.5px; line-height: 1.4; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18521
+ .ss-w-tn-h2h-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
18522
+ .ss-w-tn-leader { min-width: 0; text-align: right; font-size: 13px; font-weight: 800; line-height: 1.25; color: var(--ss-w-ink); overflow-wrap: anywhere; }
18523
+ .ss-w-tn-meetings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
18524
+ .ss-w-tn-meeting { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
18525
+ .ss-w-tn-mwhere { min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18526
+ .ss-w-tn-mname { min-width: 0; overflow-wrap: anywhere; }
18527
+ .ss-w-tn-mwho { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--ss-w-ink); }
18473
18528
  .ss-w-tn-set { white-space: nowrap; font-variant-numeric: tabular-nums; }
18474
18529
  .ss-w-tn-ask { align-self: stretch; min-height: 40px; border: 1px solid var(--ss-w-line); border-radius: 20px; background: var(--ss-w-bubble); font: inherit; font-size: 13px; font-weight: 650; color: var(--ss-w-ink); cursor: pointer; padding: 8px 14px; }
18475
18530
  .ss-w-tn-ask:hover { border-color: var(--ss-w-accent); }