@sensiblestats/widget-react 0.5.0 → 0.6.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 +15 -0
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Show competition name on betting insight cards. This shipped to master in
|
|
8
|
+
`6d629e6b` but never reached npm because the version wasn't bumped, so the
|
|
9
|
+
release workflow's `--tolerate-republish` skipped every package. This changeset
|
|
10
|
+
bumps all three so the change actually publishes (widget-embed re-bundles
|
|
11
|
+
widget-react, so it must be republished too).
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @sensiblestats/widget-sdk@0.5.0
|
|
17
|
+
|
|
3
18
|
## 0.5.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -184,6 +184,7 @@ function toInsightVM(insight) {
|
|
|
184
184
|
const home = str(insight.homeTeamName);
|
|
185
185
|
const away = str(insight.awayTeamName);
|
|
186
186
|
const fixture = home && away ? `${home} vs ${away}` : void 0;
|
|
187
|
+
const competition = str(insight.competitionName);
|
|
187
188
|
const scopes = Array.isArray(insight.scopes) ? insight.scopes.map((s) => ({ key: str(s.key), label: str(s.label), stats: readStatCells(s.stats) })).filter((s) => !!s.key && !!s.label) : void 0;
|
|
188
189
|
return {
|
|
189
190
|
id: str(insight.insightId) ?? `${str(insight.ruleId) ?? "insight"}:${num(insight.matchId) ?? ""}`,
|
|
@@ -195,6 +196,7 @@ function toInsightVM(insight) {
|
|
|
195
196
|
isLive: insight.odds?.isLive === true,
|
|
196
197
|
phase: str(insight.phase),
|
|
197
198
|
fixture,
|
|
199
|
+
competition,
|
|
198
200
|
scopes,
|
|
199
201
|
text: str(insight.text) ?? "",
|
|
200
202
|
stats: readStatCells(insight.stats),
|
|
@@ -476,12 +478,13 @@ function ScopedStats({ scopes, ui }) {
|
|
|
476
478
|
function InsightCard({ it, ui }) {
|
|
477
479
|
const live = it.isLive || it.phase === "live";
|
|
478
480
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ss-w-binsight", children: [
|
|
479
|
-
live || it.fixture ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ss-w-bi-status", children: [
|
|
481
|
+
live || it.fixture || it.competition ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ss-w-bi-status", children: [
|
|
480
482
|
live ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "ss-w-bi-live", children: [
|
|
481
483
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
|
|
482
484
|
ui?.liveLabel ?? "Live"
|
|
483
485
|
] }) : null,
|
|
484
|
-
it.fixture ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-bi-fixture", children: it.fixture }) : null
|
|
486
|
+
it.fixture ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-bi-fixture", children: it.fixture }) : null,
|
|
487
|
+
it.competition ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-bi-comp", children: it.competition }) : null
|
|
485
488
|
] }) : null,
|
|
486
489
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ss-w-bi-head", children: [
|
|
487
490
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "ss-w-bi-mkt", children: [
|
|
@@ -744,6 +747,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
744
747
|
.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: 6px; }
|
|
745
748
|
.ss-w-bi-status { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
746
749
|
.ss-w-bi-fixture { font-size: 11px; color: var(--ss-w-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
750
|
+
.ss-w-bi-comp { font-size: 10.5px; color: var(--ss-w-faint); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
747
751
|
.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; }
|
|
748
752
|
.ss-w-bi-live-dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
|
|
749
753
|
.ss-w-bi-head { display: flex; align-items: flex-start; gap: 10px; }
|