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