@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/dist/index.js CHANGED
@@ -1179,7 +1179,7 @@ function parseOddsFormat(value) {
1179
1179
  }
1180
1180
 
1181
1181
  // src/version.generated.ts
1182
- var WIDGET_REACT_VERSION = "0.124.1";
1182
+ var WIDGET_REACT_VERSION = "0.124.2";
1183
1183
 
1184
1184
  // src/config.ts
1185
1185
  function hostTag(cfg) {
@@ -5847,7 +5847,10 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
5847
5847
  children: [
5848
5848
  settled ? /* @__PURE__ */ jsx6("span", { className: "ss-w-mol-tick", "aria-hidden": "true", children: "\u2713" }) : null,
5849
5849
  price.label ? /* @__PURE__ */ jsx6("span", { className: "ss-w-mol-lab", children: price.label }) : null,
5850
- /* @__PURE__ */ jsx6("span", { children: formatOdds(selection.forms, oddsFormat) })
5850
+ /* @__PURE__ */ jsxs5("span", { className: price.valueClass, children: [
5851
+ price.lead,
5852
+ formatOdds(selection.forms, oddsFormat)
5853
+ ] })
5851
5854
  ]
5852
5855
  }
5853
5856
  ) : /* @__PURE__ */ jsx6(
@@ -5963,6 +5966,9 @@ function useNextKickoffRender(kickoffs) {
5963
5966
 
5964
5967
  // src/components/OddsMovementBadge.tsx
5965
5968
  import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
5969
+ function oddsMovedLabel(previous, current, direction2, ui) {
5970
+ return ui.oddsMoved(previous, current, direction2 === "shortened" ? ui.oddsShortened : ui.oddsDrifted);
5971
+ }
5966
5972
  function OddsMovementBadge({
5967
5973
  previous,
5968
5974
  current,
@@ -11315,10 +11321,10 @@ function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
11315
11321
 
11316
11322
  // src/components/TennisFixtureRow.tsx
11317
11323
  import { Fragment as Fragment20, jsx as jsx84, jsxs as jsxs79 } from "react/jsx-runtime";
11318
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip }) {
11324
+ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11319
11325
  const { oddsFormat } = useOddsSettings();
11320
11326
  const added = useSlipState()?.added;
11321
- const slipAllowed = !!slip && price.addToSlipEnabled && !price.isLive && slipOpenFor(slip, "tennis");
11327
+ const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11322
11328
  const label = formatOdds(forms, oddsFormat);
11323
11329
  const selection = slipAllowed && oddsId != null ? {
11324
11330
  matchOddsId: oddsId,
@@ -11331,17 +11337,32 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11331
11337
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11332
11338
  } : null;
11333
11339
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11334
- return selection ? /* @__PURE__ */ jsx84(
11335
- SlipButton,
11336
- {
11337
- selection,
11338
- marketDeveloperName: "match_winner",
11339
- selectionLabel: player.slice(0, 64),
11340
- slip,
11341
- ui,
11342
- price: { ariaLabel: `${player} ${label}` }
11343
- }
11344
- ) : /* @__PURE__ */ jsxs79("span", { className: inSlip ? "ss-w-trow-price ss-w-trow-price--in" : "ss-w-trow-price", children: [
11340
+ const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11341
+ if (selection) {
11342
+ return /* @__PURE__ */ jsx84(
11343
+ SlipButton,
11344
+ {
11345
+ selection,
11346
+ marketDeveloperName: "match_winner",
11347
+ selectionLabel: player.slice(0, 64),
11348
+ slip,
11349
+ ui,
11350
+ price: name !== void 0 ? { ariaLabel, label: name, valueClass: "ss-w-tn-pv", lead } : { ariaLabel }
11351
+ }
11352
+ );
11353
+ }
11354
+ const cls = inSlip ? "ss-w-trow-price ss-w-trow-price--in" : "ss-w-trow-price";
11355
+ return name !== void 0 ? /* @__PURE__ */ jsxs79("span", { className: cls, children: [
11356
+ /* @__PURE__ */ jsxs79("span", { className: "ss-w-vh", children: [
11357
+ player,
11358
+ " "
11359
+ ] }),
11360
+ /* @__PURE__ */ jsx84("span", { className: "ss-w-mol-lab", "aria-hidden": "true", children: name }),
11361
+ /* @__PURE__ */ jsxs79("span", { className: "ss-w-tn-pv", children: [
11362
+ lead,
11363
+ label
11364
+ ] })
11365
+ ] }) : /* @__PURE__ */ jsxs79("span", { className: cls, children: [
11345
11366
  /* @__PURE__ */ jsxs79("span", { className: "ss-w-vh", children: [
11346
11367
  player,
11347
11368
  " "
@@ -11416,19 +11437,24 @@ function WinnerPrice({ match, t, price, ui, slip }) {
11416
11437
  return /* @__PURE__ */ jsxs80("section", { className: "ss-w-tn-sec", children: [
11417
11438
  /* @__PURE__ */ jsx85("h4", { className: "ss-w-tn-h", children: t.labels.matchWinner }),
11418
11439
  price && common ? /* @__PURE__ */ jsxs80(Fragment21, { children: [
11419
- /* @__PURE__ */ jsx85("div", { className: "ss-w-tn-prices", children: sides.map((s) => /* @__PURE__ */ jsxs80("div", { className: "ss-w-tn-pside", children: [
11420
- /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-pname", children: s.player.shortName }),
11421
- /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: s.forms, value: s.value, oddsId: s.oddsId, player: s.player.name }) }),
11422
- /* @__PURE__ */ jsx85(
11423
- OddsMovementBadge,
11440
+ /* @__PURE__ */ jsx85("div", { className: "ss-w-tn-prices", children: sides.map((s) => {
11441
+ const previous = s.previous ? formatOdds(s.previous, oddsFormat) : void 0;
11442
+ const current = formatOdds(s.forms, oddsFormat);
11443
+ const hasMove = previous !== void 0 && s.dir !== void 0;
11444
+ return /* @__PURE__ */ jsx85("div", { className: "ss-w-tn-pside", children: /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ jsx85(
11445
+ TennisSidePrice,
11424
11446
  {
11425
- previous: s.previous ? formatOdds(s.previous, oddsFormat) : void 0,
11426
- current: formatOdds(s.forms, oddsFormat),
11427
- direction: s.dir,
11428
- ui
11447
+ ...common,
11448
+ forms: s.forms,
11449
+ value: s.value,
11450
+ oddsId: s.oddsId,
11451
+ player: s.player.name,
11452
+ name: s.player.shortName,
11453
+ lead: /* @__PURE__ */ jsx85(OddsMovementBadge, { previous, current, direction: s.dir, ui }),
11454
+ movedLabel: hasMove ? oddsMovedLabel(previous, current, s.dir, ui) : void 0
11429
11455
  }
11430
- )
11431
- ] }, s.player.playerId)) }),
11456
+ ) }) }, s.player.playerId);
11457
+ }) }),
11432
11458
  /* @__PURE__ */ jsxs80("p", { className: "ss-w-tn-note", children: [
11433
11459
  since ? `${moved ? ui.tennis.movedSince(since) : ui.tennis.unchangedSince(since)} \xB7 ` : "",
11434
11460
  ui.tennis.updated(ui.bettingKickoff(price.quotedAtUtc).time)
@@ -11465,12 +11491,32 @@ var SCORE = /(\d+[-–]\d+(?:\(\d+\))?)/;
11465
11491
  function wholeScores(text2) {
11466
11492
  return text2.split(SCORE).map((part, i) => i % 2 === 1 ? /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-set", children: part }, i) : part);
11467
11493
  }
11494
+ function Meeting({ m, t, ui }) {
11495
+ const where = [
11496
+ String(m.year),
11497
+ m.tournamentName,
11498
+ m.round ? ui.tennis.round[m.round] ?? m.round : null,
11499
+ m.surface ? surfaceLabel(ui, m.surface) : null
11500
+ ].filter(Boolean).join(" \xB7 ");
11501
+ const winner = m.winnerId === t.p1.playerId ? t.p1.shortName : m.winnerId === t.p2.playerId ? t.p2.shortName : null;
11502
+ return /* @__PURE__ */ jsxs80("li", { className: "ss-w-tn-meeting", children: [
11503
+ /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-mwhere", children: where }),
11504
+ /* @__PURE__ */ jsxs80("span", { className: "ss-w-tn-mwho", children: [
11505
+ winner ? /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-mname", children: winner }) : null,
11506
+ m.score ? /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-set", children: m.score }) : null
11507
+ ] })
11508
+ ] });
11509
+ }
11468
11510
  function HeadToHead({ t, ui }) {
11469
11511
  if (!t.labels.headToHead) return null;
11512
+ const h = t.headToHead;
11513
+ const meetings = (h?.meetings?.length ? h.meetings : h?.last ? [h.last] : []).slice(0, 3);
11470
11514
  return /* @__PURE__ */ jsxs80("section", { className: "ss-w-tn-sec", children: [
11471
- /* @__PURE__ */ jsx85("h4", { className: "ss-w-tn-h", children: ui.tennis.headToHead }),
11472
- /* @__PURE__ */ jsx85("p", { className: "ss-w-tn-leader", children: wholeScores(t.labels.headToHead) }),
11473
- t.labels.lastMeeting && /* @__PURE__ */ jsx85("p", { className: "ss-w-tn-last", children: wholeScores(t.labels.lastMeeting) })
11515
+ /* @__PURE__ */ jsxs80("div", { className: "ss-w-tn-h2h-head", children: [
11516
+ /* @__PURE__ */ jsx85("h4", { className: "ss-w-tn-h", children: ui.tennis.headToHead }),
11517
+ /* @__PURE__ */ jsx85("span", { className: "ss-w-tn-leader", children: wholeScores(t.labels.headToHead) })
11518
+ ] }),
11519
+ meetings.length > 0 && /* @__PURE__ */ jsx85("ul", { className: "ss-w-tn-meetings", role: "list", children: meetings.map((m, i) => /* @__PURE__ */ jsx85(Meeting, { m, t, ui }, i)) })
11474
11520
  ] });
11475
11521
  }
11476
11522
  function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
@@ -11490,7 +11536,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
11490
11536
  };
11491
11537
  onAsk(t.askPrompt, grounding, "match_sheet");
11492
11538
  };
11493
- return /* @__PURE__ */ jsx85("div", { className: "ss-w-mon-item", children: /* @__PURE__ */ jsxs80("div", { className: "ss-w-mon ss-w-tn-card", children: [
11539
+ return /* @__PURE__ */ jsx85("div", { className: "ss-w-mon-item", children: /* @__PURE__ */ jsxs80("div", { className: "ss-w-mon ss-w-tn-card", lang: ui.locale, children: [
11494
11540
  /* @__PURE__ */ jsxs80("div", { className: "ss-w-mon-top", children: [
11495
11541
  match.phase === "live" && /* @__PURE__ */ jsxs80("span", { className: "ss-w-fandash-live-pill", children: [
11496
11542
  /* @__PURE__ */ jsx85("span", { className: "ss-w-fandash-live-dot", "aria-hidden": "true" }),
@@ -11510,7 +11556,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
11510
11556
  (round || surface) && /* @__PURE__ */ jsx85("p", { className: "ss-w-tn-meta", children: [round, surface].filter(Boolean).join(" \xB7 ") }),
11511
11557
  /* @__PURE__ */ jsxs80("div", { className: "ss-w-tn-players", children: [
11512
11558
  /* @__PURE__ */ jsx85(Player2, { side: t.p1, rankRace: t.labels.p1RankRace }),
11513
- /* @__PURE__ */ jsx85("span", { className: "ss-w-mon-vs", children: ui.venue.home }),
11559
+ /* @__PURE__ */ jsx85("span", { className: "ss-w-mon-vs", children: ui.tennis.vs }),
11514
11560
  /* @__PURE__ */ jsx85(Player2, { side: t.p2, rankRace: t.labels.p2RankRace })
11515
11561
  ] }),
11516
11562
  /* @__PURE__ */ jsx85(WinnerPrice, { match, t, price: t.price, ui, slip }),
@@ -18410,14 +18456,18 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18410
18456
  .ss-w-tn-rank { font-size: 10.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18411
18457
  .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; }
18412
18458
  .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; }
18413
- .ss-w-tn-prices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
18414
- .ss-w-tn-pside { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
18415
- .ss-w-tn-pname { font-size: 11px; font-weight: 650; color: var(--ss-w-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
18416
- .ss-w-tn-pside .ss-w-trow-prices { flex-direction: row; }
18417
- .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; }
18418
- .ss-w-tn-pside .ss-w-trow-price { border: none; background: none; }
18419
- .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip { flex: 1; }
18420
- .ss-w-tn-pside .ss-w-move { justify-content: center; }
18459
+ .ss-w-tn-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
18460
+ .ss-w-tn-pside { display: flex; min-width: 0; }
18461
+ .ss-w-tn-pside .ss-w-trow-prices { flex: 1; min-width: 0; }
18462
+ .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; }
18463
+ .ss-w-tn-pside .ss-w-trow-price { padding: 9px 11px; border: none; background: none; }
18464
+ .ss-w-tn-pside .ss-w-trow-prices .ss-w-slip { flex: 1; min-width: 0; }
18465
+ .ss-w-tn-pside .ss-w-trow-prices .ss-w-toast { top: calc(100% + 6px); right: 0; transform: none; }
18466
+ .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); }
18467
+ .ss-w-tn-pside .ss-w-mol-tick { flex: none; margin-right: -2px; }
18468
+ .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; }
18469
+ .ss-w-tn-pside .ss-w-move { gap: 3px; font-weight: 600; }
18470
+ .ss-w-tn-pside .ss-w-move-prev { font-size: 11px; }
18421
18471
  .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; }
18422
18472
  .ss-w-tn-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,auto) minmax(0,1fr); align-items: center; gap: 6px 8px; }
18423
18473
  .ss-w-tn-row { display: contents; }
@@ -18430,8 +18480,13 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18430
18480
  .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); }
18431
18481
  .ss-w-tn-fchip--l { background: var(--ss-w-neg); }
18432
18482
  .ss-w-tn-fchip--w { background: var(--ss-w-pos); }
18433
- .ss-w-tn-leader { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; color: var(--ss-w-ink); overflow-wrap: anywhere; }
18434
- .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; }
18483
+ .ss-w-tn-h2h-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
18484
+ .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; }
18485
+ .ss-w-tn-meetings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
18486
+ .ss-w-tn-meeting { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
18487
+ .ss-w-tn-mwhere { min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--ss-w-faint); overflow-wrap: anywhere; }
18488
+ .ss-w-tn-mname { min-width: 0; overflow-wrap: anywhere; }
18489
+ .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); }
18435
18490
  .ss-w-tn-set { white-space: nowrap; font-variant-numeric: tabular-nums; }
18436
18491
  .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; }
18437
18492
  .ss-w-tn-ask:hover { border-color: var(--ss-w-accent); }