@applicaster/zapp-react-native-ui-components 14.0.0-alpha.9119252693 → 14.0.0-alpha.9203091422

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 (35) hide show
  1. package/Components/AnimatedInOut/index.tsx +5 -3
  2. package/Components/AudioPlayer/mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap +0 -6
  3. package/Components/Focusable/Focusable.tsx +5 -3
  4. package/Components/Focusable/FocusableTvOS.tsx +3 -3
  5. package/Components/Focusable/FocusableiOS.tsx +1 -1
  6. package/Components/FocusableList/index.tsx +4 -0
  7. package/Components/HandlePlayable/HandlePlayable.tsx +14 -8
  8. package/Components/MasterCell/elementMapper.tsx +1 -2
  9. package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
  10. package/Components/MasterCell/utils/index.ts +23 -3
  11. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
  12. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
  13. package/Components/PlayerContainer/PlayerContainer.tsx +26 -22
  14. package/Components/River/ComponentsMap/ComponentsMap.tsx +0 -1
  15. package/Components/River/TV/withTVEventHandler.tsx +1 -1
  16. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
  17. package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
  18. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
  19. package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
  20. package/Components/ScreenRevealManager/index.ts +1 -0
  21. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +79 -0
  22. package/Components/Tabs/TV/Tabs.android.tsx +0 -2
  23. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
  24. package/Components/Transitioner/Scene.tsx +1 -0
  25. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
  26. package/Components/VideoLive/animationUtils.ts +3 -3
  27. package/Components/VideoModal/hooks/useModalSize.ts +3 -1
  28. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
  29. package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
  30. package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
  31. package/Decorators/RiverFeedLoader/index.tsx +8 -2
  32. package/Decorators/RiverFeedLoader/utils/index.ts +7 -2
  33. package/Decorators/ZappPipesDataConnector/index.tsx +20 -2
  34. package/package.json +5 -6
  35. package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
@@ -12,11 +12,16 @@ export { getDatasourceUrl } from "./getDatasourceUrl";
12
12
 
13
13
  export const DATASOURCE_CHUNKS = 10;
14
14
 
15
- export async function loadDatasources(urls: string[][], riverId, dispatch) {
15
+ export async function loadDatasources(
16
+ urls: string[][],
17
+ riverId,
18
+ dispatch,
19
+ resolvers
20
+ ) {
16
21
  return reducePromises<string, void>(
17
22
  mapPromises<string, void>((url) => {
18
23
  if (url) {
19
- return dispatch(loadPipesData(url, { riverId }));
24
+ return dispatch(loadPipesData(url, { riverId, resolvers }));
20
25
  }
21
26
  }),
22
27
  undefined,
@@ -19,7 +19,11 @@ import { ZappPipesSearchContext } from "@applicaster/zapp-react-native-ui-compon
19
19
  import { useScreenContext } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
20
20
 
21
21
  import { isVerticalListOrGrid } from "./utils";
22
- import { subscribeForUrlContextKeyChanges } from "@applicaster/zapp-pipes-v2-client";
22
+ import {
23
+ subscribeForUrlContextKeyChanges,
24
+ subscribeForUrlScreenKeyChanges,
25
+ } from "@applicaster/zapp-pipes-v2-client";
26
+ import { useScreenStateStore } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useScreenStateStore";
23
27
 
24
28
  type Props = {
25
29
  component: ZappUIComponent;
@@ -204,7 +208,9 @@ export function zappPipesDataConnector(
204
208
  Component: React.FC<any> | React.ComponentClass<any>
205
209
  ) {
206
210
  return function WrappedWithZappPipesData(props: Props) {
207
- const { screenData } = useRoute();
211
+ const { screenData, pathname } = useRoute();
212
+ const screenStateStore = useScreenStateStore();
213
+
208
214
  const { plugins } = usePickFromState(["plugins"]);
209
215
 
210
216
  const screenContextData = useScreenContext();
@@ -286,6 +292,18 @@ export function zappPipesDataConnector(
286
292
  componentIndex
287
293
  );
288
294
 
295
+ useEffect(() => {
296
+ if (!(dataSourceUrl?.includes("pipesv2://") && reloadData)) {
297
+ return subscribeForUrlScreenKeyChanges(
298
+ dataSourceUrl,
299
+ pathname,
300
+ screenStateStore,
301
+ {},
302
+ reloadData
303
+ );
304
+ }
305
+ }, [dataSourceUrl, reloadData]);
306
+
289
307
  useEffect(() => {
290
308
  if (dataSourceUrl?.includes("pipesv2://") && reloadData) {
291
309
  const addListener = getListenerFromPlugin(dataSourceUrl, plugins);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "14.0.0-alpha.9119252693",
3
+ "version": "14.0.0-alpha.9203091422",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "14.0.0-alpha.9119252693",
32
- "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.9119252693",
33
- "@applicaster/zapp-react-native-redux": "14.0.0-alpha.9119252693",
34
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.9119252693",
31
+ "@applicaster/applicaster-types": "14.0.0-alpha.9203091422",
32
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.9203091422",
33
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.9203091422",
34
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.9203091422",
35
35
  "promise": "^8.3.0",
36
36
  "url": "^0.11.0",
37
37
  "uuid": "^3.3.2"
@@ -42,7 +42,6 @@
42
42
  "immer": "*",
43
43
  "react": "*",
44
44
  "react-native": "*",
45
- "react-native-safe-area-context": "*",
46
45
  "react-native-svg": "*",
47
46
  "uglify-js": "*",
48
47
  "validate-color": "*",
@@ -1,202 +0,0 @@
1
- import React, { useRef } from "react";
2
- import { View, ImageBackground, Animated } from "react-native";
3
-
4
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
5
-
6
- import { Artwork } from "./Artwork";
7
- import { directionStyles } from "./helpers";
8
-
9
- type Props = {
10
- artwork?: string;
11
- config: {
12
- titleColor: string;
13
- summaryColor: string;
14
- backgroundColor: string;
15
- backgroundImage: string;
16
- isRTL: boolean;
17
- artworkBorderRadius: Option<number>;
18
- };
19
- children: React.ReactNode;
20
- };
21
-
22
- export function AudioPlayerLayout({ artwork, config, children }: Props) {
23
- const fadeAnimation = useRef(new Animated.Value(0)).current;
24
-
25
- const fadeAudioPlayerIn = () => {
26
- Animated.timing(fadeAnimation, {
27
- toValue: 1,
28
- duration: 3000,
29
- useNativeDriver: true,
30
- }).start();
31
- };
32
-
33
- const { isRTL, backgroundColor, backgroundImage } = config;
34
-
35
- const backgroundImageSource = { uri: backgroundImage || artwork };
36
-
37
- const backgroundColorStyle = backgroundImageSource.uri
38
- ? "transparent"
39
- : backgroundColor;
40
-
41
- const mainContainerStyles = platformSelect({
42
- tvos: {
43
- width: "100%",
44
- height: "100%",
45
- alignItems: "center",
46
- justifyContent: "center",
47
- flexDirection: directionStyles(isRTL).flexDirection,
48
- backgroundColor: backgroundColorStyle,
49
- },
50
- android_tv: {
51
- width: "100%",
52
- height: "100%",
53
- alignItems: "center",
54
- justifyContent: "center",
55
- flexDirection: directionStyles(isRTL).flexDirection,
56
- backgroundColor: backgroundColorStyle,
57
- },
58
- web: {
59
- width: 1920,
60
- height: 1080,
61
- alignItems: "center",
62
- justifyContent: "center",
63
- flexDirection: directionStyles(isRTL).flexDirection,
64
- backgroundColor: backgroundColorStyle,
65
- },
66
- native: {
67
- backgroundColor: backgroundColorStyle,
68
- overflow: "hidden",
69
- width: "100%",
70
- height: "100%",
71
- },
72
- samsung_tv: {
73
- position: "absolute",
74
- margin: "auto",
75
- display: "flex",
76
- flexWrap: "wrap",
77
- width: "100vw",
78
- flex: 1,
79
- alignItems: "center",
80
- justifyContent: "center",
81
- flexDirection: directionStyles(isRTL).flexDirection,
82
- backgroundColor: backgroundColorStyle,
83
- },
84
- lg_tv: {
85
- position: "absolute",
86
- margin: "auto",
87
- display: "flex",
88
- flexWrap: "wrap",
89
- width: "100vw",
90
- flex: 1,
91
- alignItems: "center",
92
- justifyContent: "center",
93
- flexDirection: directionStyles(isRTL).flexDirection,
94
- backgroundColor: backgroundColorStyle,
95
- },
96
- });
97
-
98
- const backgroundImgStyles = platformSelect({
99
- tvos: {
100
- width: "100%",
101
- height: "100%",
102
- alignItems: "center",
103
- justifyContent: "center",
104
- },
105
- android_tv: {
106
- width: "100%",
107
- height: "100%",
108
- alignItems: "center",
109
- justifyContent: "center",
110
- },
111
- web: {
112
- position: "absolute",
113
- margin: "auto",
114
- display: "flex",
115
- flexWrap: "wrap",
116
- width: "100%",
117
- height: "100%",
118
- flex: 1,
119
- alignItems: "center",
120
- justifyContent: "center",
121
- },
122
- native: {
123
- flex: 1,
124
- },
125
- });
126
-
127
- const textContainerStyles = platformSelect({
128
- tvos: {
129
- width: 600,
130
- height: 362,
131
- marginHorizontal: 24,
132
- alignItems: directionStyles(isRTL).justifyContent,
133
- },
134
- android_tv: {
135
- width: 600,
136
- height: 362,
137
- marginHorizontal: 24,
138
- alignItems: directionStyles(isRTL).justifyContent,
139
- },
140
- web: {
141
- margin: 10,
142
- height: "100vh",
143
- alignItems: directionStyles(isRTL).justifyContent,
144
- justifyContent: "center",
145
- },
146
- });
147
-
148
- const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
149
- <ImageBackground
150
- source={backgroundImageSource}
151
- style={backgroundImgStyles}
152
- resizeMode="cover"
153
- >
154
- <View style={mainContainerStyles}>
155
- {!!artwork && <Artwork srcImage={artwork} config={config} />}
156
- <View style={textContainerStyles}>{children}</View>
157
- </View>
158
- </ImageBackground>
159
- ) : (
160
- <View style={mainContainerStyles}>
161
- {!!artwork && <Artwork srcImage={artwork} config={config} />}
162
- <View style={textContainerStyles}>{children}</View>
163
- </View>
164
- );
165
-
166
- const audioPlayerLayoutMobile = () => {
167
- fadeAudioPlayerIn();
168
-
169
- return (
170
- <View style={mainContainerStyles} pointerEvents="none">
171
- <Animated.View
172
- style={[
173
- mainContainerStyles,
174
- {
175
- opacity: fadeAnimation,
176
- },
177
- ]}
178
- >
179
- <ImageBackground
180
- source={backgroundImageSource}
181
- style={backgroundImgStyles}
182
- resizeMode="cover"
183
- >
184
- <View style={mainContainerStyles} />
185
- </ImageBackground>
186
- </Animated.View>
187
- </View>
188
- );
189
- };
190
-
191
- const audioPlayerLayout = platformSelect({
192
- tvos: audioPlayerLayoutTV,
193
- android_tv: audioPlayerLayoutTV,
194
- web: audioPlayerLayoutTV,
195
- samsung_tv: audioPlayerLayoutTV,
196
- lg_tv: audioPlayerLayoutTV,
197
- ios: audioPlayerLayoutMobile(),
198
- android: audioPlayerLayoutMobile(),
199
- });
200
-
201
- return audioPlayerLayout;
202
- }