@applicaster/zapp-react-native-ui-components 13.0.0-alpha.4585770583 → 13.0.0-alpha.4700935119
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 -13
- 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 +47 -12
- 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/Screen/index.tsx +1 -1
- 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/PlayerWrapper.tsx +59 -71
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +12 -9
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +84 -114
- package/Components/VideoModal/utils.ts +2 -4
- 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 +1 -1
- package/package.json +12 -6
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
|
@@ -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";
|
|
@@ -11,9 +11,6 @@ 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
13
|
import { playerDimesionsHack } from "./utils";
|
|
14
|
-
import { PathnameContext } from "../../Contexts/PathnameContext";
|
|
15
|
-
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
16
|
-
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
17
14
|
|
|
18
15
|
import {
|
|
19
16
|
AnimatedScrollModal,
|
|
@@ -124,19 +121,20 @@ const getTabletWidth = (
|
|
|
124
121
|
return Number(width) - sidebarWidth;
|
|
125
122
|
};
|
|
126
123
|
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
const showDetails = (
|
|
125
|
+
isMobile: boolean,
|
|
126
|
+
docked: boolean,
|
|
127
|
+
isInlineModal,
|
|
128
|
+
pip
|
|
129
|
+
): boolean => {
|
|
130
|
+
if (pip) {
|
|
131
|
+
return false;
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
if (
|
|
133
|
-
return
|
|
134
|
+
if (!isInlineModal) {
|
|
135
|
+
return false;
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
return baseStyle;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const showDetails = (isMobile: boolean, docked: boolean): boolean => {
|
|
140
138
|
// for mobile we always show details. Mounting of it very heavy operation.
|
|
141
139
|
if (isMobile) {
|
|
142
140
|
return true;
|
|
@@ -154,7 +152,7 @@ const showDetails = (isMobile: boolean, docked: boolean): boolean => {
|
|
|
154
152
|
const PlayerWrapperComponent = (props: Props) => {
|
|
155
153
|
const {
|
|
156
154
|
entry,
|
|
157
|
-
style
|
|
155
|
+
style,
|
|
158
156
|
containerStyle,
|
|
159
157
|
inline,
|
|
160
158
|
docked,
|
|
@@ -169,7 +167,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
169
167
|
|
|
170
168
|
const isInlineModal = inline && isModal;
|
|
171
169
|
|
|
172
|
-
const style = getStyles(baseStyle, !isTablet, isInlineModal);
|
|
170
|
+
// const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
173
171
|
|
|
174
172
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
175
173
|
|
|
@@ -209,72 +207,62 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
209
207
|
[containerDimensions, playerDimesionsHack]
|
|
210
208
|
);
|
|
211
209
|
|
|
212
|
-
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${entry?.id}`;
|
|
213
|
-
|
|
214
210
|
return (
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
211
|
+
<WrapperView
|
|
212
|
+
edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
|
|
213
|
+
style={[
|
|
214
|
+
safeAreaStyles(configuration, isTablet),
|
|
215
|
+
style,
|
|
216
|
+
playerDimesionsHack,
|
|
217
|
+
]}
|
|
218
|
+
>
|
|
219
|
+
<AnimationComponent
|
|
220
|
+
animationType={ComponentAnimationType.moveUpComponent}
|
|
221
|
+
additionalData={{ saveArea: true }}
|
|
222
|
+
style={[directionStyles(isTabletLandscape), defaultStyles.flex]}
|
|
223
|
+
>
|
|
224
|
+
<View
|
|
225
|
+
testID={`${entry?.id}-player-container`}
|
|
219
226
|
style={[
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
defaultStyles.playerContainer,
|
|
228
|
+
containerDimensions,
|
|
229
|
+
containerStyle,
|
|
222
230
|
playerDimesionsHack,
|
|
223
231
|
]}
|
|
224
232
|
>
|
|
225
233
|
<AnimationComponent
|
|
226
234
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
236
|
+
additionalData={{
|
|
237
|
+
useLayoutMeasure: isTabletLandscape,
|
|
238
|
+
disableAnimatedComponent: !isTabletLandscape,
|
|
239
|
+
resetAnimationValue: isTabletLandscape && docked,
|
|
240
|
+
}}
|
|
229
241
|
>
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
testID={`${entry?.id}-player-container`}
|
|
234
|
-
style={[
|
|
235
|
-
defaultStyles.playerContainer,
|
|
236
|
-
containerDimensions,
|
|
237
|
-
containerStyle,
|
|
238
|
-
playerDimesionsHack,
|
|
239
|
-
]}
|
|
240
|
-
>
|
|
241
|
-
<AnimationComponent
|
|
242
|
-
animationType={ComponentAnimationType.moveUpComponent}
|
|
243
|
-
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
244
|
-
additionalData={{
|
|
245
|
-
useLayoutMeasure: isTabletLandscape,
|
|
246
|
-
disableAnimatedComponent: !isTabletLandscape,
|
|
247
|
-
resetAnimationValue: isTabletLandscape && docked,
|
|
248
|
-
}}
|
|
249
|
-
>
|
|
250
|
-
<AnimatedVideoPlayerComponent>
|
|
251
|
-
{children(childrenStyles)}
|
|
252
|
-
</AnimatedVideoPlayerComponent>
|
|
253
|
-
</AnimationComponent>
|
|
254
|
-
</View>
|
|
255
|
-
|
|
256
|
-
<AnimatedScrollModal>
|
|
257
|
-
{showDetails(!isTablet, docked) && (
|
|
258
|
-
<AnimationComponent
|
|
259
|
-
animationType={ComponentAnimationType.componentFade}
|
|
260
|
-
style={defaultStyles.flex}
|
|
261
|
-
>
|
|
262
|
-
<PlayerDetails
|
|
263
|
-
configuration={configuration}
|
|
264
|
-
style={defaultStyles.playerDetails}
|
|
265
|
-
entry={entry}
|
|
266
|
-
isTabletLandscape={isTabletLandscape}
|
|
267
|
-
isTablet={isTablet}
|
|
268
|
-
/>
|
|
269
|
-
</AnimationComponent>
|
|
270
|
-
)}
|
|
271
|
-
</AnimatedScrollModal>
|
|
272
|
-
</ScreenContextProvider>
|
|
273
|
-
</PathnameContext.Provider>
|
|
242
|
+
<AnimatedVideoPlayerComponent>
|
|
243
|
+
{children(childrenStyles)}
|
|
244
|
+
</AnimatedVideoPlayerComponent>
|
|
274
245
|
</AnimationComponent>
|
|
275
|
-
</
|
|
276
|
-
|
|
277
|
-
|
|
246
|
+
</View>
|
|
247
|
+
|
|
248
|
+
<AnimatedScrollModal>
|
|
249
|
+
{showDetails(!isTablet, docked, isInlineModal, pip) && (
|
|
250
|
+
<AnimationComponent
|
|
251
|
+
animationType={ComponentAnimationType.componentFade}
|
|
252
|
+
style={defaultStyles.flex}
|
|
253
|
+
>
|
|
254
|
+
<PlayerDetails
|
|
255
|
+
configuration={configuration}
|
|
256
|
+
style={defaultStyles.playerDetails}
|
|
257
|
+
entry={entry}
|
|
258
|
+
isTabletLandscape={isTabletLandscape}
|
|
259
|
+
isTablet={isTablet}
|
|
260
|
+
/>
|
|
261
|
+
</AnimationComponent>
|
|
262
|
+
)}
|
|
263
|
+
</AnimatedScrollModal>
|
|
264
|
+
</AnimationComponent>
|
|
265
|
+
</WrapperView>
|
|
278
266
|
);
|
|
279
267
|
};
|
|
280
268
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import renderer from "react-test-renderer";
|
|
3
|
-
import { View } from "react-native";
|
|
4
3
|
|
|
5
4
|
const props = {
|
|
6
5
|
entry: {},
|
|
@@ -24,7 +23,11 @@ jest.mock("react-native-safe-area-context", () => ({
|
|
|
24
23
|
|
|
25
24
|
jest.mock(
|
|
26
25
|
"@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap",
|
|
27
|
-
() =>
|
|
26
|
+
() => {
|
|
27
|
+
const View = jest.requireActual("react-native").View;
|
|
28
|
+
|
|
29
|
+
return { ComponentsMap: View };
|
|
30
|
+
}
|
|
28
31
|
);
|
|
29
32
|
|
|
30
33
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen", () => ({
|