@applicaster/zapp-react-native-ui-components 14.0.0-rc.8 → 15.0.0-rc.1

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.
Files changed (163) hide show
  1. package/Components/AnimatedInOut/index.tsx +5 -3
  2. package/Components/AudioPlayer/index.tsx +15 -0
  3. package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
  4. package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
  5. package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
  6. package/Components/AudioPlayer/mobile/index.tsx +18 -0
  7. package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
  8. package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
  9. package/Components/AudioPlayer/tv/Layout.tsx +168 -0
  10. package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
  11. package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
  12. package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
  13. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
  14. package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
  15. package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
  16. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
  17. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
  18. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
  19. package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +11 -5
  20. package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
  21. package/Components/AudioPlayer/types.ts +40 -0
  22. package/Components/BaseFocusable/index.tsx +23 -12
  23. package/Components/Cell/Cell.tsx +91 -64
  24. package/Components/Cell/CellWithFocusable.tsx +3 -0
  25. package/Components/Cell/__tests__/CellWIthFocusable.test.js +3 -2
  26. package/Components/Cell/index.js +7 -3
  27. package/Components/ComponentResolver/index.ts +1 -1
  28. package/Components/FeedLoader/FeedLoader.tsx +7 -16
  29. package/Components/FeedLoader/FeedLoaderHOC.tsx +21 -0
  30. package/Components/FeedLoader/index.js +2 -8
  31. package/Components/Focusable/Focusable.tsx +12 -3
  32. package/Components/Focusable/FocusableTvOS.tsx +5 -5
  33. package/Components/Focusable/FocusableiOS.tsx +2 -2
  34. package/Components/Focusable/Touchable.tsx +5 -3
  35. package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
  36. package/Components/Focusable/index.android.tsx +19 -11
  37. package/Components/Focusable/index.tsx +1 -1
  38. package/Components/FocusableGroup/FocusableTvOS.tsx +1 -1
  39. package/Components/FocusableList/FocusableItem.tsx +4 -3
  40. package/Components/FocusableList/FocusableListItemWrapper.tsx +2 -1
  41. package/Components/FocusableList/hooks/useCellState.android.ts +13 -3
  42. package/Components/FocusableList/index.tsx +20 -9
  43. package/Components/FreezeWithCallback/__tests__/index.test.tsx +67 -43
  44. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +42 -59
  45. package/Components/GeneralContentScreen/utils/useCurationAPI.ts +13 -10
  46. package/Components/HandlePlayable/HandlePlayable.tsx +25 -9
  47. package/Components/HookRenderer/HookRenderer.tsx +5 -1
  48. package/Components/Layout/TV/LayoutBackground.tsx +1 -1
  49. package/Components/Layout/TV/__tests__/index.test.tsx +0 -1
  50. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +6 -2
  51. package/Components/MasterCell/DefaultComponents/Button.tsx +1 -1
  52. package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -39
  53. package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +1 -1
  54. package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +1 -1
  55. package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +65 -17
  56. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/Image.test.tsx +21 -3
  57. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +6 -3
  58. package/Components/MasterCell/DefaultComponents/Text/index.tsx +26 -6
  59. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +10 -10
  60. package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +18 -18
  61. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/index.test.tsx +10 -10
  62. package/Components/MasterCell/elementMapper.tsx +1 -2
  63. package/Components/MasterCell/index.tsx +1 -1
  64. package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
  65. package/Components/MasterCell/utils/index.ts +11 -5
  66. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
  67. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
  68. package/Components/OfflineHandler/__tests__/index.test.tsx +26 -35
  69. package/Components/PlayerContainer/ErrorDisplay/index.ts +1 -1
  70. package/Components/PlayerContainer/PlayerContainer.tsx +46 -33
  71. package/Components/PlayerContainer/ProgramInfo/index.tsx +1 -1
  72. package/Components/PlayerContainer/index.ts +1 -1
  73. package/Components/PlayerImageBackground/index.tsx +1 -1
  74. package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -6
  75. package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +378 -0
  76. package/Components/River/ComponentsMap/hooks/useLoadingState.ts +2 -2
  77. package/Components/River/RefreshControl.tsx +11 -17
  78. package/Components/River/RiverItem.tsx +11 -8
  79. package/Components/River/TV/River.tsx +2 -17
  80. package/Components/River/TV/index.tsx +3 -1
  81. package/Components/River/TV/withPipesV1DataLoader.tsx +43 -0
  82. package/Components/River/TV/withRiverDataLoader.tsx +17 -0
  83. package/Components/River/TV/withTVEventHandler.tsx +1 -1
  84. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -6
  85. package/Components/River/__tests__/river.test.js +12 -26
  86. package/Components/River/index.tsx +1 -1
  87. package/Components/Screen/__tests__/Screen.test.tsx +28 -29
  88. package/Components/Screen/__tests__/navigationHandler.test.ts +133 -22
  89. package/Components/Screen/navigationHandler.ts +20 -2
  90. package/Components/ScreenResolver/index.tsx +15 -0
  91. package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
  92. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
  93. package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
  94. package/Components/ScreenRevealManager/index.ts +1 -0
  95. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +79 -0
  96. package/Components/Tabs/TV/Tabs.android.tsx +1 -3
  97. package/Components/Tabs/Tabs.tsx +2 -3
  98. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
  99. package/Components/TextInputTv/index.tsx +11 -0
  100. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
  101. package/Components/Touchable/__tests__/touchable.test.tsx +12 -17
  102. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
  103. package/Components/VideoLive/animationUtils.ts +3 -3
  104. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +3 -9
  105. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.web.tsx +294 -0
  106. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.web.tsx +93 -0
  107. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +73 -29
  108. package/Components/VideoModal/PlayerDetails.tsx +24 -2
  109. package/Components/VideoModal/PlayerWrapper.tsx +26 -142
  110. package/Components/VideoModal/VideoModal.tsx +3 -17
  111. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -5
  112. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
  113. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -180
  114. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +21 -51
  115. package/Components/VideoModal/hooks/index.ts +0 -2
  116. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -1
  117. package/Components/VideoModal/hooks/useModalSize.ts +18 -2
  118. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +2 -2
  119. package/Components/VideoModal/hooks/utils/index.ts +4 -0
  120. package/Components/VideoModal/utils.ts +6 -0
  121. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
  122. package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
  123. package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
  124. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
  125. package/Contexts/CellFocusedStateContext/index.tsx +27 -0
  126. package/Contexts/ConfigutaionContext/__tests__/ConfigurationProvider.test.tsx +3 -3
  127. package/Contexts/ScreenContext/index.tsx +46 -6
  128. package/Decorators/ConfigurationWrapper/__tests__/withConfigurationProvider.test.tsx +3 -3
  129. package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
  130. package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +221 -209
  131. package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +14 -16
  132. package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -20
  133. package/Decorators/RiverFeedLoader/index.tsx +22 -4
  134. package/Decorators/RiverFeedLoader/utils/index.ts +0 -18
  135. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +3 -6
  136. package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -0
  137. package/Decorators/ZappPipesDataConnector/__tests__/NullFeedResolver.test.tsx +78 -0
  138. package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +205 -0
  139. package/Decorators/ZappPipesDataConnector/__tests__/StaticFeedResolver.test.tsx +251 -0
  140. package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +368 -0
  141. package/Decorators/ZappPipesDataConnector/__tests__/utils.test.ts +39 -0
  142. package/Decorators/ZappPipesDataConnector/index.tsx +26 -293
  143. package/Decorators/ZappPipesDataConnector/resolvers/NullFeedResolver.tsx +25 -0
  144. package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +87 -0
  145. package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +266 -0
  146. package/Decorators/ZappPipesDataConnector/types.ts +29 -0
  147. package/Decorators/ZappPipesDataConnector/utils/mongoFilter.ts +738 -0
  148. package/Decorators/ZappPipesDataConnector/utils/useFilter.tsx +157 -0
  149. package/events/index.ts +3 -0
  150. package/package.json +5 -10
  151. package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
  152. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
  153. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
  154. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
  155. package/Components/AudioPlayer/index.ts +0 -1
  156. package/Components/River/__tests__/__snapshots__/river.test.js.snap +0 -27
  157. package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
  158. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
  159. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
  160. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
  161. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
  162. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
  163. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
@@ -9,16 +9,8 @@ import {
9
9
  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
- import { PlayerDetails } from "./PlayerDetails";
13
12
  import { playerDimensionsHack } from "./utils";
14
- import { useDelayedPlayerDetails } from "./hooks";
15
-
16
- import {
17
- AnimatedScrollModal,
18
- AnimatedVideoPlayerComponent,
19
- AnimationComponent,
20
- ComponentAnimationType,
21
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
13
+ import { getTabletWidth } from "@applicaster/zapp-react-native-utils/playerUtils";
22
14
 
23
15
  const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
24
16
 
@@ -44,29 +36,15 @@ type Props = {
44
36
  isModal?: boolean;
45
37
  fullscreen?: boolean;
46
38
  isTabletPortrait?: boolean;
47
- children: (playerDimensions: DimensionsT) => React.ReactNode;
48
39
  configuration: Configuration;
40
+
41
+ playerContent: (styles: ViewStyle) => React.ReactNode;
49
42
  };
50
43
 
51
44
  const defaultStyles = StyleSheet.create({
52
45
  playerContainer: { position: "relative", alignSelf: "center", zIndex: 200 },
53
- playerDetails: { flex: 1, paddingTop: 20 },
54
- flex: { flex: 1 },
55
- });
56
-
57
- const orientationStyles = StyleSheet.create({
58
- landscape: { flexDirection: "row" },
59
- portrait: { flexDirection: "column" },
60
46
  });
61
47
 
62
- const directionStyles = (isTabletLandscape: boolean): ViewStyle => {
63
- if (isTabletLandscape) {
64
- return orientationStyles.landscape;
65
- }
66
-
67
- return orientationStyles.portrait;
68
- };
69
-
70
48
  const getScreenAspectRatio = () => {
71
49
  const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
72
50
  const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -86,51 +64,6 @@ const getEdges = (isTablet: boolean, isInlineModal: boolean) => {
86
64
  return ["top"];
87
65
  };
88
66
 
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
-
107
- const getTabletWidth = (
108
- configuration: Configuration,
109
- dimensions: DimensionsT
110
- ) => {
111
- const tablet_landscape_sidebar_width =
112
- configuration?.tablet_landscape_sidebar_width;
113
-
114
- const { width } = dimensions;
115
- let widthValue = Number(width);
116
-
117
- if (isPercentage(width)) {
118
- widthValue = getPercentageOf(width.toString(), SCREEN_WIDTH);
119
- }
120
-
121
- const sidebarWidth = Number(tablet_landscape_sidebar_width?.replace("%", ""));
122
-
123
- if (tablet_landscape_sidebar_width?.includes("%")) {
124
- return widthValue * (1 - sidebarWidth / 100);
125
- }
126
-
127
- if (Number.isNaN(sidebarWidth)) {
128
- return widthValue * 0.65;
129
- }
130
-
131
- return widthValue - sidebarWidth;
132
- };
133
-
134
67
  const PlayerWrapperComponent = (props: Props) => {
135
68
  const {
136
69
  entry,
@@ -139,35 +72,26 @@ const PlayerWrapperComponent = (props: Props) => {
139
72
  inline,
140
73
  docked,
141
74
  isModal,
142
- children,
143
75
  isTabletPortrait,
144
76
  configuration,
145
- fullscreen,
146
77
  pip,
78
+ playerContent,
147
79
  } = props;
148
80
 
149
81
  const isTablet = useIsTablet();
150
82
 
151
83
  const isInlineModal = inline && isModal;
152
84
 
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
- });
162
-
163
85
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
164
86
 
165
- const tabletWidth = getTabletWidth(configuration, style);
87
+ const tabletWidth = getTabletWidth(
88
+ configuration.tablet_landscape_sidebar_width,
89
+ style
90
+ );
166
91
 
167
92
  const baseDimensions: DimensionsT = React.useMemo(
168
93
  () => ({
169
- width:
170
- isInlineModal && !docked && isTabletLandscape ? tabletWidth : "100%",
94
+ width: isInlineModal && isTabletLandscape ? tabletWidth : "100%",
171
95
  height: undefined,
172
96
  }),
173
97
  [isInlineModal, tabletWidth, docked]
@@ -176,7 +100,7 @@ const PlayerWrapperComponent = (props: Props) => {
176
100
  const playerDimensions: DimensionsT = React.useMemo(
177
101
  () => ({
178
102
  ...baseDimensions,
179
- width: isInlineModal && docked ? undefined : baseDimensions.width,
103
+ width: baseDimensions.width,
180
104
  aspectRatio: !isInlineModal && !pip ? getScreenAspectRatio() : 16 / 9,
181
105
  }),
182
106
  [baseDimensions, isInlineModal, pip]
@@ -185,8 +109,7 @@ const PlayerWrapperComponent = (props: Props) => {
185
109
  const containerDimensions: DimensionsT = React.useMemo(
186
110
  () => ({
187
111
  ...baseDimensions,
188
- aspectRatio:
189
- isInlineModal && docked ? undefined : playerDimensions.aspectRatio,
112
+ aspectRatio: playerDimensions.aspectRatio,
190
113
  }),
191
114
  [baseDimensions, isInlineModal, docked, playerDimensions.aspectRatio]
192
115
  );
@@ -194,68 +117,29 @@ const PlayerWrapperComponent = (props: Props) => {
194
117
  const WrapperView = React.useMemo(() => (isTV() ? View : SafeAreaView), []);
195
118
 
196
119
  const childrenStyles = React.useMemo(
197
- () => ({ ...playerDimensions, ...playerDimensionsHack }),
120
+ () => ({
121
+ ...playerDimensions,
122
+ ...playerDimensionsHack,
123
+ }),
198
124
  [containerDimensions, playerDimensionsHack]
199
125
  );
200
126
 
201
- const wrapperViewStyle: ViewStyle = {
202
- backgroundColor:
203
- isTablet && !fullscreen
204
- ? configuration?.tablet_landscape_player_container_background_color
205
- : "transparent",
206
- };
207
-
208
127
  return (
209
128
  <WrapperView
210
129
  edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
211
- style={[wrapperViewStyle, style, playerDimensionsHack]}
130
+ style={playerDimensionsHack}
212
131
  >
213
- <AnimationComponent
214
- animationType={ComponentAnimationType.moveUpComponent}
215
- additionalData={{ saveArea: true }}
216
- style={[directionStyles(isTabletLandscape), defaultStyles.flex]}
132
+ <View
133
+ testID={`${entry?.id}-player-container`}
134
+ style={[
135
+ defaultStyles.playerContainer,
136
+ playerDimensionsHack,
137
+ containerDimensions,
138
+ containerStyle,
139
+ ]}
217
140
  >
218
- <View
219
- testID={`${entry?.id}-player-container`}
220
- style={[
221
- defaultStyles.playerContainer,
222
- containerDimensions,
223
- containerStyle,
224
- playerDimensionsHack,
225
- ]}
226
- >
227
- <AnimationComponent
228
- animationType={ComponentAnimationType.moveUpComponent}
229
- style={isTabletLandscape ? defaultStyles.flex : undefined}
230
- additionalData={{
231
- useLayoutMeasure: isTabletLandscape,
232
- disableAnimatedComponent: !isTabletLandscape,
233
- resetAnimationValue: isTabletLandscape && docked,
234
- }}
235
- >
236
- <AnimatedVideoPlayerComponent>
237
- {children(childrenStyles)}
238
- </AnimatedVideoPlayerComponent>
239
- </AnimationComponent>
240
- </View>
241
-
242
- <AnimatedScrollModal>
243
- {isShowPlayerDetails ? (
244
- <AnimationComponent
245
- animationType={ComponentAnimationType.componentFade}
246
- style={defaultStyles.flex}
247
- >
248
- <PlayerDetails
249
- configuration={configuration}
250
- style={defaultStyles.playerDetails}
251
- entry={entry}
252
- isTabletLandscape={isTabletLandscape}
253
- isTablet={isTablet}
254
- />
255
- </AnimationComponent>
256
- ) : null}
257
- </AnimatedScrollModal>
258
- </AnimationComponent>
141
+ {playerContent(childrenStyles)}
142
+ </View>
259
143
  </WrapperView>
260
144
  );
261
145
  };
@@ -17,11 +17,7 @@ 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
- useModalSize,
22
- useBackgroundColor,
23
- useInitialPlayerState,
24
- } from "./hooks";
20
+ import { useModalSize, useInitialPlayerState } from "./hooks";
25
21
 
26
22
  import { APP_EVENTS } from "@applicaster/zapp-react-native-utils/appUtils/events";
27
23
  import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
@@ -33,8 +29,6 @@ import { ScreenContextProvider } from "../../Contexts/ScreenContext";
33
29
  import { Spinner } from "../Spinner";
34
30
  import { OpaqueLayer } from "./OpaqueLayer";
35
31
 
36
- import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
37
-
38
32
  const LOADER_BACKGROUND_COLOR = "rgba(64,64,64,0.5)";
39
33
 
40
34
  const styles = StyleSheet.create({
@@ -65,7 +59,6 @@ const VideoModalComponent = () => {
65
59
 
66
60
  const modalSize = useModalSize();
67
61
  const isFirstRender = useIsInitialRender();
68
- const backgroundColor = useBackgroundColor();
69
62
 
70
63
  const {
71
64
  closeVideoModal,
@@ -145,20 +138,13 @@ const VideoModalComponent = () => {
145
138
  {mode === "FULLSCREEN" && <OpaqueLayer />}
146
139
 
147
140
  {itemIdHooksFinished === item?.id ? (
148
- <AnimatedPlayerModalWrapper
149
- style={[
150
- styles.container,
151
- {
152
- backgroundColor,
153
- },
154
- ]}
155
- >
141
+ <View pointerEvents="box-none" style={styles.container}>
156
142
  <HandlePlayable
157
143
  item={item}
158
144
  isModal={mode !== "PIP"}
159
145
  mode={mode}
160
146
  />
161
- </AnimatedPlayerModalWrapper>
147
+ </View>
162
148
  ) : (
163
149
  <View style={styles.loaderContainer}>
164
150
  <Spinner />
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import renderer from "react-test-renderer";
2
+ import { render } from "@testing-library/react-native";
3
3
 
4
4
  const props = {
5
5
  entry: {},
@@ -42,16 +42,16 @@ const { PlayerDetails } = require("../PlayerDetails");
42
42
 
43
43
  describe("PlayerDetails", () => {
44
44
  it("renders properly", () => {
45
- const element = renderer.create(<PlayerDetails {...props} />);
45
+ const { toJSON } = render(<PlayerDetails {...props} />);
46
46
 
47
- expect(element).toMatchSnapshot();
47
+ expect(toJSON()).toMatchSnapshot();
48
48
  });
49
49
 
50
50
  it("renders properly on tablet in landscape orientation", () => {
51
- const element = renderer.create(
51
+ const { toJSON } = render(
52
52
  <PlayerDetails {...props} isTabletLandscape={true} />
53
53
  );
54
54
 
55
- expect(element).toMatchSnapshot();
55
+ expect(toJSON()).toMatchSnapshot();
56
56
  });
57
57
  });
@@ -13,6 +13,7 @@ const props = {
13
13
  tablet_landscape_sidebar_width: "35%",
14
14
  tablet_landscape_player_container_background_color: "red",
15
15
  },
16
+ playerContent: jest.fn(() => <></>),
16
17
  };
17
18
 
18
19
  const mockUseIsDeviceTablet = jest.fn();
@@ -122,13 +123,6 @@ describe("PlayerWrapper", () => {
122
123
  </PlayerWrapper>
123
124
  );
124
125
 
125
- const expectDimensions = {
126
- ...dimensions,
127
- width: undefined,
128
- aspectRatio: 16 / 9,
129
- };
130
-
131
126
  expect(element).toMatchSnapshot();
132
- expect(children).toHaveBeenCalledWith(expectDimensions);
133
127
  });
134
128
  });
@@ -21,57 +21,27 @@ exports[`PlayerWrapper renders inline 1`] = `
21
21
  "top": "additive",
22
22
  }
23
23
  }
24
- style={
25
- [
26
- {
27
- "backgroundColor": "transparent",
28
- },
29
- {
30
- "height": 800,
31
- "width": 300,
32
- },
33
- {},
34
- ]
35
- }
24
+ style={{}}
36
25
  >
37
26
  <View
38
- additionalData={
39
- {
40
- "saveArea": true,
41
- }
42
- }
43
- animationType="moveUpComponent"
44
27
  style={
45
28
  [
46
29
  {
47
- "flexDirection": "column",
30
+ "alignSelf": "center",
31
+ "position": "relative",
32
+ "zIndex": 200,
48
33
  },
34
+ {},
49
35
  {
50
- "flex": 1,
36
+ "aspectRatio": 1.7777777777777777,
37
+ "height": undefined,
38
+ "width": "100%",
51
39
  },
40
+ {},
52
41
  ]
53
42
  }
54
- >
55
- <View
56
- style={
57
- [
58
- {
59
- "alignSelf": "center",
60
- "position": "relative",
61
- "zIndex": 200,
62
- },
63
- {
64
- "aspectRatio": 1.7777777777777777,
65
- "height": undefined,
66
- "width": "100%",
67
- },
68
- {},
69
- {},
70
- ]
71
- }
72
- testID="test-player-container"
73
- />
74
- </View>
43
+ testID="test-player-container"
44
+ />
75
45
  </RNCSafeAreaView>
76
46
  </RNCSafeAreaProvider>
77
47
  `;
@@ -97,57 +67,27 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
97
67
  "top": "additive",
98
68
  }
99
69
  }
100
- style={
101
- [
102
- {
103
- "backgroundColor": "transparent",
104
- },
105
- {
106
- "height": undefined,
107
- "width": 300,
108
- },
109
- {},
110
- ]
111
- }
70
+ style={{}}
112
71
  >
113
72
  <View
114
- additionalData={
115
- {
116
- "saveArea": true,
117
- }
118
- }
119
- animationType="moveUpComponent"
120
73
  style={
121
74
  [
122
75
  {
123
- "flexDirection": "column",
76
+ "alignSelf": "center",
77
+ "position": "relative",
78
+ "zIndex": 200,
124
79
  },
80
+ {},
125
81
  {
126
- "flex": 1,
82
+ "aspectRatio": 1.7777777777777777,
83
+ "height": undefined,
84
+ "width": "100%",
127
85
  },
86
+ {},
128
87
  ]
129
88
  }
130
- >
131
- <View
132
- style={
133
- [
134
- {
135
- "alignSelf": "center",
136
- "position": "relative",
137
- "zIndex": 200,
138
- },
139
- {
140
- "aspectRatio": undefined,
141
- "height": undefined,
142
- "width": "100%",
143
- },
144
- {},
145
- {},
146
- ]
147
- }
148
- testID="test-player-container"
149
- />
150
- </View>
89
+ testID="test-player-container"
90
+ />
151
91
  </RNCSafeAreaView>
152
92
  </RNCSafeAreaProvider>
153
93
  `;
@@ -173,73 +113,27 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
173
113
  "top": "additive",
174
114
  }
175
115
  }
176
- style={
177
- [
178
- {
179
- "backgroundColor": "red",
180
- },
181
- {
182
- "height": 800,
183
- "width": 300,
184
- },
185
- {},
186
- ]
187
- }
116
+ style={{}}
188
117
  >
189
118
  <View
190
- additionalData={
191
- {
192
- "saveArea": true,
193
- }
194
- }
195
- animationType="moveUpComponent"
196
119
  style={
197
120
  [
198
121
  {
199
- "flexDirection": "row",
122
+ "alignSelf": "center",
123
+ "position": "relative",
124
+ "zIndex": 200,
200
125
  },
126
+ {},
201
127
  {
202
- "flex": 1,
128
+ "aspectRatio": 1.7777777777777777,
129
+ "height": undefined,
130
+ "width": 195,
203
131
  },
132
+ {},
204
133
  ]
205
134
  }
206
- >
207
- <View
208
- style={
209
- [
210
- {
211
- "alignSelf": "center",
212
- "position": "relative",
213
- "zIndex": 200,
214
- },
215
- {
216
- "aspectRatio": 1.7777777777777777,
217
- "height": undefined,
218
- "width": 195,
219
- },
220
- {},
221
- {},
222
- ]
223
- }
224
- testID="test-player-container"
225
- >
226
- <View
227
- additionalData={
228
- {
229
- "disableAnimatedComponent": false,
230
- "resetAnimationValue": undefined,
231
- "useLayoutMeasure": true,
232
- }
233
- }
234
- animationType="moveUpComponent"
235
- style={
236
- {
237
- "flex": 1,
238
- }
239
- }
240
- />
241
- </View>
242
- </View>
135
+ testID="test-player-container"
136
+ />
243
137
  </RNCSafeAreaView>
244
138
  </RNCSafeAreaProvider>
245
139
  `;
@@ -265,57 +159,27 @@ exports[`PlayerWrapper renders properly 1`] = `
265
159
  "top": "additive",
266
160
  }
267
161
  }
268
- style={
269
- [
270
- {
271
- "backgroundColor": "transparent",
272
- },
273
- {
274
- "height": 800,
275
- "width": 300,
276
- },
277
- {},
278
- ]
279
- }
162
+ style={{}}
280
163
  >
281
164
  <View
282
- additionalData={
283
- {
284
- "saveArea": true,
285
- }
286
- }
287
- animationType="moveUpComponent"
288
165
  style={
289
166
  [
290
167
  {
291
- "flexDirection": "column",
168
+ "alignSelf": "center",
169
+ "position": "relative",
170
+ "zIndex": 200,
292
171
  },
172
+ {},
293
173
  {
294
- "flex": 1,
174
+ "aspectRatio": 1.7786666666666666,
175
+ "height": undefined,
176
+ "width": "100%",
295
177
  },
178
+ {},
296
179
  ]
297
180
  }
298
- >
299
- <View
300
- style={
301
- [
302
- {
303
- "alignSelf": "center",
304
- "position": "relative",
305
- "zIndex": 200,
306
- },
307
- {
308
- "aspectRatio": 1.7786666666666666,
309
- "height": undefined,
310
- "width": "100%",
311
- },
312
- {},
313
- {},
314
- ]
315
- }
316
- testID="test-player-container"
317
- />
318
- </View>
181
+ testID="test-player-container"
182
+ />
319
183
  </RNCSafeAreaView>
320
184
  </RNCSafeAreaProvider>
321
185
  `;