@maestro_io/maestro-web-sdk 4.0.0-beta.3 → 4.0.0-beta.4
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/maestro-web-sdk.esm.js +4 -4
- package/dist/maestro-web-sdk.esm.js.map +1 -1
- package/dist/maestro-web-sdk.umd.js +4 -4
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/package.json +13 -9
- package/dist/src/components/atoms/BaseButton/BaseButton.d.ts +1 -1
- package/dist/src/components/atoms/Image/index.d.ts +1 -1
- package/dist/src/components/atoms/Rive/index.d.ts +141 -11
- package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.d.ts +1 -2
- package/dist/src/components/atoms/SvgIcon/BetsIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/ChatIcon.d.ts +4 -0
- package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.d.ts +1 -2
- package/dist/src/components/atoms/SvgIcon/CollapseIcon.d.ts +1 -2
- package/dist/src/components/atoms/SvgIcon/ExpandIcon.d.ts +1 -2
- package/dist/src/components/atoms/SvgIcon/FantasyIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/FlameIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/HelloWorldIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/Icon.d.ts +5 -5
- package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/PlayIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/ShopIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/ShopifyIcon.d.ts +4 -0
- package/dist/src/components/atoms/SvgIcon/StatsIcon.d.ts +1 -1
- package/dist/src/components/atoms/SvgIcon/TimesIcon.d.ts +1 -2
- package/dist/src/components/atoms/SvgIcon/WarningIcon.d.ts +1 -1
- package/dist/src/components/core/App/App.d.ts +1 -1
- package/dist/src/components/core/PanelManager/PanelManager.d.ts +1 -1
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.d.ts +8 -7
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.js +7 -6
- package/dist/src/components/molecules/ActionButton/ActionButton.d.ts +53 -7
- package/dist/src/components/molecules/HeadshotImage/HeadshotImage.d.ts +1 -1
- package/dist/src/components/molecules/Overlay/Overlay.d.ts +1 -1
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.d.ts +53 -7
- package/dist/src/components/molecules/TabLoadError/TabLoadError.d.ts +53 -7
- package/dist/src/components/molecules/WatchButton/WatchButton.d.ts +1 -1
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.d.ts +1 -1
- package/dist/src/components/organisms/SegmentController/SegmentController.d.ts +5 -4
- package/dist/src/development/TimeSeek.d.ts +1 -1
- package/dist/src/development/development.js +7 -4
- package/dist/src/external/ReactRenderer.js +15 -3
- package/dist/src/external/spatial-navigation/withFocusable.d.ts +53 -7
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.js +1 -1
- package/dist/src/interfaces/IMaestroEvent.d.ts +2 -2
- package/dist/src/interfaces/IMaestroManager.d.ts +2 -2
- package/dist/src/modules/bets/view/BetsView.d.ts +3 -3
- package/dist/src/modules/bets/view/HotProps/HotPropsView.d.ts +53 -7
- package/dist/src/modules/bets/view/SixPack/SixPackView.d.ts +5 -4
- package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.d.ts +1 -1
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +53 -7
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.d.ts +5 -4
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/Boost/Boost.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/Straight/Straight.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.d.ts +1 -2
- package/dist/src/modules/bets/view/UserBets/UserBetsView.d.ts +3 -3
- package/dist/src/modules/bets/view/components/Bet/Bet.d.ts +99 -11
- package/dist/src/modules/bets/view/components/BetPill/BetPill.d.ts +1 -1
- package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.d.ts +1 -1
- package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.d.ts +1 -1
- package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.d.ts +1 -1
- package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +5 -4
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.d.ts +1 -1
- package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.d.ts +53 -7
- package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.d.ts +53 -7
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.d.ts +1 -1
- package/dist/src/modules/fantasy/view/FantasyItemView.d.ts +6 -5
- package/dist/src/modules/fantasy/view/FantasyView.d.ts +3 -3
- package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.d.ts +1 -1
- package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.d.ts +53 -7
- package/dist/src/modules/fantasy/view/LoginView/LoginView.d.ts +53 -7
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.d.ts +53 -7
- package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.d.ts +1 -1
- package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.d.ts +53 -7
- package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.d.ts +1 -1
- package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.d.ts +53 -7
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.d.ts +53 -7
- package/dist/src/modules/fantasy/view/PromoView/PromoView.d.ts +53 -7
- package/dist/src/modules/hello-world/HelloWorldImage.d.ts +3 -0
- package/dist/src/modules/hello-world/HelloWorldView.d.ts +11 -0
- package/dist/src/modules/hello-world/HelloWorldView.js +33 -0
- package/dist/src/modules/hello-world/index.d.ts +2 -0
- package/dist/src/modules/hello-world/index.js +2 -0
- package/dist/src/modules/key-plays/constants.js +1 -3
- package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.d.ts +1 -1
- package/dist/src/modules/key-plays/view/KeyPlayCardView.d.ts +7 -6
- package/dist/src/modules/key-plays/view/KeyPlayCardView.js +3 -3
- package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.d.ts +1 -1
- package/dist/src/modules/key-plays/view/KeyPlaysView.d.ts +3 -3
- package/dist/src/modules/shop/mocks.js +1 -0
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.d.ts +1 -2
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.js +5 -1
- package/dist/src/modules/shop/view/ShopView.d.ts +3 -3
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.d.ts +54 -8
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.js +1 -1
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.d.ts +53 -7
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.js +1 -1
- package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.d.ts +1 -2
- package/dist/src/modules/shop/view/components/ShopSection/ShopSection.d.ts +5 -4
- package/dist/src/modules/shop/view-model/ShopViewModel.js +5 -1
- package/dist/src/modules/stats/utils/renderTeamStatistic.d.ts +1 -2
- package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +2 -2
- package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +1 -2
- package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +1 -1
- package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.d.ts +53 -7
- package/dist/src/modules/stats/view/DriveSummary/DriveSummary.d.ts +1 -1
- package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.d.ts +1 -1
- package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.d.ts +1 -2
- package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.d.ts +1 -2
- package/dist/src/modules/stats/view/GameLeaders/GameLeaders.d.ts +5 -4
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.d.ts +2 -2
- package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +53 -7
- package/dist/src/modules/stats/view/Penalties/Penalties.d.ts +1 -2
- package/dist/src/modules/stats/view/RecentGames/RecentGames.d.ts +53 -7
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.d.ts +1 -1
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.js +3 -1
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.d.ts +53 -7
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.d.ts +1 -2
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.d.ts +5 -2
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.js +20 -1
- package/dist/src/modules/stats/view/StatsItemView.d.ts +6 -5
- package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.d.ts +53 -7
- package/dist/src/modules/stats/view/StatsView.d.ts +3 -3
- package/dist/src/modules/stats/view/TeamStats/TeamStatsView.d.ts +53 -7
- package/dist/src/modules/stats/view/Teams/StatsCarousel.d.ts +2 -2
- package/dist/src/modules/stats/view/Teams/StatsProgressBar.d.ts +1 -2
- package/dist/src/modules/stats/view/Teams/Teams.d.ts +53 -7
- package/dist/src/modules/stats/view/WinProbability/WinProbability.d.ts +53 -7
- package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.d.ts +53 -7
- package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.d.ts +1 -2
- package/dist/src/modules/stats/view-model/StatsViewModel.d.ts +1 -1
- package/dist/src/modules/stats/view-model/StatsViewModel.js +1 -1
- package/dist/src/services/AnalyticsService/AnalyticsService.js +3 -1
- package/dist/src/services/NetworkManager/NetworkManager.js +3 -3
- package/dist/src/view-models/MaestroEventViewModel.d.ts +1 -1
- package/dist/src/view-models/MaestroEventViewModel.js +6 -9
- package/package.json +13 -9
|
@@ -146,7 +146,7 @@ export class StatsViewModel extends ViewModel {
|
|
|
146
146
|
* Sets panel-specific data configuration
|
|
147
147
|
* @param panelData - Object containing panel configuration
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
setDataToPanel(panelData) {
|
|
150
150
|
if ('overrideUrl' in panelData) {
|
|
151
151
|
const overrideUrl = panelData.overrideUrl;
|
|
152
152
|
if (typeof overrideUrl === 'string' && overrideUrl.length > 0) {
|
|
@@ -138,10 +138,12 @@ class AnalyticsService {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
const metadata = pageConfig.page.metadata;
|
|
141
|
-
const event = SDK.getMaestroEventViewModel().getCurrentEventID();
|
|
142
141
|
const airing = metadata?.external_field_4 === 'airing'
|
|
143
142
|
? metadata.external_field_1 || ''
|
|
144
143
|
: '';
|
|
144
|
+
const event = metadata?.external_field_4 === 'event'
|
|
145
|
+
? metadata.external_field_1 || 'unknown'
|
|
146
|
+
: 'unknown';
|
|
145
147
|
const sport = metadata?.external_field_2 || '';
|
|
146
148
|
const league = metadata?.external_field_3 || '';
|
|
147
149
|
return {
|
|
@@ -122,7 +122,7 @@ class NetworkManager {
|
|
|
122
122
|
/**
|
|
123
123
|
* Make a request to the Maestro API
|
|
124
124
|
*/
|
|
125
|
-
async maestroApiRequest({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache =
|
|
125
|
+
async maestroApiRequest({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache = false, maestroDefaultHeaders = null, skipResponseBodyDeserialization = false, }) {
|
|
126
126
|
// Add SDK flavor to headers
|
|
127
127
|
const requestHeaders = {
|
|
128
128
|
'x-maestro-maestro-kit-flavor': SDK_FLAVOR,
|
|
@@ -179,7 +179,7 @@ class NetworkManager {
|
|
|
179
179
|
/**
|
|
180
180
|
* Make a request to an external API
|
|
181
181
|
*/
|
|
182
|
-
async externalApiRequest({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache =
|
|
182
|
+
async externalApiRequest({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache = false, skipResponseBodyDeserialization = false, }) {
|
|
183
183
|
// Check cache if using GET and cache is enabled
|
|
184
184
|
if (method === HttpMethod.GET && useCache) {
|
|
185
185
|
const cacheKey = this.cacheManager.produceCacheKey(JSON.stringify({
|
|
@@ -225,7 +225,7 @@ class NetworkManager {
|
|
|
225
225
|
/**
|
|
226
226
|
* Make a request to an external API and return both data and headers
|
|
227
227
|
*/
|
|
228
|
-
async externalApiRequestWithHeaders({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache =
|
|
228
|
+
async externalApiRequestWithHeaders({ endpoint, method = HttpMethod.GET, params = {}, data = null, headers = {}, useCache = false, skipResponseBodyDeserialization = false, }) {
|
|
229
229
|
// Check cache if using GET and cache is enabled
|
|
230
230
|
if (method === HttpMethod.GET && useCache) {
|
|
231
231
|
const cacheKey = this.cacheManager.produceCacheKey(JSON.stringify({
|
|
@@ -30,7 +30,7 @@ export declare class MaestroEventViewModel extends ViewModel implements IMaestro
|
|
|
30
30
|
setActivePanel(panelType: MaestroPanelType): void;
|
|
31
31
|
updatePlayerTimeCode(timestamp: number): void;
|
|
32
32
|
getPlayerTimeCode(): number | null;
|
|
33
|
-
|
|
33
|
+
setDataToPanel(panelData: Record<string, any>): void;
|
|
34
34
|
deinit(): Promise<void>;
|
|
35
35
|
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
36
36
|
updateUserSettings(settings: IUserSettings): Promise<void>;
|
|
@@ -111,10 +111,7 @@ export class MaestroEventViewModel extends ViewModel {
|
|
|
111
111
|
? new ShopViewModel(eventId)
|
|
112
112
|
: null;
|
|
113
113
|
this.panelManagerViewModel = new PanelManagerViewModel();
|
|
114
|
-
this.navigation = new SpatialNavigation(
|
|
115
|
-
throttle: 150,
|
|
116
|
-
throttleKeypresses: true,
|
|
117
|
-
});
|
|
114
|
+
this.navigation = new SpatialNavigation();
|
|
118
115
|
}
|
|
119
116
|
setActivePanel(panelType) {
|
|
120
117
|
const index = this.panelManagerViewModel.getIndex(panelType);
|
|
@@ -143,7 +140,7 @@ export class MaestroEventViewModel extends ViewModel {
|
|
|
143
140
|
getPlayerTimeCode() {
|
|
144
141
|
return this.playerTimeCode;
|
|
145
142
|
}
|
|
146
|
-
|
|
143
|
+
setDataToPanel(panelData) {
|
|
147
144
|
const panelTypes = Object.keys(panelData);
|
|
148
145
|
// Map panel types to view model instances
|
|
149
146
|
const viewModels = {
|
|
@@ -160,12 +157,12 @@ export class MaestroEventViewModel extends ViewModel {
|
|
|
160
157
|
const viewModel = viewModels[panelType];
|
|
161
158
|
if (!viewModel) {
|
|
162
159
|
// Panel is not initialized, so we ignore the data
|
|
163
|
-
console.log(`[
|
|
160
|
+
console.log(`[setDataToPanel] Panel '${panelType}' not initialized/supported. Data ignored.`);
|
|
164
161
|
}
|
|
165
162
|
else {
|
|
166
|
-
// Panel exists, call its
|
|
167
|
-
if (panelType === 'espnStats' && viewModel.
|
|
168
|
-
viewModel.
|
|
163
|
+
// Panel exists, call its setDataToPanel method
|
|
164
|
+
if (panelType === 'espnStats' && viewModel.setDataToPanel) {
|
|
165
|
+
viewModel.setDataToPanel(data);
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
168
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maestro_io/maestro-web-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.4",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/maestro-web-sdk.umd.js",
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
"@babel/preset-env": "7.12.1",
|
|
39
39
|
"@babel/preset-react": "7.12.1",
|
|
40
40
|
"@babel/preset-typescript": "7.12.1",
|
|
41
|
-
"@types/enzyme-adapter-react-
|
|
41
|
+
"@types/enzyme-adapter-react-16": "^1.0.6",
|
|
42
42
|
"@types/jest": "24.0.25",
|
|
43
43
|
"@types/node": "10",
|
|
44
44
|
"@types/prop-types": "^15.7.10",
|
|
45
|
-
"@types/react": "
|
|
46
|
-
"@types/react-dom": "
|
|
45
|
+
"@types/react": "16.14.34",
|
|
46
|
+
"@types/react-dom": "16.9.18",
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "2.34.0",
|
|
48
48
|
"@typescript-eslint/parser": "2.34.0",
|
|
49
49
|
"babel-jest": "26.6.3",
|
|
50
50
|
"babel-loader": "8",
|
|
51
51
|
"css-loader": "5",
|
|
52
52
|
"enzyme": "3.11.0",
|
|
53
|
-
"enzyme-adapter-react-
|
|
53
|
+
"enzyme-adapter-react-16": "1.15.7",
|
|
54
54
|
"eslint": "6.8.0",
|
|
55
55
|
"eslint-config-prettier": "6.0.0",
|
|
56
56
|
"eslint-plugin-react": "7.20.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"jest": "26.6.3",
|
|
63
63
|
"nodemon": "^3.1.9",
|
|
64
64
|
"prettier": "2.0.5",
|
|
65
|
-
"react-test-renderer": "
|
|
65
|
+
"react-test-renderer": "16.14.0",
|
|
66
66
|
"style-loader": "2",
|
|
67
67
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
68
68
|
"typescript": "^4",
|
|
@@ -75,9 +75,13 @@
|
|
|
75
75
|
"@sentry/browser": "7.68.0",
|
|
76
76
|
"axios": "^0.27.2",
|
|
77
77
|
"flexibility": "^2.0.1",
|
|
78
|
-
"prop-types": "15",
|
|
79
|
-
"react": "
|
|
80
|
-
"react-dom": "
|
|
78
|
+
"prop-types": "15.8.1",
|
|
79
|
+
"react": "16.14.0",
|
|
80
|
+
"react-dom": "16.14.0"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"react": "^16.0.0",
|
|
84
|
+
"react-dom": "^16.0.0"
|
|
81
85
|
},
|
|
82
86
|
"resolutions": {
|
|
83
87
|
"sockjs-client": "1.5.1",
|