@applicaster/zapp-react-native-ui-components 13.0.0-rc.13 → 13.0.0-rc.130
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__/AppContainer.test.js +4 -6
- package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
- package/Components/AudioPlayer/AudioPlayer.tsx +5 -9
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +6 -7
- package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
- 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 +56 -113
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +39 -23
- 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/AudioPlayer/__tests__/artWork.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
- package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
- package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
- package/Components/AudioPlayer/__tests__/title.test.js +3 -5
- package/Components/AudioPlayer/helpers.tsx +1 -2
- package/Components/BaseFocusable/index.ios.ts +1 -1
- package/Components/BaseFocusable/index.tsx +67 -31
- package/Components/Cell/Cell.tsx +14 -14
- package/Components/Cell/CellWithFocusable.tsx +50 -59
- package/Components/Cell/CellWrapper.tsx +18 -0
- package/Components/Cell/TvOSCellComponent.tsx +20 -26
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
- package/Components/Cell/index.js +3 -1
- package/Components/Cell/styles.ts +17 -0
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +50 -50
- package/Components/CellRendererResolver/index.ts +2 -1
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +26 -30
- package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
- package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
- package/Components/ErrorScreen/index.tsx +14 -6
- package/Components/Focusable/Focusable.tsx +1 -54
- package/Components/Focusable/FocusableTvOS.tsx +6 -2
- package/Components/Focusable/Touchable.tsx +19 -20
- package/Components/Focusable/index.android.tsx +10 -3
- package/Components/FocusableCell/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +34 -86
- package/Components/FocusableGroup/index.tsx +0 -3
- package/Components/FocusableList/index.tsx +26 -10
- package/Components/FocusableScrollView/index.tsx +43 -13
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +3 -0
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +9 -0
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +5 -3
- package/Components/GeneralContentScreen/utils/useEventAlerts.ts +30 -0
- package/Components/HandlePlayable/HandlePlayable.tsx +21 -27
- package/Components/Layout/TV/LayoutBackground.tsx +28 -0
- package/Components/Layout/TV/NavBarContainer.tsx +19 -23
- package/Components/Layout/TV/ScreenContainer.tsx +8 -2
- package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +3 -1
- package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +6 -5
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +12 -11
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +15 -10
- package/Components/Layout/TV/__tests__/index.test.tsx +14 -4
- package/Components/Layout/TV/index.tsx +6 -20
- package/Components/Layout/TV/index.web.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
- package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +10 -15
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +11 -7
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/const.ts +3 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +6 -6
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +11 -19
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +6 -235
- package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
- package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
- package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
- package/Components/MasterCell/utils/behaviorProvider.ts +136 -0
- package/Components/MasterCell/utils/index.ts +9 -135
- package/Components/ModalComponent/BottomSheetModalContent.tsx +66 -54
- package/Components/ModalComponent/Button/Item.tsx +6 -5
- package/Components/ModalComponent/Button/assets.ts +1 -1
- package/Components/ModalComponent/Button/index.tsx +45 -62
- package/Components/ModalComponent/Header/index.tsx +12 -11
- package/Components/ModalComponent/utils.ts +55 -7
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
- package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
- package/Components/OfflineHandler/utils/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +49 -29
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +53 -68
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
- package/Components/River/RefreshControl.tsx +1 -1
- package/Components/River/RiverFooter.tsx +39 -9
- package/Components/River/RiverItem.tsx +43 -3
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +121 -46
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +21 -83
- package/Components/River/__tests__/componentsMap.test.js +64 -17
- package/Components/River/__tests__/river.test.js +75 -40
- package/Components/RouteManager/TestId.tsx +1 -5
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -5
- package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
- package/Components/RouteManager/__tests__/testId.test.js +4 -6
- package/Components/Screen/TV/__tests__/index.web.test.tsx +26 -0
- package/Components/Screen/TV/index.web.tsx +5 -6
- package/Components/Screen/__tests__/Screen.test.tsx +53 -31
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +6 -6
- package/Components/Screen/hooks.ts +53 -0
- package/Components/Screen/index.tsx +16 -42
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +95 -70
- package/Components/Tabs/Tab.tsx +12 -9
- 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 +6 -5
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +2 -3
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
- package/Components/TrackedView/index.tsx +1 -0
- package/Components/Transitioner/AnimationManager.js +15 -15
- package/Components/Transitioner/Scene.tsx +53 -24
- package/Components/Transitioner/Transitioner.tsx +3 -3
- package/Components/Transitioner/__tests__/Scene.test.js +25 -14
- package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +10 -50
- package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
- package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
- package/Components/Transitioner/index.js +8 -4
- package/Components/VideoLive/LiveImageManager.ts +27 -1
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -10
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +1 -1
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +51 -31
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +8 -4
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +48 -23
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +16 -15
- package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +108 -0
- package/Components/VideoModal/ModalAnimation/const.ts +5 -0
- package/Components/VideoModal/ModalAnimation/index.ts +4 -1
- package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +32 -2
- package/Components/VideoModal/OpaqueLayer.tsx +33 -0
- package/Components/VideoModal/PlayerDetails.tsx +18 -10
- package/Components/VideoModal/PlayerWrapper.tsx +51 -57
- package/Components/VideoModal/VideoModal.tsx +17 -11
- 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 +2 -40
- 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 +6 -9
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
- package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
- package/Components/Viewport/__tests__/utils.test.js +5 -4
- package/Components/ZappUIComponent/Placeholder.tsx +3 -1
- package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
- package/Components/ZappUIComponent/index.tsx +4 -17
- package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
- package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
- package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
- package/Contexts/HeaderOffsetContext/index.tsx +4 -6
- package/Contexts/ScreenContext/index.tsx +6 -12
- package/Contexts/ScreenLayoutContext/index.tsx +5 -3
- package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
- package/Decorators/Navigator/index.tsx +1 -1
- 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__/riverResolver.test.tsx +27 -27
- package/Decorators/RiverResolver/index.tsx +6 -8
- package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
- package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
- package/Decorators/ZappPipesDataConnector/index.tsx +7 -3
- package/package.json +13 -11
- package/tsconfig.json +2 -3
- package/.babelrc +0 -8
- package/Components/Cell/CellStyles/FallbackCellStyle/index.js +0 -157
- package/Components/Cell/CellStyles/Hero/index.js +0 -111
- package/Components/Cell/CellStyles/ScreenSelector/index.js +0 -68
- package/Components/Cell/CellStyles/cellStylesResolver.ts +0 -19
- package/Components/Cell/CellStyles/colors.js +0 -40
- package/Components/Cell/CellStyles/index.js +0 -15
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
- package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
|
@@ -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,
|
|
@@ -73,20 +74,6 @@ const getScreenAspectRatio = () => {
|
|
|
73
74
|
return longEdge / shortEdge;
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
const safeAreaStyles = (
|
|
77
|
-
configuration: Configuration,
|
|
78
|
-
isTablet: boolean
|
|
79
|
-
): ViewStyle => {
|
|
80
|
-
const tablet_landscape_player_container_background_color =
|
|
81
|
-
configuration?.tablet_landscape_player_container_background_color;
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
backgroundColor: isTablet
|
|
85
|
-
? tablet_landscape_player_container_background_color
|
|
86
|
-
: "transparent",
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
|
|
90
77
|
const getEdges = (isTablet: boolean, isInlineModal: boolean) => {
|
|
91
78
|
if (isTablet) {
|
|
92
79
|
return ["top"];
|
|
@@ -99,6 +86,24 @@ const getEdges = (isTablet: boolean, isInlineModal: boolean) => {
|
|
|
99
86
|
return ["top"];
|
|
100
87
|
};
|
|
101
88
|
|
|
89
|
+
const isPercentage = (value: string | number): boolean => {
|
|
90
|
+
if (typeof value === "string") {
|
|
91
|
+
return value.includes("%");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return false;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const getPercentageOf = (percent: string, value: number) => {
|
|
98
|
+
const percentageValue = parseFloat(percent.replace("%", ""));
|
|
99
|
+
|
|
100
|
+
if (isNaN(percentageValue)) {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (value * percentageValue) / 100;
|
|
105
|
+
};
|
|
106
|
+
|
|
102
107
|
const getTabletWidth = (
|
|
103
108
|
configuration: Configuration,
|
|
104
109
|
dimensions: DimensionsT
|
|
@@ -107,46 +112,23 @@ const getTabletWidth = (
|
|
|
107
112
|
configuration?.tablet_landscape_sidebar_width;
|
|
108
113
|
|
|
109
114
|
const { width } = dimensions;
|
|
115
|
+
let widthValue = Number(width);
|
|
116
|
+
|
|
117
|
+
if (isPercentage(width)) {
|
|
118
|
+
widthValue = getPercentageOf(width.toString(), SCREEN_WIDTH);
|
|
119
|
+
}
|
|
110
120
|
|
|
111
121
|
const sidebarWidth = Number(tablet_landscape_sidebar_width?.replace("%", ""));
|
|
112
122
|
|
|
113
123
|
if (tablet_landscape_sidebar_width?.includes("%")) {
|
|
114
|
-
return
|
|
124
|
+
return widthValue * (1 - sidebarWidth / 100);
|
|
115
125
|
}
|
|
116
126
|
|
|
117
127
|
if (Number.isNaN(sidebarWidth)) {
|
|
118
|
-
return
|
|
128
|
+
return widthValue * 0.65;
|
|
119
129
|
}
|
|
120
130
|
|
|
121
|
-
return
|
|
122
|
-
};
|
|
123
|
-
|
|
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;
|
|
131
|
+
return widthValue - sidebarWidth;
|
|
150
132
|
};
|
|
151
133
|
|
|
152
134
|
const PlayerWrapperComponent = (props: Props) => {
|
|
@@ -160,6 +142,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
160
142
|
children,
|
|
161
143
|
isTabletPortrait,
|
|
162
144
|
configuration,
|
|
145
|
+
fullscreen,
|
|
163
146
|
pip,
|
|
164
147
|
} = props;
|
|
165
148
|
|
|
@@ -167,7 +150,15 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
167
150
|
|
|
168
151
|
const isInlineModal = inline && isModal;
|
|
169
152
|
|
|
170
|
-
//
|
|
153
|
+
// Mounting the PlayerDetails component is a resource-intensive process.
|
|
154
|
+
// Therefore, for performance reasons, we mount it with a delay to make the rotation process as smooth as possible.
|
|
155
|
+
// The flow is as follows: the rotation occurs first, and then, after a short delay, we mount the PlayerDetails component.
|
|
156
|
+
// This helps to avoid blocking the rotation and any animations related to the rotation.
|
|
157
|
+
const isShowPlayerDetails = useDelayedPlayerDetails({
|
|
158
|
+
isInline: isInlineModal,
|
|
159
|
+
isDocked: docked,
|
|
160
|
+
isPip: pip,
|
|
161
|
+
});
|
|
171
162
|
|
|
172
163
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
173
164
|
|
|
@@ -203,18 +194,21 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
203
194
|
const WrapperView = React.useMemo(() => (isTV() ? View : SafeAreaView), []);
|
|
204
195
|
|
|
205
196
|
const childrenStyles = React.useMemo(
|
|
206
|
-
() => ({ ...playerDimensions, ...
|
|
207
|
-
[containerDimensions,
|
|
197
|
+
() => ({ ...playerDimensions, ...playerDimensionsHack }),
|
|
198
|
+
[containerDimensions, playerDimensionsHack]
|
|
208
199
|
);
|
|
209
200
|
|
|
201
|
+
const wrapperViewStyle: ViewStyle = {
|
|
202
|
+
backgroundColor:
|
|
203
|
+
isTablet && !fullscreen
|
|
204
|
+
? configuration?.tablet_landscape_player_container_background_color
|
|
205
|
+
: "transparent",
|
|
206
|
+
};
|
|
207
|
+
|
|
210
208
|
return (
|
|
211
209
|
<WrapperView
|
|
212
210
|
edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
|
|
213
|
-
style={[
|
|
214
|
-
safeAreaStyles(configuration, isTablet),
|
|
215
|
-
style,
|
|
216
|
-
playerDimesionsHack,
|
|
217
|
-
]}
|
|
211
|
+
style={[wrapperViewStyle, style, playerDimensionsHack]}
|
|
218
212
|
>
|
|
219
213
|
<AnimationComponent
|
|
220
214
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
@@ -227,7 +221,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
227
221
|
defaultStyles.playerContainer,
|
|
228
222
|
containerDimensions,
|
|
229
223
|
containerStyle,
|
|
230
|
-
|
|
224
|
+
playerDimensionsHack,
|
|
231
225
|
]}
|
|
232
226
|
>
|
|
233
227
|
<AnimationComponent
|
|
@@ -246,7 +240,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
246
240
|
</View>
|
|
247
241
|
|
|
248
242
|
<AnimatedScrollModal>
|
|
249
|
-
{
|
|
243
|
+
{isShowPlayerDetails ? (
|
|
250
244
|
<AnimationComponent
|
|
251
245
|
animationType={ComponentAnimationType.componentFade}
|
|
252
246
|
style={defaultStyles.flex}
|
|
@@ -259,7 +253,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
259
253
|
isTablet={isTablet}
|
|
260
254
|
/>
|
|
261
255
|
</AnimationComponent>
|
|
262
|
-
)}
|
|
256
|
+
) : null}
|
|
263
257
|
</AnimatedScrollModal>
|
|
264
258
|
</AnimationComponent>
|
|
265
259
|
</WrapperView>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { StyleSheet,
|
|
2
|
+
import { equals } from "ramda";
|
|
3
|
+
import { StyleSheet, StatusBar, View } from "react-native";
|
|
4
4
|
|
|
5
5
|
import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
|
|
6
6
|
import {
|
|
@@ -17,20 +17,26 @@ import {
|
|
|
17
17
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device/useIsTablet";
|
|
18
18
|
|
|
19
19
|
import { withModalNavigationContextProvider } from "../../Contexts/ModalNavigationContext";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
import {
|
|
21
|
+
useModalSize,
|
|
22
|
+
useBackgroundColor,
|
|
23
|
+
useInitialPlayerState,
|
|
24
|
+
} from "./hooks";
|
|
25
|
+
|
|
23
26
|
import { APP_EVENTS } from "@applicaster/zapp-react-native-utils/appUtils/events";
|
|
24
|
-
import { Spinner } from "../Spinner";
|
|
25
27
|
import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
|
|
26
28
|
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
27
29
|
import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
|
|
28
30
|
import { requiresAuthentication } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
29
31
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
30
32
|
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
33
|
+
import { Spinner } from "../Spinner";
|
|
34
|
+
import { OpaqueLayer } from "./OpaqueLayer";
|
|
31
35
|
|
|
32
36
|
import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
33
37
|
|
|
38
|
+
const LOADER_BACKGROUND_COLOR = "rgba(64,64,64,0.5)";
|
|
39
|
+
|
|
34
40
|
const styles = StyleSheet.create({
|
|
35
41
|
container: {
|
|
36
42
|
top: 0,
|
|
@@ -39,7 +45,6 @@ const styles = StyleSheet.create({
|
|
|
39
45
|
bottom: 0,
|
|
40
46
|
position: "absolute",
|
|
41
47
|
},
|
|
42
|
-
// eslint-disable-next-line react-native/no-color-literals
|
|
43
48
|
loaderContainer: {
|
|
44
49
|
top: 0,
|
|
45
50
|
left: 0,
|
|
@@ -48,7 +53,7 @@ const styles = StyleSheet.create({
|
|
|
48
53
|
position: "absolute",
|
|
49
54
|
alignItems: "center",
|
|
50
55
|
justifyContent: "center",
|
|
51
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: LOADER_BACKGROUND_COLOR,
|
|
52
57
|
},
|
|
53
58
|
});
|
|
54
59
|
|
|
@@ -100,7 +105,7 @@ const VideoModalComponent = () => {
|
|
|
100
105
|
|
|
101
106
|
const onHooksSuccess = ({ payload }) => {
|
|
102
107
|
// set new modified entry
|
|
103
|
-
if (!
|
|
108
|
+
if (!equals(payload, item)) {
|
|
104
109
|
onVideoModalHookSuccessAnalyticsEvent();
|
|
105
110
|
setVideoModalItem(payload);
|
|
106
111
|
}
|
|
@@ -136,6 +141,9 @@ const VideoModalComponent = () => {
|
|
|
136
141
|
|
|
137
142
|
<PathnameContext.Provider value={pathname}>
|
|
138
143
|
<ScreenContextProvider pathname={pathname}>
|
|
144
|
+
{/* Hide content underneath when we switch to next video in fullscreen mode */}
|
|
145
|
+
{mode === "FULLSCREEN" && <OpaqueLayer />}
|
|
146
|
+
|
|
139
147
|
{itemIdHooksFinished === item?.id ? (
|
|
140
148
|
<AnimatedPlayerModalWrapper
|
|
141
149
|
style={[
|
|
@@ -148,8 +156,6 @@ const VideoModalComponent = () => {
|
|
|
148
156
|
<HandlePlayable
|
|
149
157
|
item={item}
|
|
150
158
|
isModal={mode !== "PIP"}
|
|
151
|
-
modalHeight={modalSize.height}
|
|
152
|
-
modalWidth={modalSize.width}
|
|
153
159
|
mode={mode}
|
|
154
160
|
/>
|
|
155
161
|
</AnimatedPlayerModalWrapper>
|
|
@@ -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
|
|
|
@@ -59,7 +62,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
|
59
62
|
})),
|
|
60
63
|
}));
|
|
61
64
|
|
|
62
|
-
jest.mock("../utils", () => ({
|
|
65
|
+
jest.mock("../utils", () => ({ playerDimensionsHack: {} }));
|
|
63
66
|
|
|
64
67
|
const { PlayerWrapper } = require("../PlayerWrapper");
|
|
65
68
|
|
|
@@ -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 };
|
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`PlayerDetails renders properly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
collapsable={false}
|
|
6
|
-
style={
|
|
7
|
-
Object {
|
|
8
|
-
"backgroundColor": "transparent",
|
|
9
|
-
"flex": 1,
|
|
10
|
-
"marginTop": -8,
|
|
11
|
-
"paddingTop": -8,
|
|
12
|
-
"width": 750,
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
>
|
|
16
|
-
<View
|
|
17
|
-
feed="test-source"
|
|
18
|
-
riverComponents={Array []}
|
|
19
|
-
riverId="test-id"
|
|
20
|
-
/>
|
|
21
|
-
</View>
|
|
22
|
-
`;
|
|
3
|
+
exports[`PlayerDetails renders properly 1`] = `null`;
|
|
23
4
|
|
|
24
|
-
exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] = `
|
|
25
|
-
<View
|
|
26
|
-
collapsable={false}
|
|
27
|
-
style={
|
|
28
|
-
Object {
|
|
29
|
-
"backgroundColor": "transparent",
|
|
30
|
-
"flex": 1,
|
|
31
|
-
"marginTop": -20,
|
|
32
|
-
"paddingTop": 40,
|
|
33
|
-
"width": 750,
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
<View
|
|
38
|
-
feed="test-source"
|
|
39
|
-
riverComponents={Array []}
|
|
40
|
-
riverId="test-id"
|
|
41
|
-
/>
|
|
42
|
-
</View>
|
|
43
|
-
`;
|
|
5
|
+
exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] = `null`;
|