@applicaster/zapp-react-native-ui-components 13.0.0-alpha.5033140607 → 13.0.0-alpha.5144285042

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 (179) hide show
  1. package/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
  2. package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
  3. package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
  4. package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
  5. package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
  6. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +56 -113
  7. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +39 -23
  8. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
  9. package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
  10. package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
  11. package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
  12. package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
  13. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
  14. package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
  15. package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
  16. package/Components/AudioPlayer/__tests__/title.test.js +3 -5
  17. package/Components/BaseFocusable/index.ios.ts +1 -1
  18. package/Components/BaseFocusable/index.tsx +67 -31
  19. package/Components/Cell/Cell.tsx +15 -9
  20. package/Components/Cell/CellWithFocusable.tsx +44 -59
  21. package/Components/Cell/TvOSCellComponent.tsx +23 -30
  22. package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
  23. package/Components/Cell/index.js +3 -1
  24. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +50 -50
  25. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
  26. package/Components/ComponentResolver/__tests__/componentResolver.test.js +26 -30
  27. package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
  28. package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
  29. package/Components/ErrorScreen/index.tsx +6 -6
  30. package/Components/Focusable/Focusable.tsx +1 -54
  31. package/Components/Focusable/FocusableTvOS.tsx +6 -2
  32. package/Components/Focusable/Touchable.tsx +19 -20
  33. package/Components/Focusable/index.android.tsx +10 -3
  34. package/Components/FocusableGroup/FocusableTvOS.tsx +34 -83
  35. package/Components/FocusableGroup/index.tsx +1 -3
  36. package/Components/FocusableList/index.tsx +26 -10
  37. package/Components/FocusableScrollView/index.tsx +43 -13
  38. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +76 -7
  39. package/Components/GeneralContentScreen/utils/useCurationAPI.ts +53 -9
  40. package/Components/Layout/TV/NavBarContainer.tsx +19 -23
  41. package/Components/Layout/TV/ScreenContainer.tsx +8 -1
  42. package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
  43. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +3 -1
  44. package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
  45. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +6 -5
  46. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +12 -11
  47. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  48. package/Components/Layout/TV/__tests__/index.test.tsx +7 -3
  49. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
  50. package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
  51. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
  52. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +6 -12
  53. package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
  54. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
  55. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
  56. package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
  57. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  58. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  59. package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
  60. package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
  61. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +11 -19
  62. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +6 -235
  63. package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
  64. package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
  65. package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
  66. package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
  67. package/Components/MasterCell/utils/behaviorProvider.ts +133 -0
  68. package/Components/MasterCell/utils/index.ts +4 -130
  69. package/Components/ModalComponent/Button/index.tsx +6 -6
  70. package/Components/ModalComponent/Header/index.tsx +3 -3
  71. package/Components/NativeFocusables/{index.js → index.ts} +4 -2
  72. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
  73. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
  74. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
  75. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
  76. package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
  77. package/Components/PlayerContainer/PlayerContainer.tsx +13 -19
  78. package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
  79. package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
  80. package/Components/PlayerImageBackground/index.tsx +23 -3
  81. package/Components/River/ComponentsMap/ComponentsMap.tsx +39 -65
  82. package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
  83. package/Components/River/RefreshControl.tsx +1 -1
  84. package/Components/River/RiverFooter.tsx +39 -9
  85. package/Components/River/RiverItem.tsx +37 -2
  86. package/Components/River/TV/index.tsx +6 -1
  87. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +114 -45
  88. package/Components/River/__tests__/__snapshots__/river.test.js.snap +21 -83
  89. package/Components/River/__tests__/componentsMap.test.js +64 -17
  90. package/Components/River/__tests__/river.test.js +75 -40
  91. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +12 -5
  92. package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
  93. package/Components/RouteManager/__tests__/testId.test.js +8 -6
  94. package/Components/Screen/__tests__/Screen.test.tsx +41 -27
  95. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
  96. package/Components/Screen/hooks.ts +56 -0
  97. package/Components/Screen/index.tsx +16 -42
  98. package/Components/ScreenResolver/__tests__/screenResolver.test.js +95 -70
  99. package/Components/Tabs/Tab.tsx +12 -9
  100. package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
  101. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
  102. package/Components/TextInputTv/index.tsx +6 -5
  103. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
  104. package/Components/TrackedView/index.tsx +1 -0
  105. package/Components/Transitioner/AnimationManager.js +15 -15
  106. package/Components/Transitioner/Scene.tsx +53 -24
  107. package/Components/Transitioner/Transitioner.tsx +3 -3
  108. package/Components/Transitioner/__tests__/Scene.test.js +25 -14
  109. package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
  110. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +10 -50
  111. package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
  112. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
  113. package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
  114. package/Components/Transitioner/index.js +8 -4
  115. package/Components/VideoLive/LiveImageManager.ts +27 -1
  116. package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
  117. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
  118. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -10
  119. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +16 -12
  120. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +5 -1
  121. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +15 -14
  122. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +6 -13
  123. package/Components/VideoModal/ModalAnimation/index.ts +2 -1
  124. package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
  125. package/Components/VideoModal/ModalAnimation/utils.ts +2 -2
  126. package/Components/VideoModal/OpaqueLayer.tsx +33 -0
  127. package/Components/VideoModal/PlayerDetails.tsx +9 -6
  128. package/Components/VideoModal/PlayerWrapper.tsx +17 -36
  129. package/Components/VideoModal/VideoModal.tsx +14 -23
  130. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
  131. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
  132. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
  133. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
  134. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
  135. package/Components/VideoModal/hooks/index.ts +7 -0
  136. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
  137. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
  138. package/Components/VideoModal/hooks/utils/index.ts +33 -0
  139. package/Components/VideoModal/utils.ts +3 -5
  140. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
  141. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
  142. package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
  143. package/Components/Viewport/__tests__/utils.test.js +5 -4
  144. package/Components/ZappUIComponent/Placeholder.tsx +3 -1
  145. package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
  146. package/Components/ZappUIComponent/index.tsx +3 -16
  147. package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
  148. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
  149. package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
  150. package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
  151. package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
  152. package/Contexts/HeaderOffsetContext/index.tsx +4 -6
  153. package/Contexts/ScreenContext/index.tsx +6 -12
  154. package/Contexts/ScreenLayoutContext/index.tsx +5 -3
  155. package/Decorators/Analytics/{index.js → index.tsx} +11 -11
  156. package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
  157. package/Decorators/Navigator/index.tsx +1 -1
  158. package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
  159. package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
  160. package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
  161. package/Decorators/RiverFeedLoader/index.tsx +1 -1
  162. package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
  163. package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
  164. package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
  165. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +27 -27
  166. package/Decorators/RiverResolver/index.tsx +6 -8
  167. package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
  168. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
  169. package/Decorators/ZappPipesDataConnector/index.tsx +5 -2
  170. package/package.json +13 -10
  171. package/tsconfig.json +2 -3
  172. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
  173. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
  174. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
  175. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
  176. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
  177. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
  178. package/Decorators/RiverFeedLoader/utils.ts +0 -100
  179. package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
@@ -1,26 +1,26 @@
1
1
  import React from "react";
2
- import { Animated, StyleSheet, View, Platform } from "react-native";
2
+ import { Animated, Platform, StyleSheet, View } from "react-native";
3
3
 
4
4
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
5
5
  import {
6
+ GestureHandlerRootView,
6
7
  NativeViewGestureHandler,
7
8
  PanGestureHandler,
8
9
  State,
9
10
  TapGestureHandler,
10
- GestureHandlerRootView,
11
11
  } from "react-native-gesture-handler";
12
12
 
13
13
  import { PlayerContainerContext } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainerContext";
14
14
  import {
15
- useModalAnimationContext,
16
15
  PlayerAnimationStateEnum,
16
+ useModalAnimationContext,
17
17
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
18
18
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
19
19
  import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
20
20
 
21
21
  import {
22
- setScrollModalAnimatedValue,
23
22
  resetScrollAnimatedValues,
23
+ setScrollModalAnimatedValue,
24
24
  } from "./utils";
25
25
 
26
26
  const getAnimatedConfig = (toValue) => {
@@ -62,14 +62,17 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
62
62
  } = useModalAnimationContext();
63
63
 
64
64
  const [enableGesture, setIEnableGesture] = React.useState<boolean>(true);
65
- const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
65
+
66
+ const { isLanguageOverlayVisible, isSeekBarTouch } = React.useContext(
67
+ PlayerContainerContext
68
+ );
66
69
 
67
70
  const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
68
71
  useNavigation();
69
72
 
70
73
  const { mode: videoModalMode, item: videoModalItem } = videoModalState;
71
- const isMaximazedModal = videoModalMode === "MAXIMIZED";
72
- const isMinimizedModal = videoModalMode === "MINIMIZED";
74
+ const isMaximizedModal: boolean = videoModalMode === "MAXIMIZED";
75
+ const isMinimizedModal: boolean = videoModalMode === "MINIMIZED";
73
76
  const previousItemId = usePrevious(videoModalItem?.id);
74
77
 
75
78
  const isNotMinimizeMaximazeAnimation =
@@ -80,7 +83,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
80
83
  enableGesture &&
81
84
  !isLanguageOverlayVisible &&
82
85
  isNotMinimizeMaximazeAnimation &&
83
- (isMaximazedModal || isMinimizedModal);
86
+ !isSeekBarTouch &&
87
+ (isMaximizedModal || isMinimizedModal);
84
88
 
85
89
  const isAudioItem = React.useMemo(
86
90
  () =>
@@ -342,6 +346,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
342
346
  []
343
347
  );
344
348
 
349
+ const scrollEnabled = isMaximizedModal && isNotMinimizeMaximazeAnimation;
350
+
345
351
  return (
346
352
  <Wrapper style={generalStyles.container}>
347
353
  <TapGestureHandler
@@ -355,7 +361,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
355
361
  enabled={isEnablePanGesture}
356
362
  ref={panHandlerRef}
357
363
  simultaneousHandlers={[scrollRef, tapHandlerRef]}
358
- shouldCancelWhenOutside={isMaximazedModal}
364
+ shouldCancelWhenOutside={isMaximizedModal}
359
365
  onGestureEvent={onGestureEvent}
360
366
  onHandlerStateChange={onHandlerStateChange}
361
367
  activeOffsetY={[-5, 5]}
@@ -367,9 +373,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
367
373
  simultaneousHandlers={panHandlerRef}
368
374
  >
369
375
  <Animated.ScrollView
370
- scrollEnabled={
371
- isMaximazedModal && isNotMinimizeMaximazeAnimation
372
- }
376
+ scrollEnabled={scrollEnabled}
373
377
  bounces={false}
374
378
  onScrollBeginDrag={onRegisterLastScroll}
375
379
  onScroll={onScroll}
@@ -41,7 +41,10 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
41
41
  videoModalState: { mode: videoModalMode },
42
42
  } = useNavigation();
43
43
 
44
- const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
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(
@@ -4,26 +4,26 @@ import { Animated, View } from "react-native";
4
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
5
 
6
6
  import {
7
- useModalAnimationContext,
8
7
  PlayerAnimationStateEnum,
8
+ useModalAnimationContext,
9
9
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
10
10
 
11
11
  import {
12
+ useDimensions,
12
13
  useGetBottomTabBarHeight,
13
14
  useNavigation,
14
- useDimensions,
15
15
  } from "@applicaster/zapp-react-native-utils/reactHooks";
16
16
  import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
17
17
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
18
18
  import { useAppState } from "@applicaster/zapp-react-native-utils/reactHooks/app";
19
19
 
20
20
  import {
21
- gestureListenerHelper,
22
- getAnimationStyle,
21
+ AUDIO_PLAYER_HORIZONTAL_PADDING,
22
+ ComponentAnimationType,
23
23
  defaultAspectRatioWidth,
24
+ gestureListenerHelper,
24
25
  getAnimationDefaultValue,
25
- ComponentAnimationType,
26
- AUDIO_PLAYER_HORIZONTAL_PADDING,
26
+ getAnimationStyle,
27
27
  } from "./utils";
28
28
 
29
29
  type Props = {
@@ -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
- (x, y, width, height, pageX, pageY) => {
80
+ (_x, _y, _width, _height, _pageX, pageY) => {
81
81
  setTabletLandscapePlayerTopPosition(pageY - 20);
82
82
  }
83
83
  );
@@ -100,10 +100,11 @@ export const AnimationView = ({
100
100
  const moveUpValue = additionalData.saveArea
101
101
  ? -insets.top + (isAudioItem ? 0 : progressBarHeight)
102
102
  : isTablet
103
- ? isTabletLandscape && (!isAudioItem || (isAudioItem && inlineAudioPlayer))
104
- ? -tabletLandscapePlayerTopPosition + progressBarHeight
105
- : -130
106
- : -50 + progressBarHeight;
103
+ ? isTabletLandscape &&
104
+ (!isAudioItem || (isAudioItem && inlineAudioPlayer))
105
+ ? -tabletLandscapePlayerTopPosition + progressBarHeight
106
+ : -130
107
+ : -50 + progressBarHeight;
107
108
 
108
109
  const moveComponentHorizontalValue = additionalData.moveValue
109
110
  ? isRTL
@@ -404,7 +405,7 @@ export const AnimationView = ({
404
405
 
405
406
  return (
406
407
  <Animated.View
407
- onLayout={additionalData.useLayoutMeasure && measureView}
408
+ onLayout={additionalData.useLayoutMeasure ? measureView : undefined}
408
409
  ref={animationComponentRef}
409
410
  style={[
410
411
  ...preparedStyles,
@@ -434,8 +435,8 @@ export const AnimationComponent = (props: Props) => {
434
435
  const Component = useAnimation
435
436
  ? AnimationView
436
437
  : style
437
- ? View
438
- : React.Fragment;
438
+ ? View
439
+ : React.Fragment;
439
440
 
440
441
  if (
441
442
  additionalData.extraAnimation &&
@@ -1,14 +1,12 @@
1
- import React, { useContext } from "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
- useGetBottomTabBarHeight,
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);
@@ -124,11 +118,10 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
124
118
  If bottomTabBarHeight is equal 0 it means an app does not use bottomTabBar.
125
119
  Because of this we need to minus bottom SafeArea offset.
126
120
  */
121
+
127
122
  const minValue =
128
123
  height -
129
- minimisedHeight -
130
- (bottomTabBarHeight || bottomSafeArea) -
131
- progressBarHeight;
124
+ (minimisedHeight + bottomTabBarHeight + progressBarHeight + bottomSafeArea);
132
125
 
133
126
  const modalSnapPoints = React.useMemo(() => [0, minValue], [minValue]);
134
127
  // Last snap state which will helps us to make smooth responder to scrollview animation
@@ -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";
@@ -0,0 +1,6 @@
1
+ import { useContext } from "react";
2
+ import { ModalAnimationContextT, ReactContext } from "./ModalAnimationContext";
3
+
4
+ export function useModalAnimationContext() {
5
+ return useContext<ModalAnimationContextT>(ReactContext);
6
+ }
@@ -108,8 +108,8 @@ export const calculateAnimationValue = (animationType, dragPosition, data) => {
108
108
  : { forWidth: 3, forHeight: 3 }
109
109
  : { forWidth: 2, forHeight: 2 }
110
110
  : isTabletLandscape
111
- ? { forWidth: 8, forHeight: 6.5 }
112
- : { forWidth: 3.5, forHeight: 2 };
111
+ ? { forWidth: 8, forHeight: 6.5 }
112
+ : { forWidth: 3.5, forHeight: 2 };
113
113
 
114
114
  const minWidth =
115
115
  isAudioItem && !inlineAudioPlayer ? minimisedHeight : minimisedWidth;
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+
4
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
5
+
6
+ import { Spinner } from "../Spinner";
7
+
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ ...StyleSheet.absoluteFillObject,
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ },
14
+ });
15
+
16
+ export const OpaqueLayer = () => {
17
+ const theme = useTheme();
18
+
19
+ return (
20
+ <View
21
+ style={[
22
+ styles.container,
23
+ {
24
+ // we assume that it's non-transparent and we could show spinner always until it will be covered by player
25
+ // this spinner hides all content under modal
26
+ backgroundColor: theme?.app_background_color,
27
+ },
28
+ ]}
29
+ >
30
+ <Spinner />
31
+ </View>
32
+ );
33
+ };
@@ -1,10 +1,11 @@
1
1
  import React, { useEffect, useRef } from "react";
2
2
  import {
3
- StyleProp,
4
- ViewStyle,
5
3
  Animated,
6
- Easing,
7
4
  Dimensions,
5
+ Easing,
6
+ StyleProp,
7
+ ViewStyle,
8
+ StyleSheet,
8
9
  } from "react-native";
9
10
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
10
11
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
@@ -90,17 +91,19 @@ export const PlayerDetails = ({
90
91
  {
91
92
  // workaround for avoid wrong text-height after going back to portrait rotation
92
93
  // we don't see this view in landscape mode, so we are able to use fixed width from portrait mode
93
- width: isTablet ? undefined : SCREEN_WIDTH,
94
+ width: isTablet
95
+ ? undefined
96
+ : (StyleSheet.flatten(style)?.width ?? SCREEN_WIDTH),
94
97
  },
95
98
  ]}
96
99
  >
97
- {screenData && (
100
+ {screenData ? (
98
101
  <ComponentsMap
99
102
  riverId={screenData.id}
100
103
  feed={screenData?.data?.source}
101
104
  riverComponents={screenData.ui_components}
102
105
  />
103
- )}
106
+ ) : null}
104
107
  </Animated.View>
105
108
  );
106
109
  };
@@ -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 { playerDimesionsHack } from "./utils";
13
+ import { playerDimensionsHack } from "./utils";
14
+ import { useDelayedPlayerDetails } from "./hooks";
14
15
 
15
16
  import {
16
17
  AnimatedScrollModal,
@@ -121,34 +122,6 @@ const getTabletWidth = (
121
122
  return Number(width) - sidebarWidth;
122
123
  };
123
124
 
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;
150
- };
151
-
152
125
  const PlayerWrapperComponent = (props: Props) => {
153
126
  const {
154
127
  entry,
@@ -167,7 +140,15 @@ const PlayerWrapperComponent = (props: Props) => {
167
140
 
168
141
  const isInlineModal = inline && isModal;
169
142
 
170
- // const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
143
+ // Mounting the PlayerDetails component is a resource-intensive process.
144
+ // Therefore, for performance reasons, we mount it with a delay to make the rotation process as smooth as possible.
145
+ // The flow is as follows: the rotation occurs first, and then, after a short delay, we mount the PlayerDetails component.
146
+ // This helps to avoid blocking the rotation and any animations related to the rotation.
147
+ const isShowPlayerDetails = useDelayedPlayerDetails({
148
+ isInline: isInlineModal,
149
+ isDocked: docked,
150
+ isPip: pip,
151
+ });
171
152
 
172
153
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
173
154
 
@@ -203,8 +184,8 @@ const PlayerWrapperComponent = (props: Props) => {
203
184
  const WrapperView = React.useMemo(() => (isTV() ? View : SafeAreaView), []);
204
185
 
205
186
  const childrenStyles = React.useMemo(
206
- () => ({ ...playerDimensions, ...playerDimesionsHack }),
207
- [containerDimensions, playerDimesionsHack]
187
+ () => ({ ...playerDimensions, ...playerDimensionsHack }),
188
+ [containerDimensions, playerDimensionsHack]
208
189
  );
209
190
 
210
191
  return (
@@ -213,7 +194,7 @@ const PlayerWrapperComponent = (props: Props) => {
213
194
  style={[
214
195
  safeAreaStyles(configuration, isTablet),
215
196
  style,
216
- playerDimesionsHack,
197
+ playerDimensionsHack,
217
198
  ]}
218
199
  >
219
200
  <AnimationComponent
@@ -227,7 +208,7 @@ const PlayerWrapperComponent = (props: Props) => {
227
208
  defaultStyles.playerContainer,
228
209
  containerDimensions,
229
210
  containerStyle,
230
- playerDimesionsHack,
211
+ playerDimensionsHack,
231
212
  ]}
232
213
  >
233
214
  <AnimationComponent
@@ -246,7 +227,7 @@ const PlayerWrapperComponent = (props: Props) => {
246
227
  </View>
247
228
 
248
229
  <AnimatedScrollModal>
249
- {showDetails(!isTablet, docked, isInlineModal, pip) && (
230
+ {isShowPlayerDetails ? (
250
231
  <AnimationComponent
251
232
  animationType={ComponentAnimationType.componentFade}
252
233
  style={defaultStyles.flex}
@@ -259,7 +240,7 @@ const PlayerWrapperComponent = (props: Props) => {
259
240
  isTablet={isTablet}
260
241
  />
261
242
  </AnimationComponent>
262
- )}
243
+ ) : null}
263
244
  </AnimatedScrollModal>
264
245
  </AnimationComponent>
265
246
  </WrapperView>
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import * as R from "ramda";
3
- import { StyleSheet, View, StatusBar } from "react-native";
2
+ import { equals } from "ramda";
3
+ import { StyleSheet, StatusBar } from "react-native";
4
4
 
5
5
  import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
6
6
  import {
@@ -17,17 +17,20 @@ 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 { useModalSize } from "./hooks/useModalSize";
21
- import { useBackgroundColor } from "./hooks/useBackgroundColor";
22
- import { useInitialPlayerState } from "./hooks/useInitialPlayerState";
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 { OpaqueLayer } from "./OpaqueLayer";
31
34
 
32
35
  import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
33
36
 
@@ -39,17 +42,6 @@ const styles = StyleSheet.create({
39
42
  bottom: 0,
40
43
  position: "absolute",
41
44
  },
42
- // eslint-disable-next-line react-native/no-color-literals
43
- loaderContainer: {
44
- top: 0,
45
- left: 0,
46
- right: 0,
47
- bottom: 0,
48
- position: "absolute",
49
- alignItems: "center",
50
- justifyContent: "center",
51
- backgroundColor: "rgba(64,64,64,.5)",
52
- },
53
45
  });
54
46
 
55
47
  const VideoModalComponent = () => {
@@ -100,7 +92,7 @@ const VideoModalComponent = () => {
100
92
 
101
93
  const onHooksSuccess = ({ payload }) => {
102
94
  // set new modified entry
103
- if (!R.equals(payload, item)) {
95
+ if (!equals(payload, item)) {
104
96
  onVideoModalHookSuccessAnalyticsEvent();
105
97
  setVideoModalItem(payload);
106
98
  }
@@ -136,7 +128,10 @@ const VideoModalComponent = () => {
136
128
 
137
129
  <PathnameContext.Provider value={pathname}>
138
130
  <ScreenContextProvider pathname={pathname}>
139
- {itemIdHooksFinished === item?.id ? (
131
+ {/* Hide content underneath when we switch to next video in fullscreen mode */}
132
+ {mode === "FULLSCREEN" && <OpaqueLayer />}
133
+
134
+ {itemIdHooksFinished === item?.id && (
140
135
  <AnimatedPlayerModalWrapper
141
136
  style={[
142
137
  styles.container,
@@ -153,10 +148,6 @@ const VideoModalComponent = () => {
153
148
  mode={mode}
154
149
  />
155
150
  </AnimatedPlayerModalWrapper>
156
- ) : (
157
- <View style={styles.loaderContainer}>
158
- <Spinner />
159
- </View>
160
151
  )}
161
152
  </ScreenContextProvider>
162
153
  </PathnameContext.Provider>
@@ -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
- () => ({ ComponentsMap: View })
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 useIsTablet = jest.fn();
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", () => ({ PlayerDetails: View }));
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", () => ({ playerDimesionsHack: {} }));
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
- useIsTablet.mockReturnValue(false);
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
- useIsTablet.mockReturnValue(false);
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
- useIsTablet.mockReturnValue(true);
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
- useIsTablet.mockReturnValue(false);
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
- Object {
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={Array []}
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
- Object {
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={Array []}
39
+ riverComponents={[]}
40
40
  riverId="test-id"
41
41
  />
42
42
  </View>