@applicaster/zapp-react-native-ui-components 13.0.0-alpha.5131435627 → 13.0.0-alpha.5145183145

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.
@@ -22,8 +22,6 @@ type Props = {
22
22
  audio_player_title_color?: string;
23
23
  audio_player_summary_color?: string;
24
24
  audio_player_rtl?: boolean;
25
- magic_background?: boolean;
26
- audio_player_background_image_query?: string;
27
25
  audio_player_background_image_default_color?: string;
28
26
  start_time?: string;
29
27
  end_time?: string;
@@ -34,8 +32,6 @@ type Props = {
34
32
  audio_player_title_color?: string;
35
33
  audio_player_summary_color?: string;
36
34
  audio_player_rtl?: string;
37
- magic_background?: string;
38
- audio_player_background_image_query?: string;
39
35
  audio_player_background_image_default_color?: string;
40
36
  audio_player_background_image?: string;
41
37
  audio_player_artwork_aspect_ratio?: string;
@@ -76,11 +72,6 @@ export function AudioPlayer(props: Props) {
76
72
  const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
77
73
  const channelIcon = getProp("audio_player_channel_icon");
78
74
  const rtlFlag = getProp("audio_player_rtl");
79
- const magicBackground = getProp("magic_background");
80
-
81
- const audioPlayerBackgroundImageQuery = getProp(
82
- "audio_player_background_image_query"
83
- );
84
75
 
85
76
  const audioPlayerBackgroundImageDefaultColor = getProp(
86
77
  "audio_player_background_image_default_color"
@@ -162,8 +153,6 @@ export function AudioPlayer(props: Props) {
162
153
  runTimeFontSize,
163
154
  artworkAspectRatio,
164
155
  channelIcon,
165
- magicBackground,
166
- audioPlayerBackgroundImageQuery,
167
156
  audioPlayerBackgroundImageDefaultColor,
168
157
  };
169
158
  }, [getProp]);
@@ -4,8 +4,6 @@ const defaults = {
4
4
  audio_player_background_color: "black",
5
5
  audio_player_artwork_aspect_ratio: "1:1",
6
6
  audio_player_rtl: false,
7
- magic_background: false,
8
- audio_player_background_image_query: "",
9
7
  audio_player_background_image_default_color: "",
10
8
  };
11
9
 
@@ -3,8 +3,10 @@ import { all, equals, path, prop, isEmpty, pluck, values } from "ramda";
3
3
  import { useEffect, useMemo } from "react";
4
4
  import { useDispatch } from "react-redux";
5
5
 
6
- import { useLayoutPresets } from "@applicaster/zapp-react-native-redux/hooks/useLayoutPresets";
7
- import { useZappPipesFeeds } from "@applicaster/zapp-react-native-redux/hooks/useZappPipesFeeds";
6
+ import {
7
+ useLayoutPresets,
8
+ useZappPipesFeeds,
9
+ } from "@applicaster/zapp-react-native-redux/hooks";
8
10
  import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
9
11
  import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
10
12
  import { Categories } from "./logger";
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
2
- import { View, ScrollView, StyleSheet, Platform } from "react-native";
2
+ import { View, ScrollView, Platform } from "react-native";
3
3
  import { Button } from "./Button";
4
4
  import { ItemIconProps } from "./Button/ItemIcon";
5
5
  import { ItemProps } from "./Button/Item";
@@ -39,12 +39,6 @@ type ModalComponentProps = {
39
39
  iconPlacement?: "left" | "right";
40
40
  };
41
41
 
42
- const styles = StyleSheet.create({
43
- container: {
44
- maxHeight: "100%",
45
- },
46
- });
47
-
48
42
  export function BottomSheetModalContent(props: ModalComponentProps) {
49
43
  const {
50
44
  items,
@@ -96,12 +90,10 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
96
90
 
97
91
  return (
98
92
  <View
99
- style={[
100
- styles.container,
101
- {
102
- paddingTop: paddingTop,
103
- },
104
- ]}
93
+ style={{
94
+ maxHeight: props.maxHeight,
95
+ paddingTop: paddingTop,
96
+ }}
105
97
  >
106
98
  <ModalHeader
107
99
  dismiss={dismiss}
@@ -112,7 +104,7 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
112
104
  <ScrollView
113
105
  contentContainerStyle={{
114
106
  paddingBottom:
115
- Platform.OS === "ios" ? paddingBottom + bottomInset : paddingBottom,
107
+ paddingBottom + (Platform.OS === "ios" ? bottomInset : 0),
116
108
  }}
117
109
  >
118
110
  {items.map((item, index) => (
@@ -597,7 +597,7 @@ const PlayerContainerComponent = (props: Props) => {
597
597
  );
598
598
  }
599
599
 
600
- if (screen_background_color) {
600
+ if (screen_background_color && mode !== VideoModalMode.FULLSCREEN) {
601
601
  updatedStyles.playerScreen.backgroundColor = screen_background_color;
602
602
  }
603
603
 
@@ -615,6 +615,7 @@ const PlayerContainerComponent = (props: Props) => {
615
615
  tv_component_container_height,
616
616
  screen_background_color,
617
617
  isInlineTV,
618
+ mode,
618
619
  ]);
619
620
 
620
621
  const applePlayerProps = {
@@ -0,0 +1,26 @@
1
+ const {
2
+ useScreenBackgroundColor,
3
+ } = require("@applicaster/zapp-react-native-utils/reactHooks/screen");
4
+
5
+ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen", () => ({
6
+ useScreenBackgroundColor: jest.fn(),
7
+ useNavbarState: jest.fn().mockReturnValue({ visible: true }),
8
+ }));
9
+
10
+ describe("TV Screen Component", () => {
11
+ it("uses the useScreenBackgroundColor hook with the correct screen ID", () => {
12
+ useScreenBackgroundColor.mockReturnValue("#FF0000");
13
+
14
+ expect(useScreenBackgroundColor("test-screen-id")).toBe("#FF0000");
15
+
16
+ // Verify the hook was called with the correct screen ID
17
+ expect(useScreenBackgroundColor).toHaveBeenCalledWith("test-screen-id");
18
+ });
19
+
20
+ it("returns 'transparent' when the screen background color is not defined", () => {
21
+ useScreenBackgroundColor.mockReturnValue("transparent");
22
+
23
+ // Verify the hook returns 'transparent'
24
+ expect(useScreenBackgroundColor("test-screen-id")).toBe("transparent");
25
+ });
26
+ });
@@ -68,21 +68,21 @@ jest.mock(
68
68
  })
69
69
  );
70
70
 
71
- jest.mock(
72
- "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenData",
73
- () => ({
74
- useScreenData: jest.fn(() => ({
75
- id: "testId",
76
- navigations: [{ id: "testId", category: "nav_bar" }],
77
- })),
78
- })
79
- );
80
-
81
71
  jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
82
72
  isNavBarVisible: mockIsNavBarVisible,
83
- useRoute: jest.fn(() => ({
84
- pathname: "/river/testId",
85
- screenData: { id: "testId" },
73
+ useIsScreenActive: jest.fn().mockReturnValue(true),
74
+ }));
75
+
76
+ jest.mock("@applicaster/zapp-react-native-utils/reactHooks", () => ({
77
+ useCurrentScreenData: jest.fn(() => ({
78
+ id: "testId",
79
+ })),
80
+ useNavbarState: jest.fn(() => ({
81
+ title: "Test Title",
82
+ })),
83
+ useScreenData: jest.fn(() => ({
84
+ id: "testId",
85
+ navigations: [{ id: "testId", category: "nav_bar" }],
86
86
  })),
87
87
  useNavigation: jest.fn(() => ({
88
88
  canGoBack: () => false,
@@ -91,7 +91,15 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
91
91
  screenData: { id: "testId" },
92
92
  data: { screen: { id: "testId" } },
93
93
  })),
94
- useIsScreenActive: jest.fn().mockReturnValue(true),
94
+ useRoute: jest.fn(() => ({
95
+ pathname: "/river/testId",
96
+ screenData: { id: "testId" },
97
+ })),
98
+ useDimensions: jest.fn(() => ({
99
+ width: 1920,
100
+ height: 1080,
101
+ })),
102
+ useIsTablet: jest.fn(() => false),
95
103
  }));
96
104
 
97
105
  jest.mock("@applicaster/zapp-react-native-redux/hooks/usePickFromState", () => {
@@ -16,7 +16,7 @@ exports[`<Screen Component /> when the navbar should be hidden renders correctly
16
16
  pathname="/river/testId"
17
17
  selected="testId"
18
18
  testID="navBar"
19
- title=""
19
+ title="Test Title"
20
20
  />
21
21
  <View>
22
22
  <View
@@ -48,7 +48,7 @@ exports[`<Screen Component /> when the navbar should show renders correctly 1`]
48
48
  pathname="/river/testId"
49
49
  selected="testId"
50
50
  testID="navBar"
51
- title=""
51
+ title="Test Title"
52
52
  />
53
53
  <View>
54
54
  <View
@@ -94,7 +94,7 @@ export const AnimationView = ({
94
94
  const isAudioItem = React.useMemo(
95
95
  () =>
96
96
  videoModalItem?.content?.type?.includes?.("audio") ||
97
- videoModalItem?.type?.value === "audio",
97
+ videoModalItem?.type?.value?.includes?.("audio"),
98
98
  [videoModalItem]
99
99
  );
100
100
 
@@ -107,7 +107,6 @@ export const AnimationView = ({
107
107
  progressBarHeight,
108
108
  isTablet,
109
109
  isTabletLandscape,
110
- inlineAudioPlayer,
111
110
  tabletLandscapePlayerTopPosition,
112
111
  });
113
112
 
@@ -309,7 +309,6 @@ export const getMoveUpValue = ({
309
309
  progressBarHeight,
310
310
  isTablet,
311
311
  isTabletLandscape,
312
- inlineAudioPlayer,
313
312
  tabletLandscapePlayerTopPosition,
314
313
  }) => {
315
314
  if (additionalData.saveArea) {
@@ -322,17 +321,12 @@ export const getMoveUpValue = ({
322
321
  }
323
322
 
324
323
  if (isTablet) {
325
- if (
326
- isTabletLandscape &&
327
- (!isAudioItem || (isAudioItem && inlineAudioPlayer))
328
- ) {
324
+ if (isTabletLandscape) {
329
325
  return -tabletLandscapePlayerTopPosition + progressBarHeight;
326
+ } else {
327
+ return -130;
330
328
  }
331
-
332
- // for audioPlayer(tablet/isTabletPortrait) in docked mode
333
- return -130;
334
329
  }
335
330
 
336
- // for audioPlayer(mobile) in docked mode
337
331
  return -50 + progressBarHeight;
338
332
  };
@@ -74,20 +74,6 @@ const getScreenAspectRatio = () => {
74
74
  return longEdge / shortEdge;
75
75
  };
76
76
 
77
- const safeAreaStyles = (
78
- configuration: Configuration,
79
- isTablet: boolean
80
- ): ViewStyle => {
81
- const tablet_landscape_player_container_background_color =
82
- configuration?.tablet_landscape_player_container_background_color;
83
-
84
- return {
85
- backgroundColor: isTablet
86
- ? tablet_landscape_player_container_background_color
87
- : "transparent",
88
- };
89
- };
90
-
91
77
  const getEdges = (isTablet: boolean, isInlineModal: boolean) => {
92
78
  if (isTablet) {
93
79
  return ["top"];
@@ -156,6 +142,7 @@ const PlayerWrapperComponent = (props: Props) => {
156
142
  children,
157
143
  isTabletPortrait,
158
144
  configuration,
145
+ fullscreen,
159
146
  pip,
160
147
  } = props;
161
148
 
@@ -211,14 +198,17 @@ const PlayerWrapperComponent = (props: Props) => {
211
198
  [containerDimensions, playerDimensionsHack]
212
199
  );
213
200
 
201
+ const wrapperViewStyle: ViewStyle = {
202
+ backgroundColor:
203
+ isTablet && !fullscreen
204
+ ? configuration?.tablet_landscape_player_container_background_color
205
+ : "transparent",
206
+ };
207
+
214
208
  return (
215
209
  <WrapperView
216
210
  edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
217
- style={[
218
- safeAreaStyles(configuration, isTablet),
219
- style,
220
- playerDimensionsHack,
221
- ]}
211
+ style={[wrapperViewStyle, style, playerDimensionsHack]}
222
212
  >
223
213
  <AnimationComponent
224
214
  animationType={ComponentAnimationType.moveUpComponent}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-alpha.5131435627",
3
+ "version": "13.0.0-alpha.5145183145",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.0-alpha.5131435627",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.5131435627",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.5131435627",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5131435627",
34
+ "@applicaster/applicaster-types": "13.0.0-alpha.5145183145",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.5145183145",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.5145183145",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5145183145",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",