@maestro_io/maestro-web-sdk 4.0.1 → 4.0.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/1.maestro-web-sdk.esm.js +2 -0
- package/dist/1.maestro-web-sdk.esm.js.map +1 -0
- package/dist/1.maestro-web-sdk.umd.js +2 -0
- package/dist/1.maestro-web-sdk.umd.js.map +1 -0
- package/dist/10.maestro-web-sdk.esm.js +2 -0
- package/dist/10.maestro-web-sdk.esm.js.map +1 -0
- package/dist/10.maestro-web-sdk.umd.js +2 -0
- package/dist/10.maestro-web-sdk.umd.js.map +1 -0
- package/dist/11.maestro-web-sdk.esm.js +2 -0
- package/dist/11.maestro-web-sdk.esm.js.map +1 -0
- package/dist/11.maestro-web-sdk.umd.js +2 -0
- package/dist/11.maestro-web-sdk.umd.js.map +1 -0
- package/dist/12.maestro-web-sdk.esm.js +2 -0
- package/dist/12.maestro-web-sdk.esm.js.map +1 -0
- package/dist/12.maestro-web-sdk.umd.js +2 -0
- package/dist/12.maestro-web-sdk.umd.js.map +1 -0
- package/dist/13.maestro-web-sdk.esm.js +2 -0
- package/dist/13.maestro-web-sdk.esm.js.map +1 -0
- package/dist/13.maestro-web-sdk.umd.js +2 -0
- package/dist/13.maestro-web-sdk.umd.js.map +1 -0
- package/dist/14.maestro-web-sdk.esm.js +2 -0
- package/dist/14.maestro-web-sdk.esm.js.map +1 -0
- package/dist/14.maestro-web-sdk.umd.js +2 -0
- package/dist/14.maestro-web-sdk.umd.js.map +1 -0
- package/dist/15.maestro-web-sdk.esm.js +2 -0
- package/dist/15.maestro-web-sdk.esm.js.map +1 -0
- package/dist/15.maestro-web-sdk.umd.js +2 -0
- package/dist/15.maestro-web-sdk.umd.js.map +1 -0
- package/dist/16.maestro-web-sdk.esm.js +2 -0
- package/dist/16.maestro-web-sdk.esm.js.map +1 -0
- package/dist/16.maestro-web-sdk.umd.js +2 -0
- package/dist/16.maestro-web-sdk.umd.js.map +1 -0
- package/dist/17.maestro-web-sdk.esm.js +2 -0
- package/dist/17.maestro-web-sdk.esm.js.map +1 -0
- package/dist/17.maestro-web-sdk.umd.js +2 -0
- package/dist/17.maestro-web-sdk.umd.js.map +1 -0
- package/dist/18.maestro-web-sdk.esm.js +2 -0
- package/dist/18.maestro-web-sdk.esm.js.map +1 -0
- package/dist/18.maestro-web-sdk.umd.js +2 -0
- package/dist/18.maestro-web-sdk.umd.js.map +1 -0
- package/dist/19.maestro-web-sdk.esm.js +2 -0
- package/dist/19.maestro-web-sdk.esm.js.map +1 -0
- package/dist/19.maestro-web-sdk.umd.js +2 -0
- package/dist/19.maestro-web-sdk.umd.js.map +1 -0
- package/dist/2.maestro-web-sdk.esm.js +2 -0
- package/dist/2.maestro-web-sdk.esm.js.map +1 -0
- package/dist/2.maestro-web-sdk.umd.js +2 -0
- package/dist/2.maestro-web-sdk.umd.js.map +1 -0
- package/dist/20.maestro-web-sdk.esm.js +2 -0
- package/dist/20.maestro-web-sdk.esm.js.map +1 -0
- package/dist/20.maestro-web-sdk.umd.js +2 -0
- package/dist/20.maestro-web-sdk.umd.js.map +1 -0
- package/dist/21.maestro-web-sdk.esm.js +2 -0
- package/dist/21.maestro-web-sdk.esm.js.map +1 -0
- package/dist/21.maestro-web-sdk.umd.js +2 -0
- package/dist/21.maestro-web-sdk.umd.js.map +1 -0
- package/dist/22.maestro-web-sdk.esm.js +2 -0
- package/dist/22.maestro-web-sdk.esm.js.map +1 -0
- package/dist/22.maestro-web-sdk.umd.js +2 -0
- package/dist/22.maestro-web-sdk.umd.js.map +1 -0
- package/dist/23.maestro-web-sdk.esm.js +2 -0
- package/dist/23.maestro-web-sdk.esm.js.map +1 -0
- package/dist/23.maestro-web-sdk.umd.js +2 -0
- package/dist/23.maestro-web-sdk.umd.js.map +1 -0
- package/dist/24.maestro-web-sdk.esm.js +2 -0
- package/dist/24.maestro-web-sdk.esm.js.map +1 -0
- package/dist/24.maestro-web-sdk.umd.js +2 -0
- package/dist/24.maestro-web-sdk.umd.js.map +1 -0
- package/dist/3.maestro-web-sdk.esm.js +2 -0
- package/dist/3.maestro-web-sdk.esm.js.map +1 -0
- package/dist/3.maestro-web-sdk.umd.js +2 -0
- package/dist/3.maestro-web-sdk.umd.js.map +1 -0
- package/dist/4.maestro-web-sdk.esm.js +2 -0
- package/dist/4.maestro-web-sdk.esm.js.map +1 -0
- package/dist/4.maestro-web-sdk.umd.js +2 -0
- package/dist/4.maestro-web-sdk.umd.js.map +1 -0
- package/dist/5.maestro-web-sdk.esm.js +2 -0
- package/dist/5.maestro-web-sdk.esm.js.map +1 -0
- package/dist/5.maestro-web-sdk.umd.js +2 -0
- package/dist/5.maestro-web-sdk.umd.js.map +1 -0
- package/dist/6.maestro-web-sdk.esm.js +2 -0
- package/dist/6.maestro-web-sdk.esm.js.map +1 -0
- package/dist/6.maestro-web-sdk.umd.js +2 -0
- package/dist/6.maestro-web-sdk.umd.js.map +1 -0
- package/dist/7.maestro-web-sdk.esm.js +2 -0
- package/dist/7.maestro-web-sdk.esm.js.map +1 -0
- package/dist/7.maestro-web-sdk.umd.js +2 -0
- package/dist/7.maestro-web-sdk.umd.js.map +1 -0
- package/dist/8.maestro-web-sdk.esm.js +2 -0
- package/dist/8.maestro-web-sdk.esm.js.map +1 -0
- package/dist/8.maestro-web-sdk.umd.js +2 -0
- package/dist/8.maestro-web-sdk.umd.js.map +1 -0
- package/dist/9.maestro-web-sdk.esm.js +2 -0
- package/dist/9.maestro-web-sdk.esm.js.map +1 -0
- package/dist/9.maestro-web-sdk.umd.js +2 -0
- package/dist/9.maestro-web-sdk.umd.js.map +1 -0
- package/dist/bundle-report.html +53 -0
- package/dist/maestro-web-sdk.esm.js +1 -1
- package/dist/maestro-web-sdk.esm.js.map +1 -1
- package/dist/maestro-web-sdk.umd.js +1 -1
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/src/modules/fantasy/view/TournamentBracketCard/TournamentBracketCard.d.ts +99 -0
- package/dist/src/modules/fantasy/view/TournamentBracketCard/TournamentBracketCard.js +33 -0
- package/dist/src/modules/fantasy/view/TournamentBracketCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/TournamentBracketCard/index.js +2 -0
- package/dist/src/modules/hello-world/HelloWorldView.js +8 -2
- package/dist/src/modules/stats/utils/playerStatusUtils.d.ts +4 -0
- package/dist/src/modules/stats/utils/playerStatusUtils.js +16 -0
- package/dist/src/modules/stats/view/CareerMatchup/CareerMatchup.d.ts +100 -0
- package/dist/src/modules/stats/view/CareerMatchup/CareerMatchup.js +59 -0
- package/dist/src/modules/stats/view/CareerMatchup/index.d.ts +1 -0
- package/dist/src/modules/stats/view/CareerMatchup/index.js +1 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/ExpandedPlayerStats.js +20 -23
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsCard.js +4 -1
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsMinified.js +5 -1
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsView.js +21 -4
- package/dist/src/services/StatsService.d.ts +12 -4
- package/dist/src/services/StatsService.js +35 -28
- package/package.json +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/// <reference types="prop-types" />
|
|
2
|
+
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './TournamentBracketCard.styles.css';
|
|
5
|
+
import { TournamentBracketCardItem } from '../../types';
|
|
6
|
+
type Props = {
|
|
7
|
+
item: TournamentBracketCardItem;
|
|
8
|
+
};
|
|
9
|
+
export declare const TournamentBracketCard: (props: Props & WithFocusableProps) => JSX.Element;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
new (props: (Props & WithFocusableProps) | Readonly<Props & WithFocusableProps>): {
|
|
12
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
13
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
14
|
+
getChildContext(): {
|
|
15
|
+
parentFocusKey: string;
|
|
16
|
+
};
|
|
17
|
+
setFocus: (focusKey: string) => void;
|
|
18
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
|
|
19
|
+
stealFocus: () => void;
|
|
20
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
21
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
22
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
23
|
+
onEnterReleaseHandler: () => void;
|
|
24
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
25
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
26
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
27
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
componentDidUpdate(): void;
|
|
30
|
+
componentWillUnmount(): void;
|
|
31
|
+
render(): React.ReactElement<Props & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
32
|
+
context: any;
|
|
33
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<Props & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
34
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
35
|
+
readonly props: Readonly<Props & WithFocusableProps> & Readonly<{
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}>;
|
|
38
|
+
refs: {
|
|
39
|
+
[key: string]: React.ReactInstance;
|
|
40
|
+
};
|
|
41
|
+
shouldComponentUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
42
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
43
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Props & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
44
|
+
componentWillMount?(): void;
|
|
45
|
+
UNSAFE_componentWillMount?(): void;
|
|
46
|
+
componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
47
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
48
|
+
componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
49
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
50
|
+
};
|
|
51
|
+
new (props: Props & WithFocusableProps, context: any): {
|
|
52
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
53
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
54
|
+
getChildContext(): {
|
|
55
|
+
parentFocusKey: string;
|
|
56
|
+
};
|
|
57
|
+
setFocus: (focusKey: string) => void;
|
|
58
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
|
|
59
|
+
stealFocus: () => void;
|
|
60
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
61
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
62
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
63
|
+
onEnterReleaseHandler: () => void;
|
|
64
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
65
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
66
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
67
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
68
|
+
componentDidMount(): void;
|
|
69
|
+
componentDidUpdate(): void;
|
|
70
|
+
componentWillUnmount(): void;
|
|
71
|
+
render(): React.ReactElement<Props & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
72
|
+
context: any;
|
|
73
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<Props & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
74
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
75
|
+
readonly props: Readonly<Props & WithFocusableProps> & Readonly<{
|
|
76
|
+
children?: React.ReactNode;
|
|
77
|
+
}>;
|
|
78
|
+
refs: {
|
|
79
|
+
[key: string]: React.ReactInstance;
|
|
80
|
+
};
|
|
81
|
+
shouldComponentUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
82
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
83
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Props & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
84
|
+
componentWillMount?(): void;
|
|
85
|
+
UNSAFE_componentWillMount?(): void;
|
|
86
|
+
componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
87
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
88
|
+
componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
89
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
90
|
+
};
|
|
91
|
+
contextTypes: {
|
|
92
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
93
|
+
};
|
|
94
|
+
childContextTypes: {
|
|
95
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
96
|
+
};
|
|
97
|
+
contextType?: React.Context<any> | undefined;
|
|
98
|
+
};
|
|
99
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './TournamentBracketCard.styles.css';
|
|
4
|
+
import Image from '@/components/atoms/Image';
|
|
5
|
+
export const TournamentBracketCard = (props) => {
|
|
6
|
+
const { item } = props;
|
|
7
|
+
// Percentile is stored as 0-100, display as percentage
|
|
8
|
+
const percentileText = `${item.percentile}%`;
|
|
9
|
+
return (React.createElement("div", { className: "tournament-bracket-card focus-ring", "data-focused": props.focused, "data-complete": item.isComplete, style: {
|
|
10
|
+
'--league-color': '#F51824',
|
|
11
|
+
} },
|
|
12
|
+
React.createElement("div", { className: "tournament-bracket-card-header" },
|
|
13
|
+
React.createElement(Image, { src: item.tournamentLogo, width: 64, height: 64, className: "tournament-bracket-card-logo", alt: `${item.tournamentAbbrev} Logo` }),
|
|
14
|
+
React.createElement("div", { className: "tournament-bracket-card-header-info" },
|
|
15
|
+
React.createElement("div", { className: "tournament-bracket-card-name-row" },
|
|
16
|
+
React.createElement("span", { className: "tournament-bracket-card-entry-name T10 FONT_BOLD" }, item.name),
|
|
17
|
+
item.entryStatusIcon && (React.createElement(Image, { src: item.entryStatusIcon, width: 24, height: 24, className: "tournament-bracket-card-status-icon", alt: "Entry Status" }))),
|
|
18
|
+
React.createElement("div", { className: "tournament-bracket-card-subtitle TEXT_200 T02" }, item.tournamentAbbrev))),
|
|
19
|
+
React.createElement("div", { className: "tournament-bracket-card-divider" }),
|
|
20
|
+
React.createElement("div", { className: "tournament-bracket-card-content" },
|
|
21
|
+
item.finalPick?.primaryLogo && (React.createElement(Image, { src: item.finalPick.primaryLogo, width: 64, height: 64, className: "tournament-bracket-card-team-logo", alt: "Final Pick Team Logo" })),
|
|
22
|
+
React.createElement("div", { className: "tournament-bracket-card-stats" },
|
|
23
|
+
React.createElement("div", { className: "tournament-bracket-card-stat" },
|
|
24
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-value T20 FONT_BOLD" }, item.rank),
|
|
25
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-label TEXT_200 T02" }, "RANK")),
|
|
26
|
+
React.createElement("div", { className: "tournament-bracket-card-stat" },
|
|
27
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-value T20 FONT_BOLD" }, percentileText),
|
|
28
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-label TEXT_200 T02" }, "PCT")),
|
|
29
|
+
React.createElement("div", { className: "tournament-bracket-card-stat" },
|
|
30
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-value T20 FONT_BOLD" }, item.score.toLocaleString()),
|
|
31
|
+
React.createElement("div", { className: "tournament-bracket-card-stat-label TEXT_200 T02" }, "PTS"))))));
|
|
32
|
+
};
|
|
33
|
+
export default withFocusable()(TournamentBracketCard);
|
|
@@ -3,6 +3,10 @@ import './HelloWorldView.styles.css';
|
|
|
3
3
|
import SDK from '@/index';
|
|
4
4
|
import HelloWorldImage from './HelloWorldImage';
|
|
5
5
|
import Icon from '@/components/atoms/SvgIcon';
|
|
6
|
+
const PANEL_TYPE_NAME_MAP = {
|
|
7
|
+
chat: 'Chat',
|
|
8
|
+
shopifyBlockPanel: 'Shopify',
|
|
9
|
+
};
|
|
6
10
|
class HelloWorldView extends Component {
|
|
7
11
|
constructor(props) {
|
|
8
12
|
super(props);
|
|
@@ -25,10 +29,12 @@ class HelloWorldView extends Component {
|
|
|
25
29
|
"However, some panels currently active on this",
|
|
26
30
|
React.createElement("br", null),
|
|
27
31
|
"channel aren't supported on this device:"),
|
|
28
|
-
React.createElement("ul", { className: "unsupported-list" }, unlistedPanels
|
|
32
|
+
React.createElement("ul", { className: "unsupported-list" }, unlistedPanels
|
|
33
|
+
.filter((p) => p.type in PANEL_TYPE_NAME_MAP)
|
|
34
|
+
.map((panel) => (React.createElement("li", { key: panel.type, className: "T10" },
|
|
29
35
|
React.createElement("div", { className: "panel-icon" },
|
|
30
36
|
React.createElement(Icon, { iconName: panel.type, width: 24, height: 24 })),
|
|
31
|
-
React.createElement("div", { className: "panel-title" }, panel.
|
|
37
|
+
React.createElement("div", { className: "panel-title" }, PANEL_TYPE_NAME_MAP[panel.type])))))))));
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
export default HelloWorldView;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get color for player status type
|
|
3
|
+
*/
|
|
4
|
+
export const getStatusColor = (statusType) => {
|
|
5
|
+
switch (statusType) {
|
|
6
|
+
case 'on-deck':
|
|
7
|
+
case 'substitute':
|
|
8
|
+
return '#FFB759';
|
|
9
|
+
case 'batter':
|
|
10
|
+
case 'pitcher':
|
|
11
|
+
case 'pinch-hitter':
|
|
12
|
+
return '#41BA42';
|
|
13
|
+
default:
|
|
14
|
+
return '#41BA42';
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/// <reference types="prop-types" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CareerMatchupStatsItem } from '../../view-model/StatsViewModel';
|
|
4
|
+
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
5
|
+
import './CareerMatchup.styles.css';
|
|
6
|
+
type Props = {
|
|
7
|
+
item: CareerMatchupStatsItem;
|
|
8
|
+
onEnterPress: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const CareerMatchupBase: React.FC<Props & WithFocusableProps>;
|
|
11
|
+
declare const _default: {
|
|
12
|
+
new (props: (Props & WithFocusableProps) | Readonly<Props & WithFocusableProps>): {
|
|
13
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
14
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
15
|
+
getChildContext(): {
|
|
16
|
+
parentFocusKey: string;
|
|
17
|
+
};
|
|
18
|
+
setFocus: (focusKey: string) => void;
|
|
19
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
|
|
20
|
+
stealFocus: () => void;
|
|
21
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
22
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
23
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
24
|
+
onEnterReleaseHandler: () => void;
|
|
25
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
26
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
27
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
28
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
29
|
+
componentDidMount(): void;
|
|
30
|
+
componentDidUpdate(): void;
|
|
31
|
+
componentWillUnmount(): void;
|
|
32
|
+
render(): React.ReactElement<Props & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
33
|
+
context: any;
|
|
34
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<Props & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
35
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
36
|
+
readonly props: Readonly<Props & WithFocusableProps> & Readonly<{
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
}>;
|
|
39
|
+
refs: {
|
|
40
|
+
[key: string]: React.ReactInstance;
|
|
41
|
+
};
|
|
42
|
+
shouldComponentUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
43
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
44
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Props & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
45
|
+
componentWillMount?(): void;
|
|
46
|
+
UNSAFE_componentWillMount?(): void;
|
|
47
|
+
componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
48
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
49
|
+
componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
50
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
51
|
+
};
|
|
52
|
+
new (props: Props & WithFocusableProps, context: any): {
|
|
53
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
54
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
55
|
+
getChildContext(): {
|
|
56
|
+
parentFocusKey: string;
|
|
57
|
+
};
|
|
58
|
+
setFocus: (focusKey: string) => void;
|
|
59
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
|
|
60
|
+
stealFocus: () => void;
|
|
61
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
62
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
63
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
64
|
+
onEnterReleaseHandler: () => void;
|
|
65
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
66
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
67
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
68
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
69
|
+
componentDidMount(): void;
|
|
70
|
+
componentDidUpdate(): void;
|
|
71
|
+
componentWillUnmount(): void;
|
|
72
|
+
render(): React.ReactElement<Props & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
73
|
+
context: any;
|
|
74
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<Props & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
75
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
76
|
+
readonly props: Readonly<Props & WithFocusableProps> & Readonly<{
|
|
77
|
+
children?: React.ReactNode;
|
|
78
|
+
}>;
|
|
79
|
+
refs: {
|
|
80
|
+
[key: string]: React.ReactInstance;
|
|
81
|
+
};
|
|
82
|
+
shouldComponentUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
83
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
84
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Props & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
85
|
+
componentWillMount?(): void;
|
|
86
|
+
UNSAFE_componentWillMount?(): void;
|
|
87
|
+
componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
88
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & WithFocusableProps>, nextContext: any): void;
|
|
89
|
+
componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
90
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
91
|
+
};
|
|
92
|
+
contextTypes: {
|
|
93
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
94
|
+
};
|
|
95
|
+
childContextTypes: {
|
|
96
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
97
|
+
};
|
|
98
|
+
contextType?: React.Context<any> | undefined;
|
|
99
|
+
};
|
|
100
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
3
|
+
import HeadshotImage from '@/components/molecules/HeadshotImage';
|
|
4
|
+
import './CareerMatchup.styles.css';
|
|
5
|
+
export const CareerMatchupBase = ({ item, focused, onEnterPress, }) => {
|
|
6
|
+
if (!item.sections || item.sections.length === 0) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const renderAthleteInfo = (item, align) => {
|
|
10
|
+
// Logic for color: Highlighted (e.g. "On Deck") -> warning, others -> success
|
|
11
|
+
const statusIndicatorClass = item.isHighlighted ? 'warning' : 'success';
|
|
12
|
+
return (React.createElement("div", { className: `athlete-info ${align}` },
|
|
13
|
+
React.createElement("div", { className: "athlete-info-row" },
|
|
14
|
+
align === 'left' && (React.createElement("span", { className: "athlete-name T05_ALT" }, item.athlete?.displayName)),
|
|
15
|
+
align === 'left' && (React.createElement("span", { className: "athlete-jersey T01" },
|
|
16
|
+
"#",
|
|
17
|
+
item.athlete?.jersey)),
|
|
18
|
+
align === 'right' && (React.createElement("span", { className: "athlete-jersey T01" },
|
|
19
|
+
"#",
|
|
20
|
+
item.athlete?.jersey)),
|
|
21
|
+
align === 'right' && (React.createElement("span", { className: "athlete-name T05_ALT" }, item.athlete?.displayName))),
|
|
22
|
+
React.createElement("div", { className: "status-row" }, align === 'right' ? (React.createElement(React.Fragment, null,
|
|
23
|
+
React.createElement("span", { className: "display-name T02" }, item.displayName),
|
|
24
|
+
item.status && (React.createElement("span", { className: `status-indicator T02 ${statusIndicatorClass}` }, item.status)))) : (React.createElement(React.Fragment, null,
|
|
25
|
+
item.status && (React.createElement("span", { className: `status-indicator T02 ${statusIndicatorClass}` }, item.status)),
|
|
26
|
+
React.createElement("span", { className: "display-name T02" }, item.displayName))))));
|
|
27
|
+
};
|
|
28
|
+
const renderHeadshot = (item, align) => {
|
|
29
|
+
const position = item.athlete?.position?.abbreviation;
|
|
30
|
+
const containerClass = align === 'right'
|
|
31
|
+
? 'headshot-container right-align'
|
|
32
|
+
: 'headshot-container';
|
|
33
|
+
return (React.createElement("div", { className: containerClass },
|
|
34
|
+
item.athlete?.headshot && (React.createElement(HeadshotImage, { src: item.athlete.headshot, className: "headshot-image", alt: item.athlete.displayName, crossOrigin: "anonymous" })),
|
|
35
|
+
position && (React.createElement("div", { className: "athlete-position-badge" },
|
|
36
|
+
React.createElement("span", { className: "T02" }, position)))));
|
|
37
|
+
};
|
|
38
|
+
return (React.createElement("div", { className: "career-matchup focus-ring", "data-focused": focused, onClick: onEnterPress },
|
|
39
|
+
React.createElement("div", { className: "title T05_ALT" }, item.title),
|
|
40
|
+
item.sections.map((section, index) => {
|
|
41
|
+
const { items, statistics } = section;
|
|
42
|
+
if (items.length < 2)
|
|
43
|
+
return null;
|
|
44
|
+
const leftItem = items[0];
|
|
45
|
+
const rightItem = items[1];
|
|
46
|
+
return (React.createElement("div", { className: "career-matchup-section", key: index },
|
|
47
|
+
React.createElement("div", { className: "matchup-container" },
|
|
48
|
+
renderHeadshot(leftItem, 'left'),
|
|
49
|
+
renderHeadshot(rightItem, 'right')),
|
|
50
|
+
React.createElement("div", { className: "athlete-summary" },
|
|
51
|
+
renderAthleteInfo(leftItem, 'left'),
|
|
52
|
+
React.createElement("div", { className: "vs-label T05_ALT" }, "vs"),
|
|
53
|
+
renderAthleteInfo(rightItem, 'right')),
|
|
54
|
+
React.createElement("div", { className: "stats-table" },
|
|
55
|
+
React.createElement("div", { className: "stats-header-row" }, statistics.map((stat, i) => (React.createElement("div", { key: i, className: "stats-header-cell T10" }, stat.abbreviation)))),
|
|
56
|
+
React.createElement("div", { className: "stats-row" }, statistics.map((stat, i) => (React.createElement("div", { key: i, className: "stats-cell T10" }, stat.displayValue)))))));
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
export default withFocusable()(CareerMatchupBase);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CareerMatchup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CareerMatchup';
|
|
@@ -7,26 +7,27 @@ const ExpandedPlayerStats = (props) => {
|
|
|
7
7
|
const refsArray = useRef([]);
|
|
8
8
|
const wrapperRef = useRef(null);
|
|
9
9
|
const hasInitialized = useRef(false);
|
|
10
|
-
//
|
|
10
|
+
// Compute max-height after render when refs are populated, and when players change
|
|
11
11
|
useLayoutEffect(() => {
|
|
12
|
-
if (!
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return prev + curr.clientHeight;
|
|
17
|
-
}, 0);
|
|
18
|
-
if (totalHeight > 0) {
|
|
19
|
-
setMaxHeight(`${totalHeight}px`);
|
|
20
|
-
hasInitialized.current = true;
|
|
21
|
-
}
|
|
12
|
+
if (!refsArray.current || refsArray.current.length === 0) {
|
|
13
|
+
setMaxHeight('auto');
|
|
14
|
+
hasInitialized.current = false;
|
|
15
|
+
return;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const totalHeight = refsArray.current.reduce((prev, curr) => {
|
|
18
|
+
if (!curr)
|
|
19
|
+
return prev;
|
|
20
|
+
return prev + curr.clientHeight;
|
|
21
|
+
}, 0);
|
|
22
|
+
if (totalHeight > 0) {
|
|
23
|
+
setMaxHeight(`${totalHeight}px`);
|
|
24
|
+
hasInitialized.current = true;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
setMaxHeight('auto');
|
|
28
|
+
hasInitialized.current = false;
|
|
29
|
+
}
|
|
30
|
+
}, [players.length]);
|
|
30
31
|
// Calculate max-height from focused index to end
|
|
31
32
|
const updateMaxHeight = useCallback((focusedIndex) => {
|
|
32
33
|
const items = refsArray.current.slice(focusedIndex);
|
|
@@ -51,11 +52,7 @@ const ExpandedPlayerStats = (props) => {
|
|
|
51
52
|
const handleBecameFocused = useCallback((focusedIndex) => () => {
|
|
52
53
|
updateMaxHeight(focusedIndex);
|
|
53
54
|
if (wrapperRef.current) {
|
|
54
|
-
|
|
55
|
-
scrollToElement(focusedIndex);
|
|
56
|
-
wrapperRef.current?.removeEventListener('transitionend', handleTransitionEnd);
|
|
57
|
-
};
|
|
58
|
-
wrapperRef.current.addEventListener('transitionend', handleTransitionEnd, { once: true });
|
|
55
|
+
wrapperRef.current.addEventListener('transitionend', () => scrollToElement(focusedIndex), { once: true });
|
|
59
56
|
}
|
|
60
57
|
}, [updateMaxHeight, scrollToElement]);
|
|
61
58
|
return (React.createElement("div", { className: "expanded-player-stats", style: { maxHeight }, ref: wrapperRef, "data-scrolled": scrolled }, players.map((player, index) => (React.createElement("div", { key: player.title, ref: (ref) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import HeadshotImage from '@/components/molecules/HeadshotImage';
|
|
3
3
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
4
|
+
import { getStatusColor } from '../../utils/playerStatusUtils';
|
|
4
5
|
const PlayerSeasonStatsCard = (props) => {
|
|
5
6
|
const { player, focused } = props;
|
|
6
7
|
return (React.createElement("div", { className: "player-card focus-ring", "data-focused": focused },
|
|
@@ -10,7 +11,9 @@ const PlayerSeasonStatsCard = (props) => {
|
|
|
10
11
|
React.createElement("span", { className: "T02" }, player.position)))),
|
|
11
12
|
React.createElement("div", { className: "player-info" },
|
|
12
13
|
React.createElement("div", { className: "player-name-row" },
|
|
13
|
-
React.createElement("
|
|
14
|
+
React.createElement("div", { className: "player-name-stack" },
|
|
15
|
+
React.createElement("span", { className: "player-name T05_ALT FONT_BOLD" }, player.title),
|
|
16
|
+
player.playerStatus && (React.createElement("span", { className: "status-badge T02 FONT_BOLD", style: { color: getStatusColor(player.playerStatus.type) } }, player.playerStatus.displayName))),
|
|
14
17
|
player.featuredStat && (React.createElement("span", { className: "featured-stat T30 FONT_BOLD" },
|
|
15
18
|
React.createElement("span", { className: "featured-value" }, player.featuredStat.displayValue),
|
|
16
19
|
React.createElement("span", { className: "featured-label T02" }, player.featuredStat.label)))),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { getStatusColor } from '../../utils/playerStatusUtils';
|
|
2
3
|
const PlayerSeasonStatsMinified = (props) => {
|
|
3
4
|
const { player } = props;
|
|
4
5
|
return (React.createElement("div", { className: "player-minified" },
|
|
@@ -8,6 +9,9 @@ const PlayerSeasonStatsMinified = (props) => {
|
|
|
8
9
|
React.createElement("span", { className: "player-name" }, player.title),
|
|
9
10
|
player.featuredStat && (React.createElement(React.Fragment, null,
|
|
10
11
|
React.createElement("span", { className: "featured-value FONT_BOLD" }, player.featuredStat.displayValue),
|
|
11
|
-
React.createElement("span", { className: "featured-label" }, player.featuredStat.label)))
|
|
12
|
+
React.createElement("span", { className: "featured-label" }, player.featuredStat.label))),
|
|
13
|
+
player.playerStatus && (React.createElement("span", { className: "player-status" },
|
|
14
|
+
React.createElement("span", { className: "player-status-spacing T02 FONT_BOLD" }, "-"),
|
|
15
|
+
React.createElement("span", { className: "player-status-color T02 FONT_BOLD", style: { color: getStatusColor(player.playerStatus.type) } }, player.playerStatus.displayName))))));
|
|
12
16
|
};
|
|
13
17
|
export default PlayerSeasonStatsMinified;
|
|
@@ -34,7 +34,12 @@ const TeamCard = (props) => {
|
|
|
34
34
|
};
|
|
35
35
|
const getExpandedPlayerFocusKey = (tabIndex) => {
|
|
36
36
|
const activeSection = team.sections.find((s) => s.title === activeTabKey) || team.sections[0];
|
|
37
|
-
|
|
37
|
+
if (!activeSection) {
|
|
38
|
+
console.error('[BBD] [PlayerSeasonStatsView] [getExpandedPlayerFocusKey] No active section found');
|
|
39
|
+
return 'invalid-focus-key';
|
|
40
|
+
}
|
|
41
|
+
const index = tabIndex || team.sections.indexOf(activeSection);
|
|
42
|
+
return `expanded-player-${team.teamKey}-${index}-0`;
|
|
38
43
|
};
|
|
39
44
|
// Collapse on boundary navigation (UP at first, DOWN at last)
|
|
40
45
|
const handleExpandedPlayerArrowPress = (arrowProps) => (d) => {
|
|
@@ -48,13 +53,21 @@ const TeamCard = (props) => {
|
|
|
48
53
|
SDK.getMaestroEventViewModel().deliverFocus();
|
|
49
54
|
return false;
|
|
50
55
|
}
|
|
51
|
-
// UP at first player -> navigate to tabs
|
|
56
|
+
// UP at first player -> navigate to tabs (if any) or back to card
|
|
52
57
|
if (d === 'up' && playerIndex === 0) {
|
|
53
|
-
|
|
58
|
+
if (team.sections.length > 1) {
|
|
59
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(`player-stats-tab-${team.teamKey}-${activeTabKey}`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(cardFocusKey);
|
|
63
|
+
}
|
|
54
64
|
return false;
|
|
55
65
|
}
|
|
56
66
|
// DOWN at last player -> collapse and navigate down
|
|
57
|
-
if (d === 'down' &&
|
|
67
|
+
if (d === 'down' &&
|
|
68
|
+
activeSection &&
|
|
69
|
+
Array.isArray(activeSection.items) &&
|
|
70
|
+
playerIndex === activeSection.items.length - 1) {
|
|
58
71
|
setExpanded(false);
|
|
59
72
|
SDK.getMaestroEventViewModel().navigation.navigateByDirection('down');
|
|
60
73
|
return false;
|
|
@@ -111,6 +124,10 @@ const TeamCard = (props) => {
|
|
|
111
124
|
};
|
|
112
125
|
const renderExpandedContent = () => {
|
|
113
126
|
const activeSection = team.sections.find((s) => s.title === activeTabKey) || team.sections[0];
|
|
127
|
+
if (!activeSection) {
|
|
128
|
+
console.error('[BBD] [PlayerSeasonStatsView] [renderExpandedContent] No active section found');
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
114
131
|
return (React.createElement(React.Fragment, null,
|
|
115
132
|
renderTabs(),
|
|
116
133
|
React.createElement(ExpandedPlayerStats, { players: activeSection.items, teamKey: team.teamKey, tabIndex: team.sections.indexOf(activeSection), parentFocusKey: cardFocusKey, onArrowPress: handleExpandedPlayerArrowPress, onBackPress: handleBackPress, onEnterPress: props.onEnterPress })));
|
|
@@ -28,14 +28,22 @@ declare class StatsService {
|
|
|
28
28
|
stop: () => void;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* Build sync URL for timecode-based stats fetching
|
|
32
|
-
* Enhanced with comprehensive validation and fallback strategies
|
|
33
|
-
*
|
|
31
|
+
* Build sync URL for timecode-based stats fetching
|
|
34
32
|
* @param timeCode - The timecode in milliseconds, or null for 'latest'
|
|
35
33
|
* @returns Complete sync URL for the fauxcast stats endpoint
|
|
36
|
-
* @throws Error if page config is not available or required fields are missing
|
|
37
34
|
*/
|
|
38
35
|
private getSyncEndpoint;
|
|
36
|
+
/**
|
|
37
|
+
* Extract event, league, and main IDs from page config metadata
|
|
38
|
+
* @returns Object containing eventId, leagueId, and mainId
|
|
39
|
+
*/
|
|
40
|
+
private getIdsFromPageConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Parse league data from external_field_5 JSON string
|
|
43
|
+
* @param leagueField - JSON string containing leagueId and optional fauxcastId
|
|
44
|
+
* @returns Parsed league data
|
|
45
|
+
*/
|
|
46
|
+
private parseLeagueData;
|
|
39
47
|
/**
|
|
40
48
|
* Format timecode for API consumption
|
|
41
49
|
* @param timeCode - Timecode in milliseconds or null
|