@applicaster/zapp-react-native-ui-components 13.0.8-alpha.1965510704 → 13.0.8-alpha.2505844239

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as R from "ramda";
3
- import { View, StyleSheet, FlatList } from "react-native";
3
+ import { FlatList, StyleSheet, View } from "react-native";
4
4
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
5
5
  import { RiverItem } from "../RiverItem";
6
6
  import { RiverFooter } from "../RiverFooter";
@@ -9,8 +9,8 @@ import { useScreenConfiguration } from "../useScreenConfiguration";
9
9
  import { RefreshControl } from "../RefreshControl";
10
10
  import { ifEmptyUseFallback } from "@applicaster/zapp-react-native-utils/cellUtils";
11
11
  import {
12
- useProfilerLogging,
13
12
  usePipesCacheReset,
13
+ useProfilerLogging,
14
14
  } from "@applicaster/zapp-react-native-utils/reactHooks";
15
15
  import { useLoadingState } from "./hooks/useLoadingState";
16
16
  import { ViewportTracker } from "../../Viewport";
@@ -25,6 +25,8 @@ import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHo
25
25
  import { useShallow } from "zustand/react/shallow";
26
26
 
27
27
  import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
28
+ import { ComponentsMapHeightContext } from "./ContextProviders/ComponentsMapHeightContext";
29
+ import { ComponentsMapRefContext } from "./ContextProviders/ComponentsMapRefContext";
28
30
 
29
31
  const isAndroid = isAndroidPlatform();
30
32
 
@@ -70,6 +72,7 @@ function ComponentsMapComponent(props: Props) {
70
72
  } = props;
71
73
 
72
74
  const flatListRef = React.useRef<FlatList | null>(null);
75
+ const flatListWrapperRef = React.useRef<View | null>(null);
73
76
  const screenConfig = useScreenConfiguration(riverId);
74
77
  const screenData = useScreenData(riverId);
75
78
  const pullToRefreshEnabled = screenData?.rules?.pull_to_refresh_enabled;
@@ -265,48 +268,57 @@ function ComponentsMapComponent(props: Props) {
265
268
  // The Screen Picker in Mobile is completly different than the TV
266
269
  // so the various offsets / margins in TV do not apply here.
267
270
  return (
268
- <View style={styles.container}>
269
- <ScreenLoadingMeasurements
270
- riverId={riverId}
271
- numberOfComponents={riverComponents.length}
272
- >
273
- <ViewportTracker>
274
- <FlatList
275
- ref={(ref) => {
276
- flatListRef.current = ref;
277
- }}
278
- // Fix for WebView rerender crashes on Android API 28+
279
- // https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
280
- overScrollMode={isAndroid ? "never" : "auto"}
281
- scrollIndicatorInsets={scrollIndicatorInsets}
282
- extraData={feed}
283
- stickyHeaderIndices={stickyHeaderIndices}
284
- removeClippedSubviews={isAndroid}
285
- onLayout={handleOnLayout}
286
- initialNumToRender={3}
287
- maxToRenderPerBatch={10}
288
- windowSize={12}
289
- listKey={riverId}
290
- keyExtractor={keyExtractor}
291
- renderItem={renderRiverItem}
292
- data={riverComponents}
293
- contentContainerStyle={contentContainerStyle}
294
- ListFooterComponent={
295
- <RiverFooter
296
- flatListHeight={flatListHeight}
297
- loadingState={loadingState}
271
+ <View
272
+ style={styles.container}
273
+ ref={(ref) => {
274
+ flatListWrapperRef.current = ref;
275
+ }}
276
+ >
277
+ <ComponentsMapHeightContext.Provider value={flatListHeight}>
278
+ <ComponentsMapRefContext.Provider value={flatListWrapperRef}>
279
+ <ScreenLoadingMeasurements
280
+ riverId={riverId}
281
+ numberOfComponents={riverComponents.length}
282
+ >
283
+ <ViewportTracker>
284
+ <FlatList
285
+ ref={(ref) => {
286
+ flatListRef.current = ref;
287
+ }}
288
+ // Fix for WebView rerender crashes on Android API 28+
289
+ // https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
290
+ overScrollMode={isAndroid ? "never" : "auto"}
291
+ scrollIndicatorInsets={scrollIndicatorInsets}
292
+ extraData={feed}
293
+ stickyHeaderIndices={stickyHeaderIndices}
294
+ removeClippedSubviews={isAndroid}
295
+ onLayout={handleOnLayout}
296
+ initialNumToRender={3}
297
+ maxToRenderPerBatch={10}
298
+ windowSize={12}
299
+ listKey={riverId}
300
+ keyExtractor={keyExtractor}
301
+ renderItem={renderRiverItem}
302
+ data={riverComponents}
303
+ contentContainerStyle={contentContainerStyle}
304
+ ListFooterComponent={
305
+ <RiverFooter
306
+ flatListHeight={flatListHeight}
307
+ loadingState={loadingState}
308
+ />
309
+ }
310
+ refreshControl={refreshControl}
311
+ onScrollBeginDrag={onScrollBeginDrag}
312
+ onScroll={onScroll}
313
+ onMomentumScrollEnd={_onMomentumScrollEnd}
314
+ onScrollEndDrag={_onScrollEndDrag}
315
+ scrollEventThrottle={16}
316
+ {...scrollViewExtraProps}
298
317
  />
299
- }
300
- refreshControl={refreshControl}
301
- onScrollBeginDrag={onScrollBeginDrag}
302
- onScroll={onScroll}
303
- onMomentumScrollEnd={_onMomentumScrollEnd}
304
- onScrollEndDrag={_onScrollEndDrag}
305
- scrollEventThrottle={16}
306
- {...scrollViewExtraProps}
307
- />
308
- </ViewportTracker>
309
- </ScreenLoadingMeasurements>
318
+ </ViewportTracker>
319
+ </ScreenLoadingMeasurements>
320
+ </ComponentsMapRefContext.Provider>
321
+ </ComponentsMapHeightContext.Provider>
310
322
  </View>
311
323
  );
312
324
  }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+
3
+ export const ComponentsMapHeightContext = React.createContext<number | null>(
4
+ null
5
+ );
6
+
7
+ export const useComponentsMapHeight = () =>
8
+ React.useContext(ComponentsMapHeightContext);
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { View } from "react-native";
3
+
4
+ export const ComponentsMapRefContext =
5
+ React.createContext<React.RefObject<View | null> | null>(null);
6
+
7
+ export const useComponentsMapRef = () =>
8
+ React.useContext(ComponentsMapRefContext);
@@ -372,7 +372,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
372
372
  maxDeltaY={lastSnap - modalSnapPoints[0]}
373
373
  numberOfTaps={1}
374
374
  >
375
- <View pointerEvents="box-none">
375
+ <View pointerEvents="box-none" style={generalStyles.container}>
376
376
  <PanGestureHandler
377
377
  enabled={isEnablePanGesture}
378
378
  ref={panHandlerRef}
@@ -382,7 +382,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
382
382
  onHandlerStateChange={onHandlerStateChange}
383
383
  activeOffsetY={[-5, 5]}
384
384
  >
385
- <Animated.View>
385
+ <Animated.View style={generalStyles.container}>
386
386
  <NativeViewGestureHandler
387
387
  ref={scrollRef}
388
388
  waitFor={tapHandlerRef}
@@ -397,6 +397,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
397
397
  onMomentumScrollEnd={onMomentumScrollEnd}
398
398
  scrollEventThrottle={1}
399
399
  showsVerticalScrollIndicator={false}
400
+ contentContainerStyle={generalStyles.container}
400
401
  >
401
402
  {children}
402
403
  </Animated.ScrollView>
@@ -4,8 +4,8 @@ import {
4
4
  Dimensions,
5
5
  Easing,
6
6
  StyleProp,
7
- ViewStyle,
8
7
  StyleSheet,
8
+ ViewStyle,
9
9
  } from "react-native";
10
10
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
11
11
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
@@ -13,6 +13,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
13
13
  import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
14
14
 
15
15
  const { width: SCREEN_WIDTH } = Dimensions.get("screen");
16
+ const flex1 = { flex: 1 };
16
17
 
17
18
  type Configuration = {
18
19
  [key: string]: any;
@@ -50,7 +51,7 @@ export const PlayerDetails = ({
50
51
  const extraTabletStyles = !isAudioPlayer
51
52
  ? isTabletLandscape
52
53
  ? { marginTop: -insets.top, paddingTop: insets.top + 20 }
53
- : { marginTop: -8, paddingTop: -8 }
54
+ : {}
54
55
  : {};
55
56
 
56
57
  // Animation setup
@@ -93,6 +94,7 @@ export const PlayerDetails = ({
93
94
  transform: [{ translateY }],
94
95
  opacity,
95
96
  },
97
+ flex1,
96
98
  {
97
99
  // workaround for avoid wrong text-height after going back to portrait rotation
98
100
  // we don't see this view in landscape mode, so we are able to use fixed width from portrait mode
@@ -107,6 +109,7 @@ export const PlayerDetails = ({
107
109
  riverId={screenData.id}
108
110
  feed={screenData?.data?.source}
109
111
  riverComponents={screenData.ui_components}
112
+ isScreenWrappedInContainer
110
113
  />
111
114
  ) : null}
112
115
  </Animated.View>
@@ -238,7 +238,6 @@ const PlayerWrapperComponent = (props: Props) => {
238
238
  </AnimatedVideoPlayerComponent>
239
239
  </AnimationComponent>
240
240
  </View>
241
-
242
241
  <AnimatedScrollModal>
243
242
  {isShowPlayerDetails ? (
244
243
  <AnimationComponent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.8-alpha.1965510704",
3
+ "version": "13.0.8-alpha.2505844239",
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",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.8-alpha.1965510704",
35
- "@applicaster/zapp-react-native-bridge": "13.0.8-alpha.1965510704",
36
- "@applicaster/zapp-react-native-redux": "13.0.8-alpha.1965510704",
37
- "@applicaster/zapp-react-native-utils": "13.0.8-alpha.1965510704",
34
+ "@applicaster/applicaster-types": "13.0.8-alpha.2505844239",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.8-alpha.2505844239",
36
+ "@applicaster/zapp-react-native-redux": "13.0.8-alpha.2505844239",
37
+ "@applicaster/zapp-react-native-utils": "13.0.8-alpha.2505844239",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",