@applicaster/zapp-react-native-ui-components 13.0.0-rc.14 → 13.0.0-rc.141
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/AppContainer/__tests__/AppContainer.test.js +4 -6
- package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap +66 -0
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/tv/Artwork.tsx +40 -0
- package/Components/AudioPlayer/{AudioPlayerLayout.tsx → tv/Layout.tsx} +37 -79
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +2 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +12 -9
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +12 -9
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +5 -8
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +6 -6
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +11 -6
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +170 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/channel.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +9 -7
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +3 -5
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +3 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +14 -63
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.ios.ts +1 -1
- package/Components/BaseFocusable/index.tsx +67 -31
- package/Components/Cell/Cell.tsx +14 -14
- package/Components/Cell/CellWithFocusable.tsx +50 -59
- package/Components/Cell/CellWrapper.tsx +18 -0
- package/Components/Cell/TvOSCellComponent.tsx +20 -26
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
- package/Components/Cell/index.js +3 -1
- package/Components/Cell/styles.ts +17 -0
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +50 -50
- package/Components/CellRendererResolver/index.ts +2 -1
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +26 -30
- package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
- package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
- package/Components/ErrorScreen/index.tsx +14 -6
- package/Components/Focusable/Focusable.tsx +1 -54
- package/Components/Focusable/FocusableTvOS.tsx +6 -2
- package/Components/Focusable/Touchable.tsx +19 -20
- package/Components/Focusable/index.android.tsx +10 -3
- package/Components/FocusableCell/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +34 -86
- package/Components/FocusableGroup/index.tsx +0 -3
- package/Components/FocusableList/index.tsx +26 -10
- package/Components/FocusableScrollView/index.tsx +43 -13
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +3 -0
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +9 -0
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +5 -3
- package/Components/GeneralContentScreen/utils/useEventAlerts.ts +30 -0
- package/Components/HandlePlayable/HandlePlayable.tsx +21 -27
- package/Components/Layout/TV/LayoutBackground.tsx +28 -0
- package/Components/Layout/TV/NavBarContainer.tsx +19 -23
- package/Components/Layout/TV/ScreenContainer.tsx +8 -2
- package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +3 -1
- package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +6 -5
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +12 -11
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +15 -10
- package/Components/Layout/TV/__tests__/index.test.tsx +14 -4
- package/Components/Layout/TV/index.tsx +6 -20
- package/Components/Layout/TV/index.web.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
- package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +10 -15
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +11 -7
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/const.ts +3 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +6 -6
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +11 -19
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +6 -235
- package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
- package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
- package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
- package/Components/MasterCell/utils/behaviorProvider.ts +136 -0
- package/Components/MasterCell/utils/index.ts +9 -135
- package/Components/ModalComponent/BottomSheetModalContent.tsx +66 -54
- package/Components/ModalComponent/Button/Item.tsx +6 -5
- package/Components/ModalComponent/Button/assets.ts +1 -1
- package/Components/ModalComponent/Button/index.tsx +45 -62
- package/Components/ModalComponent/Header/index.tsx +12 -11
- package/Components/ModalComponent/utils.ts +55 -7
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
- package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
- package/Components/OfflineHandler/utils/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +76 -66
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +2 -2
- package/Components/River/ComponentsMap/ComponentsMap.tsx +49 -68
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
- package/Components/River/RefreshControl.tsx +1 -1
- package/Components/River/RiverFooter.tsx +39 -9
- package/Components/River/RiverItem.tsx +44 -4
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +115 -46
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +21 -83
- package/Components/River/__tests__/componentsMap.test.js +64 -17
- package/Components/River/__tests__/river.test.js +75 -40
- package/Components/RouteManager/TestId.tsx +1 -5
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -5
- package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
- package/Components/RouteManager/__tests__/testId.test.js +4 -6
- package/Components/Screen/TV/__tests__/index.web.test.tsx +26 -0
- package/Components/Screen/TV/index.web.tsx +5 -6
- package/Components/Screen/__tests__/Screen.test.tsx +53 -31
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +6 -6
- package/Components/Screen/hooks.ts +53 -0
- package/Components/Screen/index.tsx +16 -42
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +95 -70
- package/Components/Tabs/Tab.tsx +12 -9
- package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
- package/Components/TextInputTv/index.tsx +6 -5
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +2 -3
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
- package/Components/TrackedView/index.tsx +1 -0
- package/Components/Transitioner/AnimationManager.js +15 -15
- package/Components/Transitioner/Scene.tsx +53 -24
- package/Components/Transitioner/Transitioner.tsx +3 -3
- package/Components/Transitioner/__tests__/Scene.test.js +25 -14
- package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +10 -50
- package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
- package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
- package/Components/Transitioner/index.js +8 -4
- package/Components/VideoLive/LiveImageManager.ts +27 -1
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -10
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +1 -1
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +51 -31
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +8 -4
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +48 -23
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +16 -15
- package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +108 -0
- package/Components/VideoModal/ModalAnimation/const.ts +5 -0
- package/Components/VideoModal/ModalAnimation/index.ts +4 -1
- package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +32 -2
- package/Components/VideoModal/OpaqueLayer.tsx +33 -0
- package/Components/VideoModal/PlayerDetails.tsx +18 -10
- package/Components/VideoModal/PlayerWrapper.tsx +51 -57
- package/Components/VideoModal/VideoModal.tsx +17 -11
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +2 -40
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +74 -104
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +51 -0
- package/Components/VideoModal/hooks/index.ts +7 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +38 -0
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
- package/Components/VideoModal/hooks/utils/index.ts +33 -0
- package/Components/VideoModal/utils.ts +6 -9
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
- package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
- package/Components/Viewport/__tests__/utils.test.js +5 -4
- package/Components/ZappUIComponent/Placeholder.tsx +3 -1
- package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
- package/Components/ZappUIComponent/index.tsx +4 -17
- package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
- package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
- package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
- package/Contexts/HeaderOffsetContext/index.tsx +4 -6
- package/Contexts/ScreenContext/index.tsx +6 -12
- package/Contexts/ScreenLayoutContext/index.tsx +5 -3
- package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
- package/Decorators/Navigator/index.tsx +1 -1
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
- package/Decorators/RiverFeedLoader/index.tsx +1 -1
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
- package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
- package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +27 -27
- package/Decorators/RiverResolver/index.tsx +6 -8
- package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
- package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
- package/Decorators/ZappPipesDataConnector/index.tsx +7 -3
- package/package.json +13 -11
- package/tsconfig.json +2 -3
- package/.babelrc +0 -8
- package/Components/AudioPlayer/Artwork.tsx +0 -35
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +0 -123
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -50
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -27
- package/Components/AudioPlayer/index.ts +0 -1
- package/Components/Cell/CellStyles/FallbackCellStyle/index.js +0 -157
- package/Components/Cell/CellStyles/Hero/index.js +0 -111
- package/Components/Cell/CellStyles/ScreenSelector/index.js +0 -68
- package/Components/Cell/CellStyles/cellStylesResolver.ts +0 -19
- package/Components/Cell/CellStyles/colors.js +0 -40
- package/Components/Cell/CellStyles/index.js +0 -15
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
- package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
- /package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<AudioPlayerTV /> renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityIgnoresInvertColors={true}
|
|
6
|
+
>
|
|
7
|
+
<Image
|
|
8
|
+
resizeMode="cover"
|
|
9
|
+
source={
|
|
10
|
+
{
|
|
11
|
+
"uri": "https://example.com",
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
style={
|
|
15
|
+
[
|
|
16
|
+
{
|
|
17
|
+
"bottom": 0,
|
|
18
|
+
"left": 0,
|
|
19
|
+
"position": "absolute",
|
|
20
|
+
"right": 0,
|
|
21
|
+
"top": 0,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"height": undefined,
|
|
25
|
+
"width": undefined,
|
|
26
|
+
},
|
|
27
|
+
undefined,
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
/>
|
|
31
|
+
<View
|
|
32
|
+
style={
|
|
33
|
+
{
|
|
34
|
+
"backgroundColor": "transparent",
|
|
35
|
+
"overflow": "hidden",
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
>
|
|
39
|
+
<View
|
|
40
|
+
style={
|
|
41
|
+
{
|
|
42
|
+
"marginHorizontal": 24,
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
<Image
|
|
47
|
+
fadeDuration={0}
|
|
48
|
+
resizeMode="cover"
|
|
49
|
+
source={
|
|
50
|
+
{
|
|
51
|
+
"uri": "artwork_url",
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
style={
|
|
55
|
+
[
|
|
56
|
+
{
|
|
57
|
+
"height": 400,
|
|
58
|
+
"width": 400,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"borderRadius": 0,
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
<View>
|
|
68
|
+
<View
|
|
69
|
+
style={
|
|
70
|
+
{
|
|
71
|
+
"height": 72,
|
|
72
|
+
"marginBottom": 30,
|
|
73
|
+
"width": 128,
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
>
|
|
77
|
+
<Image
|
|
78
|
+
fadeDuration={0}
|
|
79
|
+
source={
|
|
80
|
+
{
|
|
81
|
+
"uri": "https://example.com",
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
style={
|
|
85
|
+
{
|
|
86
|
+
"height": 72,
|
|
87
|
+
"width": 128,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
</View>
|
|
92
|
+
<View
|
|
93
|
+
style={
|
|
94
|
+
{
|
|
95
|
+
"height": 100,
|
|
96
|
+
"marginBottom": 12,
|
|
97
|
+
"width": 600,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
<Text
|
|
102
|
+
numberOfLines={2}
|
|
103
|
+
style={
|
|
104
|
+
{
|
|
105
|
+
"color": "white",
|
|
106
|
+
"fontFamily": null,
|
|
107
|
+
"fontSize": 38,
|
|
108
|
+
"fontWeight": "600",
|
|
109
|
+
"textAlign": "right",
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
tittle
|
|
114
|
+
</Text>
|
|
115
|
+
</View>
|
|
116
|
+
<View
|
|
117
|
+
style={
|
|
118
|
+
{
|
|
119
|
+
"height": 80,
|
|
120
|
+
"marginBottom": 30,
|
|
121
|
+
"width": 600,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
>
|
|
125
|
+
<Text
|
|
126
|
+
numberOfLines={2}
|
|
127
|
+
style={
|
|
128
|
+
{
|
|
129
|
+
"color": "white",
|
|
130
|
+
"fontFamily": null,
|
|
131
|
+
"fontSize": 20,
|
|
132
|
+
"fontWeight": "600",
|
|
133
|
+
"opacity": 0.8,
|
|
134
|
+
"textAlign": "right",
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
Summary
|
|
139
|
+
</Text>
|
|
140
|
+
</View>
|
|
141
|
+
<View
|
|
142
|
+
style={
|
|
143
|
+
{
|
|
144
|
+
"height": 40,
|
|
145
|
+
"justifyContent": "flex-end",
|
|
146
|
+
"width": 600,
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
>
|
|
150
|
+
<Text
|
|
151
|
+
style={
|
|
152
|
+
{
|
|
153
|
+
"alignItems": "flex-start",
|
|
154
|
+
"color": "white",
|
|
155
|
+
"flexDirection": "row-reverse",
|
|
156
|
+
"fontFamily": null,
|
|
157
|
+
"fontSize": 20,
|
|
158
|
+
"justifyContent": "flex-end",
|
|
159
|
+
"opacity": 0.8,
|
|
160
|
+
"textAlign": "right",
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
>
|
|
164
|
+
10:10 - 11:11
|
|
165
|
+
</Text>
|
|
166
|
+
</View>
|
|
167
|
+
</View>
|
|
168
|
+
</View>
|
|
169
|
+
</View>
|
|
170
|
+
`;
|
package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/channel.test.js.snap
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`<Channel /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"height": 72,
|
|
8
8
|
"marginBottom": 30,
|
|
9
9
|
"width": 128,
|
|
@@ -13,12 +13,12 @@ exports[`<Channel /> renders correctly 1`] = `
|
|
|
13
13
|
<Image
|
|
14
14
|
fadeDuration={0}
|
|
15
15
|
source={
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
"uri": "https://example.com",
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
style={
|
|
21
|
-
|
|
21
|
+
{
|
|
22
22
|
"height": 72,
|
|
23
23
|
"width": 128,
|
|
24
24
|
}
|
package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`<Summary /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"height": 80,
|
|
8
8
|
"marginBottom": 30,
|
|
9
9
|
"width": 600,
|
|
@@ -13,13 +13,13 @@ exports[`<Summary /> renders correctly 1`] = `
|
|
|
13
13
|
<Text
|
|
14
14
|
numberOfLines={2}
|
|
15
15
|
style={
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
"color": "white",
|
|
18
18
|
"fontFamily": null,
|
|
19
19
|
"fontSize": 20,
|
|
20
20
|
"fontWeight": "600",
|
|
21
21
|
"opacity": 0.8,
|
|
22
|
-
"textAlign": "
|
|
22
|
+
"textAlign": "right",
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`<Title /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"height": 100,
|
|
8
8
|
"marginBottom": 12,
|
|
9
9
|
"width": 600,
|
|
@@ -13,12 +13,12 @@ exports[`<Title /> renders correctly 1`] = `
|
|
|
13
13
|
<Text
|
|
14
14
|
numberOfLines={2}
|
|
15
15
|
style={
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
"color": "white",
|
|
18
18
|
"fontFamily": null,
|
|
19
19
|
"fontSize": 38,
|
|
20
20
|
"fontWeight": "600",
|
|
21
|
-
"textAlign": "
|
|
21
|
+
"textAlign": "right",
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
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
|
-
|
|
19
|
+
const { toJSON } = render(<Artwork {...artWorkProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import { AudioPlayerTV } from "..";
|
|
5
|
+
|
|
6
|
+
jest.mock("@applicaster/zapp-react-native-utils/audioPlayerUtils", () => ({
|
|
7
|
+
useArtworkImage: jest.fn(() => "artwork_url"),
|
|
8
|
+
}));
|
|
6
9
|
|
|
7
10
|
const audioPlayerProps = {
|
|
8
11
|
audio_item: {
|
|
@@ -46,10 +49,9 @@ const audioPlayerProps = {
|
|
|
46
49
|
styles: {},
|
|
47
50
|
};
|
|
48
51
|
|
|
49
|
-
describe("<
|
|
50
|
-
const wrapper = shallow(<AudioPlayer {...audioPlayerProps} />);
|
|
51
|
-
|
|
52
|
+
describe("<AudioPlayerTV />", () => {
|
|
52
53
|
it("renders correctly", () => {
|
|
53
|
-
|
|
54
|
+
const { toJSON } = render(<AudioPlayerTV {...audioPlayerProps} />);
|
|
55
|
+
expect(toJSON()).toMatchSnapshot();
|
|
54
56
|
});
|
|
55
57
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
19
|
+
const { toJSON } = render(<Title {...titleProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -2,10 +2,8 @@ const defaults = {
|
|
|
2
2
|
audio_player_title_color: "white",
|
|
3
3
|
audio_player_summary_color: "white",
|
|
4
4
|
audio_player_background_color: "black",
|
|
5
|
-
|
|
5
|
+
audio_player_background_image: undefined,
|
|
6
6
|
audio_player_rtl: false,
|
|
7
|
-
magic_background: false,
|
|
8
|
-
audio_player_background_image_query: "",
|
|
9
7
|
};
|
|
10
8
|
|
|
11
9
|
export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
|
|
@@ -27,14 +25,14 @@ export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
|
|
|
27
25
|
const LTR = {
|
|
28
26
|
flexDirection: "row",
|
|
29
27
|
justifyContent: "flex-start",
|
|
30
|
-
textAlign: "
|
|
28
|
+
textAlign: "left",
|
|
31
29
|
alignItems: "flex-end",
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
const RTL = {
|
|
35
33
|
flexDirection: "row-reverse",
|
|
36
34
|
justifyContent: "flex-end",
|
|
37
|
-
textAlign: "
|
|
35
|
+
textAlign: "right",
|
|
38
36
|
alignItems: "flex-start",
|
|
39
37
|
};
|
|
40
38
|
|
|
@@ -1,62 +1,24 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
4
|
+
import { useArtworkImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { AudioPlayerTVLayout } from "./Layout";
|
|
6
7
|
|
|
7
|
-
import { AudioPlayerLayout } from "./AudioPlayerLayout";
|
|
8
8
|
import { Channel } from "./Channel";
|
|
9
9
|
import { Title } from "./Title";
|
|
10
10
|
import { Summary } from "./Summary";
|
|
11
11
|
import { Runtime } from "./Runtime";
|
|
12
12
|
import { getPropertyFromEntryOrConfig } from "./helpers";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
audio_player_artwork_aspect_ratio?: string;
|
|
19
|
-
audio_player_background_image?: string;
|
|
20
|
-
audio_player_background_color?: string;
|
|
21
|
-
audio_player_channel_icon?: string;
|
|
22
|
-
audio_player_title_color?: string;
|
|
23
|
-
audio_player_summary_color?: string;
|
|
24
|
-
audio_player_rtl?: boolean;
|
|
25
|
-
magic_background?: boolean;
|
|
26
|
-
audio_player_background_image_query?: string;
|
|
27
|
-
start_time?: string;
|
|
28
|
-
end_time?: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
plugin_configuration: {
|
|
32
|
-
audio_player_background_color?: string;
|
|
33
|
-
audio_player_title_color?: string;
|
|
34
|
-
audio_player_summary_color?: string;
|
|
35
|
-
audio_player_rtl?: string;
|
|
36
|
-
magic_background?: string;
|
|
37
|
-
audio_player_background_image_query?: string;
|
|
38
|
-
audio_player_background_image?: string;
|
|
39
|
-
audio_player_artwork_aspect_ratio?: string;
|
|
40
|
-
lg_tv_audio_player_title_font_family?: string;
|
|
41
|
-
lg_tv_audio_player_title_font_size?: number;
|
|
42
|
-
lg_tv_audio_player_summary_font_family?: string;
|
|
43
|
-
lg_tv_audio_player_summary_font_size?: number;
|
|
44
|
-
samsung_tv_audio_player_title_font_family?: string;
|
|
45
|
-
samsung_tv_audio_player_title_font_size?: number;
|
|
46
|
-
samsung_tv_audio_player_summary_font_family?: string;
|
|
47
|
-
samsung_tv_audio_player_summary_font_size?: number;
|
|
48
|
-
tv_os_audio_player_title_font_family?: string;
|
|
49
|
-
tv_os_audio_player_title_font_size?: number;
|
|
50
|
-
tv_os_audio_player_summary_font_family?: string;
|
|
51
|
-
tv_os_audio_player_summary_font_size?: number;
|
|
52
|
-
};
|
|
53
|
-
style?: ViewStyle;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export function AudioPlayer(props: Props) {
|
|
57
|
-
const { audio_item, plugin_configuration, style } = props;
|
|
13
|
+
|
|
14
|
+
import { Props } from "../types";
|
|
15
|
+
|
|
16
|
+
export function AudioPlayerTV(props: Props) {
|
|
17
|
+
const { audio_item, plugin_configuration, style = {} } = props;
|
|
58
18
|
const { extensions, title, summary } = audio_item;
|
|
59
19
|
|
|
20
|
+
const artwork = useArtworkImage(audio_item);
|
|
21
|
+
|
|
60
22
|
const getProp = useCallback(
|
|
61
23
|
getPropertyFromEntryOrConfig({
|
|
62
24
|
entry: audio_item,
|
|
@@ -66,19 +28,14 @@ export function AudioPlayer(props: Props) {
|
|
|
66
28
|
);
|
|
67
29
|
|
|
68
30
|
const config = useMemo(() => {
|
|
69
|
-
// Checking if we are
|
|
31
|
+
// Checking if we are receiving items from the DSP
|
|
70
32
|
const titleColor = getProp("audio_player_title_color");
|
|
71
33
|
const summaryColor = getProp("audio_player_summary_color");
|
|
72
34
|
const backgroundColor = getProp("audio_player_background_color");
|
|
73
35
|
const backgroundImage = getProp("audio_player_background_image");
|
|
74
|
-
const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
|
|
75
36
|
const channelIcon = getProp("audio_player_channel_icon");
|
|
76
37
|
const rtlFlag = getProp("audio_player_rtl");
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const audioPlayerBackgroundImageQuery = getProp(
|
|
80
|
-
"audio_player_background_image_query"
|
|
81
|
-
);
|
|
38
|
+
const artworkBorderRadius = getProp("audio_player_artwork_border_radius");
|
|
82
39
|
|
|
83
40
|
const isRTL = rtlFlag === "1" || rtlFlag === "true" || rtlFlag === true;
|
|
84
41
|
|
|
@@ -154,23 +111,17 @@ export function AudioPlayer(props: Props) {
|
|
|
154
111
|
summaryFontSize,
|
|
155
112
|
runTimeFontFamily,
|
|
156
113
|
runTimeFontSize,
|
|
157
|
-
artworkAspectRatio,
|
|
158
114
|
channelIcon,
|
|
159
|
-
|
|
160
|
-
audioPlayerBackgroundImageQuery,
|
|
115
|
+
artworkBorderRadius,
|
|
161
116
|
};
|
|
162
117
|
}, [getProp]);
|
|
163
118
|
|
|
164
|
-
const artwork = imageSrcFromMediaItem(audio_item, [
|
|
165
|
-
config?.artworkAspectRatio,
|
|
166
|
-
]);
|
|
167
|
-
|
|
168
119
|
return (
|
|
169
|
-
<
|
|
120
|
+
<AudioPlayerTVLayout artwork={artwork} config={config} style={style}>
|
|
170
121
|
<Channel srcImage={config?.channelIcon} config={config} />
|
|
171
122
|
<Title title={title} config={config} />
|
|
172
123
|
<Summary summary={summary} config={config} />
|
|
173
124
|
<Runtime {...extensions} config={config} />
|
|
174
|
-
</
|
|
125
|
+
</AudioPlayerTVLayout>
|
|
175
126
|
);
|
|
176
127
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
2
|
+
|
|
3
|
+
export type Props = {
|
|
4
|
+
audio_item: ZappEntry & {
|
|
5
|
+
extensions?: {
|
|
6
|
+
audio_player_artwork_aspect_ratio?: string;
|
|
7
|
+
audio_player_background_image?: string;
|
|
8
|
+
audio_player_background_color?: string;
|
|
9
|
+
audio_player_channel_icon?: string;
|
|
10
|
+
audio_player_title_color?: string;
|
|
11
|
+
audio_player_summary_color?: string;
|
|
12
|
+
audio_player_rtl?: boolean;
|
|
13
|
+
audio_player_background_image_default_color?: string;
|
|
14
|
+
start_time?: string;
|
|
15
|
+
end_time?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
plugin_configuration: {
|
|
19
|
+
audio_player_background_color?: string;
|
|
20
|
+
audio_player_title_color?: string;
|
|
21
|
+
audio_player_summary_color?: string;
|
|
22
|
+
audio_player_rtl?: string;
|
|
23
|
+
audio_player_background_image_default_color?: string;
|
|
24
|
+
audio_player_background_image?: string;
|
|
25
|
+
audio_player_artwork_aspect_ratio?: string;
|
|
26
|
+
lg_tv_audio_player_title_font_family?: string;
|
|
27
|
+
lg_tv_audio_player_title_font_size?: number;
|
|
28
|
+
lg_tv_audio_player_summary_font_family?: string;
|
|
29
|
+
lg_tv_audio_player_summary_font_size?: number;
|
|
30
|
+
samsung_tv_audio_player_title_font_family?: string;
|
|
31
|
+
samsung_tv_audio_player_title_font_size?: number;
|
|
32
|
+
samsung_tv_audio_player_summary_font_family?: string;
|
|
33
|
+
samsung_tv_audio_player_summary_font_size?: number;
|
|
34
|
+
tv_os_audio_player_title_font_family?: string;
|
|
35
|
+
tv_os_audio_player_title_font_size?: number;
|
|
36
|
+
tv_os_audio_player_summary_font_family?: string;
|
|
37
|
+
tv_os_audio_player_summary_font_size?: number;
|
|
38
|
+
};
|
|
39
|
+
style?: ViewStyle;
|
|
40
|
+
};
|