@applicaster/zapp-react-native-ui-components 12.0.0-rc.11 → 12.0.0-rc.111
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/AudioPlayer.tsx +9 -1
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +5 -0
- package/Components/AudioPlayer/helpers.tsx +1 -0
- package/Components/BaseFocusable/index.tsx +3 -3
- package/Components/Cell/Cell.tsx +32 -11
- package/Components/Cell/CellWithFocusable.tsx +40 -19
- package/Components/Cell/TvOSCellComponent.tsx +5 -9
- package/Components/ErrorScreen/index.tsx +1 -1
- package/Components/Focusable/Focusable.tsx +6 -1
- package/Components/FocusableCell/index.tsx +7 -7
- package/Components/FocusableGroup/index.tsx +11 -2
- package/Components/FocusableList/FocusableChild.ts +24 -14
- package/Components/FocusableList/FocusableItem.tsx +1 -1
- package/Components/FocusableList/FocusableListItemWrapper.tsx +76 -0
- package/Components/FocusableList/hooks/useCellState.android.ts +3 -1
- package/Components/FocusableList/index.tsx +26 -25
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +11 -8
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +13 -6
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +1 -1
- package/Components/HandlePlayable/HandlePlayable.tsx +4 -1
- package/Components/HookRenderer/index.tsx +1 -6
- package/Components/Image/Image.android.tsx +3 -26
- package/Components/Image/Image.tsx +18 -2
- package/Components/Image/utils/index.ts +39 -0
- package/Components/Layout/TV/ScreenContainer.tsx +79 -5
- package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +2 -2
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +38 -28
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +25 -13
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +10 -50
- package/Components/Layout/TV/__tests__/index.test.tsx +20 -108
- package/Components/Layout/TV/index.tsx +15 -84
- package/Components/Layout/TV/index.web.tsx +33 -0
- package/Components/Layout/index.tsx +15 -11
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +86 -117
- package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +21 -8
- package/Components/MasterCell/DefaultComponents/DynamicBadge.tsx +4 -2
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +9 -26
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +5 -3
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImageSize.ts +65 -0
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/index.ts +57 -0
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +5 -1
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +37 -2
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +3 -2
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +14 -2
- package/Components/MasterCell/DefaultComponents/Toggle.tsx +5 -1
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +24 -9
- package/Components/MasterCell/DefaultComponents/index.ts +2 -0
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/index.android.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/index.tsx +10 -2
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +6 -10
- package/Components/MasterCell/dataAdapter.ts +21 -7
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +1 -1
- package/Components/MasterCell/index.tsx +5 -3
- package/Components/MasterCell/utils/__tests__/insertBetween.test.js +9 -0
- package/Components/MasterCell/utils/index.ts +33 -35
- package/Components/MeasurmentsPortal/BasicMeasurementsPortal.tsx +11 -7
- package/Components/MeasurmentsPortal/MeasurementsPortal.tsx +10 -1
- package/Components/ModalComponent/BottomSheetModalContent.tsx +121 -0
- package/Components/ModalComponent/Button/Item.tsx +82 -0
- package/Components/ModalComponent/Button/ItemIcon.tsx +60 -0
- package/Components/ModalComponent/Button/ItemLabel.tsx +101 -0
- package/Components/ModalComponent/Button/assets.ts +4 -0
- package/Components/ModalComponent/Button/index.tsx +111 -0
- package/Components/ModalComponent/Header/CloseButton.tsx +59 -0
- package/Components/ModalComponent/Header/Title.tsx +70 -0
- package/Components/ModalComponent/Header/assets.ts +4 -0
- package/Components/ModalComponent/Header/index.tsx +71 -0
- package/Components/ModalComponent/Header/utils.ts +79 -0
- package/Components/ModalComponent/index.tsx +38 -0
- package/Components/ModalComponent/utils.ts +126 -0
- package/Components/Navigator/StackNavigator.tsx +57 -0
- package/Components/Navigator/index.ts +1 -0
- package/Components/PlayerContainer/PlayerContainer.tsx +66 -31
- package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -1
- package/Components/PlayerImageBackground/index.tsx +34 -8
- package/Components/River/ComponentsMap/ComponentsMap.tsx +97 -2
- package/Components/River/RefreshControl.tsx +55 -1
- package/Components/River/River.tsx +8 -5
- package/Components/River/TV/River.tsx +2 -25
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +1 -1
- package/Components/River/__tests__/componentsMap.test.js +7 -0
- package/Components/River/useScreenConfiguration.ts +2 -2
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -0
- package/Components/RouteManager/__tests__/routeManager.test.js +9 -2
- package/Components/RouteManager/index.tsx +4 -2
- package/Components/Screen/TV/hooks/index.ts +3 -0
- package/Components/Screen/TV/hooks/useInitialFocus.ts +70 -0
- package/Components/Screen/TV/hooks/useRestoreFocus.ts +22 -0
- package/Components/Screen/TV/index.web.tsx +165 -0
- package/Components/Screen/__tests__/Screen.test.tsx +91 -74
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +24 -6
- package/Components/Screen/__tests__/navigationHandler.test.ts +1 -178
- package/Components/Screen/index.tsx +110 -54
- package/Components/Screen/navigationHandler.ts +5 -82
- package/Components/ScreenResolver/index.tsx +10 -13
- package/Components/Tabs/TV/styles.ts +1 -1
- package/Components/TrackedView/index.tsx +6 -3
- package/Components/Transitioner/Scene.tsx +32 -26
- package/Components/Transitioner/Transitioner.tsx +38 -43
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +12 -4
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +1 -0
- package/Components/VideoLive/LiveImageManager.ts +70 -14
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +132 -95
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +45 -3
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +21 -29
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +66 -0
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +360 -0
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +165 -0
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +456 -0
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +182 -0
- package/Components/VideoModal/ModalAnimation/index.ts +15 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +302 -0
- package/Components/VideoModal/PlayerDetails.tsx +6 -3
- package/Components/VideoModal/PlayerWrapper.tsx +81 -49
- package/Components/VideoModal/VideoModal.tsx +23 -40
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +0 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +12 -1
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +312 -166
- package/Components/VideoModal/hooks/useModalSize.ts +10 -12
- package/Components/VideoModal/utils.ts +8 -5
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +26 -21
- package/Components/Viewport/ViewportTracker/ViewportTracker.tsx +31 -40
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +4 -5
- package/Components/Viewport/ViewportTracker/index.tsx +1 -0
- package/Components/Viewport/utils.js +1 -1
- package/Components/ZappUIComponent/index.tsx +22 -12
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +4 -4
- package/Components/index.js +2 -0
- package/Contexts/FocusableGroupContext/FocusableGroupContext.ts +3 -0
- package/Contexts/FocusableGroupContext/FocusableGroupContextProvider.tsx +16 -0
- package/Contexts/FocusableGroupContext/__tests__/FocusableGroupContextProvider.test.tsx +22 -0
- package/Contexts/FocusableGroupContext/__tests__/withFocusableContext.test.tsx +26 -0
- package/Contexts/FocusableGroupContext/index.ts +7 -0
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +17 -0
- package/Contexts/MenuToggleContext/{index.js → index.ts} +16 -0
- package/Contexts/ScreenContext/__tests__/__snapshots__/index.test.tsx.snap +3 -0
- package/Contexts/ScreenContext/__tests__/index.test.tsx +27 -0
- package/Contexts/ScreenContext/index.tsx +95 -29
- package/Contexts/ScreenDataContext/index.tsx +20 -0
- package/Contexts/ZappPipesContext/ZappPipesEntryContext.ts +1 -1
- package/Decorators/ComponentsMapWrapper/withComponentsMapProvider.tsx +7 -2
- package/Decorators/RiverResolver/index.tsx +0 -4
- package/Decorators/index.tsx +0 -4
- package/events/index.ts +1 -0
- package/package.json +5 -6
- package/Components/Layout/TV/TransitionOverlay.tsx +0 -64
- package/Components/VideoModal/hooks/usePosition.ts +0 -50
- /package/Components/FocusableGroup/{index.android.js → index.android.ts} +0 -0
- /package/Components/FocusableGroup/{index.ios.js → index.ios.ts} +0 -0
- /package/Contexts/{index.js → index.ts} +0 -0
|
@@ -21,8 +21,17 @@ const useIsTablet = jest.fn();
|
|
|
21
21
|
|
|
22
22
|
jest.mock("react-native");
|
|
23
23
|
|
|
24
|
+
jest.mock("react-native-gesture-handler");
|
|
25
|
+
|
|
24
26
|
jest.mock("../PlayerDetails", () => ({ PlayerDetails: View }));
|
|
25
27
|
|
|
28
|
+
jest.mock(
|
|
29
|
+
"@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext",
|
|
30
|
+
() => ({
|
|
31
|
+
useScreenContext: jest.fn().mockReturnValue({ screen: {}, entry: {} }),
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
|
|
26
35
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/device", () => ({
|
|
27
36
|
useIsTablet,
|
|
28
37
|
}));
|
|
@@ -38,6 +47,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactUtils", () => ({
|
|
|
38
47
|
}));
|
|
39
48
|
|
|
40
49
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
50
|
+
isNavBarVisible: jest.fn(() => true),
|
|
41
51
|
useRoute: jest.fn(() => ({
|
|
42
52
|
pathname: "/river/testId",
|
|
43
53
|
})),
|
|
@@ -45,6 +55,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
|
45
55
|
canGoBack: () => false,
|
|
46
56
|
currentRoute: "/river/testId",
|
|
47
57
|
data: { screen: { id: "testId" } },
|
|
58
|
+
videoModalState: { visible: false },
|
|
48
59
|
})),
|
|
49
60
|
}));
|
|
50
61
|
|
|
@@ -94,7 +105,7 @@ describe("PlayerWrapper", () => {
|
|
|
94
105
|
useIsTablet.mockReturnValue(false);
|
|
95
106
|
|
|
96
107
|
const children = jest.fn(() => {});
|
|
97
|
-
const dimensions = { height:
|
|
108
|
+
const dimensions = { height: undefined, width: props.style.width };
|
|
98
109
|
|
|
99
110
|
const element = renderWithProviders(
|
|
100
111
|
<PlayerWrapper
|
|
@@ -1,249 +1,395 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`PlayerWrapper renders inline 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
Object {
|
|
7
|
-
"bottom": "off",
|
|
8
|
-
"left": "off",
|
|
9
|
-
"right": "off",
|
|
10
|
-
"top": "additive",
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
<RNCSafeAreaProvider
|
|
5
|
+
onInsetsChange={[Function]}
|
|
13
6
|
style={
|
|
14
7
|
Array [
|
|
15
8
|
Object {
|
|
16
|
-
"
|
|
17
|
-
},
|
|
18
|
-
Object {
|
|
19
|
-
"backgroundColor": "transparent",
|
|
20
|
-
},
|
|
21
|
-
Object {
|
|
22
|
-
"height": 800,
|
|
23
|
-
"width": 300,
|
|
9
|
+
"flex": 1,
|
|
24
10
|
},
|
|
25
|
-
|
|
11
|
+
undefined,
|
|
26
12
|
]
|
|
27
13
|
}
|
|
28
14
|
>
|
|
29
|
-
<
|
|
15
|
+
<RNCSafeAreaView
|
|
16
|
+
edges={
|
|
17
|
+
Object {
|
|
18
|
+
"bottom": "off",
|
|
19
|
+
"left": "off",
|
|
20
|
+
"right": "off",
|
|
21
|
+
"top": "additive",
|
|
22
|
+
}
|
|
23
|
+
}
|
|
30
24
|
style={
|
|
31
25
|
Array [
|
|
32
26
|
Object {
|
|
33
|
-
"
|
|
34
|
-
"position": "relative",
|
|
35
|
-
"zIndex": 200,
|
|
27
|
+
"backgroundColor": "transparent",
|
|
36
28
|
},
|
|
37
29
|
Object {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"width": "100%",
|
|
30
|
+
"height": 800,
|
|
31
|
+
"width": 300,
|
|
41
32
|
},
|
|
42
33
|
Object {},
|
|
43
|
-
Object {},
|
|
44
34
|
]
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"tablet_landscape_sidebar_width": "35%",
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
entry={
|
|
56
|
-
Object {
|
|
57
|
-
"id": "test",
|
|
36
|
+
>
|
|
37
|
+
<View
|
|
38
|
+
additionalData={
|
|
39
|
+
Object {
|
|
40
|
+
"saveArea": true,
|
|
41
|
+
}
|
|
58
42
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
animationType="moveUpComponent"
|
|
44
|
+
style={
|
|
45
|
+
Array [
|
|
46
|
+
Object {
|
|
47
|
+
"flexDirection": "column",
|
|
48
|
+
},
|
|
49
|
+
Object {
|
|
50
|
+
"flex": 1,
|
|
51
|
+
},
|
|
52
|
+
]
|
|
65
53
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
>
|
|
55
|
+
<View
|
|
56
|
+
style={
|
|
57
|
+
Array [
|
|
58
|
+
Object {
|
|
59
|
+
"alignSelf": "center",
|
|
60
|
+
"position": "relative",
|
|
61
|
+
"zIndex": 200,
|
|
62
|
+
},
|
|
63
|
+
Object {
|
|
64
|
+
"aspectRatio": 1.7777777777777777,
|
|
65
|
+
"height": undefined,
|
|
66
|
+
"width": "100%",
|
|
67
|
+
},
|
|
68
|
+
Object {},
|
|
69
|
+
Object {},
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
testID="test-player-container"
|
|
73
|
+
/>
|
|
74
|
+
<View
|
|
75
|
+
animationType="componentFade"
|
|
76
|
+
style={
|
|
77
|
+
Object {
|
|
78
|
+
"flex": 1,
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
configuration={
|
|
84
|
+
Object {
|
|
85
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
86
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
entry={
|
|
90
|
+
Object {
|
|
91
|
+
"id": "test",
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
isTabletLandscape={false}
|
|
95
|
+
style={
|
|
96
|
+
Object {
|
|
97
|
+
"flex": 1,
|
|
98
|
+
"paddingTop": 20,
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
</View>
|
|
104
|
+
</RNCSafeAreaView>
|
|
105
|
+
</RNCSafeAreaProvider>
|
|
69
106
|
`;
|
|
70
107
|
|
|
71
108
|
exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
Object {
|
|
75
|
-
"bottom": "additive",
|
|
76
|
-
"left": "off",
|
|
77
|
-
"right": "off",
|
|
78
|
-
"top": "off",
|
|
79
|
-
}
|
|
80
|
-
}
|
|
109
|
+
<RNCSafeAreaProvider
|
|
110
|
+
onInsetsChange={[Function]}
|
|
81
111
|
style={
|
|
82
112
|
Array [
|
|
83
113
|
Object {
|
|
84
|
-
"
|
|
85
|
-
},
|
|
86
|
-
Object {
|
|
87
|
-
"backgroundColor": "transparent",
|
|
88
|
-
},
|
|
89
|
-
Object {
|
|
90
|
-
"height": 50,
|
|
91
|
-
"width": 300,
|
|
114
|
+
"flex": 1,
|
|
92
115
|
},
|
|
93
|
-
|
|
116
|
+
undefined,
|
|
94
117
|
]
|
|
95
118
|
}
|
|
96
119
|
>
|
|
97
|
-
<
|
|
120
|
+
<RNCSafeAreaView
|
|
121
|
+
edges={
|
|
122
|
+
Object {
|
|
123
|
+
"bottom": "off",
|
|
124
|
+
"left": "off",
|
|
125
|
+
"right": "off",
|
|
126
|
+
"top": "additive",
|
|
127
|
+
}
|
|
128
|
+
}
|
|
98
129
|
style={
|
|
99
130
|
Array [
|
|
100
131
|
Object {
|
|
101
|
-
"
|
|
102
|
-
"position": "relative",
|
|
103
|
-
"zIndex": 200,
|
|
132
|
+
"backgroundColor": "transparent",
|
|
104
133
|
},
|
|
105
134
|
Object {
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"width": "100%",
|
|
135
|
+
"height": undefined,
|
|
136
|
+
"width": 300,
|
|
109
137
|
},
|
|
110
138
|
Object {},
|
|
111
|
-
Object {},
|
|
112
139
|
]
|
|
113
140
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"paddingTop": 20,
|
|
141
|
+
>
|
|
142
|
+
<View
|
|
143
|
+
additionalData={
|
|
144
|
+
Object {
|
|
145
|
+
"saveArea": true,
|
|
146
|
+
}
|
|
121
147
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
148
|
+
animationType="moveUpComponent"
|
|
149
|
+
style={
|
|
150
|
+
Array [
|
|
151
|
+
Object {
|
|
152
|
+
"flexDirection": "column",
|
|
153
|
+
},
|
|
154
|
+
Object {
|
|
155
|
+
"flex": 1,
|
|
156
|
+
},
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
<View
|
|
161
|
+
style={
|
|
162
|
+
Array [
|
|
163
|
+
Object {
|
|
164
|
+
"alignSelf": "center",
|
|
165
|
+
"position": "relative",
|
|
166
|
+
"zIndex": 200,
|
|
167
|
+
},
|
|
168
|
+
Object {
|
|
169
|
+
"aspectRatio": undefined,
|
|
170
|
+
"height": undefined,
|
|
171
|
+
"width": "100%",
|
|
172
|
+
},
|
|
173
|
+
Object {},
|
|
174
|
+
Object {},
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
testID="test-player-container"
|
|
178
|
+
/>
|
|
179
|
+
<View
|
|
180
|
+
style={
|
|
181
|
+
Object {
|
|
182
|
+
"flex": 1,
|
|
183
|
+
"paddingTop": 20,
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/>
|
|
187
|
+
</View>
|
|
188
|
+
</RNCSafeAreaView>
|
|
189
|
+
</RNCSafeAreaProvider>
|
|
125
190
|
`;
|
|
126
191
|
|
|
127
192
|
exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
Object {
|
|
131
|
-
"bottom": "off",
|
|
132
|
-
"left": "off",
|
|
133
|
-
"right": "off",
|
|
134
|
-
"top": "additive",
|
|
135
|
-
}
|
|
136
|
-
}
|
|
193
|
+
<RNCSafeAreaProvider
|
|
194
|
+
onInsetsChange={[Function]}
|
|
137
195
|
style={
|
|
138
196
|
Array [
|
|
139
197
|
Object {
|
|
140
|
-
"
|
|
141
|
-
},
|
|
142
|
-
Object {
|
|
143
|
-
"backgroundColor": "red",
|
|
144
|
-
},
|
|
145
|
-
Object {
|
|
146
|
-
"height": 800,
|
|
147
|
-
"width": 300,
|
|
198
|
+
"flex": 1,
|
|
148
199
|
},
|
|
149
|
-
|
|
200
|
+
undefined,
|
|
150
201
|
]
|
|
151
202
|
}
|
|
152
203
|
>
|
|
153
|
-
<
|
|
204
|
+
<RNCSafeAreaView
|
|
205
|
+
edges={
|
|
206
|
+
Object {
|
|
207
|
+
"bottom": "off",
|
|
208
|
+
"left": "off",
|
|
209
|
+
"right": "off",
|
|
210
|
+
"top": "additive",
|
|
211
|
+
}
|
|
212
|
+
}
|
|
154
213
|
style={
|
|
155
214
|
Array [
|
|
156
215
|
Object {
|
|
157
|
-
"
|
|
158
|
-
"position": "relative",
|
|
159
|
-
"zIndex": 200,
|
|
216
|
+
"backgroundColor": "red",
|
|
160
217
|
},
|
|
161
218
|
Object {
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"width": 195,
|
|
219
|
+
"height": 800,
|
|
220
|
+
"width": 300,
|
|
165
221
|
},
|
|
166
222
|
Object {},
|
|
167
|
-
Object {},
|
|
168
223
|
]
|
|
169
224
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"tablet_landscape_sidebar_width": "35%",
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
entry={
|
|
180
|
-
Object {
|
|
181
|
-
"id": "test",
|
|
225
|
+
>
|
|
226
|
+
<View
|
|
227
|
+
additionalData={
|
|
228
|
+
Object {
|
|
229
|
+
"saveArea": true,
|
|
230
|
+
}
|
|
182
231
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
232
|
+
animationType="moveUpComponent"
|
|
233
|
+
style={
|
|
234
|
+
Array [
|
|
235
|
+
Object {
|
|
236
|
+
"flexDirection": "row",
|
|
237
|
+
},
|
|
238
|
+
Object {
|
|
239
|
+
"flex": 1,
|
|
240
|
+
},
|
|
241
|
+
]
|
|
189
242
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
243
|
+
>
|
|
244
|
+
<View
|
|
245
|
+
style={
|
|
246
|
+
Array [
|
|
247
|
+
Object {
|
|
248
|
+
"alignSelf": "center",
|
|
249
|
+
"position": "relative",
|
|
250
|
+
"zIndex": 200,
|
|
251
|
+
},
|
|
252
|
+
Object {
|
|
253
|
+
"aspectRatio": 1.7777777777777777,
|
|
254
|
+
"height": undefined,
|
|
255
|
+
"width": 195,
|
|
256
|
+
},
|
|
257
|
+
Object {},
|
|
258
|
+
Object {},
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
testID="test-player-container"
|
|
262
|
+
>
|
|
263
|
+
<View
|
|
264
|
+
additionalData={
|
|
265
|
+
Object {
|
|
266
|
+
"disableAnimatedComponent": false,
|
|
267
|
+
"resetAnimationValue": undefined,
|
|
268
|
+
"useLayoutMeasure": true,
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
animationType="moveUpComponent"
|
|
272
|
+
style={
|
|
273
|
+
Object {
|
|
274
|
+
"flex": 1,
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/>
|
|
278
|
+
</View>
|
|
279
|
+
<View
|
|
280
|
+
animationType="componentFade"
|
|
281
|
+
style={
|
|
282
|
+
Object {
|
|
283
|
+
"flex": 1,
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
>
|
|
287
|
+
<View
|
|
288
|
+
configuration={
|
|
289
|
+
Object {
|
|
290
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
291
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
entry={
|
|
295
|
+
Object {
|
|
296
|
+
"id": "test",
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
isTabletLandscape={true}
|
|
300
|
+
style={
|
|
301
|
+
Object {
|
|
302
|
+
"flex": 1,
|
|
303
|
+
"paddingTop": 20,
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/>
|
|
307
|
+
</View>
|
|
308
|
+
</View>
|
|
309
|
+
</RNCSafeAreaView>
|
|
310
|
+
</RNCSafeAreaProvider>
|
|
193
311
|
`;
|
|
194
312
|
|
|
195
313
|
exports[`PlayerWrapper renders properly 1`] = `
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
Object {
|
|
199
|
-
"bottom": "off",
|
|
200
|
-
"left": "off",
|
|
201
|
-
"right": "off",
|
|
202
|
-
"top": "additive",
|
|
203
|
-
}
|
|
204
|
-
}
|
|
314
|
+
<RNCSafeAreaProvider
|
|
315
|
+
onInsetsChange={[Function]}
|
|
205
316
|
style={
|
|
206
317
|
Array [
|
|
207
318
|
Object {
|
|
208
|
-
"
|
|
209
|
-
},
|
|
210
|
-
Object {
|
|
211
|
-
"backgroundColor": "transparent",
|
|
212
|
-
},
|
|
213
|
-
Object {
|
|
214
|
-
"height": 800,
|
|
215
|
-
"width": 300,
|
|
319
|
+
"flex": 1,
|
|
216
320
|
},
|
|
217
|
-
|
|
321
|
+
undefined,
|
|
218
322
|
]
|
|
219
323
|
}
|
|
220
324
|
>
|
|
221
|
-
<
|
|
325
|
+
<RNCSafeAreaView
|
|
326
|
+
edges={
|
|
327
|
+
Object {
|
|
328
|
+
"bottom": "off",
|
|
329
|
+
"left": "off",
|
|
330
|
+
"right": "off",
|
|
331
|
+
"top": "additive",
|
|
332
|
+
}
|
|
333
|
+
}
|
|
222
334
|
style={
|
|
223
335
|
Array [
|
|
224
336
|
Object {
|
|
225
|
-
"
|
|
226
|
-
"position": "relative",
|
|
227
|
-
"zIndex": 200,
|
|
337
|
+
"backgroundColor": "transparent",
|
|
228
338
|
},
|
|
229
339
|
Object {
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"width": "100%",
|
|
340
|
+
"height": 800,
|
|
341
|
+
"width": 300,
|
|
233
342
|
},
|
|
234
343
|
Object {},
|
|
235
|
-
Object {},
|
|
236
344
|
]
|
|
237
345
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"paddingTop": 20,
|
|
346
|
+
>
|
|
347
|
+
<View
|
|
348
|
+
additionalData={
|
|
349
|
+
Object {
|
|
350
|
+
"saveArea": true,
|
|
351
|
+
}
|
|
245
352
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
353
|
+
animationType="moveUpComponent"
|
|
354
|
+
style={
|
|
355
|
+
Array [
|
|
356
|
+
Object {
|
|
357
|
+
"flexDirection": "column",
|
|
358
|
+
},
|
|
359
|
+
Object {
|
|
360
|
+
"flex": 1,
|
|
361
|
+
},
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
>
|
|
365
|
+
<View
|
|
366
|
+
style={
|
|
367
|
+
Array [
|
|
368
|
+
Object {
|
|
369
|
+
"alignSelf": "center",
|
|
370
|
+
"position": "relative",
|
|
371
|
+
"zIndex": 200,
|
|
372
|
+
},
|
|
373
|
+
Object {
|
|
374
|
+
"aspectRatio": 1.7786666666666666,
|
|
375
|
+
"height": undefined,
|
|
376
|
+
"width": "100%",
|
|
377
|
+
},
|
|
378
|
+
Object {},
|
|
379
|
+
Object {},
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
testID="test-player-container"
|
|
383
|
+
/>
|
|
384
|
+
<View
|
|
385
|
+
style={
|
|
386
|
+
Object {
|
|
387
|
+
"flex": 1,
|
|
388
|
+
"paddingTop": 20,
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/>
|
|
392
|
+
</View>
|
|
393
|
+
</RNCSafeAreaView>
|
|
394
|
+
</RNCSafeAreaProvider>
|
|
249
395
|
`;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Dimensions } from "react-native";
|
|
3
2
|
import { useIsTabletLandscape } from "@applicaster/zapp-react-native-utils/reactHooks/device/useMemoizedIsTablet";
|
|
4
3
|
import {
|
|
5
4
|
addOrientationChangeListener,
|
|
@@ -9,11 +8,10 @@ import {
|
|
|
9
8
|
} from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper";
|
|
10
9
|
|
|
11
10
|
import { getXray } from "@applicaster/zapp-react-native-utils/logger";
|
|
11
|
+
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
|
12
12
|
|
|
13
13
|
const { Logger } = getXray();
|
|
14
14
|
|
|
15
|
-
const { width: WIDTH, height: HEIGHT } = Dimensions.get("window");
|
|
16
|
-
|
|
17
15
|
const logger = new Logger(
|
|
18
16
|
"hooks",
|
|
19
17
|
"zapp-react-native-ui-components/Components/VideoModal"
|
|
@@ -24,20 +22,18 @@ type Size = {
|
|
|
24
22
|
height: number | string;
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
const MODAL_SIZE_FOR_PORTRAIT: Size = {
|
|
28
|
-
width: WIDTH,
|
|
29
|
-
height: HEIGHT,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
25
|
const MODAL_SIZE_FOR_LANDSCAPE: Size = {
|
|
33
26
|
width: "100%",
|
|
34
27
|
height: "100%",
|
|
35
28
|
};
|
|
36
29
|
|
|
37
30
|
export const useModalSize = (): Size => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
const frame = useSafeAreaFrame();
|
|
32
|
+
|
|
33
|
+
const [modalSize, setModalSize] = React.useState<Size>({
|
|
34
|
+
width: frame.width,
|
|
35
|
+
height: frame.height,
|
|
36
|
+
});
|
|
41
37
|
|
|
42
38
|
const setNewModalSize = React.useCallback((newSize, log) => {
|
|
43
39
|
setModalSize((oldSize) => {
|
|
@@ -90,7 +86,9 @@ export const useModalSize = (): Size => {
|
|
|
90
86
|
toOrientation === ORIENTATIONS.landscapeSensor;
|
|
91
87
|
|
|
92
88
|
setNewModalSize(
|
|
93
|
-
isLandscape
|
|
89
|
+
isLandscape
|
|
90
|
+
? MODAL_SIZE_FOR_LANDSCAPE
|
|
91
|
+
: { width: frame.width, height: frame.height },
|
|
94
92
|
`useModalSize: set modal size ${
|
|
95
93
|
isLandscape ? "landscape" : "portrait"
|
|
96
94
|
} for orientation: ${to}`
|
|
@@ -23,18 +23,21 @@ export const useConfiguration = () => {
|
|
|
23
23
|
const targetScreenConfiguration = rivers?.[targetScreenId];
|
|
24
24
|
|
|
25
25
|
const pluginConfiguration =
|
|
26
|
-
pluginConfigurations[targetScreenConfiguration
|
|
26
|
+
pluginConfigurations[targetScreenConfiguration?.type]?.configuration_json;
|
|
27
27
|
|
|
28
28
|
const playerPluginConfig = playerManager.getPluginConfiguration();
|
|
29
29
|
|
|
30
30
|
const config = R.mergeRight(playerPluginConfig, {
|
|
31
|
-
...targetScreenConfiguration
|
|
32
|
-
...targetScreenConfiguration
|
|
31
|
+
...targetScreenConfiguration?.general,
|
|
32
|
+
...targetScreenConfiguration?.styles,
|
|
33
33
|
...pluginConfiguration,
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
const {
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
minimised_height = 0,
|
|
38
|
+
minimised_height_tablet = 0,
|
|
39
|
+
modal_background_color,
|
|
40
|
+
} = config;
|
|
38
41
|
|
|
39
42
|
const minimisedHeight = useIsTablet()
|
|
40
43
|
? minimised_height_tablet
|