@maestro_io/maestro-web-sdk 2.1.2 → 2.1.3
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/components/atoms/Rive/index.d.ts +1 -0
- package/dist/components/atoms/Rive/index.js +3 -2
- package/dist/components/molecules/ActionButton/ActionButton.d.ts +1 -0
- package/dist/components/molecules/PanelNavButton/PanelNavButton.d.ts +1 -0
- package/dist/components/organisms/PanelNavigation/PanelNavigation.js +5 -6
- package/dist/components/organisms/SegmentController/SegmentController.d.ts +2 -2
- package/dist/components/organisms/SegmentController/SegmentController.js +5 -6
- package/dist/external/spatial-navigation/index.d.ts +2 -3
- package/dist/external/spatial-navigation/index.js +1 -2
- package/dist/external/spatial-navigation/spatialNavigation.d.ts +2 -4
- package/dist/external/spatial-navigation/spatialNavigation.js +25 -36
- package/dist/external/spatial-navigation/withFocusable.d.ts +1 -0
- package/dist/external/spatial-navigation/withFocusable.js +17 -10
- package/dist/maestro-web-sdk.umd.js +3 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/modules/bets/view/HotProps/HotPropsView.d.ts +7 -6
- package/dist/modules/bets/view/HotProps/HotPropsView.js +11 -11
- package/dist/modules/bets/view/SixPack/SixPackView.d.ts +2 -2
- package/dist/modules/bets/view/SixPack/SixPackView.js +4 -4
- package/dist/modules/bets/view/TabLoadFailureView.d.ts +1 -0
- package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +7 -6
- package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.js +10 -10
- package/dist/modules/bets/view/components/Bet/Bet.d.ts +1 -0
- package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +2 -2
- package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +4 -4
- package/dist/modules/bets/view-model/BetsViewModel.js +2 -2
- package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +0 -4
- package/dist/modules/key-plays/view/KeyPlayCardView.js +4 -26
- package/dist/modules/key-plays/view/KeyPlaysView.js +1 -2
- package/dist/modules/stats/interfaces/IStats.d.ts +6 -3
- package/dist/modules/stats/mocks.d.ts +80 -0
- package/dist/modules/stats/mocks.js +140 -0
- package/dist/modules/stats/utils/renderTeamStatistic.d.ts +21 -0
- package/dist/modules/stats/utils/renderTeamStatistic.js +16 -0
- package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +34 -0
- package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.js +78 -0
- package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +5 -0
- package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +27 -0
- package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +10 -0
- package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +15 -0
- package/dist/modules/stats/view/ActiveAthletes/index.d.ts +2 -0
- package/dist/modules/stats/view/ActiveAthletes/index.js +2 -0
- package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +2 -23
- package/dist/modules/stats/view/GameLeaders/GameLeaders.js +1 -1
- package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +1 -0
- package/dist/modules/stats/view/RecentGames/RecentGames.d.ts +1 -0
- package/dist/modules/stats/view/StatsQRCode/StatsQRCodeView.d.ts +1 -0
- package/dist/modules/stats/view/StatsView.d.ts +1 -1
- package/dist/modules/stats/view/StatsView.js +31 -11
- package/dist/modules/stats/view/TeamStats/TeamStatsView.d.ts +54 -0
- package/dist/modules/stats/view/TeamStats/TeamStatsView.js +69 -0
- package/dist/modules/stats/view/TeamStats/index.d.ts +2 -0
- package/dist/modules/stats/view/TeamStats/index.js +1 -0
- package/dist/modules/stats/view/Teams/StatsProgressBar.js +7 -3
- package/dist/modules/stats/view/Teams/Teams.d.ts +1 -0
- package/dist/modules/stats/view/Teams/Teams.js +15 -8
- package/dist/modules/stats/view/WinProbability/WinProbability.d.ts +1 -0
- package/dist/modules/stats/view/components/AthletesStatistics/AthletesStatistics.d.ts +19 -3
- package/dist/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +7 -6
- package/dist/modules/stats/view/components/AthletesStatistics/StatisticTable.d.ts +2 -8
- package/dist/modules/stats/view/components/AthletesStatistics/StatisticTable.js +4 -3
- package/dist/modules/stats/view/index.d.ts +1 -0
- package/dist/modules/stats/view/index.js +1 -0
- package/dist/services/StatsService.d.ts +36 -0
- package/dist/services/StatsService.js +68 -0
- package/dist/view-models/MaestroEventViewModel.d.ts +7 -0
- package/dist/view-models/MaestroEventViewModel.js +18 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="prop-types" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
|
-
import {
|
|
4
|
+
import { Direction, Layout } from '@/external/spatial-navigation/utils';
|
|
5
5
|
import './HotPropsView.css';
|
|
6
6
|
import { HotPropsBetItem } from '../../view-model/BetsViewModel';
|
|
7
7
|
type HotPropsViewProps = {
|
|
@@ -11,6 +11,7 @@ type HotPropsViewProps = {
|
|
|
11
11
|
declare const _default: {
|
|
12
12
|
new (props?: (HotPropsViewProps & WithFocusableProps) | undefined, context?: any): {
|
|
13
13
|
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
14
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
14
15
|
getChildContext(): {
|
|
15
16
|
parentFocusKey: string;
|
|
16
17
|
};
|
|
@@ -19,12 +20,12 @@ declare const _default: {
|
|
|
19
20
|
stealFocus: () => void;
|
|
20
21
|
onUpdateFocus: (focused: boolean) => void;
|
|
21
22
|
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
22
|
-
onEnterPressHandler: (details: Details) => void;
|
|
23
|
+
onEnterPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
23
24
|
onEnterReleaseHandler: () => void;
|
|
24
|
-
onBackPressHandler: (details: Details) => void;
|
|
25
|
-
onArrowPressHandler: (direction: Direction, details: Details) => boolean | void;
|
|
26
|
-
onBecameFocusedHandler: (layout: Layout, details: Details) => void;
|
|
27
|
-
onBecameBlurredHandler: (layout: Layout, details: Details) => void;
|
|
25
|
+
onBackPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
26
|
+
onArrowPressHandler: (direction: Direction, details: import("@/external/spatial-navigation/utils").Details) => boolean | void;
|
|
27
|
+
onBecameFocusedHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
28
|
+
onBecameBlurredHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
28
29
|
componentDidMount(): void;
|
|
29
30
|
componentDidUpdate(): void;
|
|
30
31
|
componentWillUnmount(): void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { withFocusable,
|
|
2
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
3
3
|
import Bet from '../components/Bet/Bet';
|
|
4
4
|
import BetsCard from '../components/BetsCard/BetsCard';
|
|
5
5
|
import Icon from '@/components/atoms/SvgIcon/Icon';
|
|
6
6
|
import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from '@/components/core/ScrollableContainer/ScrollableContainer';
|
|
7
7
|
import './HotPropsView.css';
|
|
8
8
|
import BetsCardHeader from '../components/BetsCard/BetsCardHeader';
|
|
9
|
-
import
|
|
9
|
+
import SDK from '@/index';
|
|
10
10
|
const BETS_MIN_VISIBLE = 4;
|
|
11
11
|
class HotPropsView extends React.Component {
|
|
12
12
|
constructor() {
|
|
@@ -17,7 +17,7 @@ class HotPropsView extends React.Component {
|
|
|
17
17
|
configurable: true,
|
|
18
18
|
writable: true,
|
|
19
19
|
value: (index) => {
|
|
20
|
-
setFocus(this.getBetFocusKey(index));
|
|
20
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(this.getBetFocusKey(index));
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
// Helper function to focus back to the card
|
|
@@ -26,7 +26,7 @@ class HotPropsView extends React.Component {
|
|
|
26
26
|
configurable: true,
|
|
27
27
|
writable: true,
|
|
28
28
|
value: () => {
|
|
29
|
-
setFocus(this.getCardFocusKey());
|
|
29
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(this.getCardFocusKey());
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
// Helper function to get the total number of bets
|
|
@@ -43,7 +43,7 @@ class HotPropsView extends React.Component {
|
|
|
43
43
|
configurable: true,
|
|
44
44
|
writable: true,
|
|
45
45
|
value: () => {
|
|
46
|
-
setFocus(this.getBetFocusKey(0));
|
|
46
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(this.getBetFocusKey(0));
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(this, "context", {
|
|
@@ -72,9 +72,9 @@ class HotPropsView extends React.Component {
|
|
|
72
72
|
enumerable: true,
|
|
73
73
|
configurable: true,
|
|
74
74
|
writable: true,
|
|
75
|
-
value: (index) => (direction, _props
|
|
76
|
-
if (direction === 'left'
|
|
77
|
-
deliverFocus(
|
|
75
|
+
value: (index) => (direction, _props) => {
|
|
76
|
+
if (direction === 'left') {
|
|
77
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
78
78
|
}
|
|
79
79
|
if (index === 0 && direction === 'up') {
|
|
80
80
|
// If the first bet is focused and up arrow is pressed, focus the card itself
|
|
@@ -87,9 +87,9 @@ class HotPropsView extends React.Component {
|
|
|
87
87
|
enumerable: true,
|
|
88
88
|
configurable: true,
|
|
89
89
|
writable: true,
|
|
90
|
-
value: (d, _props
|
|
91
|
-
if (d === 'left'
|
|
92
|
-
deliverFocus(
|
|
90
|
+
value: (d, _props) => {
|
|
91
|
+
if (d === 'left') {
|
|
92
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './SixPackView.style.css';
|
|
3
3
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
|
-
import {
|
|
4
|
+
import { Direction, Layout } from '@/external/spatial-navigation/utils';
|
|
5
5
|
import { SixPackBetItem } from '../../view-model/BetsViewModel';
|
|
6
6
|
type Props = WithFocusableProps & {
|
|
7
7
|
item: SixPackBetItem;
|
|
@@ -14,7 +14,7 @@ export default class FocusableSixPackViewWrapper extends React.Component<Props>
|
|
|
14
14
|
};
|
|
15
15
|
context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
|
|
16
16
|
onBecameFocused: (layout: Layout) => void;
|
|
17
|
-
onArrowPress: (d: Direction, _props: any
|
|
17
|
+
onArrowPress: (d: Direction, _props: any) => void;
|
|
18
18
|
render(): React.JSX.Element;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -3,7 +3,7 @@ import './SixPackView.style.css';
|
|
|
3
3
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
4
4
|
import FocusableItem from '@/components/core/ScrollableContainer/FocusableItem';
|
|
5
5
|
import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from '@/components/core/ScrollableContainer/ScrollableContainer';
|
|
6
|
-
import
|
|
6
|
+
import SDK from '@/index';
|
|
7
7
|
class SixPackView extends React.Component {
|
|
8
8
|
get columnOrder() {
|
|
9
9
|
switch (this.props.item.data.sport) {
|
|
@@ -84,9 +84,9 @@ export default class FocusableSixPackViewWrapper extends React.Component {
|
|
|
84
84
|
enumerable: true,
|
|
85
85
|
configurable: true,
|
|
86
86
|
writable: true,
|
|
87
|
-
value: (d, _props
|
|
88
|
-
if (d === 'left'
|
|
89
|
-
deliverFocus(
|
|
87
|
+
value: (d, _props) => {
|
|
88
|
+
if (d === 'left') {
|
|
89
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -4,6 +4,7 @@ import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
|
4
4
|
declare const _default: {
|
|
5
5
|
new (props?: (object & WithFocusableProps) | undefined, context?: any): {
|
|
6
6
|
state: import("../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
7
|
+
navigation: import("../../../external/spatial-navigation/spatialNavigation").default;
|
|
7
8
|
getChildContext(): {
|
|
8
9
|
parentFocusKey: string;
|
|
9
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="prop-types" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
|
-
import {
|
|
4
|
+
import { Direction, Layout } from '@/external/spatial-navigation/utils';
|
|
5
5
|
import { IUserBet } from '@/modules/bets/interfaces/IBets';
|
|
6
6
|
export declare const EVENTS_COUNT_THRESHOLD = 3;
|
|
7
7
|
export type BaseBetCardProps = {
|
|
@@ -11,6 +11,7 @@ export type BaseBetCardProps = {
|
|
|
11
11
|
declare const _default: {
|
|
12
12
|
new (props?: (BaseBetCardProps & WithFocusableProps) | undefined, context?: any): {
|
|
13
13
|
state: import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
14
|
+
navigation: import("../../../../../external/spatial-navigation/spatialNavigation").default;
|
|
14
15
|
getChildContext(): {
|
|
15
16
|
parentFocusKey: string;
|
|
16
17
|
};
|
|
@@ -19,12 +20,12 @@ declare const _default: {
|
|
|
19
20
|
stealFocus: () => void;
|
|
20
21
|
onUpdateFocus: (focused: boolean) => void;
|
|
21
22
|
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
22
|
-
onEnterPressHandler: (details: Details) => void;
|
|
23
|
+
onEnterPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
23
24
|
onEnterReleaseHandler: () => void;
|
|
24
|
-
onBackPressHandler: (details: Details) => void;
|
|
25
|
-
onArrowPressHandler: (direction: Direction, details: Details) => boolean | void;
|
|
26
|
-
onBecameFocusedHandler: (layout: Layout, details: Details) => void;
|
|
27
|
-
onBecameBlurredHandler: (layout: Layout, details: Details) => void;
|
|
25
|
+
onBackPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
26
|
+
onArrowPressHandler: (direction: Direction, details: import("@/external/spatial-navigation/utils").Details) => boolean | void;
|
|
27
|
+
onBecameFocusedHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
28
|
+
onBecameBlurredHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
28
29
|
componentDidMount(): void;
|
|
29
30
|
componentDidUpdate(): void;
|
|
30
31
|
componentWillUnmount(): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
3
3
|
import BetsCard from '../../components/BetsCard/BetsCard';
|
|
4
4
|
import BetsCardHeader from '../../components/BetsCard/BetsCardHeader';
|
|
5
5
|
import BetsCardFooter from './BetsCardFooter';
|
|
6
6
|
import BetsCardEvent from './BetsCardEvent';
|
|
7
7
|
import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from '@/components/core/ScrollableContainer/ScrollableContainer';
|
|
8
|
-
import
|
|
8
|
+
import SDK from '@/index';
|
|
9
9
|
export const EVENTS_COUNT_THRESHOLD = 3;
|
|
10
10
|
class UserBetsCard extends React.Component {
|
|
11
11
|
constructor() {
|
|
@@ -26,7 +26,7 @@ class UserBetsCard extends React.Component {
|
|
|
26
26
|
}
|
|
27
27
|
if (!this.props.hasFocusedChild) {
|
|
28
28
|
// Set focus on the first bet of the first event
|
|
29
|
-
setFocus(`sdk-bets-card-${this.betType}-bet-${this.props.bet.id}-0-0`);
|
|
29
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(`sdk-bets-card-${this.betType}-bet-${this.props.bet.id}-0-0`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
});
|
|
@@ -36,22 +36,22 @@ class UserBetsCard extends React.Component {
|
|
|
36
36
|
writable: true,
|
|
37
37
|
value: () => {
|
|
38
38
|
// Focus the card itself
|
|
39
|
-
setFocus(`${this.focusKeyPrefix}-${this.props.bet.id}`);
|
|
39
|
+
SDK.getMaestroEventViewModel().navigation.setFocus(`${this.focusKeyPrefix}-${this.props.bet.id}`);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(this, "handleBetArrowPress", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
configurable: true,
|
|
45
45
|
writable: true,
|
|
46
|
-
value: (eventIndex, legIndex) => (d, _props
|
|
46
|
+
value: (eventIndex, legIndex) => (d, _props) => {
|
|
47
47
|
if (d === 'up' && legIndex === 0 && eventIndex === 0) {
|
|
48
48
|
// If the first leg of the first event is focused and up arrow is pressed,
|
|
49
49
|
this.focusCard();
|
|
50
50
|
// Return false to prevent further propagation
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
|
-
if (d === 'left'
|
|
54
|
-
deliverFocus(
|
|
53
|
+
if (d === 'left') {
|
|
54
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -59,9 +59,9 @@ class UserBetsCard extends React.Component {
|
|
|
59
59
|
enumerable: true,
|
|
60
60
|
configurable: true,
|
|
61
61
|
writable: true,
|
|
62
|
-
value: (d, _props
|
|
63
|
-
if (d === 'left'
|
|
64
|
-
deliverFocus(
|
|
62
|
+
value: (d, _props) => {
|
|
63
|
+
if (d === 'left') {
|
|
64
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -8,6 +8,7 @@ declare const _default: {
|
|
|
8
8
|
leg: IBetLeg;
|
|
9
9
|
} & WithFocusableProps) | undefined, context?: any): {
|
|
10
10
|
state: import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
11
|
+
navigation: import("../../../../../external/spatial-navigation/spatialNavigation").default;
|
|
11
12
|
getChildContext(): {
|
|
12
13
|
parentFocusKey: string;
|
|
13
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PromoCodeBanner.styles.css';
|
|
3
3
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
|
-
import {
|
|
4
|
+
import { Direction, Layout } from '@/external/spatial-navigation/utils';
|
|
5
5
|
export interface PromoCodeBannerProps extends WithFocusableProps {
|
|
6
6
|
title: string;
|
|
7
7
|
description: string;
|
|
@@ -17,6 +17,6 @@ export default class FocusablePromoCodeBannerWrapper extends React.Component<Pro
|
|
|
17
17
|
};
|
|
18
18
|
context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
|
|
19
19
|
onBecameFocused: (layout: Layout) => void;
|
|
20
|
-
onArrowPress: (d: Direction, _props: any
|
|
20
|
+
onArrowPress: (d: Direction, _props: any) => void;
|
|
21
21
|
render(): React.JSX.Element;
|
|
22
22
|
}
|
|
@@ -3,7 +3,7 @@ import './PromoCodeBanner.styles.css';
|
|
|
3
3
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
4
4
|
import FocusableItem from '@/components/core/ScrollableContainer/FocusableItem';
|
|
5
5
|
import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from '@/components/core/ScrollableContainer/ScrollableContainer';
|
|
6
|
-
import
|
|
6
|
+
import SDK from '@/index';
|
|
7
7
|
const ESPN_BET_BACKGROUND_FALLBACK = 'https://www.espn.com/redesign/assets/img/ictv/bkg_qr_bet.jpg';
|
|
8
8
|
class PromoCodeBanner extends React.Component {
|
|
9
9
|
render() {
|
|
@@ -44,9 +44,9 @@ export default class FocusablePromoCodeBannerWrapper extends React.Component {
|
|
|
44
44
|
enumerable: true,
|
|
45
45
|
configurable: true,
|
|
46
46
|
writable: true,
|
|
47
|
-
value: (d, _props
|
|
48
|
-
if (d === 'left'
|
|
49
|
-
deliverFocus(
|
|
47
|
+
value: (d, _props) => {
|
|
48
|
+
if (d === 'left') {
|
|
49
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
});
|
|
@@ -3,7 +3,7 @@ import BetsService from '../../../services/BetsService';
|
|
|
3
3
|
// Import ViewModel with correct path
|
|
4
4
|
import { ViewModel } from '../../../view-models/ViewModel';
|
|
5
5
|
import { MOCK_BETS_API_RESPONSE } from '../mocks';
|
|
6
|
-
import
|
|
6
|
+
import SDK from '@/index';
|
|
7
7
|
// The interval for polling bet data (in milliseconds)
|
|
8
8
|
const DEFAULT_POLLING_INTERVAL = 30000; // 30 seconds
|
|
9
9
|
const BET_ITEM_TYPE = {
|
|
@@ -747,7 +747,7 @@ export class BetsViewModel extends ViewModel {
|
|
|
747
747
|
}
|
|
748
748
|
clearTabLoadFailure() {
|
|
749
749
|
this.errorState.value = 'none';
|
|
750
|
-
setFocus('PANEL_NAV_BUTTON_1');
|
|
750
|
+
SDK.getMaestroEventViewModel().navigation.setFocus('PANEL_NAV_BUTTON_1');
|
|
751
751
|
setTimeout(async () => {
|
|
752
752
|
await this.fetchNewData();
|
|
753
753
|
}, 100);
|
|
@@ -7,14 +7,12 @@ type KeyPlayCardViewProps = IKeyPlay & {
|
|
|
7
7
|
isPlaying: boolean;
|
|
8
8
|
playbackProgress: number | null;
|
|
9
9
|
isScoring: boolean;
|
|
10
|
-
setRef: (ref: HTMLDivElement | null) => void;
|
|
11
10
|
};
|
|
12
11
|
type KeyPlaysCardViewState = {
|
|
13
12
|
failedClip: KeyPlayLoadFailureStatus | null;
|
|
14
13
|
};
|
|
15
14
|
export declare class KeyPlayCardView extends React.Component<KeyPlayCardViewProps & WithFocusableProps, KeyPlaysCardViewState> {
|
|
16
15
|
private failedClipListener;
|
|
17
|
-
private ref;
|
|
18
16
|
private vm;
|
|
19
17
|
state: {
|
|
20
18
|
failedClip: null;
|
|
@@ -26,14 +24,12 @@ export declare class KeyPlayCardView extends React.Component<KeyPlayCardViewProp
|
|
|
26
24
|
render(): React.JSX.Element;
|
|
27
25
|
}
|
|
28
26
|
export default class KeyPlayCard extends React.Component<Omit<KeyPlayCardViewProps, 'setRef'> & WithFocusableProps> {
|
|
29
|
-
private ref;
|
|
30
27
|
context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
|
|
31
28
|
static contextTypes: {
|
|
32
29
|
refsMap: React.Requireable<any>;
|
|
33
30
|
setRef: React.Requireable<any>;
|
|
34
31
|
scrollToFocusedElement: React.Requireable<any>;
|
|
35
32
|
};
|
|
36
|
-
setRef: (ref: HTMLDivElement | null) => void;
|
|
37
33
|
handleLeftPressed: (d: Direction) => void;
|
|
38
34
|
onBecameFocused: (layout: Layout) => void;
|
|
39
35
|
render(): React.JSX.Element;
|
|
@@ -6,7 +6,6 @@ import Icon from '@/components/atoms/SvgIcon';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
8
8
|
import ScoreCard from './KeyPlayCardScoreTagView';
|
|
9
|
-
import deliverFocus from '@/helpers/deliver-focus';
|
|
10
9
|
import FocusableItem from '@/components/core/ScrollableContainer/FocusableItem';
|
|
11
10
|
import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from '@/components/core/ScrollableContainer/ScrollableContainer';
|
|
12
11
|
export class KeyPlayCardView extends React.Component {
|
|
@@ -18,12 +17,6 @@ export class KeyPlayCardView extends React.Component {
|
|
|
18
17
|
writable: true,
|
|
19
18
|
value: () => { }
|
|
20
19
|
});
|
|
21
|
-
Object.defineProperty(this, "ref", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: null
|
|
26
|
-
});
|
|
27
20
|
Object.defineProperty(this, "vm", {
|
|
28
21
|
enumerable: true,
|
|
29
22
|
configurable: true,
|
|
@@ -62,7 +55,6 @@ export class KeyPlayCardView extends React.Component {
|
|
|
62
55
|
this.failedClipListener = this.vm.failedClips.subscribe((failedClips) => {
|
|
63
56
|
this.setState({ failedClip: failedClips[this.props.clipID] });
|
|
64
57
|
});
|
|
65
|
-
this.props.setRef(this.ref);
|
|
66
58
|
}
|
|
67
59
|
componentWillUnmount() {
|
|
68
60
|
if (this.failedClipListener) {
|
|
@@ -72,7 +64,7 @@ export class KeyPlayCardView extends React.Component {
|
|
|
72
64
|
render() {
|
|
73
65
|
const { clipID, description, isPlaying, playbackProgress, isScoring, focused, awayTeamScore, homeTeamScore, homeTeamName, awayTeamName, } = this.props;
|
|
74
66
|
const { failedClip } = this.state;
|
|
75
|
-
return (React.createElement("div", { className: "key-play-card focus-ring", id: clipID, "data-focused": focused
|
|
67
|
+
return (React.createElement("div", { className: "key-play-card focus-ring", id: clipID, "data-focused": focused },
|
|
76
68
|
React.createElement("div", { className: "key-play-card-content" },
|
|
77
69
|
this.renderImage(),
|
|
78
70
|
React.createElement("div", { className: "text-content T05_ALT" },
|
|
@@ -90,33 +82,19 @@ const FocusableKeyPlayCard = withFocusable()(KeyPlayCardView);
|
|
|
90
82
|
export default class KeyPlayCard extends React.Component {
|
|
91
83
|
constructor() {
|
|
92
84
|
super(...arguments);
|
|
93
|
-
Object.defineProperty(this, "ref", {
|
|
94
|
-
enumerable: true,
|
|
95
|
-
configurable: true,
|
|
96
|
-
writable: true,
|
|
97
|
-
value: null
|
|
98
|
-
});
|
|
99
85
|
Object.defineProperty(this, "context", {
|
|
100
86
|
enumerable: true,
|
|
101
87
|
configurable: true,
|
|
102
88
|
writable: true,
|
|
103
89
|
value: DEFAULT_SCROLLABLE_CONTAINER_CONTEXT
|
|
104
90
|
});
|
|
105
|
-
Object.defineProperty(this, "setRef", {
|
|
106
|
-
enumerable: true,
|
|
107
|
-
configurable: true,
|
|
108
|
-
writable: true,
|
|
109
|
-
value: (ref) => {
|
|
110
|
-
this.ref = ref;
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
91
|
Object.defineProperty(this, "handleLeftPressed", {
|
|
114
92
|
enumerable: true,
|
|
115
93
|
configurable: true,
|
|
116
94
|
writable: true,
|
|
117
95
|
value: (d) => {
|
|
118
|
-
if (d === 'left'
|
|
119
|
-
deliverFocus(
|
|
96
|
+
if (d === 'left') {
|
|
97
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
120
98
|
}
|
|
121
99
|
}
|
|
122
100
|
});
|
|
@@ -131,7 +109,7 @@ export default class KeyPlayCard extends React.Component {
|
|
|
131
109
|
}
|
|
132
110
|
render() {
|
|
133
111
|
return (React.createElement(FocusableItem, null,
|
|
134
|
-
React.createElement(FocusableKeyPlayCard, { ...this.props,
|
|
112
|
+
React.createElement(FocusableKeyPlayCard, { ...this.props, onArrowPress: this.handleLeftPressed, onBecameFocused: this.onBecameFocused })));
|
|
135
113
|
}
|
|
136
114
|
}
|
|
137
115
|
Object.defineProperty(KeyPlayCard, "contextTypes", {
|
|
@@ -3,7 +3,6 @@ import KeyPlayCardView from './KeyPlayCardView';
|
|
|
3
3
|
import './KeyPlaysView.styles.css';
|
|
4
4
|
import KeyPlayErrorStateView from './KeyPlayErrorStateView';
|
|
5
5
|
import SDK from '@/index';
|
|
6
|
-
import { setFocus } from '@/external/spatial-navigation';
|
|
7
6
|
import ScrollableContainer from '@/components/core/ScrollableContainer';
|
|
8
7
|
const STICKY_HEADER_HEIGHT = 32;
|
|
9
8
|
export class KeyPlays extends Component {
|
|
@@ -143,7 +142,7 @@ export default class KeyPlaysWithErrorState extends Component {
|
|
|
143
142
|
writable: true,
|
|
144
143
|
value: async () => {
|
|
145
144
|
await this.vm.userRequestedNewKeyPlaysData();
|
|
146
|
-
setFocus('PANEL_NAV_BUTTON_0');
|
|
145
|
+
SDK.getMaestroEventViewModel().navigation.setFocus('PANEL_NAV_BUTTON_0');
|
|
147
146
|
}
|
|
148
147
|
});
|
|
149
148
|
this.vm = SDK.getMaestroEventViewModel().keyPlaysViewModel;
|
|
@@ -40,7 +40,7 @@ export interface Athlete {
|
|
|
40
40
|
jersey: string;
|
|
41
41
|
headshot: string;
|
|
42
42
|
links: AthleteLink[];
|
|
43
|
-
position
|
|
43
|
+
position?: AthletePosition;
|
|
44
44
|
statistics?: {
|
|
45
45
|
$key: string;
|
|
46
46
|
value?: number;
|
|
@@ -50,7 +50,7 @@ export interface Athlete {
|
|
|
50
50
|
export interface EntityMap<T> {
|
|
51
51
|
[id: string]: T;
|
|
52
52
|
}
|
|
53
|
-
interface LeaderStatistic {
|
|
53
|
+
export interface LeaderStatistic {
|
|
54
54
|
displayValue: string;
|
|
55
55
|
abbreviation: string;
|
|
56
56
|
}
|
|
@@ -110,7 +110,10 @@ interface ActiveAthletesTeam {
|
|
|
110
110
|
team: {
|
|
111
111
|
$key: string;
|
|
112
112
|
};
|
|
113
|
-
athletes:
|
|
113
|
+
athletes: {
|
|
114
|
+
$key: string;
|
|
115
|
+
statLine: string;
|
|
116
|
+
}[];
|
|
114
117
|
}
|
|
115
118
|
export interface ActiveAthletes {
|
|
116
119
|
displayText: string;
|
|
@@ -1,2 +1,82 @@
|
|
|
1
1
|
import { StatsApiResponse } from './interfaces/IStats';
|
|
2
2
|
export declare const MOCK_STATS_API_PRE_GAME_RESPONSE: StatsApiResponse;
|
|
3
|
+
export declare const mockTeamWithStatistics: {
|
|
4
|
+
id: string;
|
|
5
|
+
uid: string;
|
|
6
|
+
abbreviation: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
color: string;
|
|
9
|
+
logo: string;
|
|
10
|
+
homeAway: string;
|
|
11
|
+
statistics: {
|
|
12
|
+
$key: string;
|
|
13
|
+
value: number;
|
|
14
|
+
displayValue: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export declare const mockAwayTeamWithStatistics: {
|
|
19
|
+
id: string;
|
|
20
|
+
uid: string;
|
|
21
|
+
abbreviation: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
color: string;
|
|
24
|
+
logo: string;
|
|
25
|
+
homeAway: string;
|
|
26
|
+
statistics: {
|
|
27
|
+
$key: string;
|
|
28
|
+
value: number;
|
|
29
|
+
displayValue: string;
|
|
30
|
+
displayName: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
export declare const mockStatsResponseWithTeamStats: {
|
|
34
|
+
entities: {
|
|
35
|
+
teams: {
|
|
36
|
+
'12': {
|
|
37
|
+
id: string;
|
|
38
|
+
uid: string;
|
|
39
|
+
abbreviation: string;
|
|
40
|
+
displayName: string;
|
|
41
|
+
color: string;
|
|
42
|
+
logo: string;
|
|
43
|
+
homeAway: string;
|
|
44
|
+
statistics: {
|
|
45
|
+
$key: string;
|
|
46
|
+
value: number;
|
|
47
|
+
displayValue: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
'21': {
|
|
52
|
+
id: string;
|
|
53
|
+
uid: string;
|
|
54
|
+
abbreviation: string;
|
|
55
|
+
displayName: string;
|
|
56
|
+
color: string;
|
|
57
|
+
logo: string;
|
|
58
|
+
homeAway: string;
|
|
59
|
+
statistics: {
|
|
60
|
+
$key: string;
|
|
61
|
+
value: number;
|
|
62
|
+
displayValue: string;
|
|
63
|
+
displayName: string;
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
athletes: {};
|
|
68
|
+
};
|
|
69
|
+
leaders: never[];
|
|
70
|
+
header: {
|
|
71
|
+
teams: never[];
|
|
72
|
+
linescoresHeader: never[];
|
|
73
|
+
};
|
|
74
|
+
predictor: null;
|
|
75
|
+
winProbability: null;
|
|
76
|
+
gameState: string;
|
|
77
|
+
meta: {
|
|
78
|
+
gp_topic: string;
|
|
79
|
+
picker_topic: string;
|
|
80
|
+
gameState: string;
|
|
81
|
+
};
|
|
82
|
+
};
|