@applicaster/zapp-react-native-ui-components 14.0.0-alpha.5621117258 → 14.0.0-alpha.6242515303
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.
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -8
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +1 -2
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/Cell/index.js +6 -2
- package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
- package/Components/Focusable/index.android.tsx +12 -8
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +0 -2
- package/Components/HandlePlayable/HandlePlayable.tsx +11 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -27
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +1 -0
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +7 -22
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -5
- package/Components/River/RiverItem.tsx +8 -8
- package/Components/River/TV/River.tsx +0 -3
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -6
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +16 -15
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +1 -9
- package/Components/VideoModal/PlayerDetails.tsx +2 -24
- package/Components/VideoModal/PlayerWrapper.tsx +142 -26
- package/Components/VideoModal/VideoModal.tsx +17 -3
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +7 -1
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +240 -44
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +17 -55
- package/Components/VideoModal/hooks/index.ts +2 -0
- package/Components/VideoModal/hooks/useBackgroundColor.ts +10 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -26
- package/Components/VideoModal/utils.ts +0 -6
- package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
- package/index.d.ts +0 -1
- package/package.json +5 -8
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -72
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
import { View, ImageBackground, Animated } 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
|
-
backgroundColor: string;
|
|
15
|
-
backgroundImage: string;
|
|
16
|
-
isRTL: boolean;
|
|
17
|
-
artworkBorderRadius: Option<number>;
|
|
18
|
-
};
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function AudioPlayerLayout({ artwork, config, children }: Props) {
|
|
23
|
-
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
24
|
-
|
|
25
|
-
const fadeAudioPlayerIn = () => {
|
|
26
|
-
Animated.timing(fadeAnimation, {
|
|
27
|
-
toValue: 1,
|
|
28
|
-
duration: 3000,
|
|
29
|
-
useNativeDriver: true,
|
|
30
|
-
}).start();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const { isRTL, backgroundColor, backgroundImage } = config;
|
|
34
|
-
|
|
35
|
-
const backgroundImageSource = { uri: backgroundImage || artwork };
|
|
36
|
-
|
|
37
|
-
const backgroundColorStyle = backgroundImageSource.uri
|
|
38
|
-
? "transparent"
|
|
39
|
-
: backgroundColor;
|
|
40
|
-
|
|
41
|
-
const mainContainerStyles = platformSelect({
|
|
42
|
-
tvos: {
|
|
43
|
-
width: "100%",
|
|
44
|
-
height: "100%",
|
|
45
|
-
alignItems: "center",
|
|
46
|
-
justifyContent: "center",
|
|
47
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
48
|
-
backgroundColor: backgroundColorStyle,
|
|
49
|
-
},
|
|
50
|
-
android_tv: {
|
|
51
|
-
width: "100%",
|
|
52
|
-
height: "100%",
|
|
53
|
-
alignItems: "center",
|
|
54
|
-
justifyContent: "center",
|
|
55
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
56
|
-
backgroundColor: backgroundColorStyle,
|
|
57
|
-
},
|
|
58
|
-
web: {
|
|
59
|
-
width: 1920,
|
|
60
|
-
height: 1080,
|
|
61
|
-
alignItems: "center",
|
|
62
|
-
justifyContent: "center",
|
|
63
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
64
|
-
backgroundColor: backgroundColorStyle,
|
|
65
|
-
},
|
|
66
|
-
native: {
|
|
67
|
-
backgroundColor: backgroundColorStyle,
|
|
68
|
-
overflow: "hidden",
|
|
69
|
-
width: "100%",
|
|
70
|
-
height: "100%",
|
|
71
|
-
},
|
|
72
|
-
samsung_tv: {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
margin: "auto",
|
|
75
|
-
display: "flex",
|
|
76
|
-
flexWrap: "wrap",
|
|
77
|
-
width: "100vw",
|
|
78
|
-
flex: 1,
|
|
79
|
-
alignItems: "center",
|
|
80
|
-
justifyContent: "center",
|
|
81
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
82
|
-
backgroundColor: backgroundColorStyle,
|
|
83
|
-
},
|
|
84
|
-
lg_tv: {
|
|
85
|
-
position: "absolute",
|
|
86
|
-
margin: "auto",
|
|
87
|
-
display: "flex",
|
|
88
|
-
flexWrap: "wrap",
|
|
89
|
-
width: "100vw",
|
|
90
|
-
flex: 1,
|
|
91
|
-
alignItems: "center",
|
|
92
|
-
justifyContent: "center",
|
|
93
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
94
|
-
backgroundColor: backgroundColorStyle,
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const backgroundImgStyles = platformSelect({
|
|
99
|
-
tvos: {
|
|
100
|
-
width: "100%",
|
|
101
|
-
height: "100%",
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
},
|
|
105
|
-
android_tv: {
|
|
106
|
-
width: "100%",
|
|
107
|
-
height: "100%",
|
|
108
|
-
alignItems: "center",
|
|
109
|
-
justifyContent: "center",
|
|
110
|
-
},
|
|
111
|
-
web: {
|
|
112
|
-
position: "absolute",
|
|
113
|
-
margin: "auto",
|
|
114
|
-
display: "flex",
|
|
115
|
-
flexWrap: "wrap",
|
|
116
|
-
width: "100%",
|
|
117
|
-
height: "100%",
|
|
118
|
-
flex: 1,
|
|
119
|
-
alignItems: "center",
|
|
120
|
-
justifyContent: "center",
|
|
121
|
-
},
|
|
122
|
-
native: {
|
|
123
|
-
flex: 1,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const textContainerStyles = platformSelect({
|
|
128
|
-
tvos: {
|
|
129
|
-
width: 600,
|
|
130
|
-
height: 362,
|
|
131
|
-
marginHorizontal: 24,
|
|
132
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
133
|
-
},
|
|
134
|
-
android_tv: {
|
|
135
|
-
width: 600,
|
|
136
|
-
height: 362,
|
|
137
|
-
marginHorizontal: 24,
|
|
138
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
139
|
-
},
|
|
140
|
-
web: {
|
|
141
|
-
margin: 10,
|
|
142
|
-
height: "100vh",
|
|
143
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
144
|
-
justifyContent: "center",
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
|
|
149
|
-
<ImageBackground
|
|
150
|
-
source={backgroundImageSource}
|
|
151
|
-
style={backgroundImgStyles}
|
|
152
|
-
resizeMode="cover"
|
|
153
|
-
>
|
|
154
|
-
<View style={mainContainerStyles}>
|
|
155
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
156
|
-
<View style={textContainerStyles}>{children}</View>
|
|
157
|
-
</View>
|
|
158
|
-
</ImageBackground>
|
|
159
|
-
) : (
|
|
160
|
-
<View style={mainContainerStyles}>
|
|
161
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
162
|
-
<View style={textContainerStyles}>{children}</View>
|
|
163
|
-
</View>
|
|
164
|
-
);
|
|
165
|
-
|
|
166
|
-
const audioPlayerLayoutMobile = () => {
|
|
167
|
-
fadeAudioPlayerIn();
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<View style={mainContainerStyles} pointerEvents="none">
|
|
171
|
-
<Animated.View
|
|
172
|
-
style={[
|
|
173
|
-
mainContainerStyles,
|
|
174
|
-
{
|
|
175
|
-
opacity: fadeAnimation,
|
|
176
|
-
},
|
|
177
|
-
]}
|
|
178
|
-
>
|
|
179
|
-
<ImageBackground
|
|
180
|
-
source={backgroundImageSource}
|
|
181
|
-
style={backgroundImgStyles}
|
|
182
|
-
resizeMode="cover"
|
|
183
|
-
>
|
|
184
|
-
<View style={mainContainerStyles} />
|
|
185
|
-
</ImageBackground>
|
|
186
|
-
</Animated.View>
|
|
187
|
-
</View>
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const audioPlayerLayout = platformSelect({
|
|
192
|
-
tvos: audioPlayerLayoutTV,
|
|
193
|
-
android_tv: audioPlayerLayoutTV,
|
|
194
|
-
web: audioPlayerLayoutTV,
|
|
195
|
-
samsung_tv: audioPlayerLayoutTV,
|
|
196
|
-
lg_tv: audioPlayerLayoutTV,
|
|
197
|
-
ios: audioPlayerLayoutMobile(),
|
|
198
|
-
android: audioPlayerLayoutMobile(),
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return audioPlayerLayout;
|
|
202
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
pointerEvents="none"
|
|
6
|
-
style={
|
|
7
|
-
{
|
|
8
|
-
"backgroundColor": "transparent",
|
|
9
|
-
"height": "100%",
|
|
10
|
-
"overflow": "hidden",
|
|
11
|
-
"width": "100%",
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
>
|
|
15
|
-
<View
|
|
16
|
-
collapsable={false}
|
|
17
|
-
style={
|
|
18
|
-
{
|
|
19
|
-
"backgroundColor": "transparent",
|
|
20
|
-
"height": "100%",
|
|
21
|
-
"opacity": 0,
|
|
22
|
-
"overflow": "hidden",
|
|
23
|
-
"width": "100%",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
>
|
|
27
|
-
<View
|
|
28
|
-
accessibilityIgnoresInvertColors={true}
|
|
29
|
-
style={
|
|
30
|
-
{
|
|
31
|
-
"flex": 1,
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
>
|
|
35
|
-
<Image
|
|
36
|
-
resizeMode="cover"
|
|
37
|
-
source={
|
|
38
|
-
{
|
|
39
|
-
"uri": "https://example.com",
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
style={
|
|
43
|
-
[
|
|
44
|
-
{
|
|
45
|
-
"bottom": 0,
|
|
46
|
-
"left": 0,
|
|
47
|
-
"position": "absolute",
|
|
48
|
-
"right": 0,
|
|
49
|
-
"top": 0,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"height": undefined,
|
|
53
|
-
"width": undefined,
|
|
54
|
-
},
|
|
55
|
-
undefined,
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
/>
|
|
59
|
-
<View
|
|
60
|
-
style={
|
|
61
|
-
{
|
|
62
|
-
"backgroundColor": "transparent",
|
|
63
|
-
"height": "100%",
|
|
64
|
-
"overflow": "hidden",
|
|
65
|
-
"width": "100%",
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
70
|
-
</View>
|
|
71
|
-
</View>
|
|
72
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Channel /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
{
|
|
7
|
-
"height": 72,
|
|
8
|
-
"marginBottom": 30,
|
|
9
|
-
"width": 128,
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<Image
|
|
14
|
-
fadeDuration={0}
|
|
15
|
-
source={
|
|
16
|
-
{
|
|
17
|
-
"uri": "https://example.com",
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
style={
|
|
21
|
-
{
|
|
22
|
-
"height": 72,
|
|
23
|
-
"width": 128,
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/>
|
|
27
|
-
</View>
|
|
28
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react-native";
|
|
3
|
-
|
|
4
|
-
import { AudioPlayerLayout } from "../AudioPlayerLayout";
|
|
5
|
-
|
|
6
|
-
const audioPlayerLayoutProps = {
|
|
7
|
-
artwork: "string",
|
|
8
|
-
config: {
|
|
9
|
-
titleColor: "white",
|
|
10
|
-
summaryColor: "white",
|
|
11
|
-
backgroundColor: "black",
|
|
12
|
-
backgroundImage: "https://example.com",
|
|
13
|
-
isRTL: true,
|
|
14
|
-
},
|
|
15
|
-
children: [],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe("<AudioPlayerLayout />", () => {
|
|
19
|
-
it("renders correctly", () => {
|
|
20
|
-
const { toJSON } = render(
|
|
21
|
-
<AudioPlayerLayout {...audioPlayerLayoutProps} />
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
expect(toJSON()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AudioPlayer } from "./AudioPlayer";
|
|
File without changes
|
/package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|