@applicaster/zapp-react-native-ui-components 13.0.0-alpha.1692038547 → 13.0.0-alpha.1700735421

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 (107) hide show
  1. package/Components/AnimatedInOut/index.tsx +5 -3
  2. package/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
  3. package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
  4. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +54 -111
  5. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +36 -20
  6. package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
  7. package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
  8. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
  9. package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
  10. package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
  11. package/Components/AudioPlayer/__tests__/title.test.js +3 -5
  12. package/Components/BaseFocusable/index.tsx +1 -2
  13. package/Components/Cell/Cell.tsx +1 -0
  14. package/Components/Cell/CellWithFocusable.tsx +1 -0
  15. package/Components/Cell/TvOSCellComponent.tsx +20 -22
  16. package/Components/Cell/index.js +3 -1
  17. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +46 -48
  18. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
  19. package/Components/ComponentResolver/__tests__/componentResolver.test.js +16 -22
  20. package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
  21. package/Components/ErrorScreen/index.tsx +6 -6
  22. package/Components/Focusable/Focusable.tsx +1 -0
  23. package/Components/Focusable/FocusableTvOS.tsx +5 -1
  24. package/Components/Focusable/index.android.tsx +10 -3
  25. package/Components/FocusableGroup/FocusableTvOS.tsx +34 -83
  26. package/Components/FocusableGroup/index.tsx +1 -3
  27. package/Components/FocusableList/index.tsx +26 -9
  28. package/Components/FocusableScrollView/index.tsx +43 -13
  29. package/Components/Layout/TV/NavBarContainer.tsx +19 -23
  30. package/Components/Layout/TV/ScreenContainer.tsx +8 -1
  31. package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
  32. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +2 -1
  33. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -2
  34. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +3 -2
  35. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
  36. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
  37. package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
  38. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +4 -12
  39. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +0 -229
  40. package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
  41. package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
  42. package/Components/MasterCell/elementMapper.tsx +1 -2
  43. package/Components/MasterCell/utils/behaviorProvider.ts +133 -0
  44. package/Components/MasterCell/utils/index.ts +3 -129
  45. package/Components/ModalComponent/Button/index.tsx +6 -6
  46. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
  47. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
  48. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
  49. package/Components/PlayerContainer/PlayerContainer.tsx +8 -8
  50. package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
  51. package/Components/PlayerImageBackground/index.tsx +23 -3
  52. package/Components/River/ComponentsMap/ComponentsMap.tsx +0 -1
  53. package/Components/River/TV/index.tsx +6 -1
  54. package/Components/River/__tests__/__snapshots__/river.test.js.snap +20 -82
  55. package/Components/River/__tests__/river.test.js +75 -40
  56. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -4
  57. package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
  58. package/Components/RouteManager/__tests__/testId.test.js +8 -6
  59. package/Components/Screen/index.tsx +4 -4
  60. package/Components/ScreenResolver/__tests__/screenResolver.test.js +91 -70
  61. package/Components/Tabs/Tab.tsx +5 -3
  62. package/Components/TextInputTv/index.tsx +2 -1
  63. package/Components/TrackedView/index.tsx +1 -0
  64. package/Components/Transitioner/AnimationManager.js +15 -15
  65. package/Components/Transitioner/Scene.tsx +1 -1
  66. package/Components/Transitioner/Transitioner.tsx +3 -3
  67. package/Components/Transitioner/__tests__/Scene.test.js +25 -14
  68. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +12 -68
  69. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
  70. package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
  71. package/Components/VideoLive/PlayerLiveImageComponent.tsx +7 -3
  72. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +1 -0
  73. package/Components/VideoLive/animationUtils.ts +3 -3
  74. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +11 -11
  75. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +7 -7
  76. package/Components/VideoModal/PlayerDetails.tsx +9 -6
  77. package/Components/VideoModal/PlayerWrapper.tsx +2 -2
  78. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
  79. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
  80. package/Components/Viewport/__tests__/utils.test.js +5 -4
  81. package/Components/ZappUIComponent/Placeholder.tsx +3 -1
  82. package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
  83. package/Components/ZappUIComponent/index.tsx +3 -16
  84. package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
  85. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
  86. package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
  87. package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
  88. package/Contexts/HeaderOffsetContext/index.tsx +4 -6
  89. package/Contexts/ScreenContext/index.tsx +3 -10
  90. package/Contexts/ScreenLayoutContext/index.tsx +5 -3
  91. package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
  92. package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
  93. package/Decorators/Navigator/index.tsx +1 -1
  94. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +18 -24
  95. package/Decorators/RiverResolver/index.tsx +1 -1
  96. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
  97. package/Decorators/ZappPipesDataConnector/index.tsx +2 -29
  98. package/package.json +7 -11
  99. package/tsconfig.json +2 -3
  100. package/Components/Cell/CellWithFocusable.ios.tsx +0 -126
  101. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
  102. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
  103. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
  104. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
  105. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
  106. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
  107. package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react-native/no-unused-styles */
2
2
  import React from "react";
3
3
  import * as R from "ramda";
4
- import { View, Text, StyleSheet, TouchableWithoutFeedback } from "react-native";
4
+ import { StyleSheet, Text, TouchableWithoutFeedback, View } from "react-native";
5
5
  import { useConfiguration } from "@applicaster/zapp-react-native-utils/reactHooks/configuration";
6
6
  import {
7
- getStyleForPlatform,
8
7
  applyStringTransformation,
8
+ getStyleForPlatform,
9
9
  } from "@applicaster/zapp-react-native-utils/configurationUtils";
10
10
 
11
11
  type Props = {
@@ -148,7 +148,9 @@ const Tab = ({ title, selected, handleOnPress }: Props, ref: any) => {
148
148
  <Text numberOfLines={1} style={styles.label}>
149
149
  {tabTitle}
150
150
  </Text>
151
- {selected && <View testID="underline" style={styles.underline} />}
151
+ {selected ? (
152
+ <View testID="underline" style={styles.underline} />
153
+ ) : null}
152
154
  </View>
153
155
  </View>
154
156
  </TouchableWithoutFeedback>
@@ -174,7 +174,8 @@ function TextInputTV(props: Props, ref) {
174
174
 
175
175
  return isWebPlatform ? (
176
176
  <>
177
- {additional && additional()}
177
+ {additional ? additional() : null}
178
+ {/* eslint-disable-next-line react/no-unknown-property */}
178
179
  <input testID="TextInput-tv" ref={ref} {...inputProps} />
179
180
  </>
180
181
  ) : (
@@ -12,6 +12,7 @@ type TrackedViewProps = {
12
12
  onPositionUpdated: (props: { rect?: Record<string, number> }) => void;
13
13
  testId?: string | undefined;
14
14
  groupId?: string;
15
+ clipThreshold?: number;
15
16
  };
16
17
 
17
18
  export const TrackedView = memo(function TrackedView(props: TrackedViewProps) {
@@ -2,21 +2,21 @@ import { Animated } from "react-native";
2
2
 
3
3
  import { NAV_ACTION_PUSH, NAV_ACTION_BACK } from "./Transitioner";
4
4
 
5
- type TransitionConfig = {
6
- duration: number;
7
- easing: any;
8
- from: {
9
- style: any;
10
- };
11
- to: {
12
- style: any;
13
- };
14
- };
5
+ // type TransitionConfig = {
6
+ // duration: number;
7
+ // easing: any;
8
+ // from: {
9
+ // style: any;
10
+ // };
11
+ // to: {
12
+ // style: any;
13
+ // };
14
+ // };
15
15
 
16
- type Props = {
17
- transitionConfig: TransitionConfig;
18
- contentStyle: { [string]: any };
19
- };
16
+ // type Props = {
17
+ // transitionConfig: TransitionConfig;
18
+ // contentStyle: { [string]: any };
19
+ // };
20
20
 
21
21
  /**
22
22
  * Manages animation for the Transitioner,
@@ -25,7 +25,7 @@ type Props = {
25
25
  * which must have a proper structure, see types above ^.
26
26
  */
27
27
  export class AnimationManager {
28
- constructor(props: Props) {
28
+ constructor(props) {
29
29
  this.animatedValue = new Animated.Value(0.0);
30
30
 
31
31
  this.config = props.transitionConfig(
@@ -105,7 +105,7 @@ function SceneComponent({
105
105
  style={[style, contentStyle, dimensions]}
106
106
  >
107
107
  {children}
108
- {isAnimating && <Animated.View style={overlayStyle} />}
108
+ {isAnimating ? <Animated.View style={overlayStyle} /> : null}
109
109
  </Animated.View>
110
110
  );
111
111
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { View } from "react-native";
3
- import { update, compose, tail, append, take, identity, isNil } from "ramda";
3
+ import { append, compose, identity, isNil, tail, take, update } from "ramda";
4
4
 
5
5
  import { AnimationManager } from "./AnimationManager";
6
6
  import { Scene } from "./Scene";
@@ -289,7 +289,7 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
289
289
 
290
290
  return (
291
291
  <View style={styles.container}>
292
- {scenes[to.index] && (
292
+ {scenes[to.index] ? (
293
293
  <Scene
294
294
  {...{ style: to?.style || {} }}
295
295
  pathname={pathname}
@@ -301,7 +301,7 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
301
301
  >
302
302
  {scenes[to.index].children}
303
303
  </Scene>
304
- )}
304
+ ) : null}
305
305
  </View>
306
306
  );
307
307
  }
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { shallowToJson } from "enzyme-to-json";
2
+ import { render } from "@testing-library/react-native";
3
+
4
+ import { Scene } from "../Scene";
4
5
 
5
6
  const overlayStyle = { opacity: 1 };
6
7
  const contentStyle = { paddingBottom: 49 };
@@ -23,28 +24,38 @@ jest.mock(
23
24
  })
24
25
  );
25
26
 
26
- const { Scene } = require("../Scene");
27
+ jest.mock("../../../Contexts/PathnameContext", () => ({
28
+ PathnameContext: jest.requireActual("react").createContext({ pathname: "" }),
29
+ }));
27
30
 
28
- const wrapper = shallow(
29
- <Scene
30
- style={style}
31
- overlayStyle={overlayStyle}
32
- contentStyle={contentStyle}
33
- />
34
- );
31
+ jest.mock("../../../Contexts/ScreenDataContext", () => ({
32
+ ScreenDataContext: jest.requireActual("react").createContext({}),
33
+ }));
34
+
35
+ jest.mock("../../../Contexts/ScreenContext", () => ({
36
+ ScreenContextProvider: jest.requireActual("react-native").View,
37
+ }));
35
38
 
36
39
  describe("<Scene />", () => {
40
+ const wrapper = render(
41
+ <Scene
42
+ style={style}
43
+ overlayStyle={overlayStyle}
44
+ contentStyle={contentStyle}
45
+ />
46
+ );
47
+
37
48
  it("renders correctly", () => {
38
- expect(shallowToJson(wrapper)).toMatchSnapshot();
49
+ expect(wrapper.toJSON()).toMatchSnapshot();
39
50
  });
40
51
 
41
52
  // skipped - this isn't a very useful test, and it doesn't work as it used to on the new version of RN
42
53
  it.skip("renders children surrounded by AnimatedComponent", () => {
43
- expect(shallowToJson(wrapper).type).toEqual("AnimatedComponent");
54
+ expect(wrapper.toJSON()).toEqual("AnimatedComponent");
44
55
  });
45
56
 
46
57
  it("renders the overlay while animating", () => {
47
- const wrapperWithOverlay = shallow(
58
+ const wrapperWithOverlay = render(
48
59
  <Scene
49
60
  style={style}
50
61
  overlayStyle={overlayStyle}
@@ -53,6 +64,6 @@ describe("<Scene />", () => {
53
64
  />
54
65
  );
55
66
 
56
- expect(shallowToJson(wrapperWithOverlay)).toMatchSnapshot();
67
+ expect(wrapperWithOverlay.toJSON).toMatchSnapshot();
57
68
  });
58
69
  });
@@ -1,79 +1,23 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<Scene /> renders correctly 1`] = `
4
- <CurrentScreenContextProvider
5
- contentStyle={
6
- {
7
- "paddingBottom": 49,
8
- }
9
- }
10
- overlayStyle={
11
- {
12
- "opacity": 1,
13
- }
14
- }
15
- style={
16
- {
17
- "flex": 1,
18
- }
19
- }
20
- >
21
- <SceneComponent
22
- contentStyle={
23
- {
24
- "paddingBottom": 49,
25
- }
26
- }
27
- overlayStyle={
28
- {
29
- "opacity": 1,
30
- }
31
- }
4
+ <View>
5
+ <View
6
+ collapsable={false}
7
+ pointerEvents="auto"
32
8
  style={
33
9
  {
34
10
  "flex": 1,
35
- }
36
- }
37
- />
38
- </CurrentScreenContextProvider>
39
- `;
40
-
41
- exports[`<Scene /> renders the overlay while animating 1`] = `
42
- <CurrentScreenContextProvider
43
- animating={true}
44
- contentStyle={
45
- {
46
- "paddingBottom": 49,
47
- }
48
- }
49
- overlayStyle={
50
- {
51
- "opacity": 1,
52
- }
53
- }
54
- style={
55
- {
56
- "flex": 1,
57
- }
58
- }
59
- >
60
- <SceneComponent
61
- animating={true}
62
- contentStyle={
63
- {
11
+ "fontScale": 2,
12
+ "height": 1334,
64
13
  "paddingBottom": 49,
65
- }
66
- }
67
- overlayStyle={
68
- {
69
- "opacity": 1,
70
- }
71
- }
72
- style={
73
- {
74
- "flex": 1,
14
+ "scale": 2,
15
+ "statusBarHeight": null,
16
+ "width": 750,
75
17
  }
76
18
  }
77
19
  />
78
- </CurrentScreenContextProvider>
20
+ </View>
79
21
  `;
22
+
23
+ exports[`<Scene /> renders the overlay while animating 1`] = `[Function]`;
@@ -9,7 +9,7 @@ exports[`<TransitionerComponent /> renders correctly 1`] = `
9
9
  }
10
10
  }
11
11
  >
12
- <SceneComponent
12
+ <View
13
13
  isActive={true}
14
14
  screenUniqueId="mocked-uuid"
15
15
  style={{}}
@@ -23,6 +23,6 @@ exports[`<TransitionerComponent /> renders correctly 1`] = `
23
23
  children
24
24
  </Text>
25
25
  </View>
26
- </SceneComponent>
26
+ </View>
27
27
  </View>
28
28
  `;
@@ -1,9 +1,18 @@
1
1
  import React from "react";
2
2
  import { Text, View } from "react-native";
3
- import { shallow } from "enzyme";
4
- import { shallowToJson } from "enzyme-to-json";
5
3
 
6
4
  import { TransitionerComponent } from "../Transitioner";
5
+ import { render } from "@testing-library/react-native";
6
+
7
+ jest.mock("../Scene", () => {
8
+ const View = jest.requireActual("react-native").View;
9
+
10
+ return {
11
+ Scene(props) {
12
+ return <View {...props} />;
13
+ },
14
+ };
15
+ });
7
16
 
8
17
  const children = (
9
18
  <View foo="bar">
@@ -33,12 +42,12 @@ jest.mock("uuid");
33
42
 
34
43
  describe("<TransitionerComponent />", () => {
35
44
  it("renders correctly", () => {
36
- const wrapper = shallow(
45
+ const wrapper = render(
37
46
  <TransitionerComponent {...transitionerComponentProps}>
38
47
  {children}
39
48
  </TransitionerComponent>
40
49
  );
41
50
 
42
- expect(shallowToJson(wrapper)).toMatchSnapshot();
51
+ expect(wrapper.toJSON()).toMatchSnapshot();
43
52
  });
44
53
  });
@@ -1,6 +1,7 @@
1
1
  // /// <reference types="@applicaster/applicaster-types" />
2
2
  //
3
3
  import * as React from "react";
4
+ import { useEffect } from "react";
4
5
 
5
6
  import { AppState, AppStateStatus, View } from "react-native";
6
7
  import { TrackedView } from "../TrackedView";
@@ -25,13 +26,15 @@ import { PlayerRole } from "@applicaster/zapp-react-native-utils/appUtils/player
25
26
  import { getAutoplaySettings } from "./utils";
26
27
  import { isString } from "@applicaster/zapp-react-native-utils/stringUtils";
27
28
  import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
28
- import { useEffect } from "react";
29
29
 
30
30
  const { log_error, log_debug } = loggerLiveImageComponent;
31
31
 
32
32
  const isMeasurement = (item: ZappEntry) =>
33
33
  isString(item.id) && item.id.startsWith("pre-measurement-");
34
34
 
35
+ // Pixels by which the view can slightly extend outside the viewport and still be considered fully visible.
36
+ const CLIP_THRESHOLD = 10;
37
+
35
38
  type Props = {
36
39
  item: ZappEntry;
37
40
  style: Record<string, any>;
@@ -328,9 +331,10 @@ const PlayerLiveImageComponent = (props: Props) => {
328
331
  <TrackedView
329
332
  testId={`tracked-view-${playerId}-${item.title}`}
330
333
  onPositionUpdated={onPositionUpdated}
334
+ clipThreshold={CLIP_THRESHOLD}
331
335
  >
332
336
  <View ref={trackViewRef}>
333
- {isVideoMode && (
337
+ {isVideoMode ? (
334
338
  <Player
335
339
  autoplay={false}
336
340
  ref={_assignRoot}
@@ -342,7 +346,7 @@ const PlayerLiveImageComponent = (props: Props) => {
342
346
  resizeMode={"cover"}
343
347
  {...platformSpecificProps}
344
348
  />
345
- )}
349
+ ) : null}
346
350
  {
347
351
  <AnimatedInOut
348
352
  visible={isBackgroundImageVisible}
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports[`PlayerLiveImageComponent should render correctly with default props 1`] = `
4
4
  <TrackedView
5
+ clipThreshold={10}
5
6
  onPositionUpdated={[Function]}
6
7
  testId="tracked-view-player1-Test"
7
8
  >
@@ -1,8 +1,8 @@
1
1
  import { Animated, Easing, EasingFunction, StyleProp } from "react-native";
2
2
 
3
3
  type AnimatedInterpolatedStyle =
4
- | Animated.AnimatedInterpolation
5
- | [{ [Key: string]: Animated.AnimatedInterpolation }];
4
+ | Animated.AnimatedInterpolation<number>
5
+ | [{ [Key: string]: Animated.AnimatedInterpolation<number> }];
6
6
 
7
7
  type AnimationConfig = {
8
8
  duration: number;
@@ -31,7 +31,7 @@ const interpolate = (
31
31
  animatedValue: Animated.Value,
32
32
  from: number = 0,
33
33
  to: number = 1
34
- ): Animated.AnimatedInterpolation =>
34
+ ): Animated.AnimatedInterpolation<number> =>
35
35
  animatedValue.interpolate({
36
36
  inputRange: [0, 1],
37
37
  outputRange: [from, to],
@@ -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) => {
@@ -71,8 +71,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
71
71
  useNavigation();
72
72
 
73
73
  const { mode: videoModalMode, item: videoModalItem } = videoModalState;
74
- const isMaximazedModal = videoModalMode === "MAXIMIZED";
75
- const isMinimizedModal = videoModalMode === "MINIMIZED";
74
+ const isMaximizedModal: boolean = videoModalMode === "MAXIMIZED";
75
+ const isMinimizedModal: boolean = videoModalMode === "MINIMIZED";
76
76
  const previousItemId = usePrevious(videoModalItem?.id);
77
77
 
78
78
  const isNotMinimizeMaximazeAnimation =
@@ -84,7 +84,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
84
84
  !isLanguageOverlayVisible &&
85
85
  isNotMinimizeMaximazeAnimation &&
86
86
  !isSeekBarTouch &&
87
- (isMaximazedModal || isMinimizedModal);
87
+ (isMaximizedModal || isMinimizedModal);
88
88
 
89
89
  const isAudioItem = React.useMemo(
90
90
  () =>
@@ -346,6 +346,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
346
346
  []
347
347
  );
348
348
 
349
+ const scrollEnabled = isMaximizedModal && isNotMinimizeMaximazeAnimation;
350
+
349
351
  return (
350
352
  <Wrapper style={generalStyles.container}>
351
353
  <TapGestureHandler
@@ -359,7 +361,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
359
361
  enabled={isEnablePanGesture}
360
362
  ref={panHandlerRef}
361
363
  simultaneousHandlers={[scrollRef, tapHandlerRef]}
362
- shouldCancelWhenOutside={isMaximazedModal}
364
+ shouldCancelWhenOutside={isMaximizedModal}
363
365
  onGestureEvent={onGestureEvent}
364
366
  onHandlerStateChange={onHandlerStateChange}
365
367
  activeOffsetY={[-5, 5]}
@@ -371,9 +373,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
371
373
  simultaneousHandlers={panHandlerRef}
372
374
  >
373
375
  <Animated.ScrollView
374
- scrollEnabled={
375
- isMaximazedModal && isNotMinimizeMaximazeAnimation
376
- }
376
+ scrollEnabled={scrollEnabled}
377
377
  bounces={false}
378
378
  onScrollBeginDrag={onRegisterLastScroll}
379
379
  onScroll={onScroll}
@@ -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 = {
@@ -405,7 +405,7 @@ export const AnimationView = ({
405
405
 
406
406
  return (
407
407
  <Animated.View
408
- onLayout={additionalData.useLayoutMeasure && measureView}
408
+ onLayout={additionalData.useLayoutMeasure ? measureView : undefined}
409
409
  ref={animationComponentRef}
410
410
  style={[
411
411
  ...preparedStyles,
@@ -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
  };
@@ -227,7 +227,7 @@ const PlayerWrapperComponent = (props: Props) => {
227
227
  </View>
228
228
 
229
229
  <AnimatedScrollModal>
230
- {isShowPlayerDetails && (
230
+ {isShowPlayerDetails ? (
231
231
  <AnimationComponent
232
232
  animationType={ComponentAnimationType.componentFade}
233
233
  style={defaultStyles.flex}
@@ -240,7 +240,7 @@ const PlayerWrapperComponent = (props: Props) => {
240
240
  isTablet={isTablet}
241
241
  />
242
242
  </AnimationComponent>
243
- )}
243
+ ) : null}
244
244
  </AnimatedScrollModal>
245
245
  </AnimationComponent>
246
246
  </WrapperView>
@@ -33,45 +33,33 @@ exports[`<ViewportAware /> invokes the onViewportLeave function when leaving the
33
33
  `;
34
34
 
35
35
  exports[`<ViewportAware /> passes the correct view port flag 1`] = `
36
- <ForwardRef(ViewportAwareComponent)
37
- onViewportEnter={[Function]}
38
- onViewportLeave={[Function]}
39
- preTriggerRatio={0.1}
36
+ <RCTScrollView
37
+ onContentSizeChange={[Function]}
38
+ onLayout={[Function]}
39
+ onScroll={[Function]}
40
40
  >
41
- <ScrollView
42
- testID="test-component-false"
43
- />
44
- </ForwardRef(ViewportAwareComponent)>
41
+ <View>
42
+ <RCTScrollView
43
+ testID="test-component-false"
44
+ >
45
+ <View />
46
+ </RCTScrollView>
47
+ </View>
48
+ </RCTScrollView>
45
49
  `;
46
50
 
47
51
  exports[`<ViewportAware /> renders its children correctly 1`] = `
48
- <ContextProvider
49
- value={
50
- ViewportEvents {
51
- "firesLastEventOnAdd": true,
52
- "lastEvent": null,
53
- "listeners": [],
54
- "notify": [Function],
55
- }
56
- }
52
+ <RCTScrollView
53
+ onContentSizeChange={[Function]}
54
+ onLayout={[Function]}
55
+ onScroll={[Function]}
57
56
  >
58
- <ViewportTracker
59
- viewportEventsManager={
60
- ViewportEvents {
61
- "firesLastEventOnAdd": true,
62
- "lastEvent": null,
63
- "listeners": [],
64
- "notify": [Function],
65
- }
66
- }
67
- >
68
- <ScrollView>
69
- <TestComponent
70
- onViewportEnter={[MockFunction]}
71
- onViewportLeave={[MockFunction]}
72
- preTriggerRatio={0.1}
73
- />
74
- </ScrollView>
75
- </ViewportTracker>
76
- </ContextProvider>
57
+ <View>
58
+ <RCTScrollView
59
+ testID="test-component-false"
60
+ >
61
+ <View />
62
+ </RCTScrollView>
63
+ </View>
64
+ </RCTScrollView>
77
65
  `;