@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
|
@@ -1,89 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description Available layouts organized by stream count
|
|
3
3
|
*/
|
|
4
|
-
export const
|
|
5
|
-
2:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
export const DEFAULT_LAYOUTS_BY_LISTINGS_QUANTITY = {
|
|
5
|
+
2: {
|
|
6
|
+
layoutId: 'LR',
|
|
7
|
+
description: 'Two equal-sized windows side by side',
|
|
8
|
+
positions: {
|
|
9
|
+
L: {
|
|
10
|
+
w: 0.4766,
|
|
11
|
+
h: 0.4766,
|
|
12
|
+
x: 0.259,
|
|
13
|
+
y: 0.5,
|
|
14
|
+
},
|
|
15
|
+
R: {
|
|
16
|
+
w: 0.4766,
|
|
17
|
+
h: 0.4766,
|
|
18
|
+
x: 0.7409,
|
|
19
|
+
y: 0.5,
|
|
20
|
+
},
|
|
14
21
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
name: '50/50',
|
|
23
|
+
windowCount: 2,
|
|
24
|
+
positionsOrder: ['L', 'R'],
|
|
25
|
+
},
|
|
26
|
+
3: {
|
|
27
|
+
layoutId: 'TLTRB',
|
|
28
|
+
description: 'Three equal-sized windows in T layout',
|
|
29
|
+
positions: {
|
|
30
|
+
B: {
|
|
31
|
+
w: 0.458,
|
|
32
|
+
h: 0.458,
|
|
33
|
+
x: 0.5,
|
|
34
|
+
y: 0.266,
|
|
35
|
+
},
|
|
36
|
+
TL: {
|
|
37
|
+
w: 0.458,
|
|
38
|
+
h: 0.458,
|
|
39
|
+
x: 0.268,
|
|
40
|
+
y: 0.7335,
|
|
41
|
+
},
|
|
42
|
+
TR: {
|
|
43
|
+
w: 0.458,
|
|
44
|
+
h: 0.458,
|
|
45
|
+
x: 0.732,
|
|
46
|
+
y: 0.7335,
|
|
47
|
+
},
|
|
23
48
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
49
|
+
name: 'Triple T',
|
|
50
|
+
windowCount: 3,
|
|
51
|
+
positionsOrder: ['TL', 'TR', 'B'],
|
|
52
|
+
},
|
|
53
|
+
4: {
|
|
54
|
+
layoutId: 'TLTRBLBR',
|
|
55
|
+
description: 'Four equal-sized windows in 2x2 grid',
|
|
56
|
+
positions: {
|
|
57
|
+
BL: {
|
|
58
|
+
w: 0.4766,
|
|
59
|
+
h: 0.4766,
|
|
60
|
+
x: 0.259,
|
|
61
|
+
y: 0.257,
|
|
62
|
+
},
|
|
63
|
+
BR: {
|
|
64
|
+
w: 0.4766,
|
|
65
|
+
h: 0.4766,
|
|
66
|
+
x: 0.741,
|
|
67
|
+
y: 0.257,
|
|
68
|
+
},
|
|
69
|
+
TL: {
|
|
70
|
+
w: 0.4766,
|
|
71
|
+
h: 0.4766,
|
|
72
|
+
x: 0.259,
|
|
73
|
+
y: 0.743,
|
|
74
|
+
},
|
|
75
|
+
TR: {
|
|
76
|
+
w: 0.4766,
|
|
77
|
+
h: 0.4766,
|
|
78
|
+
x: 0.741,
|
|
79
|
+
y: 0.743,
|
|
80
|
+
},
|
|
32
81
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
slots: [
|
|
38
|
-
{ index: 0, x: 0, y: 0, width: 100, height: 100 },
|
|
39
|
-
{ index: 1, x: 70, y: 70, width: 25, height: 25 },
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
3: [
|
|
44
|
-
{
|
|
45
|
-
id: 'layout-3-main-side',
|
|
46
|
-
name: 'Main + Side',
|
|
47
|
-
type: '60-40',
|
|
48
|
-
slots: [
|
|
49
|
-
{ index: 0, x: 0, y: 0, width: 60, height: 100 },
|
|
50
|
-
{ index: 1, x: 60, y: 0, width: 40, height: 50 },
|
|
51
|
-
{ index: 2, x: 60, y: 50, width: 40, height: 50 },
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 'layout-3-horizontal',
|
|
56
|
-
name: 'Horizontal',
|
|
57
|
-
type: '50-50',
|
|
58
|
-
slots: [
|
|
59
|
-
{ index: 0, x: 0, y: 0, width: 100, height: 33.33 },
|
|
60
|
-
{ index: 1, x: 0, y: 33.33, width: 100, height: 33.33 },
|
|
61
|
-
{ index: 2, x: 0, y: 66.66, width: 100, height: 33.34 },
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
4: [
|
|
66
|
-
{
|
|
67
|
-
id: 'layout-4-quad',
|
|
68
|
-
name: 'Quad',
|
|
69
|
-
type: 'quad',
|
|
70
|
-
slots: [
|
|
71
|
-
{ index: 0, x: 0, y: 0, width: 50, height: 50 },
|
|
72
|
-
{ index: 1, x: 50, y: 0, width: 50, height: 50 },
|
|
73
|
-
{ index: 2, x: 0, y: 50, width: 50, height: 50 },
|
|
74
|
-
{ index: 3, x: 50, y: 50, width: 50, height: 50 },
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'layout-4-main-grid',
|
|
79
|
-
name: 'Main + Grid',
|
|
80
|
-
type: '60-40',
|
|
81
|
-
slots: [
|
|
82
|
-
{ index: 0, x: 0, y: 0, width: 60, height: 100 },
|
|
83
|
-
{ index: 1, x: 60, y: 0, width: 40, height: 33.33 },
|
|
84
|
-
{ index: 2, x: 60, y: 33.33, width: 40, height: 33.33 },
|
|
85
|
-
{ index: 3, x: 60, y: 66.66, width: 40, height: 33.34 },
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
],
|
|
82
|
+
name: '2x2 Grid',
|
|
83
|
+
windowCount: 4,
|
|
84
|
+
positionsOrder: ['TL', 'TR', 'BL', 'BR'],
|
|
85
|
+
},
|
|
89
86
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './CuratedMultiviews.styles.css';
|
|
2
|
+
import { CuratedMultiviewItem } from '../../view-model/MultiViewViewModel';
|
|
3
|
+
type Props = {
|
|
4
|
+
onSelect: (item: CuratedMultiviewItem) => void;
|
|
5
|
+
items: CuratedMultiviewItem[];
|
|
6
|
+
};
|
|
7
|
+
declare const CuratedMultiviews: (props: Props) => JSX.Element;
|
|
8
|
+
export default CuratedMultiviews;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useState, useRef, useCallback, useLayoutEffect } from 'react';
|
|
2
|
+
import CuratedMultiviewCard from '../components/curated-multiview-card';
|
|
3
|
+
import './CuratedMultiviews.styles.css';
|
|
4
|
+
import SDK from '@/index';
|
|
5
|
+
const CuratedMultiviews = (props) => {
|
|
6
|
+
const [maxHeight, setMaxHeight] = useState('auto');
|
|
7
|
+
const [scrolled, setScrolled] = useState(false);
|
|
8
|
+
const refsArray = useRef([]);
|
|
9
|
+
const headerRef = useRef(null);
|
|
10
|
+
const wrapperRef = useRef(null);
|
|
11
|
+
const hasInitialized = useRef(false);
|
|
12
|
+
const getHeaderHeight = useCallback(() => {
|
|
13
|
+
if (!headerRef.current)
|
|
14
|
+
return 0;
|
|
15
|
+
return headerRef.current.offsetHeight;
|
|
16
|
+
}, []);
|
|
17
|
+
// Compute max-height after render when refs are populated, and when items change
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
if (!refsArray.current || refsArray.current.length === 0) {
|
|
20
|
+
setMaxHeight('auto');
|
|
21
|
+
hasInitialized.current = false;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const headerHeight = getHeaderHeight();
|
|
25
|
+
const totalHeight = refsArray.current.reduce((prev, curr) => {
|
|
26
|
+
if (!curr)
|
|
27
|
+
return prev;
|
|
28
|
+
return prev + curr.clientHeight;
|
|
29
|
+
}, headerHeight);
|
|
30
|
+
if (totalHeight > 0) {
|
|
31
|
+
setMaxHeight(`${totalHeight}px`);
|
|
32
|
+
hasInitialized.current = true;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setMaxHeight('auto');
|
|
36
|
+
hasInitialized.current = false;
|
|
37
|
+
}
|
|
38
|
+
}, [props.items, getHeaderHeight]);
|
|
39
|
+
// Calculate max-height from focused index to end
|
|
40
|
+
const updateMaxHeight = useCallback((focusedIndex) => {
|
|
41
|
+
const headerHeight = getHeaderHeight();
|
|
42
|
+
const items = refsArray.current.slice(focusedIndex);
|
|
43
|
+
const totalHeight = items.reduce((prev, curr) => {
|
|
44
|
+
if (!curr)
|
|
45
|
+
return prev;
|
|
46
|
+
return prev + curr.clientHeight;
|
|
47
|
+
}, headerHeight);
|
|
48
|
+
setMaxHeight(`${totalHeight}px`);
|
|
49
|
+
}, []);
|
|
50
|
+
// Scroll to element after transition
|
|
51
|
+
const scrollToElement = useCallback((focusedIndex) => {
|
|
52
|
+
const element = refsArray.current[focusedIndex];
|
|
53
|
+
if (!element || !wrapperRef.current)
|
|
54
|
+
return;
|
|
55
|
+
if (focusedIndex === 0) {
|
|
56
|
+
wrapperRef.current.scrollTop = 0;
|
|
57
|
+
setScrolled(false);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const wrapperRect = wrapperRef.current.getBoundingClientRect();
|
|
61
|
+
const elementRect = element.getBoundingClientRect();
|
|
62
|
+
const scrollTop = elementRect.top -
|
|
63
|
+
wrapperRect.top +
|
|
64
|
+
wrapperRef.current.scrollTop -
|
|
65
|
+
getHeaderHeight();
|
|
66
|
+
wrapperRef.current.scrollTop = scrollTop;
|
|
67
|
+
setScrolled(scrollTop > 0);
|
|
68
|
+
}, [getHeaderHeight]);
|
|
69
|
+
const handleBecameFocused = useCallback((focusedIndex) => () => {
|
|
70
|
+
updateMaxHeight(focusedIndex);
|
|
71
|
+
scrollToElement(focusedIndex);
|
|
72
|
+
}, [updateMaxHeight, scrollToElement]);
|
|
73
|
+
const onArrowPress = (d) => {
|
|
74
|
+
if (d === 'left') {
|
|
75
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const onBackPress = () => {
|
|
79
|
+
SDK.getMaestroEventViewModel().navigation.setFocus('PANEL_NAVIGATION');
|
|
80
|
+
};
|
|
81
|
+
const onSelectCuratedMultiview = (item) => () => {
|
|
82
|
+
props.onSelect(item);
|
|
83
|
+
};
|
|
84
|
+
return (React.createElement("div", { className: "curated-multiviews", style: { maxHeight }, ref: wrapperRef, "data-scrolled": scrolled },
|
|
85
|
+
React.createElement("div", { className: "header", ref: headerRef }, "Curated Multiview"),
|
|
86
|
+
props.items.map((item, index) => (React.createElement("div", { key: item.id, ref: (ref) => {
|
|
87
|
+
refsArray.current[index] = ref;
|
|
88
|
+
} },
|
|
89
|
+
React.createElement(CuratedMultiviewCard, { onEnterPress: onSelectCuratedMultiview(item), onBackPress: onBackPress, onArrowPress: onArrowPress, onBecameFocused: handleBecameFocused(index), selected: item.isSelected, listings: item.listings }))))));
|
|
90
|
+
};
|
|
91
|
+
export default CuratedMultiviews;
|
|
@@ -1,5 +1,65 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ScrollableContainer from '@/components/core/ScrollableContainer';
|
|
2
|
+
import SDK from '@/index';
|
|
3
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import './FoxMultiView.styles.css';
|
|
5
|
+
import TabLoadErrorView from '../../components/TabLoadError';
|
|
6
|
+
import CuratedMultiviews from './CuratedMultiview/CuratedMultiviews';
|
|
2
7
|
const FoxMultiView = () => {
|
|
3
|
-
|
|
8
|
+
const vm = useRef(null);
|
|
9
|
+
const [items, setItems] = useState([]);
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
const [scrollableContainer, setScrollableContainer,] = useState(null);
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (containerRef.current) {
|
|
15
|
+
setScrollableContainer(containerRef.current);
|
|
16
|
+
}
|
|
17
|
+
const mvvm = SDK.getMaestroEventViewModel()
|
|
18
|
+
.multiViewViewModel;
|
|
19
|
+
if (mvvm) {
|
|
20
|
+
vm.current = mvvm;
|
|
21
|
+
setItems(vm.current.items.value);
|
|
22
|
+
const removeItemsListener = vm.current.items.subscribe((newItems) => {
|
|
23
|
+
setItems(newItems);
|
|
24
|
+
});
|
|
25
|
+
setError(vm.current.error.value);
|
|
26
|
+
const removeErrorListener = vm.current.error.subscribe((error) => {
|
|
27
|
+
setError(error);
|
|
28
|
+
});
|
|
29
|
+
vm.current.init();
|
|
30
|
+
return () => {
|
|
31
|
+
removeItemsListener();
|
|
32
|
+
removeErrorListener();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}, []);
|
|
36
|
+
const clearTabLoadFailure = () => {
|
|
37
|
+
vm.current?.clearTabLoadFailure();
|
|
38
|
+
};
|
|
39
|
+
const onArrowPress = (d) => {
|
|
40
|
+
if (d === 'left') {
|
|
41
|
+
SDK.getMaestroEventViewModel().deliverFocus();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const onSelectCuratedMultiview = (item) => {
|
|
45
|
+
vm.current?.onSelectCuratedMultiview(item);
|
|
46
|
+
};
|
|
47
|
+
const renderItems = () => {
|
|
48
|
+
if (error) {
|
|
49
|
+
return (React.createElement(TabLoadErrorView, { onEnterPress: clearTabLoadFailure, onArrowPress: onArrowPress }));
|
|
50
|
+
}
|
|
51
|
+
return items.map((item) => {
|
|
52
|
+
switch (item.type) {
|
|
53
|
+
case 'curated-multiviews':
|
|
54
|
+
return (React.createElement(CuratedMultiviews, { key: item.type, items: item.items, onSelect: onSelectCuratedMultiview }));
|
|
55
|
+
default:
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return (React.createElement("div", { className: "fox-multiview-view" },
|
|
61
|
+
React.createElement(ScrollableContainer, { scrollableContainerRef: scrollableContainer },
|
|
62
|
+
renderItems(),
|
|
63
|
+
React.createElement("div", { className: "fox-multi-view-bottom-padding" }))));
|
|
4
64
|
};
|
|
5
65
|
export default FoxMultiView;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/// <reference types="prop-types" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './CustomMultiviewStreamsCard.style.css';
|
|
4
|
+
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
5
|
+
import { CuratedMultiviewListing } from '../../../types';
|
|
6
|
+
export type Camera = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type CustomMultiviewStreamsCardProps = {
|
|
12
|
+
/** Primary listing displayed on this card */
|
|
13
|
+
listing: CuratedMultiviewListing;
|
|
14
|
+
/** Total number of available camera listings */
|
|
15
|
+
totalCameras: number;
|
|
16
|
+
/** Number of currently active cameras */
|
|
17
|
+
activeCameraCount?: number;
|
|
18
|
+
/** Current match time display (e.g. "42'") */
|
|
19
|
+
currentTime?: string;
|
|
20
|
+
/** Match location (e.g. "Miami, FL") */
|
|
21
|
+
location?: string;
|
|
22
|
+
/** List of available cameras for the expanded view */
|
|
23
|
+
cameras?: Camera[];
|
|
24
|
+
/** Callback when a camera radio is toggled */
|
|
25
|
+
onToggleCamera?: (camera: Camera) => void;
|
|
26
|
+
/** Whether the card is in expanded state */
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
/** Index of the currently focused camera in expanded view */
|
|
29
|
+
focusedCameraIndex?: number;
|
|
30
|
+
};
|
|
31
|
+
declare const CustomMultiviewStreamsCard: {
|
|
32
|
+
new (props: (CustomMultiviewStreamsCardProps & WithFocusableProps) | Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>): {
|
|
33
|
+
state: import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
34
|
+
navigation: import("../../../../../../external/spatial-navigation/spatialNavigation").default;
|
|
35
|
+
getChildContext(): {
|
|
36
|
+
parentFocusKey: string;
|
|
37
|
+
};
|
|
38
|
+
setFocus: (focusKey: string) => void;
|
|
39
|
+
navigateByDirection: (direction: import("../../../../../../external/spatial-navigation/utils").Direction, details?: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
40
|
+
stealFocus: () => void;
|
|
41
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
42
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
43
|
+
onEnterPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
44
|
+
onClickPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
45
|
+
onEnterReleaseHandler: () => void;
|
|
46
|
+
onBackPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
47
|
+
onArrowPressHandler: (direction: import("../../../../../../external/spatial-navigation/utils").Direction, details: import("../../../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
48
|
+
onBecameFocusedHandler: (layout: import("../../../../../../external/spatial-navigation/utils").Layout, details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
49
|
+
onBecameBlurredHandler: (layout: import("../../../../../../external/spatial-navigation/utils").Layout, details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
50
|
+
componentDidMount(): void;
|
|
51
|
+
componentDidUpdate(): void;
|
|
52
|
+
componentWillUnmount(): void;
|
|
53
|
+
render(): React.ReactElement<CustomMultiviewStreamsCardProps & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
54
|
+
context: any;
|
|
55
|
+
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<CustomMultiviewStreamsCardProps & 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;
|
|
56
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
57
|
+
readonly props: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps> & Readonly<{
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
refs: {
|
|
61
|
+
[key: string]: React.ReactInstance;
|
|
62
|
+
};
|
|
63
|
+
shouldComponentUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
64
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
65
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, prevState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
66
|
+
componentWillMount?(): void;
|
|
67
|
+
UNSAFE_componentWillMount?(): void;
|
|
68
|
+
componentWillReceiveProps?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextContext: any): void;
|
|
69
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextContext: any): void;
|
|
70
|
+
componentWillUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
71
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
72
|
+
};
|
|
73
|
+
new (props: CustomMultiviewStreamsCardProps & WithFocusableProps, context: any): {
|
|
74
|
+
state: import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
75
|
+
navigation: import("../../../../../../external/spatial-navigation/spatialNavigation").default;
|
|
76
|
+
getChildContext(): {
|
|
77
|
+
parentFocusKey: string;
|
|
78
|
+
};
|
|
79
|
+
setFocus: (focusKey: string) => void;
|
|
80
|
+
navigateByDirection: (direction: import("../../../../../../external/spatial-navigation/utils").Direction, details?: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
81
|
+
stealFocus: () => void;
|
|
82
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
83
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
84
|
+
onEnterPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
85
|
+
onClickPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
86
|
+
onEnterReleaseHandler: () => void;
|
|
87
|
+
onBackPressHandler: (details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
88
|
+
onArrowPressHandler: (direction: import("../../../../../../external/spatial-navigation/utils").Direction, details: import("../../../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
89
|
+
onBecameFocusedHandler: (layout: import("../../../../../../external/spatial-navigation/utils").Layout, details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
90
|
+
onBecameBlurredHandler: (layout: import("../../../../../../external/spatial-navigation/utils").Layout, details: import("../../../../../../external/spatial-navigation/utils").Details) => void;
|
|
91
|
+
componentDidMount(): void;
|
|
92
|
+
componentDidUpdate(): void;
|
|
93
|
+
componentWillUnmount(): void;
|
|
94
|
+
render(): React.ReactElement<CustomMultiviewStreamsCardProps & WithFocusableProps, string | React.JSXElementConstructor<any>>;
|
|
95
|
+
context: any;
|
|
96
|
+
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<CustomMultiviewStreamsCardProps & 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;
|
|
97
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
98
|
+
readonly props: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps> & Readonly<{
|
|
99
|
+
children?: React.ReactNode;
|
|
100
|
+
}>;
|
|
101
|
+
refs: {
|
|
102
|
+
[key: string]: React.ReactInstance;
|
|
103
|
+
};
|
|
104
|
+
shouldComponentUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
105
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
106
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, prevState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>): any;
|
|
107
|
+
componentWillMount?(): void;
|
|
108
|
+
UNSAFE_componentWillMount?(): void;
|
|
109
|
+
componentWillReceiveProps?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextContext: any): void;
|
|
110
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextContext: any): void;
|
|
111
|
+
componentWillUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
112
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<CustomMultiviewStreamsCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
113
|
+
};
|
|
114
|
+
contextTypes: {
|
|
115
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
116
|
+
};
|
|
117
|
+
childContextTypes: {
|
|
118
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
119
|
+
};
|
|
120
|
+
contextType?: React.Context<any> | undefined;
|
|
121
|
+
};
|
|
122
|
+
export default CustomMultiviewStreamsCard;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import './CustomMultiviewStreamsCard.style.css';
|
|
3
|
+
import { withFocusable, } from '@/external/spatial-navigation';
|
|
4
|
+
import { FocusableItem } from '@/components/core/ScrollableContainer';
|
|
5
|
+
import Image from '@/components/atoms/Image';
|
|
6
|
+
import Icon from '@/components/atoms/SvgIcon';
|
|
7
|
+
const CustomMultiviewStreamsCardComponent = (props) => {
|
|
8
|
+
const { listing, totalCameras, activeCameraCount = 0, currentTime, location, focusable, focused, cameras = [], onToggleCamera, expanded = false, focusedCameraIndex = -1, } = props;
|
|
9
|
+
const handleCameraToggle = useCallback((camera) => {
|
|
10
|
+
if (onToggleCamera) {
|
|
11
|
+
onToggleCamera(camera);
|
|
12
|
+
}
|
|
13
|
+
}, [onToggleCamera]);
|
|
14
|
+
const { backgroundImage, description } = listing;
|
|
15
|
+
return (React.createElement(FocusableItem, null,
|
|
16
|
+
React.createElement("div", { className: "custom-multiview-streams-card focus-ring", "data-focusable": focusable, "data-focused": focused, "data-expanded": expanded },
|
|
17
|
+
React.createElement("div", { className: "custom-multiview-streams-card-container" },
|
|
18
|
+
React.createElement("div", { className: "custom-multiview-streams-card-row custom-multiview-streams-card-row-first" },
|
|
19
|
+
React.createElement("div", { className: "custom-multiview-streams-row-content" },
|
|
20
|
+
React.createElement("div", { className: "custom-multiview-streams-status-badge" },
|
|
21
|
+
React.createElement("span", { className: "custom-multiview-streams-status-dot" }),
|
|
22
|
+
React.createElement("span", { className: "custom-multiview-streams-status-text" }, "LIVE")),
|
|
23
|
+
currentTime && (React.createElement("div", { className: "custom-multiview-streams-time" }, currentTime)),
|
|
24
|
+
location && (React.createElement("div", { className: "custom-multiview-streams-location" }, location.toUpperCase())))),
|
|
25
|
+
React.createElement("div", { className: "custom-multiview-streams-card-row custom-multiview-streams-card-row-second" },
|
|
26
|
+
React.createElement("div", { className: "custom-multiview-streams-row-content" },
|
|
27
|
+
React.createElement("div", { className: "custom-multiview-streams-thumbnail-container" }, backgroundImage ? (React.createElement(Image, { src: backgroundImage, alt: description, className: "custom-multiview-streams-thumbnail" })) : (React.createElement("div", { className: "custom-multiview-streams-thumbnail custom-multiview-streams-thumbnail-placeholder" }))),
|
|
28
|
+
React.createElement("div", { className: "custom-multiview-streams-info-container" },
|
|
29
|
+
React.createElement("div", { className: "custom-multiview-streams-teams" }, description),
|
|
30
|
+
React.createElement("div", { className: "custom-multiview-streams-cameras" },
|
|
31
|
+
activeCameraCount,
|
|
32
|
+
"/",
|
|
33
|
+
totalCameras,
|
|
34
|
+
' ',
|
|
35
|
+
totalCameras === 1 ? 'Camera' : 'Cameras',
|
|
36
|
+
" Active")),
|
|
37
|
+
React.createElement("div", { className: "custom-multiview-streams-chevron-container" },
|
|
38
|
+
React.createElement("div", { className: "custom-multiview-streams-chevron" },
|
|
39
|
+
React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
40
|
+
React.createElement("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })))))),
|
|
41
|
+
React.createElement("div", { className: "custom-multiview-streams-camera-list" }, cameras.map((camera, index) => (React.createElement("div", { key: camera.id, className: "custom-multiview-streams-camera-row", "data-focused": expanded && index === focusedCameraIndex, onClick: (e) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
handleCameraToggle(camera);
|
|
44
|
+
} },
|
|
45
|
+
React.createElement("div", { className: "custom-multiview-streams-camera-row-inner" },
|
|
46
|
+
React.createElement("div", { className: "custom-multiview-streams-camera-name T01 FONT_BOLD" }, camera.name),
|
|
47
|
+
React.createElement("div", { className: "custom-multiview-streams-camera-radio-cell" },
|
|
48
|
+
React.createElement("div", { className: "custom-multiview-streams-camera-radio", "data-active": camera.isActive }, camera.isActive ? (React.createElement(Icon, { iconName: "checkmark", width: 22.5, height: 22 })) : (React.createElement(Icon, { iconName: "add", width: 21, height: 21 })))))))))))));
|
|
49
|
+
};
|
|
50
|
+
const CustomMultiviewStreamsCard = withFocusable()(CustomMultiviewStreamsCardComponent);
|
|
51
|
+
export default CustomMultiviewStreamsCard;
|
|
@@ -3,7 +3,7 @@ import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
|
3
3
|
import { Direction } from '@/external/spatial-navigation/utils';
|
|
4
4
|
import { MultiViewLayout } from '../../../types';
|
|
5
5
|
export type LayoutSelectorProps = {
|
|
6
|
-
|
|
6
|
+
layouts: MultiViewLayout[];
|
|
7
7
|
selectedLayoutId?: string;
|
|
8
8
|
onLayoutSelect?: (layout: MultiViewLayout) => void;
|
|
9
9
|
onLayoutArrowPress?: (direction: Direction) => void;
|
|
@@ -3,20 +3,21 @@ import './LayoutSelector.style.css';
|
|
|
3
3
|
import { withFocusable, } from '@/external/spatial-navigation';
|
|
4
4
|
import { FocusableItem, useScrollableContainer, } from '@/components/core/ScrollableContainer';
|
|
5
5
|
import SDK from '@/index';
|
|
6
|
-
import { LAYOUTS_BY_COUNT } from '../../../types';
|
|
7
6
|
const LayoutOptionRowComponent = (props) => {
|
|
8
7
|
const { layout, selected, focusable, focused } = props;
|
|
9
|
-
console.log('selected', selected);
|
|
10
8
|
return (React.createElement(FocusableItem, null,
|
|
11
9
|
React.createElement("div", { className: "layout-selector-option-focus focus-ring", "data-focusable": focusable, "data-focused": focused },
|
|
12
10
|
React.createElement("div", { className: "layout-selector-row" },
|
|
13
11
|
React.createElement("div", { className: "layout-selector-cell layout-selector-cell-preview" },
|
|
14
|
-
React.createElement("div", { className: "layout-selector-preview" }, layout.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
React.createElement("div", { className: "layout-selector-preview" }, layout.positionsOrder.map((key) => {
|
|
13
|
+
const pos = layout.positions[key];
|
|
14
|
+
return (React.createElement("div", { key: `${layout.layoutId}-pos-${key}`, className: "layout-selector-slot", style: {
|
|
15
|
+
left: `${pos.x * 100}%`,
|
|
16
|
+
top: `${pos.y * 100}%`,
|
|
17
|
+
width: `${pos.w * 100}%`,
|
|
18
|
+
height: `${pos.h * 100}%`,
|
|
19
|
+
} }));
|
|
20
|
+
}))),
|
|
20
21
|
React.createElement("div", { className: "layout-selector-cell layout-selector-cell-label" },
|
|
21
22
|
React.createElement("div", { className: "layout-selector-label T30 FONT_BOLD" }, layout.name)),
|
|
22
23
|
React.createElement("div", { className: "layout-selector-cell layout-selector-cell-radio" },
|
|
@@ -25,8 +26,7 @@ const LayoutOptionRowComponent = (props) => {
|
|
|
25
26
|
const LayoutOptionRow = withFocusable()(LayoutOptionRowComponent);
|
|
26
27
|
const LayoutSelector = (props) => {
|
|
27
28
|
const { scrollToFocusedElement } = useScrollableContainer();
|
|
28
|
-
const {
|
|
29
|
-
const layouts = LAYOUTS_BY_COUNT[streamCount] || [];
|
|
29
|
+
const { layouts, selectedLayoutId, onLayoutSelect } = props;
|
|
30
30
|
const onBecameFocused = useCallback((layout) => {
|
|
31
31
|
scrollToFocusedElement(layout);
|
|
32
32
|
}, [scrollToFocusedElement]);
|
|
@@ -35,9 +35,6 @@ const LayoutSelector = (props) => {
|
|
|
35
35
|
SDK.getMaestroEventViewModel().deliverFocus();
|
|
36
36
|
}
|
|
37
37
|
}, []);
|
|
38
|
-
return (React.createElement(React.Fragment, null, layouts.length === 0 ? (React.createElement("div", { className: "layout-selector-empty T10" },
|
|
39
|
-
"No layouts available for ",
|
|
40
|
-
streamCount,
|
|
41
|
-
" streams.")) : (React.createElement("div", { className: "layout-selector-options" }, layouts.map((layout) => (React.createElement(LayoutOptionRow, { key: layout.id, focusKey: `fox-multiview-layout-${layout.id}`, layout: layout, selected: layout.id === selectedLayoutId, onEnterPress: () => onLayoutSelect?.(layout), onArrowPress: onArrowPress, onBecameFocused: onBecameFocused })))))));
|
|
38
|
+
return (React.createElement(React.Fragment, null, layouts.length === 0 ? (React.createElement("div", { className: "layout-selector-empty T10" }, "No layouts available.")) : (React.createElement("div", { className: "layout-selector-options" }, layouts.map((layout) => (React.createElement(LayoutOptionRow, { key: layout.layoutId, focusKey: `fox-multiview-layout-${layout.layoutId}`, layout: layout, selected: layout.layoutId === selectedLayoutId, onEnterPress: () => onLayoutSelect?.(layout), onArrowPress: onArrowPress, onBecameFocused: onBecameFocused })))))));
|
|
42
39
|
};
|
|
43
40
|
export default LayoutSelector;
|