@sensiblestats/widget-react 0.40.0 → 0.42.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,17 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Two-tier layout for betting-insight cards so nothing truncates on a narrow panel: the competition, kickoff and match pin sit on a quiet meta line above a full-width fixture line (long club names no longer clip), and the market label gets its own line above the selection · odds · slip · pin pick row. The market-odds card's fixture line adopts the same hero weight so both card types read consistently.
8
+
9
+ ## 0.41.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 286bdc0: Add a match pin to the chat market-odds card. The card now mirrors the two-pin betting-insight card: the header pin tracks the match, and a second pin on the market line tracks the odds. The live odds panel is unchanged — it keeps its single market pin.
14
+
3
15
  ## 0.40.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1940,55 +1940,60 @@ function InsightCard({ it, ui, slip, monitor }) {
1940
1940
  const kickoff = it.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(it.kickoffUtc) : void 0;
1941
1941
  const hasNamedTeams = !!it.homeTeamName && !!it.awayTeamName;
1942
1942
  const leftIsFixture = hasNamedTeams || !!it.fixture;
1943
- const compInMeta = leftIsFixture && !!it.competition;
1944
1943
  const showPin = !!monitor && it.pinEnabled;
1945
1944
  const showHeader = leftIsFixture || !!it.competition || live || !!kickoff || showPin;
1945
+ const headerControls = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1946
+ live ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-live", children: [
1947
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
1948
+ ui?.liveLabel ?? "Live"
1949
+ ] }) : null,
1950
+ kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-kick", children: [
1951
+ kickoff.dayLabel,
1952
+ " ",
1953
+ kickoff.time
1954
+ ] }) : null,
1955
+ showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: it.matchId } }) : null
1956
+ ] });
1946
1957
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-binsight", children: [
1947
- showHeader ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-header", children: [
1958
+ showHeader ? leftIsFixture ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-head", children: [
1959
+ it.competition || live || kickoff || showPin ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-meta", children: [
1960
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-meta-left", children: it.competition ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1961
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Crest2, { kind: "comp", url: it.competitionCrest, name: it.competition }),
1962
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-comp", children: it.competition })
1963
+ ] }) : null }),
1964
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-meta-right", children: headerControls })
1965
+ ] }) : null,
1966
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ss-w-bi-fixture-line", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardFixture, { it }) })
1967
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-header", children: [
1948
1968
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-header-left", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardFixture, { it }) }),
1949
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-header-right", children: [
1950
- live ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-live", children: [
1951
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
1952
- ui?.liveLabel ?? "Live"
1953
- ] }) : null,
1954
- compInMeta ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-comp-meta", title: it.competition, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Crest2, { kind: "comp", url: it.competitionCrest, name: it.competition }) }) : null,
1955
- kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-kick", children: [
1956
- kickoff.dayLabel,
1957
- " ",
1958
- kickoff.time
1959
- ] }) : null,
1960
- showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: it.matchId } }) : null
1961
- ] })
1969
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-header-right", children: headerControls })
1962
1970
  ] }) : null,
1963
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-action-row", children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-pick", children: [
1965
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-market", children: it.market }),
1966
- it.selection ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1967
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-pick-dot", "aria-hidden": "true", children: "\xB7" }),
1968
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-sel", children: it.selection })
1969
- ] }) : null
1970
- ] }),
1971
- it.odds ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-odds", children: [
1972
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: it.odds }),
1973
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OddsMovementBadge, { previous: it.previousOdds, current: it.odds, direction: it.movementDirection, ui }),
1974
- it.bookmaker ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-book", children: it.bookmaker }) : null
1975
- ] }) : null,
1976
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AddToSlipButton, { it, slip, ui }),
1977
- showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1978
- PinToggle,
1979
- {
1980
- ui,
1981
- monitor,
1982
- pin: {
1983
- kind: "selection",
1984
- matchId: it.matchId,
1985
- marketDeveloperName: it.marketDeveloperName,
1986
- selectionLabel: it.selectionLabel,
1987
- line: it.line,
1988
- matchOddsId: it.matchOddsId
1971
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-action", children: [
1972
+ it.market ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-market", children: it.market }) : null,
1973
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-pick-row", children: [
1974
+ it.selection ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-sel", children: it.selection }) : null,
1975
+ it.odds ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-odds", children: [
1976
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: it.odds }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OddsMovementBadge, { previous: it.previousOdds, current: it.odds, direction: it.movementDirection, ui }),
1978
+ it.bookmaker ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-book", children: it.bookmaker }) : null
1979
+ ] }) : null,
1980
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AddToSlipButton, { it, slip, ui }),
1981
+ showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1982
+ PinToggle,
1983
+ {
1984
+ ui,
1985
+ monitor,
1986
+ pin: {
1987
+ kind: "selection",
1988
+ matchId: it.matchId,
1989
+ marketDeveloperName: it.marketDeveloperName,
1990
+ selectionLabel: it.selectionLabel,
1991
+ line: it.line,
1992
+ matchOddsId: it.matchOddsId
1993
+ }
1989
1994
  }
1990
- }
1991
- ) : null
1995
+ ) : null
1996
+ ] })
1992
1997
  ] }),
1993
1998
  it.isMarketFloor ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-floor", children: ui?.marketFloorLabel ?? "Market price \xB7 not a value pick" }) : null,
1994
1999
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ReasonStrip, { it, ui }),
@@ -2022,6 +2027,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
2022
2027
  const kickoff = vm.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
2023
2028
  const hasNamedTeams = !!vm.homeTeamName && !!vm.awayTeamName;
2024
2029
  const showPin = !!monitor && vm.pinEnabled;
2030
+ const showMarketPin = showPin && !pinRef;
2025
2031
  const showHeader = !!vm.competition || vm.isLive || !!kickoff || showPin;
2026
2032
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: hideHeader ? "ss-w-mocard ss-w-mocard--bare" : "ss-w-mocard", children: [
2027
2033
  !hideHeader && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
@@ -2045,12 +2051,12 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
2045
2051
  {
2046
2052
  ui,
2047
2053
  monitor,
2048
- pin: pinRef ?? { kind: "market", matchId: vm.matchId, marketDeveloperName: vm.marketDeveloperName, line: vm.mainLine }
2054
+ pin: pinRef ?? { kind: "match", matchId: vm.matchId }
2049
2055
  }
2050
2056
  ) : null
2051
2057
  ] })
2052
2058
  ] }) : null,
2053
- hasNamedTeams || vm.fixture || vm.market ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-mo-sub", children: [
2059
+ hasNamedTeams || vm.fixture || vm.market || showMarketPin ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-mo-sub", children: [
2054
2060
  hasNamedTeams ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-bi-fixture", children: [
2055
2061
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Crest2, { kind: "team", url: vm.homeCrest, name: vm.homeTeamName }),
2056
2062
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-bi-team", children: vm.homeTeamName }),
@@ -2058,7 +2064,17 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
2058
2064
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-bi-team", children: vm.awayTeamName }),
2059
2065
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Crest2, { kind: "team", url: vm.awayCrest, name: vm.awayTeamName })
2060
2066
  ] }) : vm.fixture ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-mo-teams", children: vm.fixture }) : null,
2061
- vm.market ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-mo-market", children: vm.market }) : null
2067
+ vm.market || showMarketPin ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-mo-market-row", children: [
2068
+ vm.market ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-mo-market", children: vm.market }) : null,
2069
+ showMarketPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2070
+ PinToggle,
2071
+ {
2072
+ ui,
2073
+ monitor,
2074
+ pin: { kind: "market", matchId: vm.matchId, marketDeveloperName: vm.marketDeveloperName, line: vm.mainLine }
2075
+ }
2076
+ ) : null
2077
+ ] }) : null
2062
2078
  ] }) : null
2063
2079
  ] }),
2064
2080
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-mo-rows", children: [
@@ -3687,10 +3703,18 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3687
3703
  .ss-w-binsights { display: flex; flex-direction: column; gap: 7px; }
3688
3704
  .ss-w-binsight { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; border-left: 3px solid var(--ss-w-accent); padding: 9px 11px; display: flex; flex-direction: column; gap: 8px; }
3689
3705
 
3690
- /* row 1: competition logo + name on the left, live badge + kickoff on the right */
3706
+ /* header, competition-hero fallback: comp on the left, live badge + kickoff + pin on the right,
3707
+ all on one line (used when there is no fixture, and by MarketOddsCardList) */
3691
3708
  .ss-w-bi-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--ss-w-line); }
3692
3709
  .ss-w-bi-header-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12.5px; font-weight: 650; color: var(--ss-w-ink); }
3693
3710
  .ss-w-bi-header-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
3711
+ /* two-tier header: a quiet meta line (competition + kickoff + match pin) stacked above the
3712
+ fixture, so long club names get the whole width to themselves and stop truncating (u350) */
3713
+ .ss-w-bi-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 7px; border-bottom: 1px solid var(--ss-w-line); }
3714
+ .ss-w-bi-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
3715
+ .ss-w-bi-meta-left { display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
3716
+ .ss-w-bi-meta-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
3717
+ .ss-w-bi-fixture-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
3694
3718
  .ss-w-bi-comp { font-size: 10.5px; color: var(--ss-w-faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
3695
3719
  .ss-w-bi-kick { font-size: 10.5px; font-weight: 600; color: var(--ss-w-faint); white-space: nowrap; flex: none; }
3696
3720
  .ss-w-bi-live { font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #c0392b; border-radius: 4px; padding: 1px 5px; display: inline-flex; align-items: center; gap: 4px; flex: none; }
@@ -3702,24 +3726,24 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3702
3726
  .ss-w-bi-crest { width: 24px; height: 24px; flex: none; display: block; border-radius: 50%; object-fit: contain; }
3703
3727
  .ss-w-bi-crest-mono { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
3704
3728
 
3705
- /* header fixture atoms (team hero lives in .ss-w-bi-header-left; comp demotes to the meta) */
3729
+ /* fixture atoms -- crest-flanked team pair; shared by the insight fixture line and MarketOddsCardList */
3706
3730
  .ss-w-bi-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3707
3731
  .ss-w-bi-vs { font-size: 10px; font-weight: 600; color: var(--ss-w-faint); flex: none; }
3708
3732
  .ss-w-bi-fixture-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3709
- .ss-w-bi-comp-meta { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 0; }
3710
- /* shared crest-flanked team row, still consumed by MarketOddsCardList */
3711
- .ss-w-bi-fixture { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12px; font-weight: 650; color: var(--ss-w-ink); }
3712
-
3713
- /* row 2: one action line -- market \xB7 selection (left, market ellipsises first), odds, slip button */
3714
- .ss-w-bi-action-row { display: flex; align-items: center; gap: 9px; }
3715
- .ss-w-bi-pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
3716
- .ss-w-bi-market { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ss-w-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3717
- .ss-w-bi-pick-dot { flex: none; color: var(--ss-w-faint); font-weight: 700; }
3718
- .ss-w-bi-sel { flex: none; font-size: 12.5px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); white-space: nowrap; }
3719
- .ss-w-bi-odds { flex: none; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
3733
+ /* shared crest-flanked team row (MarketOddsCardList); matches .ss-w-bi-fixture-line's hero weight
3734
+ so the fixture reads the same on both card types (u350) */
3735
+ .ss-w-bi-fixture { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
3736
+
3737
+ /* row 2, two-tier: the market label owns a full-width line above the pick row (selection grows
3738
+ left, odds + slip + pin sit right), so neither the market name nor the fixture clips (u350) */
3739
+ .ss-w-bi-action { display: flex; flex-direction: column; gap: 6px; }
3740
+ .ss-w-bi-market { font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); min-width: 0; }
3741
+ .ss-w-bi-pick-row { display: flex; align-items: center; gap: 9px; }
3742
+ .ss-w-bi-sel { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
3743
+ .ss-w-bi-odds { flex: none; margin-left: auto; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
3720
3744
  .ss-w-bi-odds b { font-size: 20px; font-family: ui-monospace, monospace; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-accent); line-height: 1.05; }
3721
3745
  .ss-w-bi-book { font-size: 9.5px; color: var(--ss-w-faint); }
3722
- .ss-w-bi-action-row .ss-w-slip { flex: none; }
3746
+ .ss-w-bi-pick-row .ss-w-slip { flex: none; }
3723
3747
 
3724
3748
  /* row 3: bar-chart glyph + reasoning prose + stats-expander chevron, in a subtle strip */
3725
3749
  .ss-w-bi-reason { display: flex; align-items: flex-start; gap: 8px; background: var(--ss-w-bubble); border-radius: 10px; padding: 8px 10px; }
@@ -3756,7 +3780,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3756
3780
  .ss-w-mocard--bare { border: none; border-radius: 0; padding: 0; background: none; }
3757
3781
  .ss-w-mo-sub { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
3758
3782
  .ss-w-mo-teams { font-size: 13px; font-weight: 650; color: var(--ss-w-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3759
- .ss-w-mo-market { font-size: 11.5px; font-weight: 600; color: var(--ss-w-faint); }
3783
+ .ss-w-mo-market-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
3784
+ .ss-w-mo-market { font-size: 11.5px; font-weight: 600; color: var(--ss-w-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3760
3785
  .ss-w-mo-more { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--ss-w-accent); font: inherit; font-size: 11.5px; font-weight: 600; padding: 2px 0; cursor: pointer; }
3761
3786
  .ss-w-mo-more:hover { text-decoration: underline; }
3762
3787
  .ss-w-mo-more-chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }