@applicaster/zapp-react-native-ui-components 15.0.0-alpha.2463014505 → 15.0.0-rc.2
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/River/ComponentsMap/ComponentsMap.tsx +42 -49
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +1 -3
- package/Components/VideoModal/PlayerDetails.tsx +5 -5
- package/package.json +5 -5
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapHeightContext.ts +0 -8
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapRefContext.ts +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import {
|
|
3
|
+
import { View, StyleSheet, FlatList } 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
|
-
usePipesCacheReset,
|
|
13
12
|
useProfilerLogging,
|
|
13
|
+
usePipesCacheReset,
|
|
14
14
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
15
15
|
import { useLoadingState } from "./hooks/useLoadingState";
|
|
16
16
|
import { ViewportTracker } from "../../Viewport";
|
|
@@ -25,8 +25,6 @@ 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";
|
|
30
28
|
|
|
31
29
|
const isAndroid = isAndroidPlatform();
|
|
32
30
|
|
|
@@ -72,7 +70,6 @@ function ComponentsMapComponent(props: Props) {
|
|
|
72
70
|
} = props;
|
|
73
71
|
|
|
74
72
|
const flatListRef = React.useRef<FlatList | null>(null);
|
|
75
|
-
const flatListWrapperRef = React.useRef<View | null>(null);
|
|
76
73
|
const screenConfig = useScreenConfiguration(riverId);
|
|
77
74
|
const screenData = useScreenData(riverId);
|
|
78
75
|
const pullToRefreshEnabled = screenData?.rules?.pull_to_refresh_enabled;
|
|
@@ -268,51 +265,47 @@ function ComponentsMapComponent(props: Props) {
|
|
|
268
265
|
// The Screen Picker in Mobile is completly different than the TV
|
|
269
266
|
// so the various offsets / margins in TV do not apply here.
|
|
270
267
|
return (
|
|
271
|
-
<View style={styles.container}
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
flatListHeight={flatListHeight}
|
|
301
|
-
loadingState={loadingState}
|
|
302
|
-
/>
|
|
303
|
-
}
|
|
304
|
-
refreshControl={refreshControl}
|
|
305
|
-
onScrollBeginDrag={onScrollBeginDrag}
|
|
306
|
-
onScroll={onScroll}
|
|
307
|
-
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
308
|
-
onScrollEndDrag={_onScrollEndDrag}
|
|
309
|
-
scrollEventThrottle={16}
|
|
310
|
-
{...scrollViewExtraProps}
|
|
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
|
+
keyExtractor={keyExtractor}
|
|
290
|
+
renderItem={renderRiverItem}
|
|
291
|
+
data={riverComponents}
|
|
292
|
+
contentContainerStyle={contentContainerStyle}
|
|
293
|
+
ListFooterComponent={
|
|
294
|
+
<RiverFooter
|
|
295
|
+
flatListHeight={flatListHeight}
|
|
296
|
+
loadingState={loadingState}
|
|
311
297
|
/>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
298
|
+
}
|
|
299
|
+
refreshControl={refreshControl}
|
|
300
|
+
onScrollBeginDrag={onScrollBeginDrag}
|
|
301
|
+
onScroll={onScroll}
|
|
302
|
+
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
303
|
+
onScrollEndDrag={_onScrollEndDrag}
|
|
304
|
+
scrollEventThrottle={16}
|
|
305
|
+
{...scrollViewExtraProps}
|
|
306
|
+
/>
|
|
307
|
+
</ViewportTracker>
|
|
308
|
+
</ScreenLoadingMeasurements>
|
|
316
309
|
</View>
|
|
317
310
|
);
|
|
318
311
|
}
|
|
@@ -42,8 +42,6 @@ type Props = {
|
|
|
42
42
|
children: React.ReactNode;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const activeOffsetY = [-5, 5] as [number, number];
|
|
46
|
-
|
|
47
45
|
export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
48
46
|
const {
|
|
49
47
|
isActiveGesture,
|
|
@@ -374,9 +372,9 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
374
372
|
ref={panHandlerRef}
|
|
375
373
|
simultaneousHandlers={[scrollRef, tapHandlerRef]}
|
|
376
374
|
shouldCancelWhenOutside={isMaximizedModal}
|
|
377
|
-
activeOffsetY={activeOffsetY}
|
|
378
375
|
onGestureEvent={onGestureEvent}
|
|
379
376
|
onHandlerStateChange={onHandlerStateChange}
|
|
377
|
+
activeOffsetY={[-5, 5]}
|
|
380
378
|
>
|
|
381
379
|
<Animated.View>
|
|
382
380
|
<NativeViewGestureHandler
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
Dimensions,
|
|
5
5
|
Easing,
|
|
6
6
|
StyleProp,
|
|
7
|
-
StyleSheet,
|
|
8
7
|
ViewStyle,
|
|
8
|
+
StyleSheet,
|
|
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";
|
|
@@ -69,10 +69,11 @@ export const PlayerDetails = ({
|
|
|
69
69
|
const screenData = useTargetScreenData(entry);
|
|
70
70
|
const insets = useSafeAreaInsets();
|
|
71
71
|
|
|
72
|
-
const extraTabletStyles =
|
|
73
|
-
|
|
72
|
+
const extraTabletStyles = !isAudioPlayer
|
|
73
|
+
? isTabletLandscape
|
|
74
74
|
? { marginTop: -insets.top, paddingTop: insets.top + 20 }
|
|
75
|
-
:
|
|
75
|
+
: { marginTop: -8, paddingTop: -8 }
|
|
76
|
+
: {};
|
|
76
77
|
|
|
77
78
|
// Animation setup
|
|
78
79
|
const translateY = useRef(new Animated.Value(50)).current;
|
|
@@ -128,7 +129,6 @@ export const PlayerDetails = ({
|
|
|
128
129
|
riverId={screenData.id}
|
|
129
130
|
feed={screenData?.data?.source}
|
|
130
131
|
riverComponents={screenData.ui_components}
|
|
131
|
-
isScreenWrappedInContainer
|
|
132
132
|
/>
|
|
133
133
|
) : null}
|
|
134
134
|
</Animated.View>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "15.0.0-
|
|
3
|
+
"version": "15.0.0-rc.2",
|
|
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": "15.0.0-
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "15.0.0-
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "15.0.0-
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.2",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.2",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.2",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.2",
|
|
35
35
|
"promise": "^8.3.0",
|
|
36
36
|
"url": "^0.11.0",
|
|
37
37
|
"uuid": "^3.3.2"
|
|
@@ -1,8 +0,0 @@
|
|
|
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);
|