@maestro_io/maestro-web-sdk 2.1.3 → 2.2.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.
Files changed (171) hide show
  1. package/dist/MaestroEventDelegate.d.ts +1 -0
  2. package/dist/components/atoms/SvgIcon/Icon.d.ts +0 -2
  3. package/dist/components/core/ScrollableContainer/ScrollableContainer.d.ts +3 -1
  4. package/dist/external/spatial-navigation/spatialNavigation.d.ts +1 -1
  5. package/dist/interfaces/IMaestroEvent.d.ts +14 -0
  6. package/dist/interfaces/IMaestroEventDelegate.d.ts +19 -6
  7. package/dist/maestro-web-sdk.umd.js +3 -3
  8. package/dist/maestro-web-sdk.umd.js.map +1 -1
  9. package/dist/models/IPanel.d.ts +1 -2
  10. package/dist/modules/stats/interfaces/IStats.d.ts +38 -12
  11. package/dist/modules/stats/mocks.d.ts +0 -80
  12. package/dist/modules/stats/utils/driveSummaryUtils.d.ts +18 -0
  13. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +6 -19
  14. package/dist/modules/stats/view/DriveSummary/DrivePlayCard.d.ts +26 -0
  15. package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +24 -0
  16. package/dist/modules/stats/view/DriveSummary/index.d.ts +2 -0
  17. package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +15 -4
  18. package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +13 -48
  19. package/dist/modules/stats/view/RecentGames/RecentGames.d.ts +10 -21
  20. package/dist/modules/stats/view/StatsItemView.d.ts +19 -0
  21. package/dist/modules/stats/view/StatsView.d.ts +3 -3
  22. package/dist/modules/stats/view/TeamStats/TeamStatsView.d.ts +2 -4
  23. package/dist/modules/stats/view/Teams/Teams.d.ts +10 -26
  24. package/dist/modules/stats/view/WinProbability/WinProbability.d.ts +10 -21
  25. package/dist/modules/stats/view-model/StatsViewModel.d.ts +149 -5
  26. package/package.json +1 -1
  27. package/dist/MaestroEventDelegate.js +0 -60
  28. package/dist/components/atoms/BaseButton/BaseButton.js +0 -11
  29. package/dist/components/atoms/BaseButton/index.js +0 -2
  30. package/dist/components/atoms/Image/index.js +0 -30
  31. package/dist/components/atoms/Rive/index.js +0 -53
  32. package/dist/components/atoms/SvgIcon/BetGeneralIcon.js +0 -9
  33. package/dist/components/atoms/SvgIcon/BetsIcon.js +0 -11
  34. package/dist/components/atoms/SvgIcon/BetsWarningIcon.js +0 -11
  35. package/dist/components/atoms/SvgIcon/CheckmarkIcon.js +0 -6
  36. package/dist/components/atoms/SvgIcon/CollapseIcon.js +0 -6
  37. package/dist/components/atoms/SvgIcon/ExpandIcon.js +0 -6
  38. package/dist/components/atoms/SvgIcon/FantasyIcon.d.ts +0 -6
  39. package/dist/components/atoms/SvgIcon/FantasyIcon.js +0 -8
  40. package/dist/components/atoms/SvgIcon/FlameIcon.js +0 -11
  41. package/dist/components/atoms/SvgIcon/Icon.js +0 -42
  42. package/dist/components/atoms/SvgIcon/KeyPlaysIcon.js +0 -10
  43. package/dist/components/atoms/SvgIcon/MobilePhoneIcon.js +0 -11
  44. package/dist/components/atoms/SvgIcon/PlayIcon.js +0 -8
  45. package/dist/components/atoms/SvgIcon/StatsIcon.js +0 -12
  46. package/dist/components/atoms/SvgIcon/TimesIcon.js +0 -6
  47. package/dist/components/atoms/SvgIcon/WarningIcon.js +0 -8
  48. package/dist/components/atoms/SvgIcon/index.js +0 -2
  49. package/dist/components/core/App/App.js +0 -41
  50. package/dist/components/core/App/index.js +0 -2
  51. package/dist/components/core/OverlayContainer.js +0 -58
  52. package/dist/components/core/PanelManager/PanelManager.js +0 -80
  53. package/dist/components/core/PanelManager/index.js +0 -2
  54. package/dist/components/core/ScrollableContainer/FocusableItem.js +0 -38
  55. package/dist/components/core/ScrollableContainer/ScrollableContainer.js +0 -166
  56. package/dist/components/core/ScrollableContainer/index.js +0 -2
  57. package/dist/components/molecules/ActionButton/ActionButton.js +0 -10
  58. package/dist/components/molecules/ActionButton/index.js +0 -2
  59. package/dist/components/molecules/Overlay/Overlay.js +0 -139
  60. package/dist/components/molecules/Overlay/index.js +0 -2
  61. package/dist/components/molecules/PanelNavButton/PanelNavButton.js +0 -40
  62. package/dist/components/molecules/PanelNavButton/index.js +0 -2
  63. package/dist/components/molecules/SegmentButton/SegmentButton.js +0 -10
  64. package/dist/components/molecules/SegmentButton/index.js +0 -2
  65. package/dist/components/molecules/WatchButton/WatchButton.js +0 -15
  66. package/dist/components/molecules/WatchButton/index.js +0 -2
  67. package/dist/components/organisms/PanelNavigation/PanelNavigation.js +0 -71
  68. package/dist/components/organisms/PanelNavigation/index.js +0 -2
  69. package/dist/components/organisms/SegmentController/SegmentController.js +0 -68
  70. package/dist/components/organisms/SegmentController/index.js +0 -2
  71. package/dist/external/AxiosNetworkClient.js +0 -83
  72. package/dist/external/LocalStorageCacheManager.js +0 -213
  73. package/dist/external/ReactRenderer.js +0 -86
  74. package/dist/external/mocks/MockExternalNetworkClient.js +0 -161
  75. package/dist/external/ports/cacheManager.js +0 -1
  76. package/dist/external/ports/networkClient.js +0 -1
  77. package/dist/external/ports/renderer.js +0 -1
  78. package/dist/external/spatial-navigation/index.js +0 -3
  79. package/dist/external/spatial-navigation/measureLayout.js +0 -30
  80. package/dist/external/spatial-navigation/spatialNavigation.js +0 -864
  81. package/dist/external/spatial-navigation/utils.js +0 -6
  82. package/dist/external/spatial-navigation/visualDebugger.js +0 -76
  83. package/dist/external/spatial-navigation/withFocusable.js +0 -245
  84. package/dist/helpers/Observable.js +0 -37
  85. package/dist/helpers/deliver-focus.d.ts +0 -5
  86. package/dist/helpers/deliver-focus.js +0 -12
  87. package/dist/index.js +0 -192
  88. package/dist/interfaces/IMaestroEvent.js +0 -6
  89. package/dist/interfaces/IMaestroEventDelegate.js +0 -1
  90. package/dist/interfaces/IMaestroManager.js +0 -1
  91. package/dist/models/IModel.js +0 -1
  92. package/dist/models/IPanel.js +0 -53
  93. package/dist/models/ITheme.js +0 -20
  94. package/dist/models/IWinningBet.js +0 -1
  95. package/dist/modules/bets/interfaces/IBets.js +0 -1
  96. package/dist/modules/bets/mocks.js +0 -572
  97. package/dist/modules/bets/view/BetsView.js +0 -116
  98. package/dist/modules/bets/view/HotProps/HotPropsView.js +0 -139
  99. package/dist/modules/bets/view/SixPack/SixPackView.js +0 -103
  100. package/dist/modules/bets/view/TabLoadFailureView.js +0 -12
  101. package/dist/modules/bets/view/UserBets/BetResult/BetResult.js +0 -6
  102. package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.js +0 -122
  103. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardEvent.js +0 -34
  104. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardFooter.js +0 -22
  105. package/dist/modules/bets/view/UserBets/Boost/Boost.js +0 -6
  106. package/dist/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.js +0 -9
  107. package/dist/modules/bets/view/UserBets/Parlay/Parlay.js +0 -13
  108. package/dist/modules/bets/view/UserBets/Straight/Straight.js +0 -6
  109. package/dist/modules/bets/view/UserBets/Teaser/Teaser.js +0 -13
  110. package/dist/modules/bets/view/UserBets/UserBetsView.js +0 -114
  111. package/dist/modules/bets/view/components/Bet/Bet.js +0 -32
  112. package/dist/modules/bets/view/components/BetPill/BetPill.js +0 -6
  113. package/dist/modules/bets/view/components/BetsCard/BetsCard.js +0 -15
  114. package/dist/modules/bets/view/components/BetsCard/BetsCardHeader.js +0 -20
  115. package/dist/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.js +0 -14
  116. package/dist/modules/bets/view/components/LocationWarning/LocationWarning.js +0 -16
  117. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +0 -63
  118. package/dist/modules/bets/view/components/PromoCodeBanner/index.js +0 -1
  119. package/dist/modules/bets/view-model/BetsViewModel.js +0 -767
  120. package/dist/modules/key-plays/constants.js +0 -292
  121. package/dist/modules/key-plays/interfaces/IKeyPlays.js +0 -14
  122. package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.js +0 -1
  123. package/dist/modules/key-plays/view/KeyPlayCardScoreTagView.js +0 -13
  124. package/dist/modules/key-plays/view/KeyPlayCardView.js +0 -120
  125. package/dist/modules/key-plays/view/KeyPlayErrorStateView.js +0 -58
  126. package/dist/modules/key-plays/view/KeyPlaysView.js +0 -166
  127. package/dist/modules/key-plays/view-model/KeyPlaysViewModel.js +0 -182
  128. package/dist/modules/stats/interfaces/IStats.js +0 -1
  129. package/dist/modules/stats/mocks.js +0 -686
  130. package/dist/modules/stats/utils/renderTeamStatistic.js +0 -16
  131. package/dist/modules/stats/utils.js +0 -62
  132. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.js +0 -78
  133. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +0 -27
  134. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +0 -15
  135. package/dist/modules/stats/view/ActiveAthletes/index.js +0 -2
  136. package/dist/modules/stats/view/GameLeaders/GameLeaders.js +0 -9
  137. package/dist/modules/stats/view/GameLeaders/index.js +0 -2
  138. package/dist/modules/stats/view/MatchPredictor/DonutChart/DonutChart.js +0 -55
  139. package/dist/modules/stats/view/MatchPredictor/DonutChart/index.js +0 -1
  140. package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.js +0 -66
  141. package/dist/modules/stats/view/MatchPredictor/index.js +0 -2
  142. package/dist/modules/stats/view/RecentGames/RecentGames.js +0 -22
  143. package/dist/modules/stats/view/RecentGames/index.js +0 -2
  144. package/dist/modules/stats/view/StatsQRCode/StatsQRCodeView.js +0 -38
  145. package/dist/modules/stats/view/StatsQRCode/index.js +0 -1
  146. package/dist/modules/stats/view/StatsView.js +0 -107
  147. package/dist/modules/stats/view/TeamStats/TeamStatsView.js +0 -69
  148. package/dist/modules/stats/view/TeamStats/index.js +0 -1
  149. package/dist/modules/stats/view/Teams/StatsCarousel.js +0 -14
  150. package/dist/modules/stats/view/Teams/StatsProgressBar.js +0 -18
  151. package/dist/modules/stats/view/Teams/Teams.js +0 -42
  152. package/dist/modules/stats/view/Teams/index.js +0 -2
  153. package/dist/modules/stats/view/WinProbability/WinProbability.js +0 -27
  154. package/dist/modules/stats/view/WinProbability/index.js +0 -2
  155. package/dist/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +0 -29
  156. package/dist/modules/stats/view/components/AthletesStatistics/StatisticTable.js +0 -12
  157. package/dist/modules/stats/view/components/AthletesStatistics/index.js +0 -2
  158. package/dist/modules/stats/view/index.js +0 -2
  159. package/dist/modules/stats/view-model/StatsViewModel.js +0 -90
  160. package/dist/services/BetsService.js +0 -102
  161. package/dist/services/NetworkManager/NetworkManager.js +0 -410
  162. package/dist/services/NetworkManager/errors.js +0 -45
  163. package/dist/services/StatsService.js +0 -68
  164. package/dist/services/ThemeManager/constants.js +0 -47
  165. package/dist/test-polyfills.js +0 -15
  166. package/dist/types/OverlayTypes.js +0 -4
  167. package/dist/view-models/MaestroEventViewModel.js +0 -168
  168. package/dist/view-models/OverlayViewModel.js +0 -222
  169. package/dist/view-models/PanelManagerViewModel.js +0 -80
  170. package/dist/view-models/ViewModel.js +0 -32
  171. package/dist/view-models/index.js +0 -59
@@ -1,10 +1,9 @@
1
1
  export declare const MaestroPanelType: {
2
2
  readonly KEY_PLAYS: "keyPlays";
3
3
  readonly STATS: "stats";
4
- readonly FANTASY: "fantasy";
5
4
  readonly BETS: "bets";
6
5
  };
7
- export type MaestroPanelType = (typeof MaestroPanelType)[keyof typeof MaestroPanelType];
6
+ export type MaestroPanelType = typeof MaestroPanelType[keyof typeof MaestroPanelType];
8
7
  export interface PanelTypeInfo {
9
8
  id: MaestroPanelType;
10
9
  name: string;
@@ -67,8 +67,8 @@ interface LeaderTeam {
67
67
  export interface Leader {
68
68
  displayName: string;
69
69
  name: string;
70
- home: LeaderTeam;
71
- away: LeaderTeam;
70
+ home?: LeaderTeam;
71
+ away?: LeaderTeam;
72
72
  }
73
73
  interface LineScore {
74
74
  displayValue: string;
@@ -76,18 +76,18 @@ interface LineScore {
76
76
  interface HeaderTeam {
77
77
  $key: string;
78
78
  score?: string;
79
- linescores: LineScore[];
79
+ linescores?: LineScore[];
80
80
  }
81
81
  export interface Header {
82
82
  teams: HeaderTeam[];
83
- linescoresHeader: string[];
83
+ linescoresHeader?: string[];
84
84
  }
85
85
  export interface PredictorTeam {
86
86
  team: {
87
87
  $key: string;
88
88
  };
89
89
  gameProjection: string;
90
- teamChanceLoss: string;
90
+ teamChanceLoss?: string;
91
91
  }
92
92
  export interface Predictor {
93
93
  header: string;
@@ -129,25 +129,51 @@ export interface Meta {
129
129
  syncUrl?: string;
130
130
  }
131
131
  export interface StatsPromotion {
132
- title: string;
132
+ backgroundImage?: string;
133
+ description?: string;
134
+ logoPng?: string;
135
+ logo?: string;
136
+ qrCode?: string;
137
+ title?: string;
138
+ }
139
+ export interface DrivePlay {
140
+ id: string;
141
+ clock: {
142
+ displayValue: string;
143
+ };
144
+ period: {
145
+ number: number;
146
+ };
147
+ type: {
148
+ text: string;
149
+ };
150
+ text: string;
151
+ start: {
152
+ downDistanceText: string;
153
+ };
154
+ }
155
+ export interface Drive {
156
+ id: string;
157
+ team: {
158
+ $key: string;
159
+ };
133
160
  description: string;
134
- logo: string;
135
- qrCode: string;
136
- backgroundImage: string;
161
+ plays: DrivePlay[];
137
162
  }
138
163
  export interface StatsApiResponse {
139
164
  entities: {
140
165
  teams: EntityMap<Team>;
141
- athletes: EntityMap<Athlete>;
166
+ athletes?: EntityMap<Athlete>;
142
167
  };
143
- leaders: Leader[];
168
+ leaders?: Leader[];
144
169
  header: Header;
145
170
  predictor: Predictor;
146
- winProbability: WinProbability;
171
+ winProbability?: WinProbability;
147
172
  gameState: string;
148
173
  activeAthletes?: ActiveAthletes;
149
174
  meta: Meta;
150
175
  promotion?: StatsPromotion;
176
+ drives?: Drive[];
151
177
  previousGames?: {
152
178
  displayOrder: number;
153
179
  team: {
@@ -1,82 +1,2 @@
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
- };
@@ -0,0 +1,18 @@
1
+ import { DrivePlay } from '../interfaces/IStats';
2
+ /**
3
+ * Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.)
4
+ */
5
+ export declare const getOrdinalSuffix: (number: number) => string;
6
+ /**
7
+ * Parse drive description to get individual components
8
+ * Format: "11 PLAYS, 61 YARDS, 5:43"
9
+ */
10
+ export declare const parseDriveDescription: (description: string) => {
11
+ plays: string;
12
+ yards: string;
13
+ time: string;
14
+ };
15
+ /**
16
+ * Format the marquee text for the last play
17
+ */
18
+ export declare const formatLastPlayMarquee: (lastPlay: DrivePlay) => string;
@@ -1,33 +1,20 @@
1
1
  import React from 'react';
2
2
  import './ActiveAthletes.styles.css';
3
- import { WithFocusableProps } from '@/external/spatial-navigation';
4
- import { Direction } from '@/external/spatial-navigation/utils';
5
- import { AthletesStatisticsItem } from '../components/AthletesStatistics/AthletesStatistics';
6
- export type ActiveAthletesItem = {
7
- displayText: string;
8
- awayTeam: {
9
- id: string;
10
- logo: string;
11
- name: string;
12
- };
13
- homeTeam: {
14
- id: string;
15
- logo: string;
16
- name: string;
17
- };
18
- athletes: AthletesStatisticsItem[];
19
- };
3
+ import { Direction, Layout } from '@/external/spatial-navigation/utils';
4
+ import { ActiveAthletesItem } from '../../view-model/StatsViewModel';
20
5
  export type ActiveAthletesProps = {
21
6
  item: ActiveAthletesItem;
7
+ onBecameFocused: (layout: Layout) => void;
22
8
  };
23
- declare class ActiveAthletes extends React.Component<WithFocusableProps & ActiveAthletesProps, {
9
+ declare class ActiveAthletes extends React.Component<ActiveAthletesProps, {
24
10
  expanded: boolean;
25
11
  }> {
26
- constructor(props: WithFocusableProps & ActiveAthletesProps);
12
+ constructor(props: ActiveAthletesProps);
27
13
  onEnterPress(): void;
28
14
  onAthletesStatisticsArrowPress: (index: number) => (d: Direction) => boolean;
29
15
  get cardFocusKey(): string;
30
16
  onAthletesStatisticsBackPress: () => void;
17
+ onArrowPress: (d: Direction) => void;
31
18
  renderContent(): React.JSX.Element;
32
19
  render(): React.JSX.Element;
33
20
  }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { WithFocusableProps } from '@/external/spatial-navigation';
3
+ import { DrivePlay } from '../../interfaces/IStats';
4
+ import { Layout, Direction } from '@/external/spatial-navigation/utils';
5
+ import './DrivePlayCard.styles.css';
6
+ type DrivePlayCardProps = {
7
+ play: DrivePlay;
8
+ isLastPlay?: boolean;
9
+ focusKey?: string;
10
+ focusable?: boolean;
11
+ onBackPress?: () => void;
12
+ onBecameFocused?: (layout: Layout) => void;
13
+ onArrowPress?: (direction: Direction, props: any) => boolean | void;
14
+ parentFocusKey?: string;
15
+ };
16
+ export default class DrivePlayCard extends React.Component<DrivePlayCardProps & WithFocusableProps> {
17
+ static contextTypes: {
18
+ refsMap: React.Requireable<any>;
19
+ setRef: React.Requireable<any>;
20
+ scrollToFocusedElement: React.Requireable<any>;
21
+ };
22
+ context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
23
+ onBecameFocused: (layout: Layout) => void;
24
+ render(): React.JSX.Element;
25
+ }
26
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { WithFocusableProps } from '@/external/spatial-navigation';
3
+ import { Layout } from '@/external/spatial-navigation/utils';
4
+ import './DriveSummary.styles.css';
5
+ import { DriveSummaryItem } from '../../view-model/StatsViewModel';
6
+ type DriveSummaryProps = {
7
+ item: DriveSummaryItem;
8
+ };
9
+ export default class DriveSummary extends React.Component<DriveSummaryProps & WithFocusableProps> {
10
+ static contextTypes: {
11
+ refsMap: React.Requireable<any>;
12
+ setRef: React.Requireable<any>;
13
+ scrollToFocusedElement: React.Requireable<any>;
14
+ };
15
+ context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
16
+ state: {
17
+ expanded: boolean;
18
+ };
19
+ onBecameFocused: (layout: Layout) => void;
20
+ handleEnterPress: (_props: any, _details: any) => void;
21
+ collapseCard: () => void;
22
+ render(): React.JSX.Element;
23
+ }
24
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './DriveSummary';
2
+ export { default as DrivePlayCard } from './DrivePlayCard';
@@ -1,8 +1,19 @@
1
1
  import React from 'react';
2
2
  import './GameLeaders.styles.css';
3
- import { AthletesStatisticsItem } from '../components/AthletesStatistics/AthletesStatistics';
4
- export type GameLeadersStatsItem = {
5
- items: AthletesStatisticsItem[];
3
+ import { GameLeadersStatsItem } from '../../view-model/StatsViewModel';
4
+ import { Direction, Layout } from '@/external/spatial-navigation/utils';
5
+ export type GameLeaderProps = {
6
+ item: GameLeadersStatsItem;
6
7
  };
7
- declare const GameLeaders: (props: GameLeadersStatsItem) => React.JSX.Element;
8
+ declare class GameLeaders extends React.Component<GameLeaderProps> {
9
+ static contextTypes: {
10
+ refsMap: React.Requireable<any>;
11
+ setRef: React.Requireable<any>;
12
+ scrollToFocusedElement: React.Requireable<any>;
13
+ };
14
+ context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
15
+ onBecameFocused: (layout: Layout) => void;
16
+ onArrowPress: (d: Direction) => void;
17
+ render(): React.JSX.Element;
18
+ }
8
19
  export default GameLeaders;
@@ -1,53 +1,18 @@
1
- /// <reference types="prop-types" />
2
- import React from 'react';
1
+ import React, { Component } from 'react';
3
2
  import './MatchPredictorView.styles.css';
4
3
  import { WithFocusableProps } from '@/external/spatial-navigation';
5
- import { Predictor, EntityMap, Team } from '../../interfaces/IStats';
4
+ import { Layout } from '@/external/spatial-navigation/utils';
5
+ import { StatsMatchPredictorItem } from '../../view-model/StatsViewModel';
6
6
  export interface MatchPredictorProps {
7
- predictor: Predictor;
8
- teams: EntityMap<Team>;
7
+ item: StatsMatchPredictorItem;
9
8
  }
10
- declare const _default: {
11
- new (props?: (MatchPredictorProps & WithFocusableProps) | undefined, context?: any): {
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<MatchPredictorProps & WithFocusableProps>;
32
- 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: MatchPredictorProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
33
- forceUpdate(callBack?: (() => any) | undefined): void;
34
- props: Readonly<{
35
- children?: React.ReactNode;
36
- }> & Readonly<MatchPredictorProps & WithFocusableProps>;
37
- context: any;
38
- refs: {
39
- [key: string]: React.ReactInstance;
40
- };
41
- componentWillMount?(): void;
42
- componentWillReceiveProps?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextContext: any): void;
43
- shouldComponentUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
44
- componentWillUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
9
+ export default class MatchPredictorView extends Component<MatchPredictorProps & WithFocusableProps> {
10
+ static contextTypes: {
11
+ refsMap: React.Requireable<any>;
12
+ setRef: React.Requireable<any>;
13
+ scrollToFocusedElement: React.Requireable<any>;
45
14
  };
46
- contextTypes: {
47
- parentFocusKey: import("prop-types").Requireable<string>;
48
- };
49
- childContextTypes: {
50
- parentFocusKey: import("prop-types").Requireable<string>;
51
- };
52
- };
53
- export default _default;
15
+ context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
16
+ onBecameFocused: (layout: Layout) => void;
17
+ render(): React.JSX.Element;
18
+ }
@@ -2,23 +2,12 @@
2
2
  import { WithFocusableProps } from '@/external/spatial-navigation';
3
3
  import React from 'react';
4
4
  import './RecentGames.styles.css';
5
- type PreviousGame = {
6
- score: string;
7
- gameResult: string;
8
- teamLogo: string;
9
- homeAway: string;
10
- };
11
- type Team = {
12
- logo: string;
13
- name?: string;
14
- events: PreviousGame[];
15
- };
16
- export type RecentGamesStatsItem = {
17
- awayTeam: Team;
18
- homeTeam: Team;
5
+ import { RecentGamesStatsItem } from '../../view-model/StatsViewModel';
6
+ type RecentGamesProps = {
7
+ item: RecentGamesStatsItem;
19
8
  };
20
9
  declare const _default: {
21
- new (props?: (RecentGamesStatsItem & WithFocusableProps) | undefined, context?: any): {
10
+ new (props?: (RecentGamesProps & WithFocusableProps) | undefined, context?: any): {
22
11
  state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
23
12
  navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
24
13
  getChildContext(): {
@@ -38,20 +27,20 @@ declare const _default: {
38
27
  componentDidMount(): void;
39
28
  componentDidUpdate(): void;
40
29
  componentWillUnmount(): void;
41
- render(): React.ReactElement<RecentGamesStatsItem & WithFocusableProps>;
42
- 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: RecentGamesStatsItem & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
30
+ render(): React.ReactElement<RecentGamesProps & WithFocusableProps>;
31
+ 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: RecentGamesProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
43
32
  forceUpdate(callBack?: (() => any) | undefined): void;
44
33
  props: Readonly<{
45
34
  children?: React.ReactNode;
46
- }> & Readonly<RecentGamesStatsItem & WithFocusableProps>;
35
+ }> & Readonly<RecentGamesProps & WithFocusableProps>;
47
36
  context: any;
48
37
  refs: {
49
38
  [key: string]: React.ReactInstance;
50
39
  };
51
40
  componentWillMount?(): void;
52
- componentWillReceiveProps?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextContext: any): void;
53
- shouldComponentUpdate?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
54
- componentWillUpdate?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
41
+ componentWillReceiveProps?(nextProps: Readonly<RecentGamesProps & WithFocusableProps>, nextContext: any): void;
42
+ shouldComponentUpdate?(nextProps: Readonly<RecentGamesProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
43
+ componentWillUpdate?(nextProps: Readonly<RecentGamesProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
55
44
  };
56
45
  contextTypes: {
57
46
  parentFocusKey: import("prop-types").Requireable<string>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { StatsItem } from '../view-model/StatsViewModel';
3
+ import { Direction, Layout } from '@/external/spatial-navigation/utils';
4
+ type Props = {
5
+ item: StatsItem;
6
+ };
7
+ declare class StatsItemView extends React.Component<Props> {
8
+ static contextTypes: {
9
+ refsMap: React.Requireable<any>;
10
+ setRef: React.Requireable<any>;
11
+ scrollToFocusedElement: React.Requireable<any>;
12
+ };
13
+ context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
14
+ onBecameFocused: (layout: Layout) => void;
15
+ onArrowPress: (d: Direction) => void;
16
+ renderItem(): React.JSX.Element | null;
17
+ render(): React.JSX.Element;
18
+ }
19
+ export default StatsItemView;
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
2
  import './StatsView.styles.css';
3
- import { StatsApiResponse } from '../interfaces/IStats';
3
+ import { StatsItem } from '../view-model/StatsViewModel';
4
4
  interface StatsViewState {
5
5
  container: HTMLDivElement | null;
6
- statsData: StatsApiResponse | null;
6
+ statsItems: StatsItem[];
7
7
  isDataLoading: boolean;
8
8
  }
9
9
  declare class StatsView extends Component<{}, StatsViewState> {
@@ -14,7 +14,7 @@ declare class StatsView extends Component<{}, StatsViewState> {
14
14
  constructor(props: {});
15
15
  componentDidMount(): void;
16
16
  componentWillUnmount(): void;
17
- renderStatsComponents: () => React.ReactElement[];
17
+ renderItems: () => React.JSX.Element[] | null;
18
18
  render(): React.JSX.Element;
19
19
  }
20
20
  export default StatsView;
@@ -2,11 +2,9 @@
2
2
  import React from 'react';
3
3
  import './TeamStatsView.styles.css';
4
4
  import { WithFocusableProps } from '@/external/spatial-navigation';
5
- import { Team, TeamStatistic } from '../../interfaces/IStats';
5
+ import { TeamStatsItem } from '../../view-model/StatsViewModel';
6
6
  export interface TeamStatsViewProps {
7
- homeTeam: Team;
8
- awayTeam: Team;
9
- statistics?: TeamStatistic[];
7
+ item: TeamStatsItem;
10
8
  }
11
9
  declare const _default: {
12
10
  new (props?: (TeamStatsViewProps & WithFocusableProps) | undefined, context?: any): {
@@ -2,28 +2,12 @@
2
2
  import React from 'react';
3
3
  import './TeamsView.styles.css';
4
4
  import { WithFocusableProps } from '@/external/spatial-navigation';
5
- type Team = {
6
- color?: string;
7
- id: string;
8
- logo: string;
9
- name?: string;
10
- abbreviation: string;
11
- record?: string;
12
- linescores: string[];
13
- };
14
- export type HeaderTeamStatItem = {
15
- isLive: boolean;
16
- linescoresHeader: string[];
17
- statistics?: {
18
- displayName: string;
19
- homeTeamValue: number;
20
- awayTeamValue: number;
21
- }[];
22
- homeTeam: Team;
23
- awayTeam: Team;
5
+ import { HeaderTeamStatItem } from '../../view-model/StatsViewModel';
6
+ type TeamsProps = {
7
+ item: HeaderTeamStatItem;
24
8
  };
25
9
  declare const _default: {
26
- new (props?: (HeaderTeamStatItem & WithFocusableProps) | undefined, context?: any): {
10
+ new (props?: (TeamsProps & WithFocusableProps) | undefined, context?: any): {
27
11
  state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
28
12
  navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
29
13
  getChildContext(): {
@@ -43,20 +27,20 @@ declare const _default: {
43
27
  componentDidMount(): void;
44
28
  componentDidUpdate(): void;
45
29
  componentWillUnmount(): void;
46
- render(): React.ReactElement<HeaderTeamStatItem & WithFocusableProps>;
47
- 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: HeaderTeamStatItem & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
30
+ render(): React.ReactElement<TeamsProps & WithFocusableProps>;
31
+ 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: TeamsProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
48
32
  forceUpdate(callBack?: (() => any) | undefined): void;
49
33
  props: Readonly<{
50
34
  children?: React.ReactNode;
51
- }> & Readonly<HeaderTeamStatItem & WithFocusableProps>;
35
+ }> & Readonly<TeamsProps & WithFocusableProps>;
52
36
  context: any;
53
37
  refs: {
54
38
  [key: string]: React.ReactInstance;
55
39
  };
56
40
  componentWillMount?(): void;
57
- componentWillReceiveProps?(nextProps: Readonly<HeaderTeamStatItem & WithFocusableProps>, nextContext: any): void;
58
- shouldComponentUpdate?(nextProps: Readonly<HeaderTeamStatItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
59
- componentWillUpdate?(nextProps: Readonly<HeaderTeamStatItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
41
+ componentWillReceiveProps?(nextProps: Readonly<TeamsProps & WithFocusableProps>, nextContext: any): void;
42
+ shouldComponentUpdate?(nextProps: Readonly<TeamsProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
43
+ componentWillUpdate?(nextProps: Readonly<TeamsProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
60
44
  };
61
45
  contextTypes: {
62
46
  parentFocusKey: import("prop-types").Requireable<string>;
@@ -2,23 +2,12 @@
2
2
  import React from 'react';
3
3
  import './WinProbability.styles.css';
4
4
  import { WithFocusableProps } from '@/external/spatial-navigation';
5
- export type WinProbabilityStatsItem = {
6
- chartImageUrl: string;
7
- awayTeam: {
8
- id: string;
9
- abbreviation: string;
10
- logo: string;
11
- winPercentage: string;
12
- };
13
- homeTeam: {
14
- id: string;
15
- abbreviation: string;
16
- logo: string;
17
- winPercentage: string;
18
- };
5
+ import { WinProbabilityStatsItem } from '../../view-model/StatsViewModel';
6
+ type WinProbabilityProps = {
7
+ item: WinProbabilityStatsItem;
19
8
  };
20
9
  declare const _default: {
21
- new (props?: (WinProbabilityStatsItem & WithFocusableProps) | undefined, context?: any): {
10
+ new (props?: (WinProbabilityProps & WithFocusableProps) | undefined, context?: any): {
22
11
  state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
23
12
  navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
24
13
  getChildContext(): {
@@ -38,20 +27,20 @@ declare const _default: {
38
27
  componentDidMount(): void;
39
28
  componentDidUpdate(): void;
40
29
  componentWillUnmount(): void;
41
- render(): React.ReactElement<WinProbabilityStatsItem & WithFocusableProps>;
42
- 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: WinProbabilityStatsItem & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
30
+ render(): React.ReactElement<WinProbabilityProps & WithFocusableProps>;
31
+ 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: WinProbabilityProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
43
32
  forceUpdate(callBack?: (() => any) | undefined): void;
44
33
  props: Readonly<{
45
34
  children?: React.ReactNode;
46
- }> & Readonly<WinProbabilityStatsItem & WithFocusableProps>;
35
+ }> & Readonly<WinProbabilityProps & WithFocusableProps>;
47
36
  context: any;
48
37
  refs: {
49
38
  [key: string]: React.ReactInstance;
50
39
  };
51
40
  componentWillMount?(): void;
52
- componentWillReceiveProps?(nextProps: Readonly<WinProbabilityStatsItem & WithFocusableProps>, nextContext: any): void;
53
- shouldComponentUpdate?(nextProps: Readonly<WinProbabilityStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
54
- componentWillUpdate?(nextProps: Readonly<WinProbabilityStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
41
+ componentWillReceiveProps?(nextProps: Readonly<WinProbabilityProps & WithFocusableProps>, nextContext: any): void;
42
+ shouldComponentUpdate?(nextProps: Readonly<WinProbabilityProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
43
+ componentWillUpdate?(nextProps: Readonly<WinProbabilityProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
55
44
  };
56
45
  contextTypes: {
57
46
  parentFocusKey: import("prop-types").Requireable<string>;