@applicaster/zapp-react-native-ui-components 13.0.0-alpha.2459003363 → 13.0.0-alpha.2761483533

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 (102) hide show
  1. package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
  2. package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
  3. package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
  4. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +6 -6
  5. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +7 -7
  6. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
  7. package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
  8. package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
  9. package/Components/BaseFocusable/index.tsx +65 -28
  10. package/Components/Cell/Cell.tsx +14 -9
  11. package/Components/Cell/CellWithFocusable.tsx +1 -1
  12. package/Components/Cell/TvOSCellComponent.tsx +3 -8
  13. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +20 -20
  14. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +5 -3
  15. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +5 -5
  16. package/Components/ComponentResolver/__tests__/componentResolver.test.js +11 -9
  17. package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
  18. package/Components/Focusable/Focusable.tsx +0 -54
  19. package/Components/Focusable/FocusableTvOS.tsx +1 -1
  20. package/Components/FocusableList/index.tsx +0 -1
  21. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +76 -7
  22. package/Components/GeneralContentScreen/utils/useCurationAPI.ts +53 -9
  23. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +1 -0
  24. package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
  25. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -3
  26. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +9 -9
  27. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  28. package/Components/Layout/TV/__tests__/index.test.tsx +7 -3
  29. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +1 -1
  30. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
  31. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  32. package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
  33. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +7 -7
  34. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +34 -34
  35. package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
  36. package/Components/NativeFocusables/{index.js → index.ts} +4 -2
  37. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
  38. package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
  39. package/Components/PlayerContainer/PlayerContainer.tsx +5 -11
  40. package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
  41. package/Components/River/RefreshControl.tsx +1 -1
  42. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +17 -17
  43. package/Components/River/__tests__/__snapshots__/river.test.js.snap +12 -12
  44. package/Components/River/__tests__/componentsMap.test.js +61 -13
  45. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -1
  46. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +1 -1
  47. package/Components/Screen/__tests__/Screen.test.tsx +41 -27
  48. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
  49. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +2 -2
  50. package/Components/ScreenResolver/__tests__/screenResolver.test.js +31 -27
  51. package/Components/Tabs/Tab.tsx +1 -0
  52. package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
  53. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
  54. package/Components/TextInputTv/index.tsx +2 -2
  55. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
  56. package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
  57. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +9 -9
  58. package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
  59. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
  60. package/Components/VideoLive/PlayerLiveImageComponent.tsx +18 -16
  61. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
  62. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -6
  63. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +5 -1
  64. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +5 -1
  65. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +1 -1
  66. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +4 -10
  67. package/Components/VideoModal/ModalAnimation/index.ts +2 -1
  68. package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
  69. package/Components/VideoModal/OpaqueLayer.tsx +33 -0
  70. package/Components/VideoModal/PlayerWrapper.tsx +16 -35
  71. package/Components/VideoModal/VideoModal.tsx +14 -23
  72. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
  73. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
  74. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
  75. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
  76. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
  77. package/Components/VideoModal/hooks/index.ts +7 -0
  78. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
  79. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
  80. package/Components/VideoModal/hooks/utils/index.ts +33 -0
  81. package/Components/VideoModal/utils.ts +3 -5
  82. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +2 -2
  83. package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
  84. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +1 -0
  85. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +11 -11
  86. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +30 -30
  87. package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
  88. package/Contexts/FocusableGroupContext/withFocusableContext.tsx +18 -11
  89. package/Decorators/Analytics/{index.js → index.tsx} +11 -11
  90. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +2 -2
  91. package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
  92. package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
  93. package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
  94. package/Decorators/RiverFeedLoader/index.tsx +1 -1
  95. package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
  96. package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
  97. package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
  98. package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +5 -5
  99. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +16 -10
  100. package/Decorators/ZappPipesDataConnector/index.tsx +32 -2
  101. package/package.json +12 -6
  102. package/Decorators/RiverFeedLoader/utils.ts +0 -100
@@ -175,10 +175,10 @@ function TextInputTV(props: Props, ref) {
175
175
  return isWebPlatform ? (
176
176
  <>
177
177
  {additional && additional()}
178
- <input ref={ref} {...inputProps} />
178
+ <input testID="TextInput-tv" ref={ref} {...inputProps} />
179
179
  </>
180
180
  ) : (
181
- <TextInput ref={ref} {...inputProps} />
181
+ <TextInput testID="TextInput-tv" ref={ref} {...inputProps} />
182
182
  );
183
183
  }
184
184
 
@@ -14,7 +14,7 @@ exports[`<Touchable /> when not running in automated tests environment renders c
14
14
  onResponderTerminationRequest={[Function]}
15
15
  onStartShouldSetResponder={[Function]}
16
16
  style={
17
- Object {
17
+ {
18
18
  "opacity": 1,
19
19
  }
20
20
  }
@@ -40,7 +40,7 @@ exports[`<Touchable /> when running in automated tests environment has accessibl
40
40
  onResponderTerminationRequest={[Function]}
41
41
  onStartShouldSetResponder={[Function]}
42
42
  style={
43
- Object {
43
+ {
44
44
  "opacity": 1,
45
45
  }
46
46
  }
@@ -1,16 +1,16 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`AnimationManager initialState() returns a state composed from the initial configuration 1`] = `
4
- Object {
4
+ {
5
5
  "animating": false,
6
6
  "duration": 123,
7
7
  "easing": [MockFunction],
8
- "from": Object {
8
+ "from": {
9
9
  "index": 0,
10
10
  },
11
- "to": Object {
11
+ "to": {
12
12
  "index": 0,
13
- "style": Object {},
13
+ "style": {},
14
14
  },
15
15
  }
16
16
  `;
@@ -18,25 +18,25 @@ Object {
18
18
  exports[`AnimationManager returns the animation manager with the injected transition configuration 1`] = `
19
19
  AnimationManager {
20
20
  "animatedValue": 0,
21
- "config": Object {
22
- "back": Object {
21
+ "config": {
22
+ "back": {
23
23
  "duration": 123,
24
24
  "easing": [MockFunction],
25
- "from": Object {
26
- "style": Object {},
25
+ "from": {
26
+ "style": {},
27
27
  },
28
- "to": Object {
29
- "style": Object {},
28
+ "to": {
29
+ "style": {},
30
30
  },
31
31
  },
32
- "push": Object {
32
+ "push": {
33
33
  "duration": 123,
34
34
  "easing": [MockFunction],
35
- "from": Object {
36
- "style": Object {},
35
+ "from": {
36
+ "style": {},
37
37
  },
38
- "to": Object {
39
- "style": Object {},
38
+ "to": {
39
+ "style": {},
40
40
  },
41
41
  },
42
42
  },
@@ -44,25 +44,25 @@ AnimationManager {
44
44
  `;
45
45
 
46
46
  exports[`AnimationManager returns the animation manager with the injected transition configuration 2`] = `
47
- Object {
48
- "back": Object {
47
+ {
48
+ "back": {
49
49
  "duration": 123,
50
50
  "easing": [MockFunction],
51
- "from": Object {
52
- "style": Object {},
51
+ "from": {
52
+ "style": {},
53
53
  },
54
- "to": Object {
55
- "style": Object {},
54
+ "to": {
55
+ "style": {},
56
56
  },
57
57
  },
58
- "push": Object {
58
+ "push": {
59
59
  "duration": 123,
60
60
  "easing": [MockFunction],
61
- "from": Object {
62
- "style": Object {},
61
+ "from": {
62
+ "style": {},
63
63
  },
64
- "to": Object {
65
- "style": Object {},
64
+ "to": {
65
+ "style": {},
66
66
  },
67
67
  },
68
68
  }
@@ -4,14 +4,14 @@ exports[`<Scene /> renders correctly 1`] = `
4
4
  <ForwardRef(AnimatedComponentWrapper)
5
5
  pointerEvents="auto"
6
6
  style={
7
- Array [
8
- Object {
7
+ [
8
+ {
9
9
  "flex": 1,
10
10
  },
11
- Object {
11
+ {
12
12
  "paddingBottom": 49,
13
13
  },
14
- Object {
14
+ {
15
15
  "fontScale": 2,
16
16
  "height": 1334,
17
17
  "scale": 2,
@@ -33,14 +33,14 @@ exports[`<Scene /> renders the overlay while animating 1`] = `
33
33
  <ForwardRef(AnimatedComponentWrapper)
34
34
  pointerEvents="auto"
35
35
  style={
36
- Array [
37
- Object {
36
+ [
37
+ {
38
38
  "flex": 1,
39
39
  },
40
- Object {
40
+ {
41
41
  "paddingBottom": 49,
42
42
  },
43
- Object {
43
+ {
44
44
  "height": "100%",
45
45
  "width": "100%",
46
46
  },
@@ -54,7 +54,7 @@ exports[`<Scene /> renders the overlay while animating 1`] = `
54
54
  </ContextProvider>
55
55
  <ForwardRef(AnimatedComponentWrapper)
56
56
  style={
57
- Object {
57
+ {
58
58
  "opacity": 1,
59
59
  }
60
60
  }
@@ -5,34 +5,34 @@ exports[`transitionConfig accepts an Animated.Value as a parameter 1`] = `"Canno
5
5
  exports[`transitionConfig accepts an Animated.Value as a parameter 2`] = `[Function]`;
6
6
 
7
7
  exports[`transitionConfig returns a back object is valid 1`] = `
8
- Object {
8
+ {
9
9
  "duration": 350,
10
10
  "easing": [Function],
11
- "from": Object {
12
- "style": Object {
11
+ "from": {
12
+ "style": {
13
13
  "height": 1334,
14
14
  "position": "absolute",
15
- "transform": Array [
16
- Object {
15
+ "transform": [
16
+ {
17
17
  "translateX": 0,
18
18
  },
19
19
  ],
20
20
  "width": 750,
21
21
  },
22
22
  },
23
- "to": Object {
24
- "overlayStyle": Object {
23
+ "to": {
24
+ "overlayStyle": {
25
25
  "backgroundColor": "black",
26
26
  "height": 1334,
27
27
  "opacity": 0.35,
28
28
  "position": "absolute",
29
29
  "width": 750,
30
30
  },
31
- "style": Object {
31
+ "style": {
32
32
  "height": 1334,
33
33
  "position": "absolute",
34
- "transform": Array [
35
- Object {
34
+ "transform": [
35
+ {
36
36
  "translateX": -1,
37
37
  },
38
38
  ],
@@ -43,34 +43,34 @@ Object {
43
43
  `;
44
44
 
45
45
  exports[`transitionConfig returns a push object is valid 1`] = `
46
- Object {
46
+ {
47
47
  "duration": 350,
48
48
  "easing": [Function],
49
- "from": Object {
50
- "overlayStyle": Object {
49
+ "from": {
50
+ "overlayStyle": {
51
51
  "backgroundColor": "black",
52
52
  "height": 1334,
53
53
  "opacity": 0,
54
54
  "position": "absolute",
55
55
  "width": 750,
56
56
  },
57
- "style": Object {
57
+ "style": {
58
58
  "height": 1334,
59
59
  "position": "absolute",
60
- "transform": Array [
61
- Object {
60
+ "transform": [
61
+ {
62
62
  "translateX": 0,
63
63
  },
64
64
  ],
65
65
  "width": 750,
66
66
  },
67
67
  },
68
- "to": Object {
69
- "style": Object {
68
+ "to": {
69
+ "style": {
70
70
  "height": 1334,
71
71
  "position": "absolute",
72
- "transform": Array [
73
- Object {
72
+ "transform": [
73
+ {
74
74
  "translateX": 750,
75
75
  },
76
76
  ],
@@ -3,7 +3,7 @@
3
3
  exports[`<TransitionerComponent /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "flex": 1,
8
8
  "overflow": "hidden",
9
9
  }
@@ -12,7 +12,7 @@ exports[`<TransitionerComponent /> renders correctly 1`] = `
12
12
  <Scene
13
13
  isActive={true}
14
14
  screenUniqueId="mocked-uuid"
15
- style={Object {}}
15
+ style={{}}
16
16
  >
17
17
  <View
18
18
  foo="bar"
@@ -244,25 +244,27 @@ const PlayerLiveImageComponent = (props: Props) => {
244
244
  }, [item.id]);
245
245
 
246
246
  React.useEffect(() => {
247
- if (playerManager) {
248
- const isPlayerRegistered = playerManager.isPlayerRegistered(playerId);
247
+ if (isMeasurement(item) || !playerManager) {
248
+ return;
249
+ }
249
250
 
250
- if (isPlayerRegistered) {
251
- log_error(
252
- `PlayerLiveImageComponent: player ${playerId} already registered`
253
- );
254
- } else {
255
- playerManager.registerPlayer({
256
- id: playerId,
257
- playerController: controller,
258
- });
251
+ const isPlayerRegistered = playerManager.isPlayerRegistered(playerId);
259
252
 
260
- return () => {
261
- playerManager.unregisterPlayer(playerId);
262
- };
263
- }
253
+ if (isPlayerRegistered) {
254
+ log_error(
255
+ `PlayerLiveImageComponent: player ${playerId} already registered`
256
+ );
257
+ } else {
258
+ playerManager.registerPlayer({
259
+ id: playerId,
260
+ playerController: controller,
261
+ });
262
+
263
+ return () => {
264
+ playerManager.unregisterPlayer(playerId);
265
+ };
264
266
  }
265
- }, [liveImageItem, playerId, controller]);
267
+ }, [liveImageItem, playerId, controller, item.id]);
266
268
 
267
269
  const onPositionUpdated = React.useCallback(
268
270
  (data) => {
@@ -2,9 +2,9 @@
2
2
  import * as React from "react";
3
3
  import { render } from "@testing-library/react-native";
4
4
  import * as PlayerFactory from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerFactory";
5
- import { Player } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/player";
6
5
  import { ThemeContext } from "@applicaster/zapp-react-native-utils/theme";
7
6
  import * as navigationHooks from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
7
+ import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
8
8
 
9
9
  import { PlayerLiveImage } from "../PlayerLiveImageComponent";
10
10
  import * as useNavigationHooks from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
@@ -12,13 +12,13 @@ import * as useNavigationHooks from "@applicaster/zapp-react-native-utils/reactH
12
12
  import { Provider } from "react-redux";
13
13
  import configureStore from "redux-mock-store";
14
14
 
15
- const seekTo = jest.fn();
15
+ const mock_seekTo = jest.fn();
16
16
 
17
17
  jest.mock(
18
18
  "@applicaster/zapp-react-native-utils/appUtils/playerManager/player",
19
19
  () => ({
20
20
  Player: {
21
- seekTo,
21
+ seekTo: mock_seekTo,
22
22
  },
23
23
  })
24
24
  );
@@ -33,7 +33,7 @@ const mockStore = configureStore();
33
33
 
34
34
  const store = mockStore({ appData: {} });
35
35
 
36
- const Wrapper = ({ children }: { children: React.ReactChildren }) => (
36
+ const Wrapper = ({ children }: { children: React.ReactNode }) => (
37
37
  /* @ts-ignore */
38
38
  <Provider store={store}>
39
39
  <ThemeContext.Provider
@@ -60,10 +60,16 @@ describe("PlayerLiveImageComponent", () => {
60
60
  };
61
61
 
62
62
  beforeAll(() => {
63
- jest.spyOn(PlayerFactory, "playerFactory").mockImplementation(() => ({
64
- controller: new Player({}),
65
- Component: () => null,
66
- }));
63
+ jest.spyOn(PlayerFactory, "playerFactory").mockImplementation(() => {
64
+ const Player = jest.requireActual(
65
+ "@applicaster/zapp-react-native-utils/appUtils/playerManager/player"
66
+ ).Player;
67
+
68
+ return {
69
+ controller: new Player({}),
70
+ Component: () => null,
71
+ };
72
+ });
67
73
 
68
74
  jest.spyOn(navigationHooks, "useIsScreenActive").mockReturnValue(true);
69
75
  });
@@ -113,4 +119,53 @@ describe("PlayerLiveImageComponent", () => {
113
119
 
114
120
  // TODO: implement this test
115
121
  });
122
+
123
+ it("should register the player for normal item", () => {
124
+ render(
125
+ <Wrapper>
126
+ <PlayerLiveImage {...defaultProps} />
127
+ </Wrapper>
128
+ );
129
+
130
+ const isPlayerRegistered = playerManager.isPlayerRegistered(
131
+ defaultProps.playerId
132
+ );
133
+
134
+ expect(isPlayerRegistered).toBe(true);
135
+ });
136
+
137
+ it("should unregister the player for normal item", () => {
138
+ const component = render(
139
+ <Wrapper>
140
+ <PlayerLiveImage {...defaultProps} />
141
+ </Wrapper>
142
+ );
143
+
144
+ component.unmount();
145
+
146
+ const isPlayerRegistered = playerManager.isPlayerRegistered(
147
+ defaultProps.playerId
148
+ );
149
+
150
+ expect(isPlayerRegistered).toBe(false);
151
+ });
152
+
153
+ it("should not register the player for 'pre-measurement' item", () => {
154
+ const props = {
155
+ ...defaultProps,
156
+ item: {
157
+ ...defaultProps.item,
158
+ id: "pre-measurement-1",
159
+ },
160
+ };
161
+
162
+ render(
163
+ <Wrapper>
164
+ <PlayerLiveImage {...props} />
165
+ </Wrapper>
166
+ );
167
+
168
+ const isPlayerRegistered = playerManager.isPlayerRegistered(props.playerId);
169
+ expect(isPlayerRegistered).toBe(false);
170
+ });
116
171
  });
@@ -9,7 +9,7 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
9
9
  <View
10
10
  collapsable={false}
11
11
  style={
12
- Object {
12
+ {
13
13
  "opacity": 1,
14
14
  }
15
15
  }
@@ -19,10 +19,10 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
19
19
  audioMutedByDefault={false}
20
20
  imageKey="image1"
21
21
  item={
22
- Object {
22
+ {
23
23
  "id": "1",
24
24
  "title": "Test",
25
- "type": Object {
25
+ "type": {
26
26
  "value": "",
27
27
  },
28
28
  }
@@ -30,13 +30,13 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
30
30
  onError={[Function]}
31
31
  playerId="player1"
32
32
  resizeMode="cover"
33
- screenConfig={Object {}}
33
+ screenConfig={{}}
34
34
  source={
35
- Object {
35
+ {
36
36
  "uri": "",
37
37
  }
38
38
  }
39
- style={Object {}}
39
+ style={{}}
40
40
  />
41
41
  </View>
42
42
  </View>
@@ -62,7 +62,10 @@ 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();
@@ -80,6 +83,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
80
83
  enableGesture &&
81
84
  !isLanguageOverlayVisible &&
82
85
  isNotMinimizeMaximazeAnimation &&
86
+ !isSeekBarTouch &&
83
87
  (isMaximazedModal || isMinimizedModal);
84
88
 
85
89
  const isAudioItem = React.useMemo(
@@ -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(
@@ -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
  );
@@ -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);
@@ -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
+ }
@@ -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
+ };