@applicaster/zapp-react-native-ui-components 14.0.0-alpha.4009339136 → 14.0.0-alpha.4077517019

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 (44) hide show
  1. package/Components/AudioPlayer/{tv/Artwork.tsx → Artwork.tsx} +2 -3
  2. package/Components/AudioPlayer/{tv/index.tsx → AudioPlayer.tsx} +58 -17
  3. package/Components/AudioPlayer/AudioPlayerLayout.tsx +202 -0
  4. package/Components/AudioPlayer/{tv/Channel.tsx → Channel.tsx} +7 -7
  5. package/Components/AudioPlayer/{tv/Runtime.tsx → Runtime.tsx} +1 -7
  6. package/Components/AudioPlayer/{tv/Summary.tsx → Summary.tsx} +2 -6
  7. package/Components/AudioPlayer/{tv/Title.tsx → Title.tsx} +2 -6
  8. package/Components/AudioPlayer/{tv/__tests__ → __tests__}/__snapshots__/Runtime.test.js.snap +2 -2
  9. package/Components/AudioPlayer/{mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap → __tests__/__snapshots__/audioPlayer.test.js.snap} +8 -2
  10. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +72 -0
  11. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +28 -0
  12. package/Components/AudioPlayer/{tv/__tests__ → __tests__}/__snapshots__/summary.test.js.snap +2 -1
  13. package/Components/AudioPlayer/{tv/__tests__ → __tests__}/__snapshots__/title.test.js.snap +2 -1
  14. package/Components/AudioPlayer/{tv/__tests__ → __tests__}/audioPlayer.test.js +3 -7
  15. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +26 -0
  16. package/Components/AudioPlayer/{tv/helpers.tsx → helpers.tsx} +2 -1
  17. package/Components/AudioPlayer/index.ts +1 -0
  18. package/Components/MasterCell/index.tsx +1 -1
  19. package/Components/PlayerContainer/PlayerContainer.tsx +19 -7
  20. package/Components/PlayerImageBackground/index.tsx +1 -1
  21. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +9 -1
  22. package/Components/VideoModal/PlayerDetails.tsx +24 -2
  23. package/Components/VideoModal/PlayerWrapper.tsx +26 -142
  24. package/Components/VideoModal/VideoModal.tsx +3 -17
  25. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
  26. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
  27. package/Components/VideoModal/hooks/index.ts +0 -2
  28. package/Components/VideoModal/utils.ts +6 -0
  29. package/package.json +5 -5
  30. package/Components/AudioPlayer/index.tsx +0 -15
  31. package/Components/AudioPlayer/mobile/Layout.tsx +0 -66
  32. package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +0 -18
  33. package/Components/AudioPlayer/mobile/index.tsx +0 -18
  34. package/Components/AudioPlayer/tv/Layout.tsx +0 -168
  35. package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +0 -164
  36. package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +0 -19
  37. package/Components/AudioPlayer/types.ts +0 -40
  38. package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
  39. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/Runtime.test.js +0 -0
  40. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/__snapshots__/artWork.test.js.snap +0 -0
  41. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/artWork.test.js +0 -0
  42. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/channel.test.js +0 -0
  43. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/summary.test.js +0 -0
  44. /package/Components/AudioPlayer/{tv/__tests__ → __tests__}/title.test.js +0 -0
@@ -21,87 +21,27 @@ exports[`PlayerWrapper renders inline 1`] = `
21
21
  "top": "additive",
22
22
  }
23
23
  }
24
- style={
25
- [
26
- {
27
- "backgroundColor": "transparent",
28
- },
29
- {
30
- "height": 800,
31
- "width": 300,
32
- },
33
- {},
34
- ]
35
- }
24
+ style={{}}
36
25
  >
37
26
  <View
38
- additionalData={
39
- {
40
- "saveArea": true,
41
- }
42
- }
43
- animationType="moveUpComponent"
44
27
  style={
45
28
  [
46
29
  {
47
- "flexDirection": "column",
30
+ "alignSelf": "center",
31
+ "position": "relative",
32
+ "zIndex": 200,
48
33
  },
34
+ {},
49
35
  {
50
- "flex": 1,
36
+ "aspectRatio": 1.7777777777777777,
37
+ "height": undefined,
38
+ "width": "100%",
51
39
  },
40
+ {},
52
41
  ]
53
42
  }
54
- >
55
- <View
56
- style={
57
- [
58
- {
59
- "alignSelf": "center",
60
- "position": "relative",
61
- "zIndex": 200,
62
- },
63
- {
64
- "aspectRatio": 1.7777777777777777,
65
- "height": undefined,
66
- "width": "100%",
67
- },
68
- {},
69
- {},
70
- ]
71
- }
72
- testID="test-player-container"
73
- />
74
- <View
75
- animationType="componentFade"
76
- style={
77
- {
78
- "flex": 1,
79
- }
80
- }
81
- >
82
- <View
83
- configuration={
84
- {
85
- "tablet_landscape_player_container_background_color": "red",
86
- "tablet_landscape_sidebar_width": "35%",
87
- }
88
- }
89
- entry={
90
- {
91
- "id": "test",
92
- }
93
- }
94
- isTablet={false}
95
- isTabletLandscape={false}
96
- style={
97
- {
98
- "flex": 1,
99
- "paddingTop": 20,
100
- }
101
- }
102
- />
103
- </View>
104
- </View>
43
+ testID="test-player-container"
44
+ />
105
45
  </RNCSafeAreaView>
106
46
  </RNCSafeAreaProvider>
107
47
  `;
@@ -127,57 +67,27 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
127
67
  "top": "additive",
128
68
  }
129
69
  }
130
- style={
131
- [
132
- {
133
- "backgroundColor": "transparent",
134
- },
135
- {
136
- "height": undefined,
137
- "width": 300,
138
- },
139
- {},
140
- ]
141
- }
70
+ style={{}}
142
71
  >
143
72
  <View
144
- additionalData={
145
- {
146
- "saveArea": true,
147
- }
148
- }
149
- animationType="moveUpComponent"
150
73
  style={
151
74
  [
152
75
  {
153
- "flexDirection": "column",
76
+ "alignSelf": "center",
77
+ "position": "relative",
78
+ "zIndex": 200,
154
79
  },
80
+ {},
155
81
  {
156
- "flex": 1,
82
+ "aspectRatio": 1.7777777777777777,
83
+ "height": undefined,
84
+ "width": "100%",
157
85
  },
86
+ {},
158
87
  ]
159
88
  }
160
- >
161
- <View
162
- style={
163
- [
164
- {
165
- "alignSelf": "center",
166
- "position": "relative",
167
- "zIndex": 200,
168
- },
169
- {
170
- "aspectRatio": undefined,
171
- "height": undefined,
172
- "width": "100%",
173
- },
174
- {},
175
- {},
176
- ]
177
- }
178
- testID="test-player-container"
179
- />
180
- </View>
89
+ testID="test-player-container"
90
+ />
181
91
  </RNCSafeAreaView>
182
92
  </RNCSafeAreaProvider>
183
93
  `;
@@ -203,103 +113,27 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
203
113
  "top": "additive",
204
114
  }
205
115
  }
206
- style={
207
- [
208
- {
209
- "backgroundColor": "red",
210
- },
211
- {
212
- "height": 800,
213
- "width": 300,
214
- },
215
- {},
216
- ]
217
- }
116
+ style={{}}
218
117
  >
219
118
  <View
220
- additionalData={
221
- {
222
- "saveArea": true,
223
- }
224
- }
225
- animationType="moveUpComponent"
226
119
  style={
227
120
  [
228
121
  {
229
- "flexDirection": "row",
122
+ "alignSelf": "center",
123
+ "position": "relative",
124
+ "zIndex": 200,
230
125
  },
126
+ {},
231
127
  {
232
- "flex": 1,
128
+ "aspectRatio": 1.7777777777777777,
129
+ "height": undefined,
130
+ "width": 195,
233
131
  },
132
+ {},
234
133
  ]
235
134
  }
236
- >
237
- <View
238
- style={
239
- [
240
- {
241
- "alignSelf": "center",
242
- "position": "relative",
243
- "zIndex": 200,
244
- },
245
- {
246
- "aspectRatio": 1.7777777777777777,
247
- "height": undefined,
248
- "width": 195,
249
- },
250
- {},
251
- {},
252
- ]
253
- }
254
- testID="test-player-container"
255
- >
256
- <View
257
- additionalData={
258
- {
259
- "disableAnimatedComponent": false,
260
- "resetAnimationValue": undefined,
261
- "useLayoutMeasure": true,
262
- }
263
- }
264
- animationType="moveUpComponent"
265
- style={
266
- {
267
- "flex": 1,
268
- }
269
- }
270
- />
271
- </View>
272
- <View
273
- animationType="componentFade"
274
- style={
275
- {
276
- "flex": 1,
277
- }
278
- }
279
- >
280
- <View
281
- configuration={
282
- {
283
- "tablet_landscape_player_container_background_color": "red",
284
- "tablet_landscape_sidebar_width": "35%",
285
- }
286
- }
287
- entry={
288
- {
289
- "id": "test",
290
- }
291
- }
292
- isTablet={true}
293
- isTabletLandscape={true}
294
- style={
295
- {
296
- "flex": 1,
297
- "paddingTop": 20,
298
- }
299
- }
300
- />
301
- </View>
302
- </View>
135
+ testID="test-player-container"
136
+ />
303
137
  </RNCSafeAreaView>
304
138
  </RNCSafeAreaProvider>
305
139
  `;
@@ -325,57 +159,27 @@ exports[`PlayerWrapper renders properly 1`] = `
325
159
  "top": "additive",
326
160
  }
327
161
  }
328
- style={
329
- [
330
- {
331
- "backgroundColor": "transparent",
332
- },
333
- {
334
- "height": 800,
335
- "width": 300,
336
- },
337
- {},
338
- ]
339
- }
162
+ style={{}}
340
163
  >
341
164
  <View
342
- additionalData={
343
- {
344
- "saveArea": true,
345
- }
346
- }
347
- animationType="moveUpComponent"
348
165
  style={
349
166
  [
350
167
  {
351
- "flexDirection": "column",
168
+ "alignSelf": "center",
169
+ "position": "relative",
170
+ "zIndex": 200,
352
171
  },
172
+ {},
353
173
  {
354
- "flex": 1,
174
+ "aspectRatio": 1.7786666666666666,
175
+ "height": undefined,
176
+ "width": "100%",
355
177
  },
178
+ {},
356
179
  ]
357
180
  }
358
- >
359
- <View
360
- style={
361
- [
362
- {
363
- "alignSelf": "center",
364
- "position": "relative",
365
- "zIndex": 200,
366
- },
367
- {
368
- "aspectRatio": 1.7786666666666666,
369
- "height": undefined,
370
- "width": "100%",
371
- },
372
- {},
373
- {},
374
- ]
375
- }
376
- testID="test-player-container"
377
- />
378
- </View>
181
+ testID="test-player-container"
182
+ />
379
183
  </RNCSafeAreaView>
380
184
  </RNCSafeAreaProvider>
381
185
  `;
@@ -1,5 +1,3 @@
1
- export { useBackgroundColor } from "./useBackgroundColor";
2
-
3
1
  export { useDelayedPlayerDetails } from "./useDelayedPlayerDetails";
4
2
 
5
3
  export { useInitialPlayerState } from "./useInitialPlayerState";
@@ -34,6 +34,9 @@ export const useConfiguration = () => {
34
34
  minimised_height = 0,
35
35
  minimised_height_tablet = 0,
36
36
  modal_background_color,
37
+ tablet_landscape_player_container_background_color,
38
+ screen_background_color,
39
+ audio_player_background_color,
37
40
  } = config;
38
41
 
39
42
  const minimisedHeight = useIsTablet()
@@ -43,6 +46,9 @@ export const useConfiguration = () => {
43
46
  return {
44
47
  minimised_height: Number(minimisedHeight),
45
48
  modal_background_color,
49
+ tablet_landscape_player_container_background_color,
50
+ audio_player_background_color,
51
+ screen_background_color,
46
52
  };
47
53
  };
48
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "14.0.0-alpha.4009339136",
3
+ "version": "14.0.0-alpha.4077517019",
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": "14.0.0-alpha.4009339136",
35
- "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.4009339136",
36
- "@applicaster/zapp-react-native-redux": "14.0.0-alpha.4009339136",
37
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.4009339136",
34
+ "@applicaster/applicaster-types": "14.0.0-alpha.4077517019",
35
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.4077517019",
36
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.4077517019",
37
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.4077517019",
38
38
  "promise": "^8.3.0",
39
39
  "url": "^0.11.0",
40
40
  "uuid": "^3.3.2"
@@ -1,15 +0,0 @@
1
- import * as React from "react";
2
- import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
3
-
4
- import { AudioPlayerTV } from "./tv";
5
- import { AudioPlayerMobile } from "./mobile";
6
-
7
- import { Props } from "./types";
8
-
9
- export function AudioPlayer(props: Props) {
10
- if (isTV()) {
11
- return <AudioPlayerTV {...props} />;
12
- }
13
-
14
- return <AudioPlayerMobile {...props} />;
15
- }
@@ -1,66 +0,0 @@
1
- import React, { useRef } from "react";
2
- import {
3
- View,
4
- ImageBackground,
5
- Animated,
6
- ViewStyle,
7
- StyleSheet,
8
- } from "react-native";
9
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
10
-
11
- const THREE_SECONDS = 3000;
12
-
13
- const styles = StyleSheet.create({
14
- flex: {
15
- flex: 1,
16
- },
17
- });
18
-
19
- type Props = {
20
- backgroundImageSource: { uri: string };
21
- style: ViewStyle;
22
- };
23
-
24
- export function AudioPlayerMobileLayout({
25
- backgroundImageSource,
26
- style,
27
- }: Props) {
28
- const fadeAnimation = useRef(new Animated.Value(0)).current;
29
-
30
- const mainContainerStyles = platformSelect({
31
- native: {
32
- backgroundColor: "transparent",
33
- overflow: "hidden",
34
- ...style,
35
- },
36
- });
37
-
38
- React.useEffect(() => {
39
- Animated.timing(fadeAnimation, {
40
- toValue: 1,
41
- duration: THREE_SECONDS,
42
- useNativeDriver: true,
43
- }).start();
44
- }, []);
45
-
46
- return (
47
- <View style={mainContainerStyles} pointerEvents="none">
48
- <Animated.View
49
- style={[
50
- mainContainerStyles,
51
- {
52
- opacity: fadeAnimation,
53
- },
54
- ]}
55
- >
56
- <ImageBackground
57
- source={backgroundImageSource}
58
- style={styles.flex}
59
- resizeMode="cover"
60
- >
61
- <View style={mainContainerStyles} />
62
- </ImageBackground>
63
- </Animated.View>
64
- </View>
65
- );
66
- }
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import { render } from "@testing-library/react-native";
3
-
4
- import { AudioPlayerMobileLayout } from "../Layout";
5
-
6
- const audioPlayerLayoutProps = {
7
- backgroundImageSource: { uri: "background_image_url" },
8
- };
9
-
10
- describe("<AudioPlayerMobileLayout />", () => {
11
- it("renders correctly", () => {
12
- const { toJSON } = render(
13
- <AudioPlayerMobileLayout {...audioPlayerLayoutProps} />
14
- );
15
-
16
- expect(toJSON()).toMatchSnapshot();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- import * as React from "react";
2
- import { useBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
3
-
4
- import { AudioPlayerMobileLayout } from "./Layout";
5
- import { Props } from "../types";
6
-
7
- export function AudioPlayerMobile(props: Props) {
8
- const { audio_item, style = {} } = props;
9
-
10
- const backgroundImageSource = useBackgroundImage(audio_item);
11
-
12
- return (
13
- <AudioPlayerMobileLayout
14
- backgroundImageSource={backgroundImageSource}
15
- style={style}
16
- />
17
- );
18
- }
@@ -1,168 +0,0 @@
1
- import * as React from "react";
2
- import { ImageBackground, View, ViewStyle } from "react-native";
3
-
4
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
5
-
6
- import { Artwork } from "./Artwork";
7
- import { directionStyles } from "./helpers";
8
-
9
- type Props = {
10
- artwork: string;
11
- config: {
12
- titleColor: string;
13
- summaryColor: string;
14
- backgroundImageOverlay?: string;
15
- backgroundColor: string;
16
- backgroundImage: Option<string>;
17
- isRTL: boolean;
18
- artworkBorderRadius: Option<number>;
19
- };
20
- children: React.ReactNode;
21
- style: ViewStyle;
22
- };
23
-
24
- const backgroundImgStyles = platformSelect({
25
- tvos: {
26
- width: "100%",
27
- height: "100%",
28
- alignItems: "center",
29
- justifyContent: "center",
30
- },
31
- android_tv: {
32
- width: "100%",
33
- height: "100%",
34
- alignItems: "center",
35
- justifyContent: "center",
36
- },
37
- web: {
38
- position: "absolute",
39
- margin: "auto",
40
- display: "flex",
41
- flexWrap: "wrap",
42
- width: "100%",
43
- height: "100%",
44
- flex: 1,
45
- alignItems: "center",
46
- justifyContent: "center",
47
- },
48
- });
49
-
50
- export function AudioPlayerTVLayout({
51
- artwork,
52
- config,
53
- children,
54
- style,
55
- }: Props) {
56
- const { backgroundColor, backgroundImage, backgroundImageOverlay, isRTL } =
57
- config;
58
-
59
- const backgroundImageSource = { uri: backgroundImage };
60
-
61
- const backgroundColorStyle = backgroundImage
62
- ? "transparent"
63
- : backgroundColor;
64
-
65
- const textContainerStyles = platformSelect({
66
- tvos: {
67
- justifyContent: "center",
68
- alignItems: directionStyles(isRTL).justifyContent,
69
- },
70
- android_tv: {
71
- justifyContent: "center",
72
- alignItems: directionStyles(isRTL).justifyContent,
73
- },
74
- web: {
75
- justifyContent: "center",
76
- alignItems: directionStyles(isRTL).justifyContent,
77
- },
78
- });
79
-
80
- const mainContainerStyles = React.useMemo(
81
- () =>
82
- platformSelect({
83
- tvos: {
84
- width: "100%",
85
- height: "100%",
86
- alignItems: "center",
87
- justifyContent: "center",
88
- flexDirection: directionStyles(isRTL).flexDirection,
89
- backgroundColor: backgroundColorStyle,
90
- },
91
- android_tv: {
92
- width: "100%",
93
- height: "100%",
94
- alignItems: "center",
95
- justifyContent: "center",
96
- flexDirection: directionStyles(isRTL).flexDirection,
97
- backgroundColor: backgroundColorStyle,
98
- },
99
- web: {
100
- width: 1920,
101
- height: 1080,
102
- alignItems: "center",
103
- justifyContent: "center",
104
- flexDirection: directionStyles(isRTL).flexDirection,
105
- backgroundColor: backgroundColorStyle,
106
- },
107
- native: {
108
- backgroundColor: backgroundColorStyle,
109
- overflow: "hidden",
110
- ...style,
111
- },
112
- samsung_tv: {
113
- position: "absolute",
114
- margin: "auto",
115
- display: "flex",
116
- flexWrap: "wrap",
117
- height: "100vh",
118
- width: "100vw",
119
- alignItems: "center",
120
- justifyContent: "center",
121
- flexDirection: directionStyles(isRTL).flexDirection,
122
- backgroundColor: backgroundColorStyle,
123
- },
124
- lg_tv: {
125
- position: "absolute",
126
- margin: "auto",
127
- display: "flex",
128
- flexWrap: "wrap",
129
- height: "100vh",
130
- width: "100vw",
131
- alignItems: "center",
132
- justifyContent: "center",
133
- flexDirection: directionStyles(isRTL).flexDirection,
134
- backgroundColor: backgroundColorStyle,
135
- },
136
- }),
137
- [backgroundColorStyle, isRTL, style]
138
- );
139
-
140
- const backgroundOverlayStyles = React.useMemo(
141
- () => ({
142
- backgroundColor: backgroundImageOverlay,
143
- }),
144
- [backgroundImageOverlay]
145
- );
146
-
147
- if (backgroundImage) {
148
- return (
149
- <ImageBackground
150
- source={backgroundImageSource}
151
- style={backgroundImgStyles}
152
- resizeMode="cover"
153
- >
154
- <View style={[mainContainerStyles, backgroundOverlayStyles]}>
155
- <Artwork srcImage={artwork} config={config} />
156
- <View style={textContainerStyles}>{children}</View>
157
- </View>
158
- </ImageBackground>
159
- );
160
- }
161
-
162
- return (
163
- <View style={mainContainerStyles}>
164
- <Artwork srcImage={artwork} config={config} />
165
- <View style={textContainerStyles}>{children}</View>
166
- </View>
167
- );
168
- }