@applicaster/zapp-react-native-ui-components 13.0.0-alpha.3334148221 → 13.0.0-alpha.3528549047
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/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
- package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +6 -6
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +7 -7
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
- package/Components/BaseFocusable/index.tsx +65 -28
- package/Components/Cell/Cell.tsx +10 -9
- package/Components/Cell/CellWithFocusable.tsx +1 -1
- package/Components/Cell/TvOSCellComponent.tsx +3 -8
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +20 -20
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +5 -3
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +5 -5
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +11 -9
- package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
- package/Components/Focusable/Focusable.tsx +0 -54
- package/Components/Focusable/FocusableTvOS.tsx +1 -1
- package/Components/FocusableList/index.tsx +0 -1
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +76 -7
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +53 -9
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +1 -0
- package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -3
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +9 -9
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +7 -3
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +7 -7
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +34 -34
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
- package/Components/NativeFocusables/{index.js → index.ts} +4 -2
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
- package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
- package/Components/PlayerContainer/PlayerContainer.tsx +5 -11
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/River/RefreshControl.tsx +1 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +17 -17
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +12 -12
- package/Components/River/__tests__/componentsMap.test.js +61 -13
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -1
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +1 -1
- package/Components/Screen/__tests__/Screen.test.tsx +41 -27
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +2 -2
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +31 -27
- package/Components/Tabs/Tab.tsx +1 -0
- package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
- package/Components/TextInputTv/index.tsx +2 -2
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
- package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +9 -9
- package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +12 -7
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -6
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +5 -1
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +5 -1
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +1 -1
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +4 -10
- package/Components/VideoModal/ModalAnimation/index.ts +2 -1
- package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
- package/Components/VideoModal/OpaqueLayer.tsx +33 -0
- package/Components/VideoModal/PlayerWrapper.tsx +16 -35
- package/Components/VideoModal/VideoModal.tsx +14 -23
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
- package/Components/VideoModal/hooks/index.ts +7 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
- package/Components/VideoModal/hooks/utils/index.ts +33 -0
- package/Components/VideoModal/utils.ts +3 -5
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +2 -2
- package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +1 -0
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +11 -11
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +30 -30
- package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +18 -11
- package/Decorators/Analytics/{index.js → index.tsx} +11 -11
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +2 -2
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
- package/Decorators/RiverFeedLoader/index.tsx +1 -1
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
- package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
- package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
- package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +5 -5
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +16 -10
- package/Decorators/ZappPipesDataConnector/index.tsx +32 -2
- package/package.json +12 -6
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
|
@@ -175,10 +175,10 @@ function TextInputTV(props: Props, ref) {
|
|
|
175
175
|
return isWebPlatform ? (
|
|
176
176
|
<>
|
|
177
177
|
{additional && additional()}
|
|
178
|
-
<input ref={ref} {...inputProps} />
|
|
178
|
+
<input testID="TextInput-tv" ref={ref} {...inputProps} />
|
|
179
179
|
</>
|
|
180
180
|
) : (
|
|
181
|
-
<TextInput ref={ref} {...inputProps} />
|
|
181
|
+
<TextInput testID="TextInput-tv" ref={ref} {...inputProps} />
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -14,7 +14,7 @@ exports[`<Touchable /> when not running in automated tests environment renders c
|
|
|
14
14
|
onResponderTerminationRequest={[Function]}
|
|
15
15
|
onStartShouldSetResponder={[Function]}
|
|
16
16
|
style={
|
|
17
|
-
|
|
17
|
+
{
|
|
18
18
|
"opacity": 1,
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -40,7 +40,7 @@ exports[`<Touchable /> when running in automated tests environment has accessibl
|
|
|
40
40
|
onResponderTerminationRequest={[Function]}
|
|
41
41
|
onStartShouldSetResponder={[Function]}
|
|
42
42
|
style={
|
|
43
|
-
|
|
43
|
+
{
|
|
44
44
|
"opacity": 1,
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`AnimationManager initialState() returns a state composed from the initial configuration 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"animating": false,
|
|
6
6
|
"duration": 123,
|
|
7
7
|
"easing": [MockFunction],
|
|
8
|
-
"from":
|
|
8
|
+
"from": {
|
|
9
9
|
"index": 0,
|
|
10
10
|
},
|
|
11
|
-
"to":
|
|
11
|
+
"to": {
|
|
12
12
|
"index": 0,
|
|
13
|
-
"style":
|
|
13
|
+
"style": {},
|
|
14
14
|
},
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
@@ -18,25 +18,25 @@ Object {
|
|
|
18
18
|
exports[`AnimationManager returns the animation manager with the injected transition configuration 1`] = `
|
|
19
19
|
AnimationManager {
|
|
20
20
|
"animatedValue": 0,
|
|
21
|
-
"config":
|
|
22
|
-
"back":
|
|
21
|
+
"config": {
|
|
22
|
+
"back": {
|
|
23
23
|
"duration": 123,
|
|
24
24
|
"easing": [MockFunction],
|
|
25
|
-
"from":
|
|
26
|
-
"style":
|
|
25
|
+
"from": {
|
|
26
|
+
"style": {},
|
|
27
27
|
},
|
|
28
|
-
"to":
|
|
29
|
-
"style":
|
|
28
|
+
"to": {
|
|
29
|
+
"style": {},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
"push":
|
|
32
|
+
"push": {
|
|
33
33
|
"duration": 123,
|
|
34
34
|
"easing": [MockFunction],
|
|
35
|
-
"from":
|
|
36
|
-
"style":
|
|
35
|
+
"from": {
|
|
36
|
+
"style": {},
|
|
37
37
|
},
|
|
38
|
-
"to":
|
|
39
|
-
"style":
|
|
38
|
+
"to": {
|
|
39
|
+
"style": {},
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -44,25 +44,25 @@ AnimationManager {
|
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
46
|
exports[`AnimationManager returns the animation manager with the injected transition configuration 2`] = `
|
|
47
|
-
|
|
48
|
-
"back":
|
|
47
|
+
{
|
|
48
|
+
"back": {
|
|
49
49
|
"duration": 123,
|
|
50
50
|
"easing": [MockFunction],
|
|
51
|
-
"from":
|
|
52
|
-
"style":
|
|
51
|
+
"from": {
|
|
52
|
+
"style": {},
|
|
53
53
|
},
|
|
54
|
-
"to":
|
|
55
|
-
"style":
|
|
54
|
+
"to": {
|
|
55
|
+
"style": {},
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
-
"push":
|
|
58
|
+
"push": {
|
|
59
59
|
"duration": 123,
|
|
60
60
|
"easing": [MockFunction],
|
|
61
|
-
"from":
|
|
62
|
-
"style":
|
|
61
|
+
"from": {
|
|
62
|
+
"style": {},
|
|
63
63
|
},
|
|
64
|
-
"to":
|
|
65
|
-
"style":
|
|
64
|
+
"to": {
|
|
65
|
+
"style": {},
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
}
|
|
@@ -4,14 +4,14 @@ exports[`<Scene /> renders correctly 1`] = `
|
|
|
4
4
|
<ForwardRef(AnimatedComponentWrapper)
|
|
5
5
|
pointerEvents="auto"
|
|
6
6
|
style={
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
[
|
|
8
|
+
{
|
|
9
9
|
"flex": 1,
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
{
|
|
12
12
|
"paddingBottom": 49,
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
{
|
|
15
15
|
"fontScale": 2,
|
|
16
16
|
"height": 1334,
|
|
17
17
|
"scale": 2,
|
|
@@ -33,14 +33,14 @@ exports[`<Scene /> renders the overlay while animating 1`] = `
|
|
|
33
33
|
<ForwardRef(AnimatedComponentWrapper)
|
|
34
34
|
pointerEvents="auto"
|
|
35
35
|
style={
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
38
|
"flex": 1,
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
{
|
|
41
41
|
"paddingBottom": 49,
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
{
|
|
44
44
|
"height": "100%",
|
|
45
45
|
"width": "100%",
|
|
46
46
|
},
|
|
@@ -54,7 +54,7 @@ exports[`<Scene /> renders the overlay while animating 1`] = `
|
|
|
54
54
|
</ContextProvider>
|
|
55
55
|
<ForwardRef(AnimatedComponentWrapper)
|
|
56
56
|
style={
|
|
57
|
-
|
|
57
|
+
{
|
|
58
58
|
"opacity": 1,
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -5,34 +5,34 @@ exports[`transitionConfig accepts an Animated.Value as a parameter 1`] = `"Canno
|
|
|
5
5
|
exports[`transitionConfig accepts an Animated.Value as a parameter 2`] = `[Function]`;
|
|
6
6
|
|
|
7
7
|
exports[`transitionConfig returns a back object is valid 1`] = `
|
|
8
|
-
|
|
8
|
+
{
|
|
9
9
|
"duration": 350,
|
|
10
10
|
"easing": [Function],
|
|
11
|
-
"from":
|
|
12
|
-
"style":
|
|
11
|
+
"from": {
|
|
12
|
+
"style": {
|
|
13
13
|
"height": 1334,
|
|
14
14
|
"position": "absolute",
|
|
15
|
-
"transform":
|
|
16
|
-
|
|
15
|
+
"transform": [
|
|
16
|
+
{
|
|
17
17
|
"translateX": 0,
|
|
18
18
|
},
|
|
19
19
|
],
|
|
20
20
|
"width": 750,
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
"to":
|
|
24
|
-
"overlayStyle":
|
|
23
|
+
"to": {
|
|
24
|
+
"overlayStyle": {
|
|
25
25
|
"backgroundColor": "black",
|
|
26
26
|
"height": 1334,
|
|
27
27
|
"opacity": 0.35,
|
|
28
28
|
"position": "absolute",
|
|
29
29
|
"width": 750,
|
|
30
30
|
},
|
|
31
|
-
"style":
|
|
31
|
+
"style": {
|
|
32
32
|
"height": 1334,
|
|
33
33
|
"position": "absolute",
|
|
34
|
-
"transform":
|
|
35
|
-
|
|
34
|
+
"transform": [
|
|
35
|
+
{
|
|
36
36
|
"translateX": -1,
|
|
37
37
|
},
|
|
38
38
|
],
|
|
@@ -43,34 +43,34 @@ Object {
|
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
exports[`transitionConfig returns a push object is valid 1`] = `
|
|
46
|
-
|
|
46
|
+
{
|
|
47
47
|
"duration": 350,
|
|
48
48
|
"easing": [Function],
|
|
49
|
-
"from":
|
|
50
|
-
"overlayStyle":
|
|
49
|
+
"from": {
|
|
50
|
+
"overlayStyle": {
|
|
51
51
|
"backgroundColor": "black",
|
|
52
52
|
"height": 1334,
|
|
53
53
|
"opacity": 0,
|
|
54
54
|
"position": "absolute",
|
|
55
55
|
"width": 750,
|
|
56
56
|
},
|
|
57
|
-
"style":
|
|
57
|
+
"style": {
|
|
58
58
|
"height": 1334,
|
|
59
59
|
"position": "absolute",
|
|
60
|
-
"transform":
|
|
61
|
-
|
|
60
|
+
"transform": [
|
|
61
|
+
{
|
|
62
62
|
"translateX": 0,
|
|
63
63
|
},
|
|
64
64
|
],
|
|
65
65
|
"width": 750,
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
-
"to":
|
|
69
|
-
"style":
|
|
68
|
+
"to": {
|
|
69
|
+
"style": {
|
|
70
70
|
"height": 1334,
|
|
71
71
|
"position": "absolute",
|
|
72
|
-
"transform":
|
|
73
|
-
|
|
72
|
+
"transform": [
|
|
73
|
+
{
|
|
74
74
|
"translateX": 750,
|
|
75
75
|
},
|
|
76
76
|
],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`<TransitionerComponent /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"flex": 1,
|
|
8
8
|
"overflow": "hidden",
|
|
9
9
|
}
|
|
@@ -12,7 +12,7 @@ exports[`<TransitionerComponent /> renders correctly 1`] = `
|
|
|
12
12
|
<Scene
|
|
13
13
|
isActive={true}
|
|
14
14
|
screenUniqueId="mocked-uuid"
|
|
15
|
-
style={
|
|
15
|
+
style={{}}
|
|
16
16
|
>
|
|
17
17
|
<View
|
|
18
18
|
foo="bar"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { render } from "@testing-library/react-native";
|
|
4
4
|
import * as PlayerFactory from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerFactory";
|
|
5
|
-
import { Player } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/player";
|
|
6
5
|
import { ThemeContext } from "@applicaster/zapp-react-native-utils/theme";
|
|
7
6
|
import * as navigationHooks from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
|
8
7
|
|
|
@@ -12,13 +11,13 @@ import * as useNavigationHooks from "@applicaster/zapp-react-native-utils/reactH
|
|
|
12
11
|
import { Provider } from "react-redux";
|
|
13
12
|
import configureStore from "redux-mock-store";
|
|
14
13
|
|
|
15
|
-
const
|
|
14
|
+
const mock_seekTo = jest.fn();
|
|
16
15
|
|
|
17
16
|
jest.mock(
|
|
18
17
|
"@applicaster/zapp-react-native-utils/appUtils/playerManager/player",
|
|
19
18
|
() => ({
|
|
20
19
|
Player: {
|
|
21
|
-
seekTo,
|
|
20
|
+
seekTo: mock_seekTo,
|
|
22
21
|
},
|
|
23
22
|
})
|
|
24
23
|
);
|
|
@@ -60,10 +59,16 @@ describe("PlayerLiveImageComponent", () => {
|
|
|
60
59
|
};
|
|
61
60
|
|
|
62
61
|
beforeAll(() => {
|
|
63
|
-
jest.spyOn(PlayerFactory, "playerFactory").mockImplementation(() =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
jest.spyOn(PlayerFactory, "playerFactory").mockImplementation(() => {
|
|
63
|
+
const Player = jest.requireActual(
|
|
64
|
+
"@applicaster/zapp-react-native-utils/appUtils/playerManager/player"
|
|
65
|
+
).Player;
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
controller: new Player({}),
|
|
69
|
+
Component: () => null,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
67
72
|
|
|
68
73
|
jest.spyOn(navigationHooks, "useIsScreenActive").mockReturnValue(true);
|
|
69
74
|
});
|
|
@@ -9,7 +9,7 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
|
|
|
9
9
|
<View
|
|
10
10
|
collapsable={false}
|
|
11
11
|
style={
|
|
12
|
-
|
|
12
|
+
{
|
|
13
13
|
"opacity": 1,
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -19,10 +19,10 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
|
|
|
19
19
|
audioMutedByDefault={false}
|
|
20
20
|
imageKey="image1"
|
|
21
21
|
item={
|
|
22
|
-
|
|
22
|
+
{
|
|
23
23
|
"id": "1",
|
|
24
24
|
"title": "Test",
|
|
25
|
-
"type":
|
|
25
|
+
"type": {
|
|
26
26
|
"value": "",
|
|
27
27
|
},
|
|
28
28
|
}
|
|
@@ -30,13 +30,13 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
|
|
|
30
30
|
onError={[Function]}
|
|
31
31
|
playerId="player1"
|
|
32
32
|
resizeMode="cover"
|
|
33
|
-
screenConfig={
|
|
33
|
+
screenConfig={{}}
|
|
34
34
|
source={
|
|
35
|
-
|
|
35
|
+
{
|
|
36
36
|
"uri": "",
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
style={
|
|
39
|
+
style={{}}
|
|
40
40
|
/>
|
|
41
41
|
</View>
|
|
42
42
|
</View>
|
|
@@ -62,7 +62,10 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
62
62
|
} = useModalAnimationContext();
|
|
63
63
|
|
|
64
64
|
const [enableGesture, setIEnableGesture] = React.useState<boolean>(true);
|
|
65
|
-
|
|
65
|
+
|
|
66
|
+
const { isLanguageOverlayVisible, isSeekBarTouch } = React.useContext(
|
|
67
|
+
PlayerContainerContext
|
|
68
|
+
);
|
|
66
69
|
|
|
67
70
|
const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
|
|
68
71
|
useNavigation();
|
|
@@ -80,6 +83,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
80
83
|
enableGesture &&
|
|
81
84
|
!isLanguageOverlayVisible &&
|
|
82
85
|
isNotMinimizeMaximazeAnimation &&
|
|
86
|
+
!isSeekBarTouch &&
|
|
83
87
|
(isMaximazedModal || isMinimizedModal);
|
|
84
88
|
|
|
85
89
|
const isAudioItem = React.useMemo(
|
|
@@ -41,7 +41,10 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
41
41
|
videoModalState: { mode: videoModalMode },
|
|
42
42
|
} = useNavigation();
|
|
43
43
|
|
|
44
|
-
const { isLanguageOverlayVisible } = React.useContext(
|
|
44
|
+
const { isLanguageOverlayVisible, isSeekBarTouch } = React.useContext(
|
|
45
|
+
PlayerContainerContext
|
|
46
|
+
);
|
|
47
|
+
|
|
45
48
|
const isMaximazedModal = videoModalMode === "MAXIMIZED";
|
|
46
49
|
const isMinimizedModal = videoModalMode === "MINIMIZED";
|
|
47
50
|
|
|
@@ -52,6 +55,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
52
55
|
const isEnablePanGesture =
|
|
53
56
|
!isLanguageOverlayVisible &&
|
|
54
57
|
isNotMinimizeMaximazeAnimation &&
|
|
58
|
+
!isSeekBarTouch &&
|
|
55
59
|
(isMaximazedModal || isMinimizedModal);
|
|
56
60
|
|
|
57
61
|
const onGestureEvent = Animated.event(
|
|
@@ -77,7 +77,7 @@ export const AnimationView = ({
|
|
|
77
77
|
const measureView = React.useCallback(() => {
|
|
78
78
|
if (isTabletLandscape && tabletLandscapePlayerTopPosition === 0) {
|
|
79
79
|
animationComponentRef.current.measure(
|
|
80
|
-
(
|
|
80
|
+
(_x, _y, _width, _height, _pageX, pageY) => {
|
|
81
81
|
setTabletLandscapePlayerTopPosition(pageY - 20);
|
|
82
82
|
}
|
|
83
83
|
);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
useSafeAreaInsets,
|
|
6
6
|
useSafeAreaFrame,
|
|
7
7
|
} from "react-native-safe-area-context";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
useNavigation,
|
|
11
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
|
+
import { useGetBottomTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useGetBottomTabBarHeight";
|
|
9
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
|
|
12
10
|
import { isLive } from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
13
11
|
|
|
14
12
|
import { PROGRESS_BAR_HEIGHT } from "./utils";
|
|
@@ -48,7 +46,7 @@ export type ModalAnimationContextT = {
|
|
|
48
46
|
progressBarHeight: number;
|
|
49
47
|
};
|
|
50
48
|
|
|
51
|
-
const ReactContext = React.createContext<ModalAnimationContextT>({
|
|
49
|
+
export const ReactContext = React.createContext<ModalAnimationContextT>({
|
|
52
50
|
isActiveGesture: false,
|
|
53
51
|
playerAnimationState: null,
|
|
54
52
|
setPlayerAnimationState: () => null,
|
|
@@ -73,10 +71,6 @@ const ReactContext = React.createContext<ModalAnimationContextT>({
|
|
|
73
71
|
progressBarHeight: 0,
|
|
74
72
|
});
|
|
75
73
|
|
|
76
|
-
export function useModalAnimationContext() {
|
|
77
|
-
return useContext<ModalAnimationContextT>(ReactContext);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
74
|
const Provider = ({ children }: { children: React.ReactNode }) => {
|
|
81
75
|
const [playerAnimationState, setPlayerAnimationState] =
|
|
82
76
|
React.useState<PlayerAnimationStateT>(null);
|
|
@@ -6,10 +6,11 @@ export { AnimatedVideoPlayerComponent } from "./AnimatedVideoPlayerComponent";
|
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
withModalAnimationProvider,
|
|
9
|
-
useModalAnimationContext,
|
|
10
9
|
PlayerAnimationStateEnum,
|
|
11
10
|
} from "./ModalAnimationContext";
|
|
12
11
|
|
|
12
|
+
export { useModalAnimationContext } from "./useModalAnimationContext";
|
|
13
|
+
|
|
13
14
|
export { AnimationComponent } from "./AnimationComponent";
|
|
14
15
|
|
|
15
16
|
export { ComponentAnimationType, defaultAspectRatioWidth } from "./utils";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
5
|
+
|
|
6
|
+
import { Spinner } from "../Spinner";
|
|
7
|
+
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
...StyleSheet.absoluteFillObject,
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const OpaqueLayer = () => {
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<View
|
|
21
|
+
style={[
|
|
22
|
+
styles.container,
|
|
23
|
+
{
|
|
24
|
+
// we assume that it's non-transparent and we could show spinner always until it will be covered by player
|
|
25
|
+
// this spinner hides all content under modal
|
|
26
|
+
backgroundColor: theme?.app_background_color,
|
|
27
|
+
},
|
|
28
|
+
]}
|
|
29
|
+
>
|
|
30
|
+
<Spinner />
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -10,7 +10,8 @@ import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
|
10
10
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
11
11
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
12
12
|
import { PlayerDetails } from "./PlayerDetails";
|
|
13
|
-
import {
|
|
13
|
+
import { playerDimensionsHack } from "./utils";
|
|
14
|
+
import { useDelayedPlayerDetails } from "./hooks";
|
|
14
15
|
|
|
15
16
|
import {
|
|
16
17
|
AnimatedScrollModal,
|
|
@@ -121,34 +122,6 @@ const getTabletWidth = (
|
|
|
121
122
|
return Number(width) - sidebarWidth;
|
|
122
123
|
};
|
|
123
124
|
|
|
124
|
-
const showDetails = (
|
|
125
|
-
isMobile: boolean,
|
|
126
|
-
docked: boolean,
|
|
127
|
-
isInlineModal,
|
|
128
|
-
pip
|
|
129
|
-
): boolean => {
|
|
130
|
-
if (pip) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (!isInlineModal) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// for mobile we always show details. Mounting of it very heavy operation.
|
|
139
|
-
if (isMobile) {
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// workaround for tablets we need to mount/unmount in order to avoid PlayerDetails content dissappearing
|
|
144
|
-
// FIXME - find out the reason of dissapearing of content
|
|
145
|
-
if (docked) {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return true;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
125
|
const PlayerWrapperComponent = (props: Props) => {
|
|
153
126
|
const {
|
|
154
127
|
entry,
|
|
@@ -167,7 +140,15 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
167
140
|
|
|
168
141
|
const isInlineModal = inline && isModal;
|
|
169
142
|
|
|
170
|
-
//
|
|
143
|
+
// Mounting the PlayerDetails component is a resource-intensive process.
|
|
144
|
+
// Therefore, for performance reasons, we mount it with a delay to make the rotation process as smooth as possible.
|
|
145
|
+
// The flow is as follows: the rotation occurs first, and then, after a short delay, we mount the PlayerDetails component.
|
|
146
|
+
// This helps to avoid blocking the rotation and any animations related to the rotation.
|
|
147
|
+
const isShowPlayerDetails = useDelayedPlayerDetails({
|
|
148
|
+
isInline: isInlineModal,
|
|
149
|
+
isDocked: docked,
|
|
150
|
+
isPip: pip,
|
|
151
|
+
});
|
|
171
152
|
|
|
172
153
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
173
154
|
|
|
@@ -203,8 +184,8 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
203
184
|
const WrapperView = React.useMemo(() => (isTV() ? View : SafeAreaView), []);
|
|
204
185
|
|
|
205
186
|
const childrenStyles = React.useMemo(
|
|
206
|
-
() => ({ ...playerDimensions, ...
|
|
207
|
-
[containerDimensions,
|
|
187
|
+
() => ({ ...playerDimensions, ...playerDimensionsHack }),
|
|
188
|
+
[containerDimensions, playerDimensionsHack]
|
|
208
189
|
);
|
|
209
190
|
|
|
210
191
|
return (
|
|
@@ -213,7 +194,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
213
194
|
style={[
|
|
214
195
|
safeAreaStyles(configuration, isTablet),
|
|
215
196
|
style,
|
|
216
|
-
|
|
197
|
+
playerDimensionsHack,
|
|
217
198
|
]}
|
|
218
199
|
>
|
|
219
200
|
<AnimationComponent
|
|
@@ -227,7 +208,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
227
208
|
defaultStyles.playerContainer,
|
|
228
209
|
containerDimensions,
|
|
229
210
|
containerStyle,
|
|
230
|
-
|
|
211
|
+
playerDimensionsHack,
|
|
231
212
|
]}
|
|
232
213
|
>
|
|
233
214
|
<AnimationComponent
|
|
@@ -246,7 +227,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
246
227
|
</View>
|
|
247
228
|
|
|
248
229
|
<AnimatedScrollModal>
|
|
249
|
-
{
|
|
230
|
+
{isShowPlayerDetails && (
|
|
250
231
|
<AnimationComponent
|
|
251
232
|
animationType={ComponentAnimationType.componentFade}
|
|
252
233
|
style={defaultStyles.flex}
|