@applicaster/zapp-react-native-ui-components 14.0.0-rc.9 → 15.0.0-alpha.2239032089
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/AnimatedInOut/index.tsx +5 -3
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +11 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.tsx +23 -12
- package/Components/Cell/Cell.tsx +91 -64
- package/Components/Cell/CellWithFocusable.tsx +3 -0
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +3 -2
- package/Components/Cell/index.js +7 -3
- package/Components/ComponentResolver/index.ts +1 -1
- package/Components/FeedLoader/FeedLoader.tsx +7 -16
- package/Components/FeedLoader/FeedLoaderHOC.tsx +21 -0
- package/Components/FeedLoader/index.js +2 -8
- package/Components/Focusable/Focusable.tsx +16 -5
- package/Components/Focusable/FocusableTvOS.tsx +10 -6
- package/Components/Focusable/FocusableiOS.tsx +2 -2
- package/Components/Focusable/Touchable.tsx +5 -3
- package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
- package/Components/Focusable/index.android.tsx +19 -11
- package/Components/Focusable/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +6 -1
- package/Components/FocusableList/FocusableItem.tsx +4 -3
- package/Components/FocusableList/FocusableListItemWrapper.tsx +2 -1
- package/Components/FocusableList/hooks/useCellState.android.ts +13 -3
- package/Components/FocusableList/index.tsx +20 -9
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +67 -43
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +42 -59
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +13 -10
- package/Components/HandlePlayable/HandlePlayable.tsx +25 -9
- package/Components/HookRenderer/HookRenderer.tsx +5 -1
- package/Components/Layout/TV/LayoutBackground.tsx +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +0 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +6 -2
- package/Components/MasterCell/DefaultComponents/Button.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -39
- package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +65 -17
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/Image.test.tsx +21 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +6 -3
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +26 -6
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +10 -10
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +18 -18
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/index.test.tsx +10 -10
- package/Components/MasterCell/elementMapper.tsx +1 -2
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
- package/Components/MasterCell/utils/index.ts +11 -5
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
- package/Components/OfflineHandler/__tests__/index.test.tsx +26 -35
- package/Components/PlayerContainer/ErrorDisplay/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +46 -33
- package/Components/PlayerContainer/ProgramInfo/index.tsx +1 -1
- package/Components/PlayerContainer/index.ts +1 -1
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +49 -43
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapHeightContext.ts +8 -0
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapRefContext.ts +8 -0
- package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +378 -0
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +2 -2
- package/Components/River/RefreshControl.tsx +11 -17
- package/Components/River/RiverItem.tsx +3 -0
- package/Components/River/TV/River.tsx +11 -20
- package/Components/River/TV/index.tsx +5 -3
- package/Components/River/TV/withFocusableGroupForContent.tsx +60 -0
- package/Components/River/TV/withPipesV1DataLoader.tsx +43 -0
- package/Components/River/TV/withRiverDataLoader.tsx +17 -0
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
- package/Components/River/__tests__/river.test.js +12 -26
- package/Components/River/index.tsx +1 -1
- package/Components/Screen/__tests__/Screen.test.tsx +28 -29
- package/Components/Screen/__tests__/navigationHandler.test.ts +133 -22
- package/Components/Screen/navigationHandler.ts +20 -2
- package/Components/ScreenResolver/index.tsx +15 -0
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
- package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
- package/Components/ScreenRevealManager/index.ts +1 -0
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +79 -0
- package/Components/Tabs/TV/Tabs.android.tsx +1 -3
- package/Components/Tabs/Tabs.tsx +2 -3
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
- package/Components/TextInputTv/index.tsx +11 -0
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
- package/Components/Touchable/__tests__/touchable.test.tsx +12 -17
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
- package/Components/VideoLive/animationUtils.ts +3 -3
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +6 -10
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.web.tsx +294 -0
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.web.tsx +93 -0
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +73 -29
- package/Components/VideoModal/PlayerDetails.tsx +29 -7
- package/Components/VideoModal/PlayerWrapper.tsx +26 -142
- package/Components/VideoModal/VideoModal.tsx +3 -17
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -5
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +9 -1
- package/Components/VideoModal/hooks/index.ts +0 -2
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +40 -15
- package/Components/VideoModal/hooks/useModalSize.ts +18 -2
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +2 -2
- package/Components/VideoModal/hooks/utils/index.ts +4 -0
- package/Components/VideoModal/utils.ts +6 -0
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
- package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
- package/Contexts/CellFocusedStateContext/index.tsx +27 -0
- package/Contexts/ConfigutaionContext/__tests__/ConfigurationProvider.test.tsx +3 -3
- package/Contexts/ScreenContext/index.tsx +46 -6
- package/Decorators/ConfigurationWrapper/__tests__/withConfigurationProvider.test.tsx +3 -3
- package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +221 -209
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +14 -16
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -20
- package/Decorators/RiverFeedLoader/index.tsx +22 -4
- package/Decorators/RiverFeedLoader/utils/index.ts +0 -18
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +3 -6
- package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/__tests__/NullFeedResolver.test.tsx +78 -0
- package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +205 -0
- package/Decorators/ZappPipesDataConnector/__tests__/StaticFeedResolver.test.tsx +251 -0
- package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +368 -0
- package/Decorators/ZappPipesDataConnector/__tests__/utils.test.ts +39 -0
- package/Decorators/ZappPipesDataConnector/index.tsx +26 -293
- package/Decorators/ZappPipesDataConnector/resolvers/NullFeedResolver.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +87 -0
- package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +266 -0
- package/Decorators/ZappPipesDataConnector/types.ts +29 -0
- package/Decorators/ZappPipesDataConnector/utils/mongoFilter.ts +738 -0
- package/Decorators/ZappPipesDataConnector/utils/useFilter.tsx +157 -0
- package/events/index.ts +5 -0
- package/package.json +5 -10
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- package/Components/River/TV/withTVEventHandler.tsx +0 -27
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +0 -27
- package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text, Animated } from "react-native";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
NotificationView,
|
|
7
|
+
onlinePhrase,
|
|
8
|
+
offlinePhrase,
|
|
9
|
+
} from "../NotificationView";
|
|
7
10
|
|
|
8
11
|
jest.mock("@applicaster/zapp-react-native-redux/hooks", () => ({
|
|
9
12
|
usePickFromState: () => ({
|
|
@@ -32,39 +35,31 @@ jest.mock("react-native-safe-area-context", () => ({
|
|
|
32
35
|
|
|
33
36
|
const dismiss = jest.fn();
|
|
34
37
|
|
|
35
|
-
const {
|
|
36
|
-
NotificationView,
|
|
37
|
-
onlinePhrase,
|
|
38
|
-
offlinePhrase,
|
|
39
|
-
} = require("../NotificationView");
|
|
40
|
-
|
|
41
38
|
describe("NotificationView", () => {
|
|
42
39
|
it("Show online message when Online", () => {
|
|
43
|
-
const component =
|
|
44
|
-
<NotificationView online dismiss={dismiss} />
|
|
45
|
-
);
|
|
40
|
+
const component = render(<NotificationView online dismiss={dismiss} />);
|
|
46
41
|
|
|
47
|
-
expect(component.
|
|
42
|
+
expect(component.UNSAFE_getByType(Text).props.children).toBe(onlinePhrase);
|
|
48
43
|
});
|
|
49
44
|
|
|
50
45
|
it("Show offline message when Online", () => {
|
|
51
|
-
const component =
|
|
46
|
+
const component = render(
|
|
52
47
|
<NotificationView online={false} dismiss={dismiss} />
|
|
53
48
|
);
|
|
54
49
|
|
|
55
|
-
expect(component.
|
|
50
|
+
expect(component.UNSAFE_getByType(Text).props.children).toBe(offlinePhrase);
|
|
56
51
|
});
|
|
57
52
|
|
|
58
53
|
it("When hidden is false to true notification is visible", () => {
|
|
59
|
-
const component =
|
|
54
|
+
const component = render(
|
|
60
55
|
<NotificationView online={false} hidden={false} dismiss={dismiss} />
|
|
61
56
|
);
|
|
62
57
|
|
|
63
|
-
component.
|
|
58
|
+
component.rerender(
|
|
64
59
|
<NotificationView online={false} hidden={true} dismiss={dismiss} />
|
|
65
60
|
);
|
|
66
61
|
|
|
67
|
-
const animatedView = component.
|
|
62
|
+
const animatedView = component.UNSAFE_getByType(Animated.View);
|
|
68
63
|
const animatedViewStyles = animatedView.props.style;
|
|
69
64
|
|
|
70
65
|
expect(animatedViewStyles.opacity).toBe(1);
|
|
@@ -21,6 +21,15 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
21
21
|
}
|
|
22
22
|
>
|
|
23
23
|
<View
|
|
24
|
+
accessibilityState={
|
|
25
|
+
{
|
|
26
|
+
"busy": undefined,
|
|
27
|
+
"checked": undefined,
|
|
28
|
+
"disabled": undefined,
|
|
29
|
+
"expanded": undefined,
|
|
30
|
+
"selected": undefined,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
accessible={true}
|
|
25
34
|
collapsable={false}
|
|
26
35
|
focusable={true}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import renderer, { act } from "react-test-renderer";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
6
5
|
|
|
@@ -19,29 +18,27 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/utils", () => {
|
|
|
19
18
|
};
|
|
20
19
|
});
|
|
21
20
|
|
|
22
|
-
jest.mock(
|
|
23
|
-
"@applicaster/zapp-react-native-redux/hooks
|
|
24
|
-
() => ({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
21
|
+
jest.mock("@applicaster/zapp-react-native-redux/hooks", () => ({
|
|
22
|
+
...jest.requireActual("@applicaster/zapp-react-native-redux/hooks"),
|
|
23
|
+
usePickFromState: () => ({
|
|
24
|
+
plugins: [
|
|
25
|
+
{
|
|
26
|
+
name: "offline experience",
|
|
27
|
+
identifier: "offline-experience",
|
|
28
|
+
type: "general",
|
|
29
|
+
module: {
|
|
30
|
+
useOfflineExperienceConfiguration: () => ({
|
|
31
|
+
configurationFields: {},
|
|
32
|
+
localizations: {
|
|
33
|
+
offline_toast_message: "No internet connection",
|
|
34
|
+
online_toast_message: "You are back online",
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
40
37
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
);
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
41
|
+
}));
|
|
45
42
|
|
|
46
43
|
jest.mock("react-native-safe-area-context", () => ({
|
|
47
44
|
useSafeAreaInsets: () => ({ top: 44 }),
|
|
@@ -51,24 +48,18 @@ describe("OfflineHandler", () => {
|
|
|
51
48
|
const { OfflineHandler, NotificationView } = require("../");
|
|
52
49
|
|
|
53
50
|
it("renders", () => {
|
|
54
|
-
const
|
|
55
|
-
expect(
|
|
51
|
+
const { toJSON } = render(<OfflineHandler />);
|
|
52
|
+
expect(toJSON()).toMatchSnapshot();
|
|
56
53
|
});
|
|
57
54
|
|
|
58
55
|
it("renders Notification mode if component was rendered while online", () => {
|
|
59
56
|
mockConnectionStatus = true;
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
act(() => {
|
|
64
|
-
instance = renderer.create(<OfflineHandler />);
|
|
65
|
-
});
|
|
58
|
+
const { rerender, UNSAFE_getByType } = render(<OfflineHandler />);
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
instance.update(<OfflineHandler />);
|
|
69
|
-
});
|
|
60
|
+
rerender(<OfflineHandler />);
|
|
70
61
|
|
|
71
|
-
const notificationsView =
|
|
62
|
+
const notificationsView = UNSAFE_getByType(NotificationView);
|
|
72
63
|
expect(notificationsView).toBeDefined();
|
|
73
64
|
});
|
|
74
65
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useReducer } from "react";
|
|
3
|
-
|
|
4
|
-
import { TVMenuControl, View, ViewStyle } from "react-native";
|
|
3
|
+
import { View, ViewStyle } from "react-native";
|
|
5
4
|
import * as R from "ramda";
|
|
6
5
|
import uuid from "uuid/v4";
|
|
7
6
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
@@ -62,6 +61,11 @@ import {
|
|
|
62
61
|
useModalAnimationContext,
|
|
63
62
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
64
63
|
|
|
64
|
+
import {
|
|
65
|
+
PlayerNativeCommandTypes,
|
|
66
|
+
PlayerNativeSendCommand,
|
|
67
|
+
} from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerNativeCommand";
|
|
68
|
+
|
|
65
69
|
type Props = {
|
|
66
70
|
Player: React.ComponentType<any>;
|
|
67
71
|
PlayerLoadingView?: React.ComponentType<any>; // 👀 we are not receiving this prop
|
|
@@ -88,7 +92,7 @@ export const VideoModalMode = {
|
|
|
88
92
|
MAXIMIZED: "MAXIMIZED",
|
|
89
93
|
MINIMIZED: "MINIMIZED",
|
|
90
94
|
FULLSCREEN: "FULLSCREEN",
|
|
91
|
-
};
|
|
95
|
+
} as const;
|
|
92
96
|
|
|
93
97
|
export type PlayNextData = {
|
|
94
98
|
state: PlayNextState;
|
|
@@ -127,7 +131,7 @@ const webStyles = {
|
|
|
127
131
|
playerScreen: {
|
|
128
132
|
flex: 1,
|
|
129
133
|
height: "100vh",
|
|
130
|
-
|
|
134
|
+
backgroundColor: "black",
|
|
131
135
|
},
|
|
132
136
|
playerWrapper: {
|
|
133
137
|
height: "100%",
|
|
@@ -135,9 +139,6 @@ const webStyles = {
|
|
|
135
139
|
},
|
|
136
140
|
inlineRiver: {
|
|
137
141
|
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
138
|
-
|
|
139
|
-
borderWidth: 4,
|
|
140
|
-
borderColor: "yellow",
|
|
141
142
|
},
|
|
142
143
|
};
|
|
143
144
|
|
|
@@ -148,7 +149,6 @@ const nativeStyles = {
|
|
|
148
149
|
},
|
|
149
150
|
playerScreen: {
|
|
150
151
|
flex: 1,
|
|
151
|
-
backgroundColor: "black",
|
|
152
152
|
overflow: "hidden",
|
|
153
153
|
},
|
|
154
154
|
playerWrapper: {
|
|
@@ -263,9 +263,15 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
// send command to clear and stop player
|
|
267
|
+
PlayerNativeSendCommand(
|
|
268
|
+
PlayerNativeCommandTypes.clearPlayerData,
|
|
269
|
+
state.playerId
|
|
270
|
+
);
|
|
271
|
+
|
|
266
272
|
showNavBar(true);
|
|
267
273
|
navigator.goBack();
|
|
268
|
-
}, [isModal, navigator.goBack, showNavBar]);
|
|
274
|
+
}, [isModal, navigator.goBack, state.playerId, showNavBar]);
|
|
269
275
|
|
|
270
276
|
const playEntry = (entry) => navigator.replaceTop(entry, { mode });
|
|
271
277
|
|
|
@@ -393,13 +399,17 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
393
399
|
}
|
|
394
400
|
};
|
|
395
401
|
|
|
396
|
-
const playerRemoteHandler = (
|
|
397
|
-
|
|
402
|
+
const playerRemoteHandler = React.useCallback(
|
|
403
|
+
(isLanguageOverlayVisible = false) =>
|
|
404
|
+
(event) => {
|
|
405
|
+
const { eventType } = event;
|
|
398
406
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
407
|
+
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
408
|
+
close();
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
[close]
|
|
412
|
+
);
|
|
403
413
|
|
|
404
414
|
// Effects
|
|
405
415
|
useEffect(() => {
|
|
@@ -413,7 +423,10 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
413
423
|
id: playerContainerId,
|
|
414
424
|
listener: {
|
|
415
425
|
onVideoEnd,
|
|
416
|
-
onError
|
|
426
|
+
onError: (err: Error) => {
|
|
427
|
+
// Adapt Error to the expected shape for onError
|
|
428
|
+
onError({ error: err });
|
|
429
|
+
},
|
|
417
430
|
onLoad,
|
|
418
431
|
onPlayerClose: close,
|
|
419
432
|
onPlayerDetached: close,
|
|
@@ -512,16 +525,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
512
525
|
}
|
|
513
526
|
}, [isAudioContent]);
|
|
514
527
|
|
|
515
|
-
// Needs to handle back button on Apple TV
|
|
516
|
-
// https://github.com/facebook/react-native/issues/18930
|
|
517
|
-
useEffect(() => {
|
|
518
|
-
TVMenuControl?.enableTVMenuKey();
|
|
519
|
-
|
|
520
|
-
return () => {
|
|
521
|
-
TVMenuControl?.disableTVMenuKey();
|
|
522
|
-
};
|
|
523
|
-
}, []);
|
|
524
|
-
|
|
525
528
|
useEffect(() => {
|
|
526
529
|
playerEvent("source_changed", { item });
|
|
527
530
|
|
|
@@ -568,8 +571,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
568
571
|
const isInlineTV = isInlineTVUtil(screenData);
|
|
569
572
|
|
|
570
573
|
const inline =
|
|
571
|
-
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
|
|
572
|
-
|
|
574
|
+
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
|
|
575
|
+
mode as any
|
|
576
|
+
) || isInlineTV;
|
|
573
577
|
|
|
574
578
|
const value = React.useMemo(
|
|
575
579
|
() => ({ playerId: state.playerId }),
|
|
@@ -590,7 +594,11 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
590
594
|
);
|
|
591
595
|
}
|
|
592
596
|
|
|
593
|
-
if (
|
|
597
|
+
if (
|
|
598
|
+
screen_background_color &&
|
|
599
|
+
mode !== VideoModalMode.FULLSCREEN &&
|
|
600
|
+
isTV()
|
|
601
|
+
) {
|
|
594
602
|
updatedStyles.playerScreen.backgroundColor = screen_background_color;
|
|
595
603
|
}
|
|
596
604
|
|
|
@@ -620,6 +628,8 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
620
628
|
playNextData,
|
|
621
629
|
};
|
|
622
630
|
|
|
631
|
+
const pointerEventsProp = mode === "MINIMIZED" ? "box-none" : "auto";
|
|
632
|
+
|
|
623
633
|
return (
|
|
624
634
|
<PlayerStateContext.Provider value={value}>
|
|
625
635
|
<PlayerContainerContextProvider
|
|
@@ -630,9 +640,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
630
640
|
<PlayerContainerContext.Consumer>
|
|
631
641
|
{(context) => (
|
|
632
642
|
<TVEventHandlerComponent
|
|
633
|
-
tvEventHandler={(
|
|
634
|
-
|
|
635
|
-
}
|
|
643
|
+
tvEventHandler={playerRemoteHandler(
|
|
644
|
+
context.isLanguageOverlayVisible
|
|
645
|
+
)}
|
|
636
646
|
>
|
|
637
647
|
<FocusableGroup
|
|
638
648
|
id={FocusableGroupMainContainerId}
|
|
@@ -640,14 +650,17 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
640
650
|
preferredFocus
|
|
641
651
|
shouldUsePreferredFocus
|
|
642
652
|
groupId={groupId}
|
|
653
|
+
pointerEvents={pointerEventsProp}
|
|
643
654
|
>
|
|
644
655
|
{/* Video player and components */}
|
|
645
656
|
<View
|
|
646
657
|
style={styles.playerScreen}
|
|
647
658
|
testID={"player-screen-container"}
|
|
659
|
+
pointerEvents={pointerEventsProp}
|
|
648
660
|
>
|
|
649
661
|
{/* Player container */}
|
|
650
662
|
<View
|
|
663
|
+
pointerEvents={pointerEventsProp}
|
|
651
664
|
style={[
|
|
652
665
|
styles.playerWrapper,
|
|
653
666
|
// eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
|
|
@@ -719,7 +732,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
719
732
|
key={item.id}
|
|
720
733
|
groupId={FocusableGroupMainContainerId}
|
|
721
734
|
cellTapAction={onCellTap}
|
|
722
|
-
extraAnchorPointYOffset={
|
|
735
|
+
extraAnchorPointYOffset={0}
|
|
723
736
|
isScreenWrappedInContainer={true}
|
|
724
737
|
containerHeight={styles.inlineRiver.height}
|
|
725
738
|
componentsMapExtraProps={{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
1
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
2
2
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
3
3
|
import { styleKeys } from "@applicaster/zapp-react-native-utils/styleKeysUtils";
|
|
4
4
|
import { transformColorCode as fixColorHexCode } from "@applicaster/zapp-react-native-utils/transform";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
2
|
|
|
3
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
3
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
4
4
|
import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
|
|
5
5
|
|
|
6
6
|
import { PlayerContainer as PlayerContainerComponent } from "./PlayerContainer";
|
|
@@ -28,7 +28,7 @@ const PlayerImageBackgroundComponent = ({
|
|
|
28
28
|
defaultImageDimensions,
|
|
29
29
|
}: Props) => {
|
|
30
30
|
const source = React.useMemo(
|
|
31
|
-
() => ({ uri: imageSrcFromMediaItem(entry, imageKey) }),
|
|
31
|
+
() => ({ uri: imageSrcFromMediaItem(entry, [imageKey]) }),
|
|
32
32
|
[imageKey, entry]
|
|
33
33
|
);
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import {
|
|
3
|
+
import { FlatList, StyleSheet, View } from "react-native";
|
|
4
4
|
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
5
5
|
import { RiverItem } from "../RiverItem";
|
|
6
6
|
import { RiverFooter } from "../RiverFooter";
|
|
@@ -9,8 +9,8 @@ import { useScreenConfiguration } from "../useScreenConfiguration";
|
|
|
9
9
|
import { RefreshControl } from "../RefreshControl";
|
|
10
10
|
import { ifEmptyUseFallback } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
11
11
|
import {
|
|
12
|
-
useProfilerLogging,
|
|
13
12
|
usePipesCacheReset,
|
|
13
|
+
useProfilerLogging,
|
|
14
14
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
15
15
|
import { useLoadingState } from "./hooks/useLoadingState";
|
|
16
16
|
import { ViewportTracker } from "../../Viewport";
|
|
@@ -25,6 +25,8 @@ import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHo
|
|
|
25
25
|
import { useShallow } from "zustand/react/shallow";
|
|
26
26
|
|
|
27
27
|
import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
28
|
+
import { ComponentsMapHeightContext } from "./ContextProviders/ComponentsMapHeightContext";
|
|
29
|
+
import { ComponentsMapRefContext } from "./ContextProviders/ComponentsMapRefContext";
|
|
28
30
|
|
|
29
31
|
const isAndroid = isAndroidPlatform();
|
|
30
32
|
|
|
@@ -70,6 +72,7 @@ function ComponentsMapComponent(props: Props) {
|
|
|
70
72
|
} = props;
|
|
71
73
|
|
|
72
74
|
const flatListRef = React.useRef<FlatList | null>(null);
|
|
75
|
+
const flatListWrapperRef = React.useRef<View | null>(null);
|
|
73
76
|
const screenConfig = useScreenConfiguration(riverId);
|
|
74
77
|
const screenData = useScreenData(riverId);
|
|
75
78
|
const pullToRefreshEnabled = screenData?.rules?.pull_to_refresh_enabled;
|
|
@@ -265,48 +268,51 @@ function ComponentsMapComponent(props: Props) {
|
|
|
265
268
|
// The Screen Picker in Mobile is completly different than the TV
|
|
266
269
|
// so the various offsets / margins in TV do not apply here.
|
|
267
270
|
return (
|
|
268
|
-
<View style={styles.container}>
|
|
269
|
-
<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
271
|
+
<View style={styles.container} ref={flatListWrapperRef}>
|
|
272
|
+
<ComponentsMapHeightContext.Provider value={flatListHeight}>
|
|
273
|
+
<ComponentsMapRefContext.Provider value={flatListWrapperRef}>
|
|
274
|
+
<ScreenLoadingMeasurements
|
|
275
|
+
riverId={riverId}
|
|
276
|
+
numberOfComponents={riverComponents.length}
|
|
277
|
+
>
|
|
278
|
+
<ViewportTracker>
|
|
279
|
+
<FlatList
|
|
280
|
+
ref={(ref) => {
|
|
281
|
+
flatListRef.current = ref;
|
|
282
|
+
}}
|
|
283
|
+
// Fix for WebView rerender crashes on Android API 28+
|
|
284
|
+
// https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
|
|
285
|
+
overScrollMode={isAndroid ? "never" : "auto"}
|
|
286
|
+
scrollIndicatorInsets={scrollIndicatorInsets}
|
|
287
|
+
extraData={feed}
|
|
288
|
+
stickyHeaderIndices={stickyHeaderIndices}
|
|
289
|
+
removeClippedSubviews={isAndroid}
|
|
290
|
+
onLayout={handleOnLayout}
|
|
291
|
+
initialNumToRender={3}
|
|
292
|
+
maxToRenderPerBatch={10}
|
|
293
|
+
windowSize={12}
|
|
294
|
+
keyExtractor={keyExtractor}
|
|
295
|
+
renderItem={renderRiverItem}
|
|
296
|
+
data={riverComponents}
|
|
297
|
+
contentContainerStyle={contentContainerStyle}
|
|
298
|
+
ListFooterComponent={
|
|
299
|
+
<RiverFooter
|
|
300
|
+
flatListHeight={flatListHeight}
|
|
301
|
+
loadingState={loadingState}
|
|
302
|
+
/>
|
|
303
|
+
}
|
|
304
|
+
refreshControl={refreshControl}
|
|
305
|
+
onScrollBeginDrag={onScrollBeginDrag}
|
|
306
|
+
onScroll={onScroll}
|
|
307
|
+
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
308
|
+
onScrollEndDrag={_onScrollEndDrag}
|
|
309
|
+
scrollEventThrottle={16}
|
|
310
|
+
{...scrollViewExtraProps}
|
|
298
311
|
/>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
304
|
-
onScrollEndDrag={_onScrollEndDrag}
|
|
305
|
-
scrollEventThrottle={16}
|
|
306
|
-
{...scrollViewExtraProps}
|
|
307
|
-
/>
|
|
308
|
-
</ViewportTracker>
|
|
309
|
-
</ScreenLoadingMeasurements>
|
|
312
|
+
</ViewportTracker>
|
|
313
|
+
</ScreenLoadingMeasurements>
|
|
314
|
+
</ComponentsMapRefContext.Provider>
|
|
315
|
+
</ComponentsMapHeightContext.Provider>
|
|
310
316
|
</View>
|
|
311
317
|
);
|
|
312
318
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
export const ComponentsMapRefContext =
|
|
5
|
+
React.createContext<React.RefObject<View | null> | null>(null);
|
|
6
|
+
|
|
7
|
+
export const useComponentsMapRef = () =>
|
|
8
|
+
React.useContext(ComponentsMapRefContext);
|