@applicaster/zapp-react-native-ui-components 12.0.0-rc.50 → 12.0.0-rc.52
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/MasterCell/DefaultComponents/Image/Image.ios.tsx +5 -3
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +8 -5
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +0 -5
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +11 -4
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +9 -2
- package/package.json +5 -5
|
@@ -43,14 +43,16 @@ function Image({
|
|
|
43
43
|
[source, error]
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
+
const _source = shouldRenderImg
|
|
47
|
+
? withDimensions(source)
|
|
48
|
+
: defaultPlaceHolderImage;
|
|
49
|
+
|
|
46
50
|
return (
|
|
47
51
|
// @ts-ignore
|
|
48
52
|
<MemoizedImage
|
|
49
53
|
style={style as ImageStyle}
|
|
50
54
|
onError={() => setErrorState(true)}
|
|
51
|
-
source={
|
|
52
|
-
shouldRenderImg ? withDimensions(source) : defaultPlaceHolderImage
|
|
53
|
-
}
|
|
55
|
+
source={_source?.uri ? _source : undefined}
|
|
54
56
|
{...R.omit(["source"], otherProps)}
|
|
55
57
|
/>
|
|
56
58
|
);
|
|
@@ -54,7 +54,10 @@ import { toNumber } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
|
54
54
|
import { usePlayNextOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayNextOverlay";
|
|
55
55
|
import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
|
|
56
56
|
|
|
57
|
-
import {
|
|
57
|
+
import {
|
|
58
|
+
useModalAnimationContext,
|
|
59
|
+
PlayerAnimationStateEnum,
|
|
60
|
+
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
58
61
|
|
|
59
62
|
type Props = {
|
|
60
63
|
Player: React.ComponentType<any>;
|
|
@@ -231,6 +234,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
231
234
|
const screenData = useTargetScreenData(item);
|
|
232
235
|
const { setVisible: showNavBar } = useSetNavbarState();
|
|
233
236
|
|
|
237
|
+
const { isActiveGesture, startComponentsAnimation, setPlayerAnimationState } =
|
|
238
|
+
useModalAnimationContext();
|
|
239
|
+
|
|
234
240
|
const playerEvent = (event, ...args) => {
|
|
235
241
|
playerManager.invokeHandler(event, ...args);
|
|
236
242
|
};
|
|
@@ -448,7 +454,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
448
454
|
if (disableMiniPlayer) {
|
|
449
455
|
navigator.closeVideoModal();
|
|
450
456
|
} else {
|
|
451
|
-
|
|
457
|
+
setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
|
|
452
458
|
}
|
|
453
459
|
}
|
|
454
460
|
|
|
@@ -600,9 +606,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
600
606
|
pluginConfiguration,
|
|
601
607
|
};
|
|
602
608
|
|
|
603
|
-
const { isActiveGesture, startComponentsAnimation } =
|
|
604
|
-
useModalAnimationContext();
|
|
605
|
-
|
|
606
609
|
return (
|
|
607
610
|
<PlayerStateContext.Provider value={value}>
|
|
608
611
|
<PlayerContainerContextProvider
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
TapGestureHandler,
|
|
10
10
|
GestureHandlerRootView,
|
|
11
11
|
} from "react-native-gesture-handler";
|
|
12
|
+
|
|
13
|
+
import { PlayerContainerContext } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainerContext";
|
|
12
14
|
import {
|
|
13
15
|
useModalAnimationContext,
|
|
14
16
|
PlayerAnimationStateEnum,
|
|
@@ -58,6 +60,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
58
60
|
setLastSnap,
|
|
59
61
|
} = useModalAnimationContext();
|
|
60
62
|
|
|
63
|
+
const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
|
|
64
|
+
|
|
61
65
|
const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
|
|
62
66
|
useNavigation();
|
|
63
67
|
|
|
@@ -69,6 +73,11 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
69
73
|
playerAnimationState !== PlayerAnimationStateEnum.minimize &&
|
|
70
74
|
playerAnimationState !== PlayerAnimationStateEnum.maximaze;
|
|
71
75
|
|
|
76
|
+
const isEnablePanGesture =
|
|
77
|
+
!isLanguageOverlayVisible &&
|
|
78
|
+
isNotMinimizeMaximazeAnimation &&
|
|
79
|
+
(isMaximazedModal || isMinimizedModal);
|
|
80
|
+
|
|
72
81
|
const isAudioItem = React.useMemo(
|
|
73
82
|
() =>
|
|
74
83
|
videoModalState.item?.content?.type?.includes?.("audio") ||
|
|
@@ -290,15 +299,13 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
290
299
|
>
|
|
291
300
|
<View pointerEvents="box-none">
|
|
292
301
|
<PanGestureHandler
|
|
293
|
-
enabled={
|
|
294
|
-
(isMaximazedModal || isMinimizedModal) &&
|
|
295
|
-
isNotMinimizeMaximazeAnimation
|
|
296
|
-
}
|
|
302
|
+
enabled={isEnablePanGesture}
|
|
297
303
|
ref={panHandlerRef}
|
|
298
304
|
simultaneousHandlers={[scrollRef, tapHandlerRef]}
|
|
299
305
|
shouldCancelWhenOutside={isMaximazedModal}
|
|
300
306
|
onGestureEvent={onGestureEvent}
|
|
301
307
|
onHandlerStateChange={onHandlerStateChange}
|
|
308
|
+
activeOffsetY={[-5, 5]}
|
|
302
309
|
>
|
|
303
310
|
<Animated.View>
|
|
304
311
|
<NativeViewGestureHandler
|
|
@@ -3,6 +3,8 @@ import { Animated, StyleSheet } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
5
5
|
import { PanGestureHandler, State } from "react-native-gesture-handler";
|
|
6
|
+
|
|
7
|
+
import { PlayerContainerContext } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainerContext";
|
|
6
8
|
import {
|
|
7
9
|
useModalAnimationContext,
|
|
8
10
|
PlayerAnimationStateEnum,
|
|
@@ -35,9 +37,14 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
35
37
|
} = useModalAnimationContext();
|
|
36
38
|
|
|
37
39
|
const { videoModalState } = useNavigation();
|
|
40
|
+
const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
|
|
41
|
+
|
|
38
42
|
const isMaximazedModal = videoModalState.mode === "MAXIMIZED";
|
|
39
43
|
const isMinimizedModal = videoModalState.mode === "MINIMIZED";
|
|
40
44
|
|
|
45
|
+
const isEnablePanGesture =
|
|
46
|
+
!isLanguageOverlayVisible && (isMaximazedModal || isMinimizedModal);
|
|
47
|
+
|
|
41
48
|
const onGestureEvent = Animated.event(
|
|
42
49
|
[{ nativeEvent: { translationY: dragVideoPlayerY } }],
|
|
43
50
|
{ useNativeDriver: true }
|
|
@@ -53,7 +60,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
53
60
|
if (videoModalState.mode === "MAXIMIZED") {
|
|
54
61
|
if (translationY > 0) {
|
|
55
62
|
const endOffsetY =
|
|
56
|
-
lastSnap + preparedTranslationY + dragToss * velocityY +
|
|
63
|
+
lastSnap + preparedTranslationY + dragToss * velocityY + 200;
|
|
57
64
|
|
|
58
65
|
let destSnapPoint = modalSnapPoints[0];
|
|
59
66
|
|
|
@@ -127,7 +134,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
127
134
|
|
|
128
135
|
return (
|
|
129
136
|
<PanGestureHandler
|
|
130
|
-
enabled={
|
|
137
|
+
enabled={isEnablePanGesture}
|
|
131
138
|
shouldCancelWhenOutside={isMaximazedModal}
|
|
132
139
|
onGestureEvent={onGestureEvent}
|
|
133
140
|
onHandlerStateChange={onHandlerStateChange}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.0-rc.
|
|
3
|
+
"version": "12.0.0-rc.52",
|
|
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",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"redux-mock-store": "^1.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@applicaster/applicaster-types": "12.0.0-rc.
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-rc.
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-rc.
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-rc.
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.0-rc.52",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-rc.52",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-rc.52",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-rc.52",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|