@sensiblestats/widget-react 0.10.0 → 0.11.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,22 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Neutral odds price-movement display on market_odds card rows.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.9.0
13
+
14
+ ## 0.10.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Fix single-league entity-card header overflow: a long competition name (e.g. "UEFA Europa Conference League") no longer wraps the season pill onto a second line. The competition name now truncates with an ellipsis (full name kept as a `title` tooltip) while the season pill stays pinned on the same row.
19
+
3
20
  ## 0.10.0
4
21
 
5
22
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -61,6 +61,9 @@ var STRINGS = {
61
61
  marketPrices: "Market prices",
62
62
  moreLines: "More lines",
63
63
  hideLines: "Hide lines",
64
+ oddsMoved: (was, now, direction) => `was ${was}, now ${now}, ${direction}`,
65
+ oddsShortened: "shortened",
66
+ oddsDrifted: "drifted",
64
67
  updatedLabel: "updated",
65
68
  inSlip: "In slip",
66
69
  slipAdded: (n) => n === void 0 ? "Added to slip" : `Added to slip (${n} selection${n === 1 ? "" : "s"})`,
@@ -91,6 +94,9 @@ var STRINGS = {
91
94
  marketPrices: "Piyasa fiyatlar\u0131",
92
95
  moreLines: "Di\u011Fer \xE7izgiler",
93
96
  hideLines: "\xC7izgileri gizle",
97
+ oddsMoved: (was, now, direction) => `\xF6nce ${was}, \u015Fimdi ${now}, ${direction}`,
98
+ oddsShortened: "d\xFC\u015Ft\xFC",
99
+ oddsDrifted: "y\xFCkseldi",
94
100
  updatedLabel: "g\xFCncellendi",
95
101
  inSlip: "Kuponda",
96
102
  slipAdded: (n) => n === void 0 ? "Kupona eklendi" : `Kupona eklendi (${n} se\xE7im)`,
@@ -137,6 +143,9 @@ function normalizeUi(cfg) {
137
143
  marketPrices: strings.marketPrices,
138
144
  moreLines: strings.moreLines,
139
145
  hideLines: strings.hideLines,
146
+ oddsMoved: strings.oddsMoved,
147
+ oddsShortened: strings.oddsShortened,
148
+ oddsDrifted: strings.oddsDrifted,
140
149
  updatedLabel: strings.updatedLabel,
141
150
  addToSlip: strings.addToSlip,
142
151
  inSlip: strings.inSlip,
@@ -280,6 +289,8 @@ function toMarketOddsVM(card) {
280
289
  const toRow = (r, i) => {
281
290
  const selection = [str(r.selectionLabel), str(r.line)].filter(Boolean).join(" ");
282
291
  const price = typeof r.price === "number" && Number.isFinite(r.price) ? r.price : void 0;
292
+ const previous = typeof r.previousPrice === "number" && Number.isFinite(r.previousPrice) ? r.previousPrice : void 0;
293
+ const direction = r.movementDirection === "shortened" || r.movementDirection === "drifted" ? r.movementDirection : void 0;
283
294
  return {
284
295
  key: `${selection}:${str(r.line) ?? ""}:${i}`,
285
296
  selection,
@@ -287,7 +298,9 @@ function toMarketOddsVM(card) {
287
298
  oddsDecimal: price,
288
299
  matchOddsId: typeof r.matchOddsId === "number" ? r.matchOddsId : void 0,
289
300
  quotedAtUtc: str(r.quotedAtUtc),
290
- isMain: r.isMainLine !== false
301
+ isMain: r.isMainLine !== false,
302
+ previousOdds: previous !== void 0 && direction !== void 0 ? previous.toFixed(2) : void 0,
303
+ movementDirection: previous !== void 0 && direction !== void 0 ? direction : void 0
291
304
  };
292
305
  };
293
306
  const vms = rows.map(toRow).filter((r) => r.selection && r.odds);
@@ -580,9 +593,9 @@ function CardBody({ c }) {
580
593
  const only = c.scopes[0];
581
594
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ss-w-ecard-body", children: [
582
595
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ss-w-ecard-tabs ss-w-ecard-tabs-static", children: [
583
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "ss-w-ecard-lead", children: [
596
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "ss-w-ecard-lead", title: only.label, children: [
584
597
  only.image ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Crest, { image: only.image }) : null,
585
- only.label
598
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ss-w-ecard-lead-txt", children: only.label })
586
599
  ] }),
587
600
  season
588
601
  ] }),
@@ -823,8 +836,18 @@ var import_react6 = require("react");
823
836
  var import_jsx_runtime10 = require("react/jsx-runtime");
824
837
  function OddsRow({ vm, row, ui, slip }) {
825
838
  const selection = vm.addToSlipEnabled ? marketOddsRowToSlipSelection(vm, row, slip.conversationId) : null;
839
+ const directionWord = row.movementDirection === "shortened" ? ui?.oddsShortened ?? "shortened" : ui?.oddsDrifted ?? "drifted";
840
+ const movementLabel = row.previousOdds !== void 0 ? ui?.oddsMoved?.(row.previousOdds, row.odds, directionWord) ?? `was ${row.previousOdds}, now ${row.odds}, ${directionWord}` : void 0;
826
841
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ss-w-mo-row", children: [
827
842
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-mo-sel", children: row.selection }),
843
+ row.previousOdds !== void 0 ? (
844
+ // Strikethrough is invisible to screen readers, so the whole was/now/direction sentence
845
+ // rides on one aria-label and the visual glyphs are hidden from the accessibility tree.
846
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "ss-w-mo-move", role: "img", "aria-label": movementLabel, children: [
847
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-mo-prev", "aria-hidden": "true", children: row.previousOdds }),
848
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-mo-arrow", "aria-hidden": "true", children: row.movementDirection === "shortened" ? "\u25BC" : "\u25B2" })
849
+ ] })
850
+ ) : null,
828
851
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-mo-price", children: row.odds }),
829
852
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SlipButton, { selection, shownOdds: row.odds, marketName: vm.market, slip, ui })
830
853
  ] });
@@ -1110,10 +1133,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
1110
1133
  .ss-w-ecard-tabs { display: flex; align-items: stretch; gap: 3px; border-bottom: 1px solid var(--ss-w-line); margin-bottom: 9px; flex-wrap: wrap; }
1111
1134
  .ss-w-ecard-tab { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 620; color: var(--ss-w-faint); background: none; border: none; cursor: pointer; padding: 5px 8px 8px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
1112
1135
  .ss-w-ecard-tab[aria-selected="true"] { color: var(--ss-w-ink); border-bottom-color: var(--ss-w-accent); }
1113
- .ss-w-ecard-tabs-static { align-items: center; }
1114
- .ss-w-ecard-lead { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 640; color: var(--ss-w-ink); padding: 4px 2px 8px; min-width: 0; }
1136
+ .ss-w-ecard-tabs-static { align-items: center; flex-wrap: nowrap; }
1137
+ .ss-w-ecard-lead { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 640; color: var(--ss-w-ink); padding: 4px 2px 8px; min-width: 0; flex: 1; }
1138
+ .ss-w-ecard-lead-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1115
1139
  .ss-w-ecard-crest { width: 15px; height: 15px; flex: none; display: block; border-radius: 4px; background-size: cover; background-position: center; }
1116
- .ss-w-ecard-season { margin-left: auto; align-self: center; margin-bottom: 5px; font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 13%, var(--ss-w-panel)); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
1140
+ .ss-w-ecard-season { flex: none; margin-left: auto; align-self: center; margin-bottom: 5px; font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 13%, var(--ss-w-panel)); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
1117
1141
  .ss-w-ecard-tabs-static .ss-w-ecard-season { margin-bottom: 4px; }
1118
1142
 
1119
1143
  .ss-w-ecard-stats { display: flex; flex-direction: column; gap: 4px; }
@@ -1181,6 +1205,12 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
1181
1205
  .ss-w-mo-row:last-child { border-bottom: none; }
1182
1206
  .ss-w-mo-sel { font-size: 12.5px; font-weight: 600; color: var(--ss-w-ink); }
1183
1207
  .ss-w-mo-price { margin-left: auto; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; color: var(--ss-w-accent); }
1208
+ /* Movement: BOTH directions share --ss-w-faint on purpose. Green-good/red-bad would frame a
1209
+ shortening price as a discount, which inverts what it actually means for the bettor. */
1210
+ .ss-w-mo-move { margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px; color: var(--ss-w-faint); }
1211
+ .ss-w-mo-prev { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 12px; text-decoration: line-through; }
1212
+ .ss-w-mo-arrow { font-size: 9px; line-height: 1; }
1213
+ .ss-w-mo-move + .ss-w-mo-price { margin-left: 0; }
1184
1214
  .ss-w-mo-row .ss-w-slip { margin: 0; }
1185
1215
  .ss-w-mo-foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ss-w-faint); }
1186
1216