@applicaster/zapp-react-native-ui-components 13.0.0-alpha.3592223128 → 13.0.0-alpha.3592913150
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 +11 -9
- package/Components/Cell/CellWithFocusable.tsx +1 -1
- package/Components/Cell/TvOSCellComponent.tsx +23 -30
- package/Components/Cell/index.js +3 -1
- 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 +6 -2
- package/Components/FocusableList/index.tsx +25 -10
- package/Components/FocusableScrollView/index.tsx +39 -12
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +76 -7
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +53 -9
- package/Components/Layout/TV/NavBarContainer.tsx +8 -7
- 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/TV/index.tsx +6 -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 +9 -16
- 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 -84
- 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/ComponentsMapOffsetContext/index.tsx +46 -0
- 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";
|
|
@@ -121,23 +121,16 @@ const getTabletWidth = (
|
|
|
121
121
|
return Number(width) - sidebarWidth;
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
const getStyles = (baseStyle, isMobile, isPortrait) => {
|
|
125
|
-
if (isMobile && isPortrait) {
|
|
126
|
-
return { width: SCREEN_WIDTH, height: SCREEN_HEIGHT };
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (isMobile && !isPortrait) {
|
|
130
|
-
return { width: SCREEN_HEIGHT, height: SCREEN_WIDTH };
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return baseStyle;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
124
|
const showDetails = (
|
|
137
125
|
isMobile: boolean,
|
|
138
126
|
docked: boolean,
|
|
139
|
-
isInlineModal
|
|
127
|
+
isInlineModal,
|
|
128
|
+
pip
|
|
140
129
|
): boolean => {
|
|
130
|
+
if (pip) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
141
134
|
if (!isInlineModal) {
|
|
142
135
|
return false;
|
|
143
136
|
}
|
|
@@ -159,7 +152,7 @@ const showDetails = (
|
|
|
159
152
|
const PlayerWrapperComponent = (props: Props) => {
|
|
160
153
|
const {
|
|
161
154
|
entry,
|
|
162
|
-
style
|
|
155
|
+
style,
|
|
163
156
|
containerStyle,
|
|
164
157
|
inline,
|
|
165
158
|
docked,
|
|
@@ -174,7 +167,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
174
167
|
|
|
175
168
|
const isInlineModal = inline && isModal;
|
|
176
169
|
|
|
177
|
-
const style = getStyles(baseStyle, !isTablet, isInlineModal);
|
|
170
|
+
// const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
178
171
|
|
|
179
172
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
180
173
|
|
|
@@ -253,7 +246,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
253
246
|
</View>
|
|
254
247
|
|
|
255
248
|
<AnimatedScrollModal>
|
|
256
|
-
{showDetails(!isTablet, docked, isInlineModal) && (
|
|
249
|
+
{showDetails(!isTablet, docked, isInlineModal, pip) && (
|
|
257
250
|
<AnimationComponent
|
|
258
251
|
animationType={ComponentAnimationType.componentFade}
|
|
259
252
|
style={defaultStyles.flex}
|
|
@@ -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", () => ({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
|
|
5
3
|
import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
|
|
6
4
|
|
|
7
5
|
const props = {
|
|
@@ -17,13 +15,17 @@ const props = {
|
|
|
17
15
|
},
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
const
|
|
18
|
+
const mockUseIsDeviceTablet = jest.fn();
|
|
21
19
|
|
|
22
20
|
jest.mock("react-native");
|
|
23
21
|
|
|
24
22
|
jest.mock("react-native-gesture-handler");
|
|
25
23
|
|
|
26
|
-
jest.mock("../PlayerDetails", () =>
|
|
24
|
+
jest.mock("../PlayerDetails", () => {
|
|
25
|
+
const View = jest.requireActual("react-native").View;
|
|
26
|
+
|
|
27
|
+
return { PlayerDetails: View };
|
|
28
|
+
});
|
|
27
29
|
|
|
28
30
|
jest.mock(
|
|
29
31
|
"@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext",
|
|
@@ -33,10 +35,11 @@ jest.mock(
|
|
|
33
35
|
);
|
|
34
36
|
|
|
35
37
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/device", () => ({
|
|
36
|
-
useIsTablet,
|
|
38
|
+
useIsTablet: mockUseIsDeviceTablet,
|
|
37
39
|
}));
|
|
38
40
|
|
|
39
41
|
jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
|
|
42
|
+
...jest.requireActual("@applicaster/zapp-react-native-utils/theme"),
|
|
40
43
|
useTheme: jest.fn(() => ({})),
|
|
41
44
|
}));
|
|
42
45
|
|
|
@@ -68,7 +71,7 @@ const children = jest.fn(() => {});
|
|
|
68
71
|
|
|
69
72
|
describe("PlayerWrapper", () => {
|
|
70
73
|
it("renders properly", () => {
|
|
71
|
-
|
|
74
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
72
75
|
|
|
73
76
|
const element = renderWithProviders(
|
|
74
77
|
<PlayerWrapper {...props}>{children}</PlayerWrapper>
|
|
@@ -78,7 +81,7 @@ describe("PlayerWrapper", () => {
|
|
|
78
81
|
});
|
|
79
82
|
|
|
80
83
|
it("renders inline", () => {
|
|
81
|
-
|
|
84
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
82
85
|
|
|
83
86
|
const element = renderWithProviders(
|
|
84
87
|
<PlayerWrapper {...props} inline={true} isModal={true}>
|
|
@@ -90,7 +93,7 @@ describe("PlayerWrapper", () => {
|
|
|
90
93
|
});
|
|
91
94
|
|
|
92
95
|
it("renders inline on tablet in landscape orientation", () => {
|
|
93
|
-
|
|
96
|
+
mockUseIsDeviceTablet.mockReturnValue(true);
|
|
94
97
|
|
|
95
98
|
const element = renderWithProviders(
|
|
96
99
|
<PlayerWrapper {...props} inline={true} isModal={true}>
|
|
@@ -102,7 +105,7 @@ describe("PlayerWrapper", () => {
|
|
|
102
105
|
});
|
|
103
106
|
|
|
104
107
|
it("renders inline and docked", () => {
|
|
105
|
-
|
|
108
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
106
109
|
|
|
107
110
|
const children = jest.fn(() => {});
|
|
108
111
|
const dimensions = { height: undefined, width: props.style.width };
|
|
@@ -4,7 +4,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
4
4
|
<View
|
|
5
5
|
collapsable={false}
|
|
6
6
|
style={
|
|
7
|
-
|
|
7
|
+
{
|
|
8
8
|
"backgroundColor": "transparent",
|
|
9
9
|
"flex": 1,
|
|
10
10
|
"marginTop": -8,
|
|
@@ -15,7 +15,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
15
15
|
>
|
|
16
16
|
<View
|
|
17
17
|
feed="test-source"
|
|
18
|
-
riverComponents={
|
|
18
|
+
riverComponents={[]}
|
|
19
19
|
riverId="test-id"
|
|
20
20
|
/>
|
|
21
21
|
</View>
|
|
@@ -25,7 +25,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
25
25
|
<View
|
|
26
26
|
collapsable={false}
|
|
27
27
|
style={
|
|
28
|
-
|
|
28
|
+
{
|
|
29
29
|
"backgroundColor": "transparent",
|
|
30
30
|
"flex": 1,
|
|
31
31
|
"marginTop": -20,
|
|
@@ -36,7 +36,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
36
36
|
>
|
|
37
37
|
<View
|
|
38
38
|
feed="test-source"
|
|
39
|
-
riverComponents={
|
|
39
|
+
riverComponents={[]}
|
|
40
40
|
riverId="test-id"
|
|
41
41
|
/>
|
|
42
42
|
</View>
|