@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
@@ -3,6 +3,7 @@ import IMaestroEventDelegate from './interfaces/IMaestroEventDelegate';
3
3
  * Our own implementation of the IMaestroEventDelegate interface. Useful for Development and Testing
4
4
  */
5
5
  export default class MaestroEventDelegate implements IMaestroEventDelegate {
6
+ getStatsAPIBaseURL(): string;
6
7
  getBettingAPIBaseURL(): string;
7
8
  userRequestedNewKeyPlaysData(): Promise<void>;
8
9
  startFocusManagement(): Promise<void>;
@@ -3,7 +3,6 @@ import KeyPlaysIcon from './KeyPlaysIcon';
3
3
  import PlayIcon from './PlayIcon';
4
4
  import BetsIcon from './BetsIcon';
5
5
  import StatsIcon from './StatsIcon';
6
- import FantasyIcon from './FantasyIcon';
7
6
  import WarningIcon from './WarningIcon';
8
7
  import FlameIcon from './FlameIcon';
9
8
  import BetsWarningIcon from './BetsWarningIcon';
@@ -13,7 +12,6 @@ declare const iconImports: {
13
12
  play: typeof PlayIcon;
14
13
  bets: typeof BetsIcon;
15
14
  stats: typeof StatsIcon;
16
- fantasy: typeof FantasyIcon;
17
15
  warning: typeof WarningIcon;
18
16
  expand: (props: IconProps) => React.JSX.Element;
19
17
  collapse: (props: IconProps) => React.JSX.Element;
@@ -11,7 +11,9 @@ export interface ScrollableContainerContextType {
11
11
  * Called when an item is focused.
12
12
  * This function scrolls the container to the focused item if necessary.
13
13
  */
14
- scrollToFocusedElement: (layout: Layout) => void;
14
+ scrollToFocusedElement: (layout: Layout, options?: {
15
+ offsetTop?: number;
16
+ }) => void;
15
17
  /**
16
18
  * An array of all registered focusable items.
17
19
  * This is used to determine the order of focusable items.
@@ -70,7 +70,7 @@ interface UpdateFocusableOptions {
70
70
  export declare const getChildClosestToOrigin: (children: FocusableComponent[]) => FocusableComponent;
71
71
  declare class SpatialNavigation {
72
72
  private focusableComponents;
73
- private focusKey;
73
+ focusKey: string | null;
74
74
  private parentsHavingFocusedChild;
75
75
  private nativeMode;
76
76
  private throttle;
@@ -6,58 +6,72 @@ import IMaestroKeyPlaysResponse from '../modules/key-plays/interfaces/IKeyPlaysR
6
6
  export default interface IMaestroEvent {
7
7
  /**
8
8
  * @description Tells the SDK that the user just started playing a new key play clip at the given index.
9
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/playback-controls/didStartPlayingClip
9
10
  */
10
11
  didStartPlayingClip(index: number): void;
11
12
  /**
12
13
  * @description Tells the SDK that the user just stopped playing a key play clip at the given index.
14
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/playback-controls/didStopPlayingClip
13
15
  */
14
16
  didStopPlayingClip(index: number): void;
15
17
  /**
16
18
  * @description Tells the SDK that the user tried to play the clip but it failed to play back.
19
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/playback-controls/didFailToPlayClip
17
20
  */
18
21
  didFailToPlayClip(index: number): void;
19
22
  /**
20
23
  * @description Updates the SDK with the latest progress in the playback of the currently-played key play clip, from 0 to 1.
24
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/playback-controls/didUpdatePlaybackProgressOfClip
21
25
  */
22
26
  didUpdatePlaybackProgressOfClip(index: number, to: number): void;
23
27
  /**
24
28
  * @description Tells the SDK that the app displayed the MaestroPanel.
29
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/panel-management/didShowPanel
25
30
  */
26
31
  didShowPanel(): Promise<void>;
27
32
  /**
28
33
  * @description Tells the SDK that the app hid the MaestroPanel.
34
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/panel-management/didHidePanel
29
35
  */
30
36
  didHidePanel(): Promise<void>;
31
37
  /**
32
38
  * @description Alerts the SDK that the current event does not support key plays.
39
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/panel-management/currentEventDoesNotSupportKeyPlays
33
40
  */
34
41
  currentEventDoesNotSupportKeyPlays(): void;
35
42
  /**
36
43
  * @description Retrieves the event ID for the currently loaded event.
44
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/getCurrentEventID
37
45
  */
38
46
  getCurrentEventID(): string | null;
39
47
  /**
40
48
  * @description Retrieves the array index of the key play clip that is currently being played.
49
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/getCurrentlyPlayingClipIndex
41
50
  */
42
51
  getCurrentlyPlayingClipIndex(): number | null;
43
52
  /**
44
53
  * @description Retrieves the array index of the key plays clip that was most recently played.
54
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/getLastPlayedClipIndex
45
55
  */
46
56
  getLastPlayedClipIndex(): number | null;
47
57
  /**
48
58
  * @description Retrieves the progress (between 0 and 1) of the currently-played key play clip.
59
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/getCurrentClipPlaybackProgress
49
60
  */
50
61
  getCurrentClipPlaybackProgress(): number | null;
51
62
  /**
52
63
  * @description Retrieves the number of key plays.
64
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/getKeyPlaysCount
53
65
  */
54
66
  getKeyPlaysCount(): number | null;
55
67
  /**
56
68
  * @description Tells the SDK to start managing focus.
69
+ * https://developers.maestro.io/sdk/web/focus-management/parent-app-focus
57
70
  */
58
71
  startFocusManagement(): Promise<void>;
59
72
  /**
60
73
  * @description Feeds the SDK new key plays data. A null value indicates a failure to retrieve the data.
74
+ * https://developers.maestro.io/sdk/web/maestro-event-interface/state/updateKeyPlaysData
61
75
  */
62
76
  updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
63
77
  simulateUseCase<T = any>(useCase: TestUseCase, panelType: MaestroPanelType, testData?: T): void;
@@ -5,31 +5,44 @@ export default interface IMaestroEventDelegate {
5
5
  /**
6
6
  * @description Allows the SDK to tell the client app that the user has encountered an error screen for lack of valid key
7
7
  plays data, indicating the client app should call `updateKeyPlaysData` as soon as possible.
8
+ https://developers.maestro.io/sdk/web/event-delegate/userRequestedNewKeyPlaysData
8
9
  */
9
10
  userRequestedNewKeyPlaysData(): Promise<void>;
10
11
  /**
11
12
  * Allows the SDK to request the client app play a particular key plays clip, given its array index in the key plays list. Note that the `MaestroKeyPlaysResponse` subdivides the key plays by section, so the `index` referenced here assumes the client app has access to a flattened list of the key plays, disregarding the sectional subdivisions.
13
+ * https://developers.maestro.io/sdk/web/event-delegate/playClip
12
14
  */
13
15
  playClip(atIndex: number): void;
14
16
  /**
15
- * @description SDK can notify the client app when its time to handle the focus management
17
+ * @description SDK can notify the client app when its time to handle the focus management.
18
+ * https://developers.maestro.io/sdk/web/event-delegate/startFocusManagement
16
19
  */
17
20
  startFocusManagement(): Promise<void>;
18
21
  /**
19
- * @description Check if the user is authenticated for betting
22
+ * @description Check if the user is authenticated for betting.
23
+ * https://developers.maestro.io/sdk/web/event-delegate/userIsAuthenticated
20
24
  */
21
25
  userIsAuthenticated(): Promise<boolean>;
22
26
  /**
23
- * @description Get the user's SWID for authenticated betting requests
27
+ * @description Get the user's SWID for authenticated betting requests.
28
+ * https://developers.maestro.io/sdk/web/event-delegate/getUserSWID
24
29
  */
25
30
  getUserSWID(): Promise<string | null>;
26
31
  /**
27
- * @description Get the user's Cookie token for authenticated betting requests
32
+ * @description Get the user's Cookie token for authenticated betting requests.
33
+ * https://developers.maestro.io/sdk/web/event-delegate/getUserToken
28
34
  */
29
35
  getUserToken(): Promise<string | null>;
30
36
  /**
31
- * @description Get the API endpoint for betting-related requests.
32
- * This endpoint is used to fetch betting data, such as odds and betting lines.
37
+ * @description Get the API base URL for betting-related requests.
38
+ * This baseURL is used to fetch betting data, such as odds and betting lines.
39
+ * https://developers.maestro.io/sdk/web/event-delegate/getBettingAPIBaseURL
33
40
  */
34
41
  getBettingAPIBaseURL(): string;
42
+ /**
43
+ * @description Get the API base URL for stats-related requests.
44
+ * This baseURL is used to fetch stats data for the event.
45
+ *
46
+ */
47
+ getStatsAPIBaseURL(): string;
35
48
  }