@applicaster/zapp-react-native-ui-components 13.0.0-rc.13 → 13.0.0-rc.130
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/AudioPlayer.tsx +5 -9
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +6 -7
- package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
- package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +56 -113
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +39 -23
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
- package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
- package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
- package/Components/AudioPlayer/__tests__/title.test.js +3 -5
- package/Components/AudioPlayer/helpers.tsx +1 -2
- 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 +49 -29
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +53 -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 +43 -3
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +121 -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 +66 -156
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
- package/Components/VideoModal/hooks/index.ts +7 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -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/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
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
2
|
-
import { PluginConfiguration } from "./
|
|
2
|
+
import { PluginConfiguration } from "./";
|
|
3
|
+
import { ItemIconProps } from "./Button/ItemIcon";
|
|
4
|
+
import { ItemLabelProps } from "./Button/ItemLabel";
|
|
5
|
+
import { ItemProps } from "./Button/Item";
|
|
3
6
|
|
|
4
7
|
export function defaultItemProps(
|
|
5
8
|
config: PluginConfiguration,
|
|
6
9
|
maxWidth: number
|
|
7
|
-
) {
|
|
10
|
+
): ItemProps {
|
|
8
11
|
const {
|
|
9
12
|
modal_bottom_sheet_item_background_color,
|
|
10
13
|
modal_bottom_sheet_item_focus_background_color,
|
|
11
14
|
modal_bottom_sheet_item_selected_background_color,
|
|
12
|
-
|
|
15
|
+
modal_bottom_sheet_item_focused_selected_background_color,
|
|
13
16
|
modal_bottom_sheet_item_corner_radius,
|
|
14
17
|
modal_bottom_sheet_item_margin_bottom,
|
|
15
18
|
modal_bottom_sheet_item_margin_left,
|
|
@@ -25,8 +28,8 @@ export function defaultItemProps(
|
|
|
25
28
|
backgroundColor: modal_bottom_sheet_item_background_color,
|
|
26
29
|
focusedBackgroundColor: modal_bottom_sheet_item_focus_background_color,
|
|
27
30
|
selectedBackgroundColor: modal_bottom_sheet_item_selected_background_color,
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
focusedSelectedBackgroundColor:
|
|
32
|
+
modal_bottom_sheet_item_focused_selected_background_color,
|
|
30
33
|
borderRadius: modal_bottom_sheet_item_corner_radius,
|
|
31
34
|
marginBottom: modal_bottom_sheet_item_margin_bottom,
|
|
32
35
|
marginTop: modal_bottom_sheet_item_margin_top,
|
|
@@ -43,7 +46,7 @@ export function defaultItemProps(
|
|
|
43
46
|
export function defaultItemLabelProps(
|
|
44
47
|
config: PluginConfiguration,
|
|
45
48
|
sheetWidth: number
|
|
46
|
-
) {
|
|
49
|
+
): ItemLabelProps {
|
|
47
50
|
const {
|
|
48
51
|
modal_bottom_sheet_item_label_android_letter_spacing,
|
|
49
52
|
modal_bottom_sheet_item_label_ios_letter_spacing,
|
|
@@ -103,7 +106,9 @@ export function defaultItemLabelProps(
|
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
export function defaultItemIconProps(
|
|
109
|
+
export function defaultItemIconProps(
|
|
110
|
+
config: PluginConfiguration
|
|
111
|
+
): ItemIconProps {
|
|
107
112
|
const {
|
|
108
113
|
modal_bottom_sheet_item_icon_height,
|
|
109
114
|
modal_bottom_sheet_item_icon_width,
|
|
@@ -124,3 +129,46 @@ export function defaultItemIconProps(config: PluginConfiguration) {
|
|
|
124
129
|
marginRight: modal_bottom_sheet_item_icon_margin_right,
|
|
125
130
|
};
|
|
126
131
|
}
|
|
132
|
+
|
|
133
|
+
export function getItemIconProps(
|
|
134
|
+
theme: PluginConfiguration,
|
|
135
|
+
iconProps?: ((theme: PluginConfiguration) => ItemIconProps) | ItemIconProps
|
|
136
|
+
) {
|
|
137
|
+
if (iconProps) {
|
|
138
|
+
return typeof iconProps === "function" ? iconProps(theme) : iconProps;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return defaultItemIconProps(theme);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function getItemLabelProps(
|
|
145
|
+
theme: PluginConfiguration,
|
|
146
|
+
width: number,
|
|
147
|
+
labelProps?:
|
|
148
|
+
| ((theme: PluginConfiguration, width: number) => ItemLabelProps)
|
|
149
|
+
| ItemLabelProps
|
|
150
|
+
) {
|
|
151
|
+
if (labelProps) {
|
|
152
|
+
return typeof labelProps === "function"
|
|
153
|
+
? labelProps(theme, width)
|
|
154
|
+
: labelProps;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return defaultItemLabelProps(theme, width);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function getItemProps(
|
|
161
|
+
theme: PluginConfiguration,
|
|
162
|
+
width: number,
|
|
163
|
+
itemProps?:
|
|
164
|
+
| ((theme: PluginConfiguration, width: number) => ItemProps)
|
|
165
|
+
| ItemProps
|
|
166
|
+
) {
|
|
167
|
+
if (itemProps) {
|
|
168
|
+
return typeof itemProps === "function"
|
|
169
|
+
? itemProps(theme, width)
|
|
170
|
+
: itemProps;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return defaultItemProps(theme, width);
|
|
174
|
+
}
|
|
@@ -90,7 +90,7 @@ export const NotificationView = (props: Props) => {
|
|
|
90
90
|
return (
|
|
91
91
|
<div onClick={onClose}>
|
|
92
92
|
{children}
|
|
93
|
-
{open
|
|
93
|
+
{open ? (
|
|
94
94
|
<div style={styles.body}>
|
|
95
95
|
<div style={styles.title}>
|
|
96
96
|
<h2>{MSG}</h2>
|
|
@@ -98,7 +98,7 @@ export const NotificationView = (props: Props) => {
|
|
|
98
98
|
|
|
99
99
|
<h4 style={styles.subtitle}>{EXTRA_MSG}</h4>
|
|
100
100
|
</div>
|
|
101
|
-
)}
|
|
101
|
+
) : null}
|
|
102
102
|
</div>
|
|
103
103
|
);
|
|
104
104
|
};
|
|
@@ -85,7 +85,7 @@ export const NotificationView = (props: Props) => {
|
|
|
85
85
|
return (
|
|
86
86
|
<div onClick={onClose}>
|
|
87
87
|
{children}
|
|
88
|
-
{shown
|
|
88
|
+
{shown ? (
|
|
89
89
|
<div style={styles.body}>
|
|
90
90
|
<div style={styles.title}>
|
|
91
91
|
<h2>{title}</h2>
|
|
@@ -93,7 +93,7 @@ export const NotificationView = (props: Props) => {
|
|
|
93
93
|
|
|
94
94
|
<h4 style={styles.subtitle}>{subtitle}</h4>
|
|
95
95
|
</div>
|
|
96
|
-
)}
|
|
96
|
+
) : null}
|
|
97
97
|
</div>
|
|
98
98
|
);
|
|
99
99
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text, Animated } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { shallow } from "enzyme";
|
|
5
4
|
import renderer from "react-test-renderer";
|
|
6
5
|
|
|
7
6
|
jest.useFakeTimers();
|
|
@@ -40,10 +39,6 @@ const {
|
|
|
40
39
|
} = require("../NotificationView");
|
|
41
40
|
|
|
42
41
|
describe("NotificationView", () => {
|
|
43
|
-
it("renders", () => {
|
|
44
|
-
shallow(<NotificationView dismiss={dismiss} />);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
42
|
it("Show online message when Online", () => {
|
|
48
43
|
const component = renderer.create(
|
|
49
44
|
<NotificationView online dismiss={dismiss} />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OfflineHandler renders 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"flex": 1,
|
|
8
8
|
"position": "relative",
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
11
11
|
>
|
|
12
12
|
<View
|
|
13
13
|
style={
|
|
14
|
-
|
|
14
|
+
{
|
|
15
15
|
"bottom": 0,
|
|
16
16
|
"left": 0,
|
|
17
17
|
"position": "absolute",
|
|
@@ -32,7 +32,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
32
32
|
onResponderTerminationRequest={[Function]}
|
|
33
33
|
onStartShouldSetResponder={[Function]}
|
|
34
34
|
style={
|
|
35
|
-
|
|
35
|
+
{
|
|
36
36
|
"alignItems": "center",
|
|
37
37
|
"backgroundColor": undefined,
|
|
38
38
|
"flex": 1,
|
|
@@ -43,8 +43,8 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
43
43
|
"position": "absolute",
|
|
44
44
|
"right": 0,
|
|
45
45
|
"top": 0,
|
|
46
|
-
"transform":
|
|
47
|
-
|
|
46
|
+
"transform": [
|
|
47
|
+
{
|
|
48
48
|
"translateY": -88,
|
|
49
49
|
},
|
|
50
50
|
],
|
|
@@ -54,7 +54,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
54
54
|
>
|
|
55
55
|
<View
|
|
56
56
|
style={
|
|
57
|
-
|
|
57
|
+
{
|
|
58
58
|
"backgroundColor": undefined,
|
|
59
59
|
"height": 44,
|
|
60
60
|
}
|
|
@@ -62,7 +62,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
62
62
|
/>
|
|
63
63
|
<Text
|
|
64
64
|
style={
|
|
65
|
-
|
|
65
|
+
{
|
|
66
66
|
"color": undefined,
|
|
67
67
|
"fontFamily": undefined,
|
|
68
68
|
"fontSize": undefined,
|
|
@@ -2,43 +2,46 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import renderer, { act } from "react-test-renderer";
|
|
4
4
|
|
|
5
|
-
jest.useFakeTimers();
|
|
5
|
+
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
6
6
|
|
|
7
|
-
let
|
|
8
|
-
const
|
|
7
|
+
let mockConnectionStatus = false;
|
|
8
|
+
const mockPreviousValue = null;
|
|
9
9
|
|
|
10
10
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/connection", () => {
|
|
11
11
|
return {
|
|
12
|
-
useConnectionInfo: jest.fn(() =>
|
|
12
|
+
useConnectionInfo: jest.fn(() => mockConnectionStatus),
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/utils", () => {
|
|
17
17
|
return {
|
|
18
|
-
usePrevious: jest.fn(() =>
|
|
18
|
+
usePrevious: jest.fn(() => mockPreviousValue),
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
jest.mock(
|
|
23
|
-
usePickFromState
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
jest.mock(
|
|
23
|
+
"@applicaster/zapp-react-native-redux/hooks/usePickFromState",
|
|
24
|
+
() => ({
|
|
25
|
+
usePickFromState: () => ({
|
|
26
|
+
plugins: [
|
|
27
|
+
{
|
|
28
|
+
name: "offline experience",
|
|
29
|
+
identifier: "offline-experience",
|
|
30
|
+
type: "general",
|
|
31
|
+
module: {
|
|
32
|
+
useOfflineExperienceConfiguration: () => ({
|
|
33
|
+
configurationFields: {},
|
|
34
|
+
localizations: {
|
|
35
|
+
offline_toast_message: "No internet connection",
|
|
36
|
+
online_toast_message: "You are back online",
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
37
40
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
|
|
41
|
+
],
|
|
42
|
+
}),
|
|
43
|
+
})
|
|
44
|
+
);
|
|
42
45
|
|
|
43
46
|
jest.mock("react-native-safe-area-context", () => ({
|
|
44
47
|
useSafeAreaInsets: () => ({ top: 44 }),
|
|
@@ -53,7 +56,7 @@ describe("OfflineHandler", () => {
|
|
|
53
56
|
});
|
|
54
57
|
|
|
55
58
|
it("renders Notification mode if component was rendered while online", () => {
|
|
56
|
-
|
|
59
|
+
mockConnectionStatus = true;
|
|
57
60
|
|
|
58
61
|
let instance;
|
|
59
62
|
|
|
@@ -57,7 +57,7 @@ export const useNotificationHeight = () => {
|
|
|
57
57
|
|
|
58
58
|
const navBarHeight = platformSelect({ ios: 44, android: 56 });
|
|
59
59
|
|
|
60
|
-
const statusHeight =
|
|
60
|
+
const statusHeight = insets.top;
|
|
61
61
|
const notificationHeight = statusHeight + navBarHeight;
|
|
62
62
|
|
|
63
63
|
return { statusHeight, notificationHeight };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { useEffect, useReducer } from "react";
|
|
2
3
|
// @ts-ignore
|
|
3
|
-
import { View, ViewStyle
|
|
4
|
+
import { TVMenuControl, View, ViewStyle } from "react-native";
|
|
4
5
|
import * as R from "ramda";
|
|
5
6
|
import uuid from "uuid/v4";
|
|
6
7
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
7
8
|
import {
|
|
8
9
|
isApplePlatform,
|
|
9
|
-
platformSelect,
|
|
10
10
|
isTV,
|
|
11
|
+
platformSelect,
|
|
12
|
+
isAndroidTVPlatform,
|
|
11
13
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
14
|
+
import { isAudioItem } from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
12
15
|
|
|
13
16
|
import { TVEventHandlerComponent } from "@applicaster/zapp-react-native-tvos-ui-components/Components/TVEventHandlerComponent";
|
|
14
|
-
import { useEffect, useReducer } from "react";
|
|
15
17
|
import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
16
18
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
17
19
|
import {
|
|
@@ -29,16 +31,14 @@ import {
|
|
|
29
31
|
import { ProgramInfo } from "./ProgramInfo";
|
|
30
32
|
import { AudioPlayer } from "../AudioPlayer";
|
|
31
33
|
import {
|
|
32
|
-
playerContainerLogger,
|
|
33
34
|
log_debug,
|
|
34
35
|
log_info,
|
|
35
36
|
log_warning,
|
|
37
|
+
playerContainerLogger,
|
|
36
38
|
} from "./logger";
|
|
37
39
|
import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
useTargetScreenData,
|
|
41
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
40
|
+
import { useSetNavbarState } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
41
|
+
import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
42
42
|
import {
|
|
43
43
|
PlayerContainerContext,
|
|
44
44
|
PlayerContainerContextProvider,
|
|
@@ -55,8 +55,8 @@ import { usePlayNextOverlay } from "@applicaster/zapp-react-native-utils/appUtil
|
|
|
55
55
|
import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
|
|
56
56
|
|
|
57
57
|
import {
|
|
58
|
-
useModalAnimationContext,
|
|
59
58
|
PlayerAnimationStateEnum,
|
|
59
|
+
useModalAnimationContext,
|
|
60
60
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
61
61
|
|
|
62
62
|
type Props = {
|
|
@@ -95,6 +95,20 @@ export type PlayNextData = {
|
|
|
95
95
|
|
|
96
96
|
const focusableBottomContainerId = "player-container-bottom";
|
|
97
97
|
|
|
98
|
+
const isAndroidTV = isAndroidTVPlatform();
|
|
99
|
+
|
|
100
|
+
const withBorderHack = () => {
|
|
101
|
+
if (isAndroidTV) {
|
|
102
|
+
/* @HACK: see GH#7269 */
|
|
103
|
+
return {
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
borderColor: "transparent",
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {};
|
|
110
|
+
};
|
|
111
|
+
|
|
98
112
|
// Styles
|
|
99
113
|
const webStyles = {
|
|
100
114
|
focusableGroup: {
|
|
@@ -337,9 +351,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
337
351
|
|
|
338
352
|
const resumeTime = Number(item?.extensions?.resumeTime);
|
|
339
353
|
|
|
340
|
-
//
|
|
354
|
+
// Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
|
|
341
355
|
if (
|
|
342
|
-
|
|
356
|
+
!playerManager.getActivePlayer()?.hasResumePosition() &&
|
|
343
357
|
!isNaN(resumeTime)
|
|
344
358
|
) {
|
|
345
359
|
player?.seekTo(resumeTime);
|
|
@@ -382,7 +396,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
382
396
|
}
|
|
383
397
|
};
|
|
384
398
|
|
|
385
|
-
const playerRemoteHandler = (
|
|
399
|
+
const playerRemoteHandler = (event, isLanguageOverlayVisible) => {
|
|
386
400
|
const { eventType } = event;
|
|
387
401
|
|
|
388
402
|
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
@@ -480,9 +494,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
480
494
|
// TODO: Skip hook call on TV platform
|
|
481
495
|
useBackHandler(backHandler);
|
|
482
496
|
|
|
483
|
-
const isAudioContent =
|
|
484
|
-
typeof item?.content?.type === "string" &&
|
|
485
|
-
item?.content?.type.includes("audio");
|
|
497
|
+
const isAudioContent = isAudioItem(item);
|
|
486
498
|
|
|
487
499
|
useEffect(() => {
|
|
488
500
|
if (!isAudioContent) {
|
|
@@ -516,6 +528,12 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
516
528
|
useEffect(() => {
|
|
517
529
|
playerEvent("source_changed", { item });
|
|
518
530
|
|
|
531
|
+
return () => {
|
|
532
|
+
playerEvent("player_did_close", { item });
|
|
533
|
+
};
|
|
534
|
+
}, [item?.id, Player]);
|
|
535
|
+
|
|
536
|
+
useEffect(() => {
|
|
519
537
|
if (!isModal) {
|
|
520
538
|
showNavBar(false);
|
|
521
539
|
}
|
|
@@ -525,13 +543,11 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
525
543
|
}
|
|
526
544
|
|
|
527
545
|
return () => {
|
|
528
|
-
playerEvent("player_did_close", { item });
|
|
529
|
-
|
|
530
546
|
if (!isModal) {
|
|
531
547
|
showNavBar(true);
|
|
532
548
|
}
|
|
533
549
|
};
|
|
534
|
-
}, [showNavBar,
|
|
550
|
+
}, [showNavBar, isModal, Player]);
|
|
535
551
|
|
|
536
552
|
useEffect(() => {
|
|
537
553
|
if (prevItemId && !R.equals(prevItemId, item?.id)) {
|
|
@@ -580,7 +596,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
580
596
|
);
|
|
581
597
|
}
|
|
582
598
|
|
|
583
|
-
if (screen_background_color) {
|
|
599
|
+
if (screen_background_color && mode !== VideoModalMode.FULLSCREEN) {
|
|
584
600
|
updatedStyles.playerScreen.backgroundColor = screen_background_color;
|
|
585
601
|
}
|
|
586
602
|
|
|
@@ -598,6 +614,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
598
614
|
tv_component_container_height,
|
|
599
615
|
screen_background_color,
|
|
600
616
|
isInlineTV,
|
|
617
|
+
mode,
|
|
601
618
|
]);
|
|
602
619
|
|
|
603
620
|
const applePlayerProps = {
|
|
@@ -625,12 +642,8 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
625
642
|
<PlayerContainerContext.Consumer>
|
|
626
643
|
{(context) => (
|
|
627
644
|
<TVEventHandlerComponent
|
|
628
|
-
tvEventHandler={(
|
|
629
|
-
playerRemoteHandler(
|
|
630
|
-
component,
|
|
631
|
-
event,
|
|
632
|
-
context.isLanguageOverlayVisible
|
|
633
|
-
)
|
|
645
|
+
tvEventHandler={(_component, event) =>
|
|
646
|
+
playerRemoteHandler(event, context.isLanguageOverlayVisible)
|
|
634
647
|
}
|
|
635
648
|
>
|
|
636
649
|
<FocusableGroup
|
|
@@ -646,7 +659,14 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
646
659
|
testID={"player-screen-container"}
|
|
647
660
|
>
|
|
648
661
|
{/* Player container */}
|
|
649
|
-
<View
|
|
662
|
+
<View
|
|
663
|
+
style={[
|
|
664
|
+
styles.playerWrapper,
|
|
665
|
+
// eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
|
|
666
|
+
withBorderHack(),
|
|
667
|
+
]}
|
|
668
|
+
testID={"player-wrapper"}
|
|
669
|
+
>
|
|
650
670
|
<PlayerFocusableWrapperView
|
|
651
671
|
nextFocusDown={context.bottomFocusableId}
|
|
652
672
|
>
|
|
@@ -689,10 +709,10 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
689
709
|
|
|
690
710
|
{renderRestPlayers(restPlayerProps)}
|
|
691
711
|
|
|
692
|
-
{state.error
|
|
712
|
+
{state.error ? <ErrorDisplay error={state.error} /> : null}
|
|
693
713
|
</View>
|
|
694
714
|
{/* Components container */}
|
|
695
|
-
{isInlineTV && context.showComponentsContainer
|
|
715
|
+
{isInlineTV && context.showComponentsContainer ? (
|
|
696
716
|
<View
|
|
697
717
|
style={styles.inlineRiver}
|
|
698
718
|
testID={"inline-river-component-wrapper"}
|
|
@@ -723,7 +743,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
723
743
|
)}
|
|
724
744
|
</ComponentFocusableWrapperView>
|
|
725
745
|
</View>
|
|
726
|
-
)}
|
|
746
|
+
) : null}
|
|
727
747
|
</View>
|
|
728
748
|
</FocusableGroup>
|
|
729
749
|
</TVEventHandlerComponent>
|
|
@@ -9,11 +9,14 @@ type ContextProps = {
|
|
|
9
9
|
setIsLanguageOverlayVisible: (isVisible) => void;
|
|
10
10
|
setShowComponentsContainer: (isVisible) => void;
|
|
11
11
|
showComponentsContainer: boolean;
|
|
12
|
+
setIsSeekBarTouch: (isTouch) => void;
|
|
13
|
+
isSeekBarTouch: boolean;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export const PlayerContainerContext = createContext({
|
|
15
17
|
ignoreOffsetContainer: false,
|
|
16
18
|
isLanguageOverlayVisible: false,
|
|
19
|
+
isSeekBarTouch: false,
|
|
17
20
|
} as ContextProps);
|
|
18
21
|
|
|
19
22
|
type Props = {
|
|
@@ -40,6 +43,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
40
43
|
const [showComponentsContainer, setShowComponentsContainer] =
|
|
41
44
|
React.useState(true);
|
|
42
45
|
|
|
46
|
+
const [isSeekBarTouch, setIsSeekBarTouch] = React.useState(false);
|
|
47
|
+
|
|
43
48
|
const value = React.useMemo(
|
|
44
49
|
() => ({
|
|
45
50
|
ignoreOffsetContainer,
|
|
@@ -49,6 +54,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
49
54
|
setIsLanguageOverlayVisible,
|
|
50
55
|
showComponentsContainer,
|
|
51
56
|
setShowComponentsContainer: inline ? setShowComponentsContainer : null,
|
|
57
|
+
isSeekBarTouch,
|
|
58
|
+
setIsSeekBarTouch,
|
|
52
59
|
}),
|
|
53
60
|
[
|
|
54
61
|
ignoreOffsetContainer,
|
|
@@ -58,6 +65,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
58
65
|
setIsLanguageOverlayVisible,
|
|
59
66
|
showComponentsContainer,
|
|
60
67
|
setShowComponentsContainer,
|
|
68
|
+
isSeekBarTouch,
|
|
69
|
+
setIsSeekBarTouch,
|
|
61
70
|
]
|
|
62
71
|
);
|
|
63
72
|
|
|
@@ -114,12 +114,12 @@ function ProgramInfoComponent({
|
|
|
114
114
|
return (
|
|
115
115
|
<View style={container}>
|
|
116
116
|
<View style={programStyles.programInfo.container}>
|
|
117
|
-
{logo
|
|
117
|
+
{logo ? (
|
|
118
118
|
<Image
|
|
119
119
|
source={{ uri: logo }}
|
|
120
120
|
style={programStyles.programInfo.logo}
|
|
121
121
|
/>
|
|
122
|
-
)}
|
|
122
|
+
) : null}
|
|
123
123
|
{!isAudioContent && transportInfo}
|
|
124
124
|
</View>
|
|
125
125
|
</View>
|