@applicaster/zapp-react-native-ui-components 13.0.0-alpha.7330390362 → 13.0.0-alpha.7807341867

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 (87) hide show
  1. package/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
  2. package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
  3. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +54 -111
  4. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +36 -20
  5. package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
  6. package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
  7. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
  8. package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
  9. package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
  10. package/Components/AudioPlayer/__tests__/title.test.js +3 -5
  11. package/Components/BaseFocusable/index.tsx +1 -2
  12. package/Components/Cell/Cell.tsx +1 -0
  13. package/Components/Cell/CellWithFocusable.tsx +1 -0
  14. package/Components/Cell/TvOSCellComponent.tsx +20 -22
  15. package/Components/Cell/index.js +3 -1
  16. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +46 -48
  17. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
  18. package/Components/ComponentResolver/__tests__/componentResolver.test.js +16 -22
  19. package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
  20. package/Components/ErrorScreen/index.tsx +6 -6
  21. package/Components/Focusable/Focusable.tsx +1 -0
  22. package/Components/Focusable/FocusableTvOS.tsx +5 -1
  23. package/Components/Focusable/index.android.tsx +10 -3
  24. package/Components/FocusableList/index.tsx +26 -9
  25. package/Components/FocusableScrollView/index.tsx +43 -13
  26. package/Components/Layout/TV/NavBarContainer.tsx +19 -23
  27. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -2
  28. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +3 -2
  29. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
  30. package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +0 -6
  31. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +0 -6
  32. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
  33. package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
  34. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +4 -12
  35. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +0 -229
  36. package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
  37. package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
  38. package/Components/ModalComponent/Button/index.tsx +6 -6
  39. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
  40. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
  41. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
  42. package/Components/PlayerContainer/PlayerContainer.tsx +8 -8
  43. package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
  44. package/Components/PlayerImageBackground/index.tsx +23 -3
  45. package/Components/River/TV/index.tsx +6 -1
  46. package/Components/River/__tests__/__snapshots__/river.test.js.snap +20 -82
  47. package/Components/River/__tests__/river.test.js +75 -40
  48. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -4
  49. package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
  50. package/Components/RouteManager/__tests__/testId.test.js +8 -6
  51. package/Components/Screen/index.tsx +4 -4
  52. package/Components/ScreenResolver/__tests__/screenResolver.test.js +91 -70
  53. package/Components/Tabs/Tab.tsx +5 -3
  54. package/Components/TextInputTv/index.tsx +2 -1
  55. package/Components/Transitioner/Scene.tsx +1 -1
  56. package/Components/Transitioner/Transitioner.tsx +3 -3
  57. package/Components/Transitioner/__tests__/Scene.test.js +25 -14
  58. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +12 -68
  59. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
  60. package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
  61. package/Components/VideoLive/PlayerLiveImageComponent.tsx +3 -3
  62. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +11 -11
  63. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +7 -7
  64. package/Components/VideoModal/PlayerDetails.tsx +9 -6
  65. package/Components/VideoModal/PlayerWrapper.tsx +2 -2
  66. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
  67. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
  68. package/Components/Viewport/__tests__/utils.test.js +5 -4
  69. package/Components/ZappUIComponent/Placeholder.tsx +3 -1
  70. package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
  71. package/Components/ZappUIComponent/index.tsx +3 -16
  72. package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
  73. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
  74. package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
  75. package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
  76. package/Decorators/Navigator/index.tsx +1 -1
  77. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +18 -24
  78. package/Decorators/RiverResolver/index.tsx +1 -1
  79. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
  80. package/package.json +7 -7
  81. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
  82. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
  83. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
  84. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
  85. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
  86. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
  87. package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { View, Text } from "react-native";
3
- import { shallow } from "enzyme";
4
- import { shallowToJson } from "enzyme-to-json";
3
+ import { render } from "@testing-library/react-native";
4
+ import { AppContainer } from "../index";
5
5
 
6
6
  const styles = {
7
7
  iphone: {
@@ -15,11 +15,9 @@ jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
15
15
  })),
16
16
  }));
17
17
 
18
- const { AppContainer } = require("../index");
19
-
20
18
  describe("<AppContainer />", () => {
21
19
  it("renders correctly", () => {
22
- const wrapper = shallow(
20
+ const { toJSON } = render(
23
21
  <AppContainer styles={styles}>
24
22
  <View>
25
23
  <Text>I'm an app</Text>
@@ -27,6 +25,6 @@ describe("<AppContainer />", () => {
27
25
  </AppContainer>
28
26
  );
29
27
 
30
- expect(shallowToJson(wrapper)).toMatchSnapshot();
28
+ expect(toJSON()).toMatchSnapshot();
31
29
  });
32
30
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { Runtime } from "../Runtime";
6
5
 
@@ -18,14 +17,12 @@ const RuntimeProps = (isRTL) => ({
18
17
 
19
18
  describe("<Runtime />", () => {
20
19
  it("RTL renders correctly", () => {
21
- const wrapper = shallow(<Runtime {...RuntimeProps(true)} />);
22
-
23
- expect(shallowToJson(wrapper)).toMatchSnapshot();
20
+ const { toJSON } = render(<Runtime {...RuntimeProps(true)} />);
21
+ expect(toJSON()).toMatchSnapshot();
24
22
  });
25
23
 
26
24
  it("LTR renders correctly", () => {
27
- const wrapper = shallow(<Runtime {...RuntimeProps(false)} />);
28
-
29
- expect(shallowToJson(wrapper)).toMatchSnapshot();
25
+ const { toJSON } = render(<Runtime {...RuntimeProps(false)} />);
26
+ expect(toJSON()).toMatchSnapshot();
30
27
  });
31
28
  });
@@ -1,123 +1,66 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<AudioPlayer /> renders correctly 1`] = `
4
- <AudioPlayerLayout
5
- config={
4
+ <View
5
+ pointerEvents="none"
6
+ style={
6
7
  {
7
- "artworkAspectRatio": "1:1",
8
- "audioPlayerBackgroundImageQuery": "",
9
- "backgroundColor": "black",
10
- "backgroundImage": "https://example.com",
11
- "channelIcon": "https://example.com",
12
- "isRTL": true,
13
- "magicBackground": false,
14
- "runTimeFontFamily": undefined,
15
- "runTimeFontSize": undefined,
16
- "summaryColor": "white",
17
- "summaryFontFamily": undefined,
18
- "summaryFontSize": undefined,
19
- "titleColor": "white",
20
- "titleFontFamily": undefined,
21
- "titleFontSize": undefined,
8
+ "backgroundColor": "transparent",
9
+ "overflow": "hidden",
22
10
  }
23
11
  }
24
- style={{}}
25
12
  >
26
- <Channel
27
- config={
13
+ <View
14
+ collapsable={false}
15
+ style={
28
16
  {
29
- "artworkAspectRatio": "1:1",
30
- "audioPlayerBackgroundImageQuery": "",
31
- "backgroundColor": "black",
32
- "backgroundImage": "https://example.com",
33
- "channelIcon": "https://example.com",
34
- "isRTL": true,
35
- "magicBackground": false,
36
- "runTimeFontFamily": undefined,
37
- "runTimeFontSize": undefined,
38
- "summaryColor": "white",
39
- "summaryFontFamily": undefined,
40
- "summaryFontSize": undefined,
41
- "titleColor": "white",
42
- "titleFontFamily": undefined,
43
- "titleFontSize": undefined,
17
+ "backgroundColor": "transparent",
18
+ "opacity": 0,
19
+ "overflow": "hidden",
44
20
  }
45
21
  }
46
- srcImage="https://example.com"
47
- />
48
- <Title
49
- config={
50
- {
51
- "artworkAspectRatio": "1:1",
52
- "audioPlayerBackgroundImageQuery": "",
53
- "backgroundColor": "black",
54
- "backgroundImage": "https://example.com",
55
- "channelIcon": "https://example.com",
56
- "isRTL": true,
57
- "magicBackground": false,
58
- "runTimeFontFamily": undefined,
59
- "runTimeFontSize": undefined,
60
- "summaryColor": "white",
61
- "summaryFontFamily": undefined,
62
- "summaryFontSize": undefined,
63
- "titleColor": "white",
64
- "titleFontFamily": undefined,
65
- "titleFontSize": undefined,
66
- }
67
- }
68
- title="tittle"
69
- />
70
- <Summary
71
- config={
72
- {
73
- "artworkAspectRatio": "1:1",
74
- "audioPlayerBackgroundImageQuery": "",
75
- "backgroundColor": "black",
76
- "backgroundImage": "https://example.com",
77
- "channelIcon": "https://example.com",
78
- "isRTL": true,
79
- "magicBackground": false,
80
- "runTimeFontFamily": undefined,
81
- "runTimeFontSize": undefined,
82
- "summaryColor": "white",
83
- "summaryFontFamily": undefined,
84
- "summaryFontSize": undefined,
85
- "titleColor": "white",
86
- "titleFontFamily": undefined,
87
- "titleFontSize": undefined,
22
+ >
23
+ <View
24
+ accessibilityIgnoresInvertColors={true}
25
+ style={
26
+ {
27
+ "flex": 1,
28
+ }
88
29
  }
89
- }
90
- summary="Summary"
91
- />
92
- <Runtime
93
- audio_player_artwork_aspect_ratio="1:1"
94
- audio_player_background_color="black"
95
- audio_player_background_image="https://example.com"
96
- audio_player_channel_icon="https://example.com"
97
- audio_player_rtl={true}
98
- audio_player_summary_color="white"
99
- audio_player_title_color="white"
100
- config={
101
- {
102
- "artworkAspectRatio": "1:1",
103
- "audioPlayerBackgroundImageQuery": "",
104
- "backgroundColor": "black",
105
- "backgroundImage": "https://example.com",
106
- "channelIcon": "https://example.com",
107
- "isRTL": true,
108
- "magicBackground": false,
109
- "runTimeFontFamily": undefined,
110
- "runTimeFontSize": undefined,
111
- "summaryColor": "white",
112
- "summaryFontFamily": undefined,
113
- "summaryFontSize": undefined,
114
- "titleColor": "white",
115
- "titleFontFamily": undefined,
116
- "titleFontSize": undefined,
117
- }
118
- }
119
- end_time="11:11"
120
- start_time="10:10"
121
- />
122
- </AudioPlayerLayout>
30
+ >
31
+ <Image
32
+ resizeMode="cover"
33
+ source={
34
+ {
35
+ "uri": "https://example.com",
36
+ }
37
+ }
38
+ style={
39
+ [
40
+ {
41
+ "bottom": 0,
42
+ "left": 0,
43
+ "position": "absolute",
44
+ "right": 0,
45
+ "top": 0,
46
+ },
47
+ {
48
+ "height": undefined,
49
+ "width": undefined,
50
+ },
51
+ undefined,
52
+ ]
53
+ }
54
+ />
55
+ <View
56
+ style={
57
+ {
58
+ "backgroundColor": "transparent",
59
+ "overflow": "hidden",
60
+ }
61
+ }
62
+ />
63
+ </View>
64
+ </View>
65
+ </View>
123
66
  `;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<AudioPlayerLayout /> renders correctly 1`] = `
3
+ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
4
4
  <View
5
5
  pointerEvents="none"
6
6
  style={
@@ -10,32 +10,48 @@ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
10
10
  }
11
11
  }
12
12
  >
13
- <ForwardRef(AnimatedComponentWrapper)
13
+ <View
14
+ collapsable={false}
14
15
  style={
15
- [
16
- {
17
- "backgroundColor": "transparent",
18
- "overflow": "hidden",
19
- },
20
- {
21
- "opacity": 0,
22
- },
23
- ]
16
+ {
17
+ "backgroundColor": "transparent",
18
+ "opacity": 0,
19
+ "overflow": "hidden",
20
+ }
24
21
  }
25
22
  >
26
- <ImageBackground
27
- resizeMode="cover"
28
- source={
29
- {
30
- "uri": "https://example.com",
31
- }
32
- }
23
+ <View
24
+ accessibilityIgnoresInvertColors={true}
33
25
  style={
34
26
  {
35
27
  "flex": 1,
36
28
  }
37
29
  }
38
30
  >
31
+ <Image
32
+ resizeMode="cover"
33
+ source={
34
+ {
35
+ "uri": "https://example.com",
36
+ }
37
+ }
38
+ style={
39
+ [
40
+ {
41
+ "bottom": 0,
42
+ "left": 0,
43
+ "position": "absolute",
44
+ "right": 0,
45
+ "top": 0,
46
+ },
47
+ {
48
+ "height": undefined,
49
+ "width": undefined,
50
+ },
51
+ undefined,
52
+ ]
53
+ }
54
+ />
39
55
  <View
40
56
  style={
41
57
  {
@@ -44,7 +60,7 @@ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
44
60
  }
45
61
  }
46
62
  />
47
- </ImageBackground>
48
- </ForwardRef(AnimatedComponentWrapper)>
63
+ </View>
64
+ </View>
49
65
  </View>
50
66
  `;
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { Artwork } from "../Artwork";
6
5
 
@@ -16,9 +15,8 @@ const artWorkProps = {
16
15
  };
17
16
 
18
17
  describe("<Artwork />", () => {
19
- const wrapper = shallow(<Artwork {...artWorkProps} />);
20
-
21
18
  it("renders correctly", () => {
22
- expect(shallowToJson(wrapper)).toMatchSnapshot();
19
+ const { toJSON } = render(<Artwork {...artWorkProps} />);
20
+ expect(toJSON()).toMatchSnapshot();
23
21
  });
24
22
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { AudioPlayer } from "../AudioPlayer";
6
5
 
@@ -47,9 +46,8 @@ const audioPlayerProps = {
47
46
  };
48
47
 
49
48
  describe("<AudioPlayer />", () => {
50
- const wrapper = shallow(<AudioPlayer {...audioPlayerProps} />);
51
-
52
49
  it("renders correctly", () => {
53
- expect(shallowToJson(wrapper)).toMatchSnapshot();
50
+ const { toJSON } = render(<AudioPlayer {...audioPlayerProps} />);
51
+ expect(toJSON()).toMatchSnapshot();
54
52
  });
55
53
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { AudioPlayerLayout } from "../AudioPlayerLayout";
6
5
 
@@ -16,12 +15,12 @@ const audioPlayerLayoutProps = {
16
15
  children: [],
17
16
  };
18
17
 
19
- jest.useFakeTimers();
20
-
21
- describe("<AudioPlayerLayout />", () => {
22
- const wrapper = shallow(<AudioPlayerLayout {...audioPlayerLayoutProps} />);
23
-
18
+ describe("<AudioPlayerLayout />", () => {
24
19
  it("renders correctly", () => {
25
- expect(shallowToJson(wrapper)).toMatchSnapshot();
20
+ const { toJSON } = render(
21
+ <AudioPlayerLayout {...audioPlayerLayoutProps} />
22
+ );
23
+
24
+ expect(toJSON()).toMatchSnapshot();
26
25
  });
27
26
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { Channel } from "../Channel";
6
5
 
@@ -16,9 +15,8 @@ const channelProps = {
16
15
  };
17
16
 
18
17
  describe("<Channel />", () => {
19
- const wrapper = shallow(<Channel {...channelProps} />);
20
-
21
18
  it("renders correctly", () => {
22
- expect(shallowToJson(wrapper)).toMatchSnapshot();
19
+ const { toJSON } = render(<Channel {...channelProps} />);
20
+ expect(toJSON()).toMatchSnapshot();
23
21
  });
24
22
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { Summary } from "../Summary";
6
5
 
@@ -16,9 +15,8 @@ const summaryProps = {
16
15
  };
17
16
 
18
17
  describe("<Summary />", () => {
19
- const wrapper = shallow(<Summary {...summaryProps} />);
20
-
21
18
  it("renders correctly", () => {
22
- expect(shallowToJson(wrapper)).toMatchSnapshot();
19
+ const { toJSON } = render(<Summary {...summaryProps} />);
20
+ expect(toJSON()).toMatchSnapshot();
23
21
  });
24
22
  });
@@ -1,6 +1,5 @@
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";
4
3
 
5
4
  import { Title } from "../Title";
6
5
 
@@ -16,9 +15,8 @@ const titleProps = {
16
15
  };
17
16
 
18
17
  describe("<Title />", () => {
19
- const wrapper = shallow(<Title {...titleProps} />);
20
-
21
18
  it("renders correctly", () => {
22
- expect(shallowToJson(wrapper)).toMatchSnapshot();
19
+ const { toJSON } = render(<Title {...titleProps} />);
20
+ expect(toJSON()).toMatchSnapshot();
23
21
  });
24
22
  });
@@ -6,7 +6,6 @@ import {
6
6
  BoundingRect,
7
7
  } from "./BaseFocusable.interface";
8
8
 
9
- import { createReactRef } from "@applicaster/zapp-react-native-utils/reactUtils";
10
9
  import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
11
10
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
12
11
 
@@ -45,7 +44,7 @@ export class BaseFocusable<
45
44
  focused: initialFocus || false,
46
45
  };
47
46
 
48
- this.ref = createReactRef();
47
+ this.ref = React.createRef();
49
48
  }
50
49
 
51
50
  componentDidMount() {
@@ -61,6 +61,7 @@ type Props = {
61
61
  skipFocusManagerRegistration?: boolean;
62
62
  shouldUpdate: boolean;
63
63
  behavior: Behavior;
64
+ componentsMapOffset: number;
64
65
  };
65
66
 
66
67
  type State = {
@@ -86,6 +86,7 @@ export function CellWithFocusable(props: Props) {
86
86
  shouldUsePreferredFocus
87
87
  onFocus={onGroupFocus}
88
88
  onBlur={onGroupBlur}
89
+ skipFocusManagerRegistration={skipFocusManagerRegistration}
89
90
  >
90
91
  <CellRenderer
91
92
  testID={"cell-with-focusable-cell-renderer"}
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import * as R from "ramda";
3
3
  import { View, StyleSheet } from "react-native";
4
4
 
5
- import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
5
+ import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/FocusableTvOS";
6
6
  import { FocusableCell } from "@applicaster/zapp-react-native-ui-components/Components/FocusableCell";
7
7
  import { getItemType } from "@applicaster/zapp-react-native-utils/navigationUtils";
8
8
  import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypes";
@@ -65,6 +65,7 @@ type Props = {
65
65
  isFocusable: boolean;
66
66
  shouldUpdate: boolean;
67
67
  behavior: Behavior;
68
+ componentsMapOffset: number;
68
69
  };
69
70
 
70
71
  type State = {
@@ -179,6 +180,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
179
180
  groupId,
180
181
  component,
181
182
  index,
183
+ componentsMapOffset,
182
184
  } = this.props;
183
185
 
184
186
  this.setScreenLayout(componentAnchorPointY, screenLayout);
@@ -193,13 +195,11 @@ export class TvOSCellComponent extends React.Component<Props, State> {
193
195
  const extraAnchorPointYOffset =
194
196
  screenLayout?.extraAnchorPointYOffset || 0;
195
197
 
196
- const marginTop = screenLayout?.screenMarginTop || 0;
197
-
198
198
  const totalOffset =
199
199
  headerOffset +
200
- (componentAnchorPointY || 0) +
201
- extraAnchorPointYOffset -
202
- marginTop;
200
+ (componentAnchorPointY || 0) +
201
+ extraAnchorPointYOffset -
202
+ componentsMapOffset || 0;
203
203
 
204
204
  mainOffsetUpdater?.(
205
205
  { tag: this.target },
@@ -247,7 +247,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
247
247
 
248
248
  const focusableId = R.join("-", [component?.id, id, index]);
249
249
 
250
- const handleFocus = (arg1: any, index: number) => {
250
+ const handleFocus = (arg1: any, index?: number) => {
251
251
  const focusFn = onFocus || noop;
252
252
  focusFn(arg1, index);
253
253
 
@@ -280,7 +280,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
280
280
  <View onLayout={this.onLayout} style={styles.container}>
281
281
  <Focusable
282
282
  id={focusableId}
283
- groupId={groupId || component?.id}
283
+ groupId={String(groupId || component?.id)}
284
284
  onFocus={handleFocus}
285
285
  onBlur={onBlur || this.onBlur}
286
286
  isParallaxDisabled={this.layout?.width > 1740}
@@ -292,20 +292,18 @@ export class TvOSCellComponent extends React.Component<Props, State> {
292
292
  style={baseCellStyles}
293
293
  isFocusable={isFocusable}
294
294
  >
295
- {(focused) => {
296
- return (
297
- <FocusableCell
298
- {...{
299
- index,
300
- CellRenderer,
301
- item,
302
- focused: this.props.focused || selectedCell || focused,
303
- scrollTo: this.scrollTo,
304
- behavior,
305
- }}
306
- />
307
- );
308
- }}
295
+ {(focused) => (
296
+ <FocusableCell
297
+ {...{
298
+ index,
299
+ CellRenderer,
300
+ item,
301
+ focused: !!(this.props.focused || selectedCell || focused),
302
+ scrollTo: this.scrollTo,
303
+ behavior,
304
+ }}
305
+ />
306
+ )}
309
307
  </Focusable>
310
308
  </View>
311
309
  );
@@ -11,6 +11,7 @@ import { ScreenScrollingContext } from "../../Contexts/ScreenScrollingContext";
11
11
 
12
12
  import { ScreenLayoutContextConsumer } from "../../Contexts/ScreenLayoutContext";
13
13
  import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
14
+ import { withComponentsMapOffsetContextConsumer } from "../../Contexts/ComponentsMapOffsetContext";
14
15
 
15
16
  // TODO | Gallery QB | Extract this
16
17
  export const ScrollInterceptorContext = createContext(
@@ -30,5 +31,6 @@ export const Cell = R.compose(
30
31
  RiverOffsetContext.withConsumer,
31
32
  HorizontalScrollContext.withConsumer,
32
33
  withConsumer,
33
- ScreenLayoutContextConsumer
34
+ ScreenLayoutContextConsumer,
35
+ withComponentsMapOffsetContextConsumer
34
36
  )(Component);