@applicaster/zapp-react-native-ui-components 12.0.5 → 13.0.0-alpha.1035032144
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__/__snapshots__/AppContainer.test.js.snap +1 -1
- 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 +6 -6
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +7 -7
- 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/Cell/Cell.tsx +4 -8
- package/Components/Cell/CellWithFocusable.tsx +60 -44
- package/Components/Cell/TvOSCellComponent.tsx +3 -8
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +6 -13
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +20 -20
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +5 -3
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +5 -5
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +11 -9
- package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
- package/Components/Focusable/FocusableTvOS.tsx +1 -1
- package/Components/FocusableList/index.tsx +0 -1
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +9 -0
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +1 -1
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +1 -0
- package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -3
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +9 -9
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +7 -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 +5 -11
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +7 -7
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +34 -34
- package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
- package/Components/NativeFocusables/{index.js → index.ts} +4 -2
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
- package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
- package/Components/PlayerContainer/PlayerContainer.tsx +5 -11
- package/Components/River/ComponentsMap/ComponentsMap.tsx +39 -65
- 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 +37 -2
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +114 -45
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +12 -12
- package/Components/River/__tests__/componentsMap.test.js +64 -17
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -1
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +1 -1
- package/Components/Screen/__tests__/Screen.test.tsx +41 -27
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
- package/Components/Screen/hooks.ts +56 -0
- package/Components/Screen/index.tsx +13 -39
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +2 -2
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +31 -27
- package/Components/Tabs/Tab.tsx +1 -0
- 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 +2 -2
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
- package/Components/Transitioner/Scene.tsx +52 -23
- package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +62 -46
- 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/index.js +8 -4
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +5 -2
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +14 -9
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +5 -10
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +1 -1
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +4 -10
- package/Components/VideoModal/ModalAnimation/index.ts +2 -1
- package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +12 -9
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -66
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +1 -1
- package/Components/VideoModal/utils.ts +2 -4
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +2 -2
- package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +11 -11
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +30 -30
- package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +2 -2
- 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__/__snapshots__/riverResolver.test.tsx.snap +5 -5
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +16 -10
- package/Decorators/ZappPipesDataConnector/index.tsx +32 -2
- package/README.md +1 -13
- package/package.json +12 -6
- package/Components/Cell/CellWithFocusable.ios.tsx +0 -126
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
- /package/Decorators/Analytics/{index.js → index.tsx} +0 -0
|
@@ -10,7 +10,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
10
10
|
<ImageContainer
|
|
11
11
|
key="0"
|
|
12
12
|
style={
|
|
13
|
-
|
|
13
|
+
{
|
|
14
14
|
"borderTopLeftRadius": 4,
|
|
15
15
|
"borderTopRightRadius": 4,
|
|
16
16
|
"height": 216,
|
|
@@ -22,7 +22,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
22
22
|
<View
|
|
23
23
|
key="1"
|
|
24
24
|
style={
|
|
25
|
-
|
|
25
|
+
{
|
|
26
26
|
"height": 30,
|
|
27
27
|
"marginHorizontal": 24,
|
|
28
28
|
"marginTop": 24,
|
|
@@ -37,7 +37,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
37
37
|
label="Test Entry"
|
|
38
38
|
numberOfLines={1}
|
|
39
39
|
style={
|
|
40
|
-
|
|
40
|
+
{
|
|
41
41
|
"color": "#EFEFEF",
|
|
42
42
|
"fontSize": 26,
|
|
43
43
|
"fontStyle": "normal",
|
|
@@ -49,7 +49,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
49
49
|
<View
|
|
50
50
|
key="2"
|
|
51
51
|
style={
|
|
52
|
-
|
|
52
|
+
{
|
|
53
53
|
"height": 60,
|
|
54
54
|
"marginHorizontal": 24,
|
|
55
55
|
"marginTop": 10,
|
|
@@ -63,7 +63,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
63
63
|
label="Summary of the test entry"
|
|
64
64
|
numberOfLines={2}
|
|
65
65
|
style={
|
|
66
|
-
|
|
66
|
+
{
|
|
67
67
|
"color": "#EFEFEF",
|
|
68
68
|
"fontSize": 24,
|
|
69
69
|
"fontStyle": "normal",
|
|
@@ -76,7 +76,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
76
76
|
<View
|
|
77
77
|
key="3"
|
|
78
78
|
style={
|
|
79
|
-
|
|
79
|
+
{
|
|
80
80
|
"height": 42,
|
|
81
81
|
"margin": 24,
|
|
82
82
|
"width": 56,
|
|
@@ -88,7 +88,7 @@ exports[`elementMapper renders the nodes 1`] = `
|
|
|
88
88
|
<ImageContainer
|
|
89
89
|
key="0"
|
|
90
90
|
style={
|
|
91
|
-
|
|
91
|
+
{
|
|
92
92
|
"height": 42,
|
|
93
93
|
"width": 56,
|
|
94
94
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`masterCellBuilder when using a custom data adapter renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"flex": 1,
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ exports[`masterCellBuilder when using a custom data adapter renders correctly 1`
|
|
|
13
13
|
key="0"
|
|
14
14
|
skipButtons={false}
|
|
15
15
|
style={
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
"backgroundColor": "#2F2F2F",
|
|
18
18
|
"borderRadius": 4,
|
|
19
19
|
"height": 436,
|
|
@@ -22,7 +22,7 @@ exports[`masterCellBuilder when using a custom data adapter renders correctly 1`
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
wrapperRef={
|
|
25
|
-
|
|
25
|
+
{
|
|
26
26
|
"current": null,
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -33,7 +33,7 @@ exports[`masterCellBuilder when using a custom data adapter renders correctly 1`
|
|
|
33
33
|
exports[`masterCellBuilder when using custom containerStyle renders correctly 1`] = `
|
|
34
34
|
<View
|
|
35
35
|
style={
|
|
36
|
-
|
|
36
|
+
{
|
|
37
37
|
"backgroundColor": "black",
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -42,9 +42,9 @@ exports[`masterCellBuilder when using custom containerStyle renders correctly 1`
|
|
|
42
42
|
cellUUID="mocked-uuid"
|
|
43
43
|
key="0"
|
|
44
44
|
skipButtons={false}
|
|
45
|
-
style={
|
|
45
|
+
style={{}}
|
|
46
46
|
wrapperRef={
|
|
47
|
-
|
|
47
|
+
{
|
|
48
48
|
"current": null,
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -55,7 +55,7 @@ exports[`masterCellBuilder when using custom containerStyle renders correctly 1`
|
|
|
55
55
|
exports[`masterCellBuilder when using custom default components renders correctly 1`] = `
|
|
56
56
|
<mockConstructor
|
|
57
57
|
style={
|
|
58
|
-
|
|
58
|
+
{
|
|
59
59
|
"flex": 1,
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -64,9 +64,9 @@ exports[`masterCellBuilder when using custom default components renders correctl
|
|
|
64
64
|
cellUUID="mocked-uuid"
|
|
65
65
|
key="0"
|
|
66
66
|
skipButtons={false}
|
|
67
|
-
style={
|
|
67
|
+
style={{}}
|
|
68
68
|
wrapperRef={
|
|
69
|
-
|
|
69
|
+
{
|
|
70
70
|
"current": null,
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -77,7 +77,7 @@ exports[`masterCellBuilder when using custom default components renders correctl
|
|
|
77
77
|
exports[`masterCellBuilder when using default options can be invoked as a React Component 1`] = `
|
|
78
78
|
<View
|
|
79
79
|
style={
|
|
80
|
-
|
|
80
|
+
{
|
|
81
81
|
"flex": 1,
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -87,7 +87,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
87
87
|
key="0"
|
|
88
88
|
skipButtons={false}
|
|
89
89
|
style={
|
|
90
|
-
|
|
90
|
+
{
|
|
91
91
|
"backgroundColor": "#2F2F2F",
|
|
92
92
|
"borderRadius": 4,
|
|
93
93
|
"height": 436,
|
|
@@ -96,13 +96,13 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
whoAmI={
|
|
99
|
-
|
|
99
|
+
{
|
|
100
100
|
"contentType": "feed",
|
|
101
101
|
"state": "default",
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
wrapperRef={
|
|
105
|
-
|
|
105
|
+
{
|
|
106
106
|
"current": null,
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
113
113
|
numberOfLines={1}
|
|
114
114
|
skipButtons={false}
|
|
115
115
|
style={
|
|
116
|
-
|
|
116
|
+
{
|
|
117
117
|
"borderTopLeftRadius": 4,
|
|
118
118
|
"borderTopRightRadius": 4,
|
|
119
119
|
"height": 216,
|
|
@@ -127,7 +127,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
127
127
|
key="1"
|
|
128
128
|
skipButtons={false}
|
|
129
129
|
style={
|
|
130
|
-
|
|
130
|
+
{
|
|
131
131
|
"height": 30,
|
|
132
132
|
"marginHorizontal": 24,
|
|
133
133
|
"marginTop": 24,
|
|
@@ -135,7 +135,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
wrapperRef={
|
|
138
|
-
|
|
138
|
+
{
|
|
139
139
|
"current": null,
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -146,7 +146,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
146
146
|
numberOfLines={1}
|
|
147
147
|
skipButtons={false}
|
|
148
148
|
style={
|
|
149
|
-
|
|
149
|
+
{
|
|
150
150
|
"color": "#EFEFEF",
|
|
151
151
|
"fontSize": 26,
|
|
152
152
|
"fontStyle": "normal",
|
|
@@ -160,7 +160,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
160
160
|
key="2"
|
|
161
161
|
skipButtons={false}
|
|
162
162
|
style={
|
|
163
|
-
|
|
163
|
+
{
|
|
164
164
|
"height": 60,
|
|
165
165
|
"marginHorizontal": 24,
|
|
166
166
|
"marginTop": 10,
|
|
@@ -168,7 +168,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
wrapperRef={
|
|
171
|
-
|
|
171
|
+
{
|
|
172
172
|
"current": null,
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -179,7 +179,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
179
179
|
numberOfLines={2}
|
|
180
180
|
skipButtons={false}
|
|
181
181
|
style={
|
|
182
|
-
|
|
182
|
+
{
|
|
183
183
|
"color": "#EFEFEF",
|
|
184
184
|
"fontSize": 24,
|
|
185
185
|
"fontStyle": "normal",
|
|
@@ -194,14 +194,14 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
194
194
|
key="3"
|
|
195
195
|
skipButtons={false}
|
|
196
196
|
style={
|
|
197
|
-
|
|
197
|
+
{
|
|
198
198
|
"height": 42,
|
|
199
199
|
"margin": 24,
|
|
200
200
|
"width": 56,
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
wrapperRef={
|
|
204
|
-
|
|
204
|
+
{
|
|
205
205
|
"current": null,
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -211,7 +211,7 @@ exports[`masterCellBuilder when using default options can be invoked as a React
|
|
|
211
211
|
key="0"
|
|
212
212
|
skipButtons={false}
|
|
213
213
|
style={
|
|
214
|
-
|
|
214
|
+
{
|
|
215
215
|
"height": 42,
|
|
216
216
|
"width": 56,
|
|
217
217
|
}
|
|
@@ -227,24 +227,24 @@ exports[`masterCellBuilder when using default options renders correctly 1`] = `
|
|
|
227
227
|
<View>
|
|
228
228
|
<Memo(MasterCell)
|
|
229
229
|
item={
|
|
230
|
-
|
|
231
|
-
"author":
|
|
230
|
+
{
|
|
231
|
+
"author": {
|
|
232
232
|
"name": "John Doe",
|
|
233
233
|
},
|
|
234
234
|
"id": "A1234",
|
|
235
|
-
"media_group":
|
|
236
|
-
|
|
237
|
-
"media_item":
|
|
238
|
-
|
|
235
|
+
"media_group": [
|
|
236
|
+
{
|
|
237
|
+
"media_item": [
|
|
238
|
+
{
|
|
239
239
|
"key": "image_base",
|
|
240
240
|
"src": "http://urlOfTheImage.net/img.png",
|
|
241
241
|
},
|
|
242
242
|
],
|
|
243
243
|
"type": "image",
|
|
244
244
|
},
|
|
245
|
-
|
|
246
|
-
"media_item":
|
|
247
|
-
|
|
245
|
+
{
|
|
246
|
+
"media_item": [
|
|
247
|
+
{
|
|
248
248
|
"key": "logo_thumbnail",
|
|
249
249
|
"src": "http://urlOfTheImage.net/channelLogo.png",
|
|
250
250
|
},
|
|
@@ -255,7 +255,7 @@ exports[`masterCellBuilder when using default options renders correctly 1`] = `
|
|
|
255
255
|
"published": "2019/03/17 02:17:46 +0000",
|
|
256
256
|
"summary": "Summary of the test entry",
|
|
257
257
|
"title": "Test Entry",
|
|
258
|
-
"type":
|
|
258
|
+
"type": {
|
|
259
259
|
"value": "feed",
|
|
260
260
|
},
|
|
261
261
|
}
|
|
@@ -265,7 +265,7 @@ exports[`masterCellBuilder when using default options renders correctly 1`] = `
|
|
|
265
265
|
`;
|
|
266
266
|
|
|
267
267
|
exports[`masterCellBuilder when using default options returns a function 1`] = `
|
|
268
|
-
|
|
268
|
+
{
|
|
269
269
|
"$$typeof": Symbol(react.memo),
|
|
270
270
|
"compare": null,
|
|
271
271
|
"hasFocusableInside": [Function],
|
|
@@ -16,13 +16,13 @@ export class MasterCellAsyncRenderManager {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
public emitAsyncElementRegistrate = () => {
|
|
19
|
-
this.asyncElementRegistrate$.next();
|
|
19
|
+
this.asyncElementRegistrate$.next(null);
|
|
20
20
|
|
|
21
21
|
return this.decrementAsyncElementRegistrationCount;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
public emitAsyncElementLayout = () => {
|
|
25
|
-
this.asyncElementLayout$.next();
|
|
25
|
+
this.asyncElementLayout$.next(null);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
public decrementAsyncElementRegistrationCount = () => {
|
|
@@ -8,7 +8,7 @@ import { MasterCellAsyncRenderManager } from "./MasterCellAsyncRenderManager";
|
|
|
8
8
|
const layoutMeasure = (viewRef, onMeasure) => {
|
|
9
9
|
viewRef?.measureLayout?.(
|
|
10
10
|
findNodeHandle(viewRef),
|
|
11
|
-
(
|
|
11
|
+
(_x, _y, width, height) => {
|
|
12
12
|
onMeasure({ width, height });
|
|
13
13
|
},
|
|
14
14
|
noop
|
|
@@ -16,7 +16,7 @@ const layoutMeasure = (viewRef, onMeasure) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const regularMeasure = (viewRef, onMeasure) => {
|
|
19
|
-
viewRef?.measure?.((
|
|
19
|
+
viewRef?.measure?.((_x, _y, width, height) => {
|
|
20
20
|
onMeasure({ width, height });
|
|
21
21
|
});
|
|
22
22
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { requireNativeComponent, View } from "react-native";
|
|
2
2
|
import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
|
|
3
3
|
|
|
4
|
+
// @TODO define the types
|
|
4
5
|
export const FocusableGroupNative = isAppleTV()
|
|
5
|
-
? requireNativeComponent("FocusableGroupViewModule"
|
|
6
|
+
? requireNativeComponent<any>("FocusableGroupViewModule")
|
|
6
7
|
: View;
|
|
7
8
|
|
|
9
|
+
// @TODO define the types
|
|
8
10
|
export const FocusableItemNative = isAppleTV()
|
|
9
|
-
? requireNativeComponent("FocusableViewModule"
|
|
11
|
+
? requireNativeComponent<any>("FocusableViewModule")
|
|
10
12
|
: View;
|
|
@@ -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
|
|
|
@@ -35,10 +35,8 @@ import {
|
|
|
35
35
|
log_warning,
|
|
36
36
|
} from "./logger";
|
|
37
37
|
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";
|
|
38
|
+
import { useSetNavbarState } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
39
|
+
import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
42
40
|
import {
|
|
43
41
|
PlayerContainerContext,
|
|
44
42
|
PlayerContainerContextProvider,
|
|
@@ -382,7 +380,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
382
380
|
}
|
|
383
381
|
};
|
|
384
382
|
|
|
385
|
-
const playerRemoteHandler = (
|
|
383
|
+
const playerRemoteHandler = (event, isLanguageOverlayVisible) => {
|
|
386
384
|
const { eventType } = event;
|
|
387
385
|
|
|
388
386
|
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
@@ -625,12 +623,8 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
625
623
|
<PlayerContainerContext.Consumer>
|
|
626
624
|
{(context) => (
|
|
627
625
|
<TVEventHandlerComponent
|
|
628
|
-
tvEventHandler={(
|
|
629
|
-
playerRemoteHandler(
|
|
630
|
-
component,
|
|
631
|
-
event,
|
|
632
|
-
context.isLanguageOverlayVisible
|
|
633
|
-
)
|
|
626
|
+
tvEventHandler={(_component, event) =>
|
|
627
|
+
playerRemoteHandler(event, context.isLanguageOverlayVisible)
|
|
634
628
|
}
|
|
635
629
|
>
|
|
636
630
|
<FocusableGroup
|
|
@@ -70,21 +70,6 @@ function ComponentsMapComponent(props: Props) {
|
|
|
70
70
|
|
|
71
71
|
const [flatListHeight, setFlatListHeight] = React.useState(null);
|
|
72
72
|
|
|
73
|
-
const {
|
|
74
|
-
isAnyLoading,
|
|
75
|
-
isAllLoaded,
|
|
76
|
-
waitForAllComponents,
|
|
77
|
-
onLoadFinished,
|
|
78
|
-
onLoadFailed,
|
|
79
|
-
shouldShowLoadingError,
|
|
80
|
-
isAnyLoaded,
|
|
81
|
-
arePreviousComponentsLoaded,
|
|
82
|
-
} = useLoadingState(feed?.entry?.length || components.length);
|
|
83
|
-
|
|
84
|
-
const theme = useTheme();
|
|
85
|
-
|
|
86
|
-
const logTimestamp = useProfilerLogging();
|
|
87
|
-
|
|
88
73
|
const riverComponents = React.useMemo(() => {
|
|
89
74
|
if (feed?.entry?.length < components.length) {
|
|
90
75
|
return R.slice(0, feed?.entry?.length, components);
|
|
@@ -93,55 +78,42 @@ function ComponentsMapComponent(props: Props) {
|
|
|
93
78
|
return components;
|
|
94
79
|
}, [components, feed]);
|
|
95
80
|
|
|
81
|
+
const logTimestamp = useProfilerLogging();
|
|
82
|
+
|
|
83
|
+
const onLoadDone = React.useCallback(() => {
|
|
84
|
+
logTimestamp(riverId?.toString());
|
|
85
|
+
}, [logTimestamp]);
|
|
86
|
+
|
|
87
|
+
const { loadingState, onLoadFinished, onLoadFailed, shouldShowLoadingError } =
|
|
88
|
+
useLoadingState(riverComponents.length, onLoadDone);
|
|
89
|
+
|
|
90
|
+
const theme = useTheme();
|
|
91
|
+
|
|
96
92
|
const renderRiverItem = React.useCallback(
|
|
97
93
|
({ item, index }) => {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
const riverItemProps = {
|
|
95
|
+
riverId,
|
|
96
|
+
item,
|
|
97
|
+
index,
|
|
98
|
+
isScreenWrappedInContainer,
|
|
99
|
+
feed,
|
|
100
|
+
groupId,
|
|
101
|
+
onLoadFailed,
|
|
102
|
+
onLoadFinished,
|
|
103
|
+
getStaticComponentFeed,
|
|
104
|
+
isLast: isLast(index, riverComponents.length),
|
|
105
|
+
loadingState,
|
|
102
106
|
};
|
|
103
107
|
|
|
104
108
|
return (
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
{...{
|
|
109
|
-
readyToBeDisplayed,
|
|
110
|
-
riverId,
|
|
111
|
-
item,
|
|
112
|
-
index,
|
|
113
|
-
isScreenWrappedInContainer,
|
|
114
|
-
feed,
|
|
115
|
-
groupId,
|
|
116
|
-
onLoadFailed,
|
|
117
|
-
onLoadFinished,
|
|
118
|
-
getStaticComponentFeed,
|
|
119
|
-
isLast: isLast(index, riverComponents.length),
|
|
120
|
-
}}
|
|
121
|
-
/>
|
|
122
|
-
</ScreenLoadingMeasurementsListItemWrapper>
|
|
123
|
-
</View>
|
|
109
|
+
<ScreenLoadingMeasurementsListItemWrapper index={index}>
|
|
110
|
+
<RiverItem {...riverItemProps} />
|
|
111
|
+
</ScreenLoadingMeasurementsListItemWrapper>
|
|
124
112
|
);
|
|
125
113
|
},
|
|
126
|
-
[
|
|
127
|
-
feed,
|
|
128
|
-
getStaticComponentFeed,
|
|
129
|
-
arePreviousComponentsLoaded,
|
|
130
|
-
onLoadFailed,
|
|
131
|
-
onLoadFinished,
|
|
132
|
-
]
|
|
114
|
+
[feed, getStaticComponentFeed, onLoadFailed, onLoadFinished]
|
|
133
115
|
);
|
|
134
116
|
|
|
135
|
-
const renderFooter = React.useCallback(() => {
|
|
136
|
-
return (
|
|
137
|
-
<RiverFooter
|
|
138
|
-
visible={isAnyLoading}
|
|
139
|
-
flatListHeight={flatListHeight}
|
|
140
|
-
isAnyLoaded={isAnyLoaded || waitForAllComponents}
|
|
141
|
-
/>
|
|
142
|
-
);
|
|
143
|
-
}, [flatListHeight, isAnyLoading, isAnyLoaded]);
|
|
144
|
-
|
|
145
117
|
const screenStyle = React.useMemo(
|
|
146
118
|
() => ({
|
|
147
119
|
paddingTop: ifEmptyUseFallback(
|
|
@@ -179,12 +151,6 @@ function ComponentsMapComponent(props: Props) {
|
|
|
179
151
|
|
|
180
152
|
usePipesCacheReset(riverId, riverComponents);
|
|
181
153
|
|
|
182
|
-
React.useEffect(() => {
|
|
183
|
-
if (isAllLoaded) {
|
|
184
|
-
logTimestamp(riverId?.toString());
|
|
185
|
-
}
|
|
186
|
-
}, [isAllLoaded]);
|
|
187
|
-
|
|
188
154
|
const refreshControl = React.useMemo(
|
|
189
155
|
() =>
|
|
190
156
|
pullToRefreshEnabled ? (
|
|
@@ -280,6 +246,11 @@ function ComponentsMapComponent(props: Props) {
|
|
|
280
246
|
}
|
|
281
247
|
}, []);
|
|
282
248
|
|
|
249
|
+
const contentContainerStyle = React.useMemo(
|
|
250
|
+
() => (isScreenWrappedInContainer ? {} : screenStyle),
|
|
251
|
+
[isScreenWrappedInContainer, screenStyle]
|
|
252
|
+
);
|
|
253
|
+
|
|
283
254
|
if (shouldShowLoadingError) {
|
|
284
255
|
return <RiverError />;
|
|
285
256
|
}
|
|
@@ -291,7 +262,7 @@ function ComponentsMapComponent(props: Props) {
|
|
|
291
262
|
<View style={styles.container}>
|
|
292
263
|
<ScreenLoadingMeasurements
|
|
293
264
|
riverId={riverId}
|
|
294
|
-
numberOfComponents={
|
|
265
|
+
numberOfComponents={riverComponents.length}
|
|
295
266
|
>
|
|
296
267
|
<ViewportTracker>
|
|
297
268
|
<FlatList
|
|
@@ -312,10 +283,13 @@ function ComponentsMapComponent(props: Props) {
|
|
|
312
283
|
keyExtractor={keyExtractor}
|
|
313
284
|
renderItem={renderRiverItem}
|
|
314
285
|
data={riverComponents}
|
|
315
|
-
contentContainerStyle={
|
|
316
|
-
|
|
286
|
+
contentContainerStyle={contentContainerStyle}
|
|
287
|
+
ListFooterComponent={
|
|
288
|
+
<RiverFooter
|
|
289
|
+
flatListHeight={flatListHeight}
|
|
290
|
+
loadingState={loadingState}
|
|
291
|
+
/>
|
|
317
292
|
}
|
|
318
|
-
ListFooterComponent={renderFooter}
|
|
319
293
|
refreshControl={refreshControl}
|
|
320
294
|
onScrollBeginDrag={onScrollBeginDrag}
|
|
321
295
|
onScroll={onScroll}
|