@sensiblestats/widget-react 0.95.1 → 0.97.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 +17 -0
- package/dist/index.cjs +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1099,7 +1099,7 @@ function isEnglishLocale(locale) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
// src/version.generated.ts
|
|
1102
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1102
|
+
var WIDGET_REACT_VERSION = "0.97.0";
|
|
1103
1103
|
|
|
1104
1104
|
// src/config.ts
|
|
1105
1105
|
function normalizeUi(cfg) {
|
|
@@ -2681,7 +2681,7 @@ function clearConversation(storageKey) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
|
|
2683
2683
|
// src/presets.ts
|
|
2684
|
-
var CLIENT_CAPABILITIES = ["price_presets", "price_presets_open", "limit_notice", "nba_insight", "nba_insight_v2"];
|
|
2684
|
+
var CLIENT_CAPABILITIES = ["price_presets", "price_presets_open", "limit_notice", "nba_insight", "nba_insight_v2", "basketball_icon"];
|
|
2685
2685
|
var PRICE_TILE_PREFIX = "goal-preset-";
|
|
2686
2686
|
function isPriceTile(tile) {
|
|
2687
2687
|
const id = tile.signal?.entityId;
|
|
@@ -4286,7 +4286,8 @@ var DASHBOARD_EMOJI = {
|
|
|
4286
4286
|
"chart-bar": "\u{1F4CA}",
|
|
4287
4287
|
chat: "\u{1F4AC}",
|
|
4288
4288
|
fire: "\u{1F525}",
|
|
4289
|
-
sparkle: "\u2728"
|
|
4289
|
+
sparkle: "\u2728",
|
|
4290
|
+
basketball: "\u{1F3C0}"
|
|
4290
4291
|
};
|
|
4291
4292
|
function DashboardIcon({ name }) {
|
|
4292
4293
|
const glyph = Object.prototype.hasOwnProperty.call(DASHBOARD_EMOJI, name) ? DASHBOARD_EMOJI[name] : DASHBOARD_EMOJI.target;
|
|
@@ -7544,18 +7545,20 @@ function Roster({ bundle, players, side, ui, slip }) {
|
|
|
7544
7545
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
7545
7546
|
const [side, setSide] = useState34("home");
|
|
7546
7547
|
const [, setTick] = useState34(0);
|
|
7547
|
-
const
|
|
7548
|
+
const pre = preTip(match);
|
|
7549
|
+
const live = match.phase === "live";
|
|
7550
|
+
const open = pre || live;
|
|
7548
7551
|
useEffect25(() => {
|
|
7549
7552
|
if (open) monitor.loadPlayerProps?.(match.matchId);
|
|
7550
7553
|
}, [match.matchId, match.asOfUtc, open]);
|
|
7551
7554
|
useEffect25(() => {
|
|
7552
|
-
if (!
|
|
7555
|
+
if (!pre || !match.kickoffUtc) return;
|
|
7553
7556
|
const wait = Math.min(Math.max(Date.parse(match.kickoffUtc) - Date.now(), 0), MAX_TIMER_MS);
|
|
7554
7557
|
const id = setTimeout(() => setTick((t) => t + 1), wait);
|
|
7555
7558
|
return () => clearTimeout(id);
|
|
7556
|
-
}, [
|
|
7559
|
+
}, [pre, match.kickoffUtc]);
|
|
7557
7560
|
const bundle = monitor.playerProps?.[match.matchId]?.bundle;
|
|
7558
|
-
if (!open || !bundle || bundle.players.length === 0) return null;
|
|
7561
|
+
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
7559
7562
|
const bySide = (s) => bundle.players.filter((p) => p.side === s);
|
|
7560
7563
|
const other = side === "home" ? "away" : "home";
|
|
7561
7564
|
const shown = bySide(side).length > 0 ? side : other;
|