@maestro_io/maestro-web-sdk 5.1.2 → 5.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.
- package/dist/1.maestro-web-sdk.esm.js +1 -1
- package/dist/1.maestro-web-sdk.esm.js.map +1 -1
- package/dist/10.maestro-web-sdk.esm.js +1 -1
- package/dist/10.maestro-web-sdk.esm.js.map +1 -1
- package/dist/11.maestro-web-sdk.esm.js +1 -1
- package/dist/11.maestro-web-sdk.esm.js.map +1 -1
- package/dist/12.maestro-web-sdk.esm.js +1 -1
- package/dist/12.maestro-web-sdk.esm.js.map +1 -1
- package/dist/13.maestro-web-sdk.esm.js +1 -1
- package/dist/13.maestro-web-sdk.esm.js.map +1 -1
- package/dist/14.maestro-web-sdk.esm.js +1 -1
- package/dist/14.maestro-web-sdk.esm.js.map +1 -1
- package/dist/15.maestro-web-sdk.esm.js +1 -1
- package/dist/15.maestro-web-sdk.esm.js.map +1 -1
- package/dist/16.maestro-web-sdk.esm.js +1 -1
- package/dist/16.maestro-web-sdk.esm.js.map +1 -1
- package/dist/17.maestro-web-sdk.esm.js +1 -1
- package/dist/17.maestro-web-sdk.esm.js.map +1 -1
- package/dist/18.maestro-web-sdk.esm.js +1 -1
- package/dist/18.maestro-web-sdk.esm.js.map +1 -1
- package/dist/19.maestro-web-sdk.esm.js +1 -1
- package/dist/19.maestro-web-sdk.esm.js.map +1 -1
- package/dist/2.maestro-web-sdk.esm.js +1 -1
- package/dist/20.maestro-web-sdk.esm.js +1 -1
- package/dist/20.maestro-web-sdk.esm.js.map +1 -1
- package/dist/21.maestro-web-sdk.esm.js +1 -1
- package/dist/21.maestro-web-sdk.esm.js.map +1 -1
- package/dist/22.maestro-web-sdk.esm.js +1 -1
- package/dist/22.maestro-web-sdk.esm.js.map +1 -1
- package/dist/23.maestro-web-sdk.esm.js +1 -1
- package/dist/23.maestro-web-sdk.esm.js.map +1 -1
- package/dist/24.maestro-web-sdk.esm.js +1 -1
- package/dist/24.maestro-web-sdk.esm.js.map +1 -1
- package/dist/25.maestro-web-sdk.esm.js +1 -1
- package/dist/25.maestro-web-sdk.esm.js.map +1 -1
- package/dist/26.maestro-web-sdk.esm.js +1 -1
- package/dist/26.maestro-web-sdk.esm.js.map +1 -1
- package/dist/27.maestro-web-sdk.esm.js +1 -1
- package/dist/27.maestro-web-sdk.esm.js.map +1 -1
- package/dist/28.maestro-web-sdk.esm.js +1 -1
- package/dist/28.maestro-web-sdk.esm.js.map +1 -1
- package/dist/29.maestro-web-sdk.esm.js +1 -1
- package/dist/29.maestro-web-sdk.esm.js.map +1 -1
- package/dist/3.maestro-web-sdk.esm.js +1 -1
- package/dist/3.maestro-web-sdk.esm.js.map +1 -1
- package/dist/30.maestro-web-sdk.esm.js +1 -1
- package/dist/30.maestro-web-sdk.esm.js.map +1 -1
- package/dist/31.maestro-web-sdk.esm.js +1 -1
- package/dist/31.maestro-web-sdk.esm.js.map +1 -1
- package/dist/32.maestro-web-sdk.esm.js +1 -1
- package/dist/32.maestro-web-sdk.esm.js.map +1 -1
- package/dist/33.maestro-web-sdk.esm.js +1 -1
- package/dist/33.maestro-web-sdk.esm.js.map +1 -1
- package/dist/34.maestro-web-sdk.esm.js +1 -1
- package/dist/34.maestro-web-sdk.esm.js.map +1 -1
- package/dist/35.maestro-web-sdk.esm.js +1 -1
- package/dist/35.maestro-web-sdk.esm.js.map +1 -1
- package/dist/36.maestro-web-sdk.esm.js +1 -1
- package/dist/36.maestro-web-sdk.esm.js.map +1 -1
- package/dist/37.maestro-web-sdk.esm.js +1 -1
- package/dist/37.maestro-web-sdk.esm.js.map +1 -1
- package/dist/38.maestro-web-sdk.esm.js +1 -1
- package/dist/38.maestro-web-sdk.esm.js.map +1 -1
- package/dist/39.maestro-web-sdk.esm.js +2 -0
- package/dist/39.maestro-web-sdk.esm.js.map +1 -0
- package/dist/4.maestro-web-sdk.esm.js +1 -1
- package/dist/4.maestro-web-sdk.esm.js.map +1 -1
- package/dist/40.maestro-web-sdk.esm.js +2 -0
- package/dist/40.maestro-web-sdk.esm.js.map +1 -0
- package/dist/5.maestro-web-sdk.esm.js +1 -1
- package/dist/5.maestro-web-sdk.esm.js.map +1 -1
- package/dist/6.maestro-web-sdk.esm.js +1 -1
- package/dist/6.maestro-web-sdk.esm.js.map +1 -1
- package/dist/7.maestro-web-sdk.esm.js +1 -1
- package/dist/7.maestro-web-sdk.esm.js.map +1 -1
- package/dist/8.maestro-web-sdk.esm.js +1 -1
- package/dist/8.maestro-web-sdk.esm.js.map +1 -1
- package/dist/9.maestro-web-sdk.esm.js +1 -1
- package/dist/9.maestro-web-sdk.esm.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/maestro-web-sdk.esm.js +3 -3
- package/dist/maestro-web-sdk.esm.js.map +1 -1
- package/dist/maestro-web-sdk.umd.js +3 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/components/atoms/SvgIcon/AddIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/AddIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/Icon.js +2 -0
- package/dist/src/components/core/PanelManager/PanelManager.js +5 -3
- package/dist/src/components/molecules/NetworkDialog/NetworkDialog.d.ts +11 -0
- package/dist/src/components/molecules/NetworkDialog/NetworkDialog.js +34 -0
- package/dist/src/components/molecules/NetworkDialog/index.d.ts +2 -0
- package/dist/src/components/molecules/NetworkDialog/index.js +2 -0
- package/dist/src/components/molecules/NetworkError/NetworkError.d.ts +104 -0
- package/dist/src/components/molecules/NetworkError/NetworkError.js +26 -0
- package/dist/src/components/molecules/NetworkError/index.d.ts +2 -0
- package/dist/src/components/molecules/NetworkError/index.js +2 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.d.ts +1 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.js +16 -7
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.d.ts +1 -0
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.js +11 -7
- package/dist/src/development/MaestroEventDelegate.js +1 -0
- package/dist/src/helpers/site.d.ts +1 -0
- package/dist/src/helpers/site.js +6 -0
- package/dist/src/helpers/siteConfig.d.ts +1 -0
- package/dist/src/helpers/siteConfig.js +5 -0
- package/dist/src/models/IPanel.d.ts +1 -1
- package/dist/src/models/IPanel.js +1 -1
- package/dist/src/modules/espn/bets/view/BetsView.js +1 -1
- package/dist/src/modules/espn/components/TabLoadError/TabLoadError.d.ts +96 -0
- package/dist/src/modules/espn/components/TabLoadError/TabLoadError.js +14 -0
- package/dist/src/modules/espn/components/TabLoadError/index.d.ts +2 -0
- package/dist/src/modules/espn/components/TabLoadError/index.js +2 -0
- package/dist/src/modules/espn/fantasy/components/TournamentOverflowQR/TournamentOverflowQR.d.ts +5 -5
- package/dist/src/modules/espn/fantasy/components/TournamentOverflowQR/TournamentOverflowQR.js +7 -73
- package/dist/src/modules/espn/fantasy/services/FantasyService.js +1 -1
- package/dist/src/modules/espn/fantasy/view/FantasyItemView.js +1 -1
- package/dist/src/modules/espn/fantasy/view/FantasyView.js +1 -1
- package/dist/src/modules/espn/key-plays/view/KeyPlayErrorStateView.js +1 -1
- package/dist/src/modules/espn/shop/view/ShopView.js +1 -1
- package/dist/src/modules/espn/stats/view/StatsView.js +1 -1
- package/dist/src/modules/fox/components/TabLoadError/TabLoadError.d.ts +96 -0
- package/dist/src/modules/fox/components/TabLoadError/TabLoadError.js +19 -0
- package/dist/src/modules/fox/components/TabLoadError/index.d.ts +2 -0
- package/dist/src/modules/fox/components/TabLoadError/index.js +2 -0
- package/dist/src/modules/fox/multi-view/interfaces/IMultiViewViewModel.d.ts +3 -0
- package/dist/src/modules/fox/multi-view/interfaces/IMultiViewViewModel.js +1 -0
- package/dist/src/modules/fox/multi-view/services/MultiViewService.d.ts +99 -0
- package/dist/src/modules/fox/multi-view/services/MultiViewService.js +94 -0
- package/dist/src/modules/fox/multi-view/types.d.ts +29 -43
- package/dist/src/modules/fox/multi-view/types.js +79 -82
- package/dist/src/modules/fox/multi-view/view/CuratedMultiview/CuratedMultiviews.d.ts +8 -0
- package/dist/src/modules/fox/multi-view/view/CuratedMultiview/CuratedMultiviews.js +91 -0
- package/dist/src/modules/fox/multi-view/view/CuratedMultiview/index.d.ts +2 -0
- package/dist/src/modules/fox/multi-view/view/CuratedMultiview/index.js +2 -0
- package/dist/src/modules/fox/multi-view/view/FoxMultiView.d.ts +1 -0
- package/dist/src/modules/fox/multi-view/view/FoxMultiView.js +62 -2
- package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/CustomMultiviewStreamsCard.d.ts +122 -0
- package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/CustomMultiviewStreamsCard.js +51 -0
- package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/index.d.ts +2 -0
- package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/index.js +2 -0
- package/dist/src/modules/fox/multi-view/view/components/LayoutSelector/LayoutSelector.d.ts +1 -1
- package/dist/src/modules/fox/multi-view/view/components/LayoutSelector/LayoutSelector.js +11 -14
- package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/CuratedMultiviewCard.d.ts +101 -0
- package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/CuratedMultiviewCard.js +21 -0
- package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/index.d.ts +2 -0
- package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/index.js +2 -0
- package/dist/src/modules/fox/multi-view/view-model/MultiViewViewModel.d.ts +63 -0
- package/dist/src/modules/fox/multi-view/view-model/MultiViewViewModel.js +328 -0
- package/dist/src/modules/fox/multi-view/view-model/index.d.ts +1 -0
- package/dist/src/modules/fox/multi-view/view-model/index.js +1 -0
- package/dist/src/services/NetworkManager/NetworkManager.js +1 -1
- package/dist/src/services/NetworkManager/errors.d.ts +3 -1
- package/dist/src/services/NetworkManager/errors.js +15 -1
- package/dist/src/services/StaticService/StaticService.js +1 -0
- package/dist/src/view-models/MaestroEventViewModel.d.ts +2 -0
- package/dist/src/view-models/MaestroEventViewModel.js +17 -1
- package/package.json +1 -1
package/dist/src/modules/espn/fantasy/components/TournamentOverflowQR/TournamentOverflowQR.js
CHANGED
|
@@ -2,93 +2,27 @@ import React from 'react';
|
|
|
2
2
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
3
3
|
import './TournamentOverflowQR.styles.css';
|
|
4
4
|
import Image from '@/components/atoms/Image';
|
|
5
|
-
import ActionButton from '@/components/molecules/ActionButton';
|
|
6
|
-
import SDK from '@/index';
|
|
7
5
|
const FocusableWrapper = withFocusable()((props) => {
|
|
8
|
-
const { children, focused = false,
|
|
9
|
-
return (React.createElement("div", { className: "tournament-overflow-qr focus-ring T02", "data-focused": focused, "data-
|
|
6
|
+
const { children, focused = false, backgroundImage } = props;
|
|
7
|
+
return (React.createElement("div", { className: "tournament-overflow-qr focus-ring T02", "data-focused": focused, "data-focuskey": props.focusKey || '', role: "button", tabIndex: 0, style: {
|
|
10
8
|
backgroundImage: `url(${backgroundImage})`,
|
|
11
|
-
} }, children
|
|
9
|
+
} }, children));
|
|
12
10
|
});
|
|
13
11
|
class TournamentOverflowQR extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
Object.defineProperty(this, "state", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: {
|
|
21
|
-
expanded: false,
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(this, "onDismissPress", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: () => {
|
|
29
|
-
this.setState({ expanded: false }, () => {
|
|
30
|
-
SDK.getMaestroEventViewModel().navigation.setFocus(this.focusKey);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
12
|
get focusKey() {
|
|
36
13
|
return `tournament-overflow-qr-${this.props.item.id}`;
|
|
37
14
|
}
|
|
38
|
-
|
|
39
|
-
const newValue = !this.state.expanded;
|
|
40
|
-
this.setState({
|
|
41
|
-
expanded: newValue,
|
|
42
|
-
}, () => {
|
|
43
|
-
if (newValue) {
|
|
44
|
-
SDK.getMaestroEventViewModel().navigation.setFocus(`${this.focusKey}`);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
this.props.onEnterPress();
|
|
48
|
-
}
|
|
49
|
-
onArrowPress(direction) {
|
|
50
|
-
if (this.state.expanded && (direction === 'up' || direction === 'down')) {
|
|
51
|
-
this.setState({
|
|
52
|
-
expanded: false,
|
|
53
|
-
}, () => {
|
|
54
|
-
SDK.getMaestroEventViewModel().navigation.navigateByDirection(direction);
|
|
55
|
-
});
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
onBackPress() {
|
|
61
|
-
if (this.state.expanded) {
|
|
62
|
-
this.setState({
|
|
63
|
-
expanded: false,
|
|
64
|
-
});
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
renderCollapsedView() {
|
|
70
|
-
const { item } = this.props;
|
|
71
|
-
return (React.createElement(React.Fragment, null,
|
|
72
|
-
React.createElement("div", { className: "tournament-overflow-qr-content" },
|
|
73
|
-
React.createElement("p", { className: "tournament-overflow-qr-title T30 FONT_BOLD_HEADLINE" }, item.title),
|
|
74
|
-
React.createElement("p", { className: "tournament-overflow-qr-subtitle T10 FONT_BOLD" }, item.description)),
|
|
75
|
-
React.createElement(Image, { src: item.logo, alt: "Tournament Logo", className: "tournament-overflow-qr-logo-image" })));
|
|
76
|
-
}
|
|
77
|
-
renderExpandedView(focused) {
|
|
15
|
+
renderExpandedView() {
|
|
78
16
|
const { item } = this.props;
|
|
79
17
|
return (React.createElement("div", { className: "tournament-overflow-qr-expanded" },
|
|
80
18
|
React.createElement(Image, { src: item.logo, alt: "Tournament Logo", className: "tournament-overflow-qr-expanded-logo" }),
|
|
81
19
|
React.createElement("p", { className: "tournament-overflow-qr-expanded-title T20 FONT_BOLD" }, item.title),
|
|
82
|
-
React.createElement(Image, { src: item.qrCode, alt: "QR Code", width:
|
|
83
|
-
React.createElement("p", { className: "tournament-overflow-qr-expanded-instructions
|
|
84
|
-
React.createElement(ActionButton, { onEnterPress: this.onDismissPress, focusKey: `${this.focusKey}-dismiss`, "data-focused": focused }, "Dismiss")));
|
|
20
|
+
React.createElement(Image, { src: item.qrCode, alt: "QR Code", width: 300, height: 300, className: "tournament-overflow-qr-expanded-qr" }),
|
|
21
|
+
React.createElement("p", { className: "tournament-overflow-qr-expanded-instructions T20 FONT_BOLD" }, item.description)));
|
|
85
22
|
}
|
|
86
23
|
render() {
|
|
87
24
|
const { item } = this.props;
|
|
88
|
-
|
|
89
|
-
return (React.createElement(FocusableWrapper, { ...this.props, focusKey: this.focusKey, onEnterPress: this.onEnterPress.bind(this), onArrowPress: this.onArrowPress.bind(this), onBackPress: this.onBackPress.bind(this), expanded: expanded, backgroundImage: item.background }, (focused) => expanded
|
|
90
|
-
? this.renderExpandedView(focused)
|
|
91
|
-
: this.renderCollapsedView()));
|
|
25
|
+
return (React.createElement(FocusableWrapper, { ...this.props, focusKey: this.focusKey, backgroundImage: item.background }, this.renderExpandedView()));
|
|
92
26
|
}
|
|
93
27
|
}
|
|
94
28
|
export default withFocusable()(TournamentOverflowQR);
|
|
@@ -37,7 +37,7 @@ const FantasyItemView = ({ item, onEnterPress: onEnterPressProp, }) => {
|
|
|
37
37
|
case 'tournament-bracket-card':
|
|
38
38
|
return (React.createElement(TournamentBracketCard, { key: item.id, item: item, onArrowPress: onArrowPress, onBecameFocused: onBecameFocused, onEnterPress: onEnterPress }));
|
|
39
39
|
case 'tournament-overflow-qr':
|
|
40
|
-
return (React.createElement(TournamentOverflowQR, { key: item.id, item: item, onEnterPress: onEnterPress, onBecameFocused: onBecameFocused }));
|
|
40
|
+
return (React.createElement(TournamentOverflowQR, { key: item.id, item: item, onArrowPress: onArrowPress, onEnterPress: onEnterPress, onBecameFocused: onBecameFocused }));
|
|
41
41
|
default:
|
|
42
42
|
console.warn('Unknown fantasy item type:', JSON.stringify(item));
|
|
43
43
|
return null;
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import './FantasyView.styles.css';
|
|
3
3
|
import ScrollableContainer from '@/components/core/ScrollableContainer';
|
|
4
4
|
import SDK from '@/index';
|
|
5
|
-
import TabLoadErrorView from '
|
|
5
|
+
import TabLoadErrorView from '../../components/TabLoadError';
|
|
6
6
|
import { captureException } from '@/sentry';
|
|
7
7
|
import FantasyItemView from './FantasyItemView';
|
|
8
8
|
import FantasyHeaderView from './FantasyHeaderView';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './KeyPlayErrorStateView.styles.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import SDK from '@/index';
|
|
4
|
-
import TabLoadErrorView from '
|
|
4
|
+
import TabLoadErrorView from '../../components/TabLoadError';
|
|
5
5
|
import { useMaxHeightToBottom } from '@/hooks/useMaxHeightToBottom';
|
|
6
6
|
const UnpopulatedEvent = () => {
|
|
7
7
|
const maxHeightRef = useMaxHeightToBottom();
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import './ShopView.styles.css';
|
|
3
3
|
import ScrollableContainer from '@/components/core/ScrollableContainer';
|
|
4
4
|
import SDK from '@/index';
|
|
5
|
-
import TabLoadErrorView from '
|
|
5
|
+
import TabLoadErrorView from '../../components/TabLoadError';
|
|
6
6
|
import { isShopProduct, } from '../types';
|
|
7
7
|
import ShopSection from './components/ShopSection';
|
|
8
8
|
import ProductDetailView from './ProductDetailView';
|
|
@@ -3,7 +3,7 @@ import './StatsView.styles.css';
|
|
|
3
3
|
import ScrollableContainer from '@/components/core/ScrollableContainer';
|
|
4
4
|
import SDK from '@/index';
|
|
5
5
|
import StatsItemView from './StatsItemView';
|
|
6
|
-
import TabLoadErrorView from '
|
|
6
|
+
import TabLoadErrorView from '../../components/TabLoadError';
|
|
7
7
|
import { captureException } from '@/sentry';
|
|
8
8
|
import { setupMaxHeightToBottom } from '@/hooks/useMaxHeightToBottom';
|
|
9
9
|
const STICKY_HEADER_HEIGHT = 32; // Match KeyPlaysView
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="prop-types" />
|
|
2
|
+
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './TabLoadError.styles.css';
|
|
5
|
+
declare const _default: {
|
|
6
|
+
new (props: (object & WithFocusableProps) | Readonly<object & WithFocusableProps>): {
|
|
7
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
8
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
9
|
+
getChildContext(): {
|
|
10
|
+
parentFocusKey: string;
|
|
11
|
+
};
|
|
12
|
+
setFocus: (focusKey: string) => void;
|
|
13
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
14
|
+
stealFocus: () => void;
|
|
15
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
16
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
17
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
18
|
+
onClickPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
19
|
+
onEnterReleaseHandler: () => void;
|
|
20
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
21
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
22
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
23
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
componentDidUpdate(): void;
|
|
26
|
+
componentWillUnmount(): void;
|
|
27
|
+
render(): React.ReactElement<object & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
28
|
+
context: any;
|
|
29
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<object & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
30
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
31
|
+
readonly props: Readonly<object & WithFocusableProps> & Readonly<{
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
}>;
|
|
34
|
+
refs: {
|
|
35
|
+
[key: string]: React.ReactInstance;
|
|
36
|
+
};
|
|
37
|
+
shouldComponentUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
38
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
39
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<object & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
40
|
+
componentWillMount?(): void;
|
|
41
|
+
UNSAFE_componentWillMount?(): void;
|
|
42
|
+
componentWillReceiveProps?(nextProps: Readonly<object & WithFocusableProps>, nextContext: any): void;
|
|
43
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<object & WithFocusableProps>, nextContext: any): void;
|
|
44
|
+
componentWillUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
45
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
46
|
+
};
|
|
47
|
+
new (props: object & WithFocusableProps, context: any): {
|
|
48
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
49
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
50
|
+
getChildContext(): {
|
|
51
|
+
parentFocusKey: string;
|
|
52
|
+
};
|
|
53
|
+
setFocus: (focusKey: string) => void;
|
|
54
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
55
|
+
stealFocus: () => void;
|
|
56
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
57
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
58
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
59
|
+
onClickPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
60
|
+
onEnterReleaseHandler: () => void;
|
|
61
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
62
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
63
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
64
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
65
|
+
componentDidMount(): void;
|
|
66
|
+
componentDidUpdate(): void;
|
|
67
|
+
componentWillUnmount(): void;
|
|
68
|
+
render(): React.ReactElement<object & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
69
|
+
context: any;
|
|
70
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: Readonly<object & WithFocusableProps>) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K> | null, callback?: (() => void) | undefined): void;
|
|
71
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
72
|
+
readonly props: Readonly<object & WithFocusableProps> & Readonly<{
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
}>;
|
|
75
|
+
refs: {
|
|
76
|
+
[key: string]: React.ReactInstance;
|
|
77
|
+
};
|
|
78
|
+
shouldComponentUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
79
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
80
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<object & WithFocusableProps>, prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
81
|
+
componentWillMount?(): void;
|
|
82
|
+
UNSAFE_componentWillMount?(): void;
|
|
83
|
+
componentWillReceiveProps?(nextProps: Readonly<object & WithFocusableProps>, nextContext: any): void;
|
|
84
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<object & WithFocusableProps>, nextContext: any): void;
|
|
85
|
+
componentWillUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
86
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<object & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
87
|
+
};
|
|
88
|
+
contextTypes: {
|
|
89
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
90
|
+
};
|
|
91
|
+
childContextTypes: {
|
|
92
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
93
|
+
};
|
|
94
|
+
contextType?: React.Context<any> | undefined;
|
|
95
|
+
};
|
|
96
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './TabLoadError.styles.css';
|
|
4
|
+
import ActionButton from '@/components/molecules/ActionButton';
|
|
5
|
+
const TabLoadErrorView = (props) => {
|
|
6
|
+
const { focused, onEnterPress } = props;
|
|
7
|
+
const setHeight = (element) => {
|
|
8
|
+
if (!element)
|
|
9
|
+
return;
|
|
10
|
+
const rect = element.getBoundingClientRect();
|
|
11
|
+
element.style.height = `${window.innerHeight - rect.top}px`;
|
|
12
|
+
};
|
|
13
|
+
return (React.createElement("div", { className: "tab-load-error", ref: setHeight },
|
|
14
|
+
React.createElement("h3", { className: "T70" }, "Oops! Something went wrong."),
|
|
15
|
+
React.createElement("p", { className: "T20" }, 'We are having trouble loading Multiview right now. Please try again'),
|
|
16
|
+
React.createElement("div", { className: "fox" },
|
|
17
|
+
React.createElement(ActionButton, { "data-focused": focused, onEnterPress: onEnterPress }, "Try Again"))));
|
|
18
|
+
};
|
|
19
|
+
export default withFocusable()(TabLoadErrorView);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { HttpMethod } from '@/services/NetworkManager/NetworkManager';
|
|
2
|
+
import { MultiViewLayout } from '../types';
|
|
3
|
+
export type ProductAPIData = {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
method: HttpMethod;
|
|
6
|
+
headers: Record<string, string>;
|
|
7
|
+
};
|
|
8
|
+
export type ProductAPIErrorPayload = {
|
|
9
|
+
code: number;
|
|
10
|
+
message: string;
|
|
11
|
+
success: false;
|
|
12
|
+
data?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type MultiViewListingRequest = {
|
|
15
|
+
layoutId: string;
|
|
16
|
+
listings: Array<{
|
|
17
|
+
listingId: string;
|
|
18
|
+
callsign: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export type MultiViewListingResponse = {
|
|
22
|
+
multiviewId?: string;
|
|
23
|
+
callbackSeconds?: number;
|
|
24
|
+
};
|
|
25
|
+
export interface CuratedMultiviewResponse {
|
|
26
|
+
status: boolean;
|
|
27
|
+
data?: {
|
|
28
|
+
items?: CuratedMultiviewItem[];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface CuratedMultiviewItem {
|
|
32
|
+
entity_id?: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
is_multiview?: boolean;
|
|
36
|
+
is_multiview_eligible?: boolean;
|
|
37
|
+
is_sportingevent?: boolean;
|
|
38
|
+
images?: {
|
|
39
|
+
still?: string;
|
|
40
|
+
};
|
|
41
|
+
multiview?: string[];
|
|
42
|
+
multiview_metadata?: CuratedMultiviewMetadata[];
|
|
43
|
+
}
|
|
44
|
+
interface CuratedMultiviewMetadata {
|
|
45
|
+
entity_id: string;
|
|
46
|
+
type: string;
|
|
47
|
+
is_sportingevent: boolean;
|
|
48
|
+
images: Record<string, unknown>;
|
|
49
|
+
left_team: Team;
|
|
50
|
+
right_team: Team;
|
|
51
|
+
}
|
|
52
|
+
interface Team {
|
|
53
|
+
abbreviation: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const isProductAPIValid: (data: any) => data is ProductAPIData;
|
|
56
|
+
/**
|
|
57
|
+
* Service for handling multi-view API calls
|
|
58
|
+
*/
|
|
59
|
+
declare class MultiViewService {
|
|
60
|
+
private networkManager;
|
|
61
|
+
private productAPI;
|
|
62
|
+
constructor();
|
|
63
|
+
/**
|
|
64
|
+
* Fetch available multi-view layouts
|
|
65
|
+
*
|
|
66
|
+
* @returns Promise resolving to layouts data
|
|
67
|
+
*/
|
|
68
|
+
getLayouts(): Promise<MultiViewLayout[]> | null;
|
|
69
|
+
/**
|
|
70
|
+
* Set the product API configuration
|
|
71
|
+
*
|
|
72
|
+
* @param productAPI - The product API endpoint, method, and headers
|
|
73
|
+
*/
|
|
74
|
+
setProductAPIData(productAPI: ProductAPIData): void;
|
|
75
|
+
/**
|
|
76
|
+
* Start polling curated multiviews using the product API configuration.
|
|
77
|
+
* Returns null if no product API has been set.
|
|
78
|
+
*
|
|
79
|
+
* @param interval - Polling interval in milliseconds
|
|
80
|
+
* @param onData - Callback invoked with the data on each successful poll
|
|
81
|
+
* @param onError - Optional callback invoked on error
|
|
82
|
+
* @returns Object with a stop function, or null if no productAPI is configured
|
|
83
|
+
*/
|
|
84
|
+
pollCuratedMultiviews(interval: number, onData: (data: CuratedMultiviewResponse) => void, onError?: (error: Error) => void): {
|
|
85
|
+
stop: () => void;
|
|
86
|
+
} | null;
|
|
87
|
+
/**
|
|
88
|
+
* Request an existing or new custom multiview.
|
|
89
|
+
* If the multiview exists, the response will include a multiviewId.
|
|
90
|
+
* If the multiview needs to be created, the response will include
|
|
91
|
+
* callbackSeconds indicating when to retry.
|
|
92
|
+
*
|
|
93
|
+
* @param config - The layout ID and listings for the multiview
|
|
94
|
+
* @param headers - Request headers (e.g. x-access-token, Content-Type)
|
|
95
|
+
* @returns Promise resolving to the multiview listing response
|
|
96
|
+
*/
|
|
97
|
+
getOrCreateCustomMultiview(config: MultiViewListingRequest, headers?: Record<string, string>): Promise<MultiViewListingResponse>;
|
|
98
|
+
}
|
|
99
|
+
export default MultiViewService;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import NetworkManager, { HttpMethod, } from '@/services/NetworkManager/NetworkManager';
|
|
2
|
+
const MULTIVIEW_BASE_URL = 'https://qa-mvlm.api.shared.digitalvideoplatform.com';
|
|
3
|
+
export const isProductAPIValid = (data) => {
|
|
4
|
+
if (!data || typeof data !== 'object')
|
|
5
|
+
return false;
|
|
6
|
+
return (typeof data.endpoint === 'string' &&
|
|
7
|
+
typeof data.method === 'string' &&
|
|
8
|
+
data.headers !== null &&
|
|
9
|
+
typeof data.headers === 'object' &&
|
|
10
|
+
!Array.isArray(data.headers));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Service for handling multi-view API calls
|
|
14
|
+
*/
|
|
15
|
+
class MultiViewService {
|
|
16
|
+
constructor() {
|
|
17
|
+
Object.defineProperty(this, "networkManager", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "productAPI", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: null
|
|
28
|
+
});
|
|
29
|
+
this.networkManager = new NetworkManager();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fetch available multi-view layouts
|
|
33
|
+
*
|
|
34
|
+
* @returns Promise resolving to layouts data
|
|
35
|
+
*/
|
|
36
|
+
getLayouts() {
|
|
37
|
+
if (!this.productAPI) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return this.networkManager.externalApiRequest({
|
|
41
|
+
endpoint: `${MULTIVIEW_BASE_URL}/mvlm/v1/layouts`,
|
|
42
|
+
headers: this.productAPI.headers,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Set the product API configuration
|
|
47
|
+
*
|
|
48
|
+
* @param productAPI - The product API endpoint, method, and headers
|
|
49
|
+
*/
|
|
50
|
+
setProductAPIData(productAPI) {
|
|
51
|
+
this.productAPI = productAPI;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Start polling curated multiviews using the product API configuration.
|
|
55
|
+
* Returns null if no product API has been set.
|
|
56
|
+
*
|
|
57
|
+
* @param interval - Polling interval in milliseconds
|
|
58
|
+
* @param onData - Callback invoked with the data on each successful poll
|
|
59
|
+
* @param onError - Optional callback invoked on error
|
|
60
|
+
* @returns Object with a stop function, or null if no productAPI is configured
|
|
61
|
+
*/
|
|
62
|
+
pollCuratedMultiviews(interval, onData, onError) {
|
|
63
|
+
if (!this.productAPI) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return this.networkManager.pollExternalApiRequest({
|
|
67
|
+
endpoint: this.productAPI.endpoint,
|
|
68
|
+
interval,
|
|
69
|
+
method: this.productAPI.method,
|
|
70
|
+
headers: this.productAPI.headers,
|
|
71
|
+
onData,
|
|
72
|
+
onError,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Request an existing or new custom multiview.
|
|
77
|
+
* If the multiview exists, the response will include a multiviewId.
|
|
78
|
+
* If the multiview needs to be created, the response will include
|
|
79
|
+
* callbackSeconds indicating when to retry.
|
|
80
|
+
*
|
|
81
|
+
* @param config - The layout ID and listings for the multiview
|
|
82
|
+
* @param headers - Request headers (e.g. x-access-token, Content-Type)
|
|
83
|
+
* @returns Promise resolving to the multiview listing response
|
|
84
|
+
*/
|
|
85
|
+
getOrCreateCustomMultiview(config, headers = {}) {
|
|
86
|
+
return this.networkManager.externalApiRequest({
|
|
87
|
+
endpoint: `${MULTIVIEW_BASE_URL}/mvlm/v1/mvlisting`,
|
|
88
|
+
method: HttpMethod.POST,
|
|
89
|
+
data: config,
|
|
90
|
+
headers,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export default MultiViewService;
|
|
@@ -1,62 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description Represents a single stream/camera listing available for multi-view
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface CuratedMultiviewListing {
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
homeTeam?: {
|
|
10
|
-
name: string;
|
|
11
|
-
abbreviation: string;
|
|
12
|
-
logoUrl: string;
|
|
13
|
-
score?: number;
|
|
14
|
-
};
|
|
15
|
-
awayTeam?: {
|
|
16
|
-
name: string;
|
|
17
|
-
abbreviation: string;
|
|
18
|
-
logoUrl: string;
|
|
19
|
-
score?: number;
|
|
20
|
-
};
|
|
21
|
-
status?: 'live' | 'upcoming' | 'ended';
|
|
22
|
-
metadata?: Record<string, unknown>;
|
|
6
|
+
description: string;
|
|
7
|
+
backgroundImage: string;
|
|
8
|
+
type: string;
|
|
23
9
|
}
|
|
24
10
|
/**
|
|
25
|
-
* @description
|
|
11
|
+
* @description Position data for a single window within a layout
|
|
12
|
+
*/
|
|
13
|
+
export interface LayoutPosition {
|
|
14
|
+
w: number;
|
|
15
|
+
h: number;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @description Defines a multi-view layout configuration with positioned windows
|
|
26
21
|
*/
|
|
27
22
|
export interface MultiViewLayout {
|
|
28
|
-
|
|
23
|
+
layoutId: string;
|
|
24
|
+
description: string;
|
|
25
|
+
positions: Record<string, LayoutPosition>;
|
|
29
26
|
name: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
index: number;
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
width: number;
|
|
36
|
-
height: number;
|
|
37
|
-
}>;
|
|
27
|
+
windowCount: number;
|
|
28
|
+
positionsOrder: string[];
|
|
38
29
|
}
|
|
39
30
|
/**
|
|
40
|
-
* @description
|
|
31
|
+
* @description Child listing with position for new multiview event payload (PRD: SDK to pass event to client)
|
|
41
32
|
*/
|
|
42
|
-
export interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
export interface NewMultiviewChildListing {
|
|
34
|
+
listingId: string;
|
|
35
|
+
callsign: string;
|
|
36
|
+
position: LayoutPosition;
|
|
46
37
|
}
|
|
47
38
|
/**
|
|
48
|
-
* @description
|
|
39
|
+
* @description Payload for fox-multiview:new-multiview panel event when a curated multiview is selected
|
|
49
40
|
*/
|
|
50
|
-
export interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
description?: string;
|
|
54
|
-
thumbnailUrl?: string;
|
|
55
|
-
listings: Listing[];
|
|
56
|
-
defaultLayout: MultiViewLayout;
|
|
57
|
-
metadata?: Record<string, unknown>;
|
|
41
|
+
export interface NewMultiviewPayload {
|
|
42
|
+
multiviewID: string;
|
|
43
|
+
childListings: NewMultiviewChildListing[];
|
|
58
44
|
}
|
|
59
45
|
/**
|
|
60
46
|
* @description Available layouts organized by stream count
|
|
61
47
|
*/
|
|
62
|
-
export declare const
|
|
48
|
+
export declare const DEFAULT_LAYOUTS_BY_LISTINGS_QUANTITY: Record<number, MultiViewLayout>;
|