@applicaster/zapp-react-native-ui-components 12.0.0-rc.130 → 12.0.0-rc.132
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/Cell/Cell.tsx +8 -1
- package/Components/FocusableList/FocusableChild.ts +3 -1
- package/Components/MasterCell/utils/index.ts +3 -4
- package/Components/PlayerContainer/PlayerContainer.tsx +9 -7
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +3 -9
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +38 -41
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +9 -6
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +18 -24
- package/package.json +5 -5
package/Components/Cell/Cell.tsx
CHANGED
|
@@ -276,13 +276,20 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
276
276
|
skipFocusManagerRegistration={skipFocusManagerRegistration}
|
|
277
277
|
>
|
|
278
278
|
{(focused, event) => {
|
|
279
|
+
const isFocused = this.isCellFocused(focused);
|
|
280
|
+
|
|
281
|
+
if (isFocused) {
|
|
282
|
+
const accessibilityManager = AccessibilityManager.getInstance();
|
|
283
|
+
accessibilityManager.readText({ text: item.title });
|
|
284
|
+
}
|
|
285
|
+
|
|
279
286
|
return (
|
|
280
287
|
<FocusableCell
|
|
281
288
|
{...{
|
|
282
289
|
index,
|
|
283
290
|
CellRenderer,
|
|
284
291
|
item,
|
|
285
|
-
focused:
|
|
292
|
+
focused: isFocused,
|
|
286
293
|
scrollTo: this.scrollToIndex(event),
|
|
287
294
|
behavior,
|
|
288
295
|
}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isEqual } from "@applicaster/zapp-react-native-utils/equalUtils";
|
|
3
3
|
import { useFocusable } from "../Focusable/index.android";
|
|
4
|
+
import { useCellState } from "./hooks/useCellState.android";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* returns parent focus from prop or from context
|
|
@@ -29,7 +30,8 @@ const useParentFocus = (
|
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
function FocusableChildComponent(props) {
|
|
32
|
-
const { setIsFocusable,
|
|
33
|
+
const { setIsFocusable, ...focusableContext } = useFocusable();
|
|
34
|
+
const focused = useCellState(props.id);
|
|
33
35
|
|
|
34
36
|
const parentFocus = useParentFocus(props, focusableContext);
|
|
35
37
|
|
|
@@ -53,10 +53,9 @@ function resolveColorForProp(entry, style, colorProp) {
|
|
|
53
53
|
const colorFromProp = style[colorProp];
|
|
54
54
|
const nestedEntryValue = R.path(colorFromProp.split("."), entry);
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
) {
|
|
56
|
+
const color = colorFromProp.replace(".00", "").replace(".0", ""); // https://github.com/dreamyguy/validate-color/issues/44
|
|
57
|
+
|
|
58
|
+
if (nestedEntryValue === undefined && !validateColor(color)) {
|
|
60
59
|
logWarning(colorFromProp, style, entry, nestedEntryValue);
|
|
61
60
|
}
|
|
62
61
|
|
|
@@ -362,13 +362,15 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
362
362
|
const toggleFullscreen = (event) => {
|
|
363
363
|
const { fullscreen = false } = event || {};
|
|
364
364
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
365
|
+
setTimeout(() => {
|
|
366
|
+
if (fullscreen) {
|
|
367
|
+
navigator.fullscreenVideoModal();
|
|
368
|
+
playerEvent("onFullscreenPlayerWillPresent");
|
|
369
|
+
} else {
|
|
370
|
+
navigator.maximiseVideoModal();
|
|
371
|
+
playerEvent("onFullscreenPlayerWillDismiss");
|
|
372
|
+
}
|
|
373
|
+
});
|
|
372
374
|
};
|
|
373
375
|
|
|
374
376
|
const onCellTap = (entry) => {
|
|
@@ -45,15 +45,9 @@ export const AnimatedPlayerModalWrapper = (props: Props) => {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
React.useEffect(() => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setStartComponentsAnimation(true);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return () => {
|
|
55
|
-
translateYListener && translateY.removeListener(translateYListener);
|
|
56
|
-
};
|
|
48
|
+
(playerAnimationState === PlayerAnimationStateEnum.minimize ||
|
|
49
|
+
playerAnimationState === PlayerAnimationStateEnum.maximaze) &&
|
|
50
|
+
setStartComponentsAnimation(true);
|
|
57
51
|
}, [playerAnimationState]);
|
|
58
52
|
|
|
59
53
|
return (
|
|
@@ -66,9 +66,10 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
66
66
|
const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
|
|
67
67
|
useNavigation();
|
|
68
68
|
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
69
|
+
const { mode: videoModalMode, item: videoModalItem } = videoModalState;
|
|
70
|
+
const isMaximazedModal = videoModalMode === "MAXIMIZED";
|
|
71
|
+
const isMinimizedModal = videoModalMode === "MINIMIZED";
|
|
72
|
+
const previousItemId = usePrevious(videoModalItem?.id);
|
|
72
73
|
|
|
73
74
|
const isNotMinimizeMaximazeAnimation =
|
|
74
75
|
playerAnimationState !== PlayerAnimationStateEnum.minimize &&
|
|
@@ -81,9 +82,9 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
81
82
|
|
|
82
83
|
const isAudioItem = React.useMemo(
|
|
83
84
|
() =>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
[
|
|
85
|
+
videoModalItem?.content?.type?.includes?.("audio") ||
|
|
86
|
+
videoModalItem?.type?.value === "audio",
|
|
87
|
+
[videoModalItem]
|
|
87
88
|
);
|
|
88
89
|
|
|
89
90
|
// Refs for components
|
|
@@ -114,7 +115,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
114
115
|
const preparedTranslationY =
|
|
115
116
|
Math.abs(translationY) - lastScrollYValue.current;
|
|
116
117
|
|
|
117
|
-
if (
|
|
118
|
+
if (videoModalMode === "MAXIMIZED") {
|
|
118
119
|
const endOffsetY =
|
|
119
120
|
lastSnap + preparedTranslationY + dragToss * velocityY + 150;
|
|
120
121
|
|
|
@@ -161,7 +162,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
161
162
|
resetPlayerAnimationState();
|
|
162
163
|
}
|
|
163
164
|
},
|
|
164
|
-
[lastSnap, modalSnapPoints, playerAnimationState,
|
|
165
|
+
[lastSnap, modalSnapPoints, playerAnimationState, videoModalMode]
|
|
165
166
|
);
|
|
166
167
|
|
|
167
168
|
const onScroll = React.useCallback(({ nativeEvent }) => {
|
|
@@ -196,10 +197,9 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
196
197
|
}, []);
|
|
197
198
|
|
|
198
199
|
React.useEffect(() => {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
) {
|
|
200
|
+
const { mode, previousMode, item } = videoModalState;
|
|
201
|
+
|
|
202
|
+
if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
|
|
203
203
|
// set animation to the minimize values if moving from the player to another screen
|
|
204
204
|
if (playerAnimationState === null) {
|
|
205
205
|
setScrollModalAnimatedValue(
|
|
@@ -214,22 +214,17 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
214
214
|
dragScrollY,
|
|
215
215
|
dragVideoPlayerY
|
|
216
216
|
);
|
|
217
|
-
} else {
|
|
218
|
-
resetPlayerAnimationState();
|
|
219
217
|
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
previousItemId
|
|
226
|
-
(previousItemId !== videoModalState.item?.id &&
|
|
227
|
-
videoModalState.mode !== "FULLSCREEN")
|
|
218
|
+
} else if (
|
|
219
|
+
playerAnimationState === null &&
|
|
220
|
+
((previousItemId === item?.id &&
|
|
221
|
+
mode === "MAXIMIZED" &&
|
|
222
|
+
(previousMode === "MINIMIZED" || previousMode === "MAXIMIZED")) ||
|
|
223
|
+
(previousItemId !== item?.id && mode !== "FULLSCREEN"))
|
|
228
224
|
) {
|
|
229
225
|
setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
|
|
230
|
-
setTimeout(() => resetPlayerAnimationState());
|
|
231
226
|
}
|
|
232
|
-
}, [videoModalState
|
|
227
|
+
}, [videoModalState]);
|
|
233
228
|
|
|
234
229
|
React.useEffect(() => {
|
|
235
230
|
if (playerAnimationState === PlayerAnimationStateEnum.minimize) {
|
|
@@ -254,22 +249,22 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
254
249
|
translateYOffset,
|
|
255
250
|
getAnimatedConfig(modalSnapPoints[1])
|
|
256
251
|
).start(() => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
252
|
+
minimiseVideoModal();
|
|
253
|
+
|
|
254
|
+
setScrollModalAnimatedValue(
|
|
255
|
+
translateYOffset,
|
|
256
|
+
modalSnapPoints[1],
|
|
257
|
+
setLastSnap
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
resetScrollAnimatedValues(
|
|
261
|
+
lastScrollY,
|
|
262
|
+
lastScrollYValue,
|
|
263
|
+
dragScrollY,
|
|
264
|
+
dragVideoPlayerY
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
resetPlayerAnimationState();
|
|
273
268
|
});
|
|
274
269
|
} else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
|
|
275
270
|
Animated.timing(translateYOffset, getAnimatedConfig(0)).start(() => {
|
|
@@ -286,7 +281,9 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
286
281
|
resetPlayerAnimationState();
|
|
287
282
|
});
|
|
288
283
|
}
|
|
284
|
+
}, [playerAnimationState]);
|
|
289
285
|
|
|
286
|
+
React.useEffect(() => {
|
|
290
287
|
const lastScrollYListenerId = lastScrollY.addListener(({ value }) => {
|
|
291
288
|
lastScrollYValue.current = value;
|
|
292
289
|
});
|
|
@@ -312,7 +309,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
312
309
|
lastScrollY.removeListener(lastScrollYListenerId);
|
|
313
310
|
dragScrollY.removeListener(dragListenerId);
|
|
314
311
|
};
|
|
315
|
-
}, [playerAnimationState, isAudioItem,
|
|
312
|
+
}, [playerAnimationState, isAudioItem, isMinimizedModal]);
|
|
316
313
|
|
|
317
314
|
const Wrapper = React.useMemo(
|
|
318
315
|
() => (Platform.OS === "android" ? GestureHandlerRootView : View),
|
|
@@ -37,11 +37,14 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
37
37
|
setStartComponentsAnimation,
|
|
38
38
|
} = useModalAnimationContext();
|
|
39
39
|
|
|
40
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
videoModalState: { mode: videoModalMode },
|
|
42
|
+
} = useNavigation();
|
|
43
|
+
|
|
41
44
|
const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
|
|
42
45
|
|
|
43
|
-
const isMaximazedModal =
|
|
44
|
-
const isMinimizedModal =
|
|
46
|
+
const isMaximazedModal = videoModalMode === "MAXIMIZED";
|
|
47
|
+
const isMinimizedModal = videoModalMode === "MINIMIZED";
|
|
45
48
|
|
|
46
49
|
const isEnablePanGesture =
|
|
47
50
|
!isLanguageOverlayVisible && (isMaximazedModal || isMinimizedModal);
|
|
@@ -59,7 +62,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
59
62
|
const preparedTranslationY = Math.abs(translationY);
|
|
60
63
|
const dragToss = 0.05;
|
|
61
64
|
|
|
62
|
-
if (
|
|
65
|
+
if (videoModalMode === "MAXIMIZED") {
|
|
63
66
|
if (translationY > 0) {
|
|
64
67
|
const endOffsetY =
|
|
65
68
|
lastSnap + preparedTranslationY + dragToss * velocityY + 200;
|
|
@@ -84,7 +87,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
84
87
|
setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
|
-
} else if (
|
|
90
|
+
} else if (videoModalMode === "MINIMIZED") {
|
|
88
91
|
if (translationY < 0) {
|
|
89
92
|
// from mini to full
|
|
90
93
|
setLastSnap(modalSnapPoints[0]);
|
|
@@ -100,7 +103,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
},
|
|
103
|
-
[lastSnap, modalSnapPoints,
|
|
106
|
+
[lastSnap, modalSnapPoints, videoModalMode]
|
|
104
107
|
);
|
|
105
108
|
|
|
106
109
|
React.useEffect(() => {
|
|
@@ -66,6 +66,8 @@ export const AnimationView = ({
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const { videoModalState } = useNavigation();
|
|
69
|
+
const { mode: videoModalMode, item: videoModalItem } = videoModalState;
|
|
70
|
+
|
|
69
71
|
const insets = useSafeAreaInsets();
|
|
70
72
|
const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
|
|
71
73
|
const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
|
|
@@ -88,9 +90,9 @@ export const AnimationView = ({
|
|
|
88
90
|
|
|
89
91
|
const isAudioItem = React.useMemo(
|
|
90
92
|
() =>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
[
|
|
93
|
+
videoModalItem?.content?.type?.includes?.("audio") ||
|
|
94
|
+
videoModalItem?.type?.value === "audio",
|
|
95
|
+
[videoModalItem]
|
|
94
96
|
);
|
|
95
97
|
|
|
96
98
|
const inlineAudioPlayer = additionalData.inlineAudioPlayer;
|
|
@@ -229,10 +231,8 @@ export const AnimationView = ({
|
|
|
229
231
|
);
|
|
230
232
|
|
|
231
233
|
const getInitialValue = React.useCallback(() => {
|
|
232
|
-
const mode =
|
|
233
|
-
|
|
234
|
-
? videoModalState.previousMode
|
|
235
|
-
: videoModalState.mode;
|
|
234
|
+
const { mode: videoModalMode, previousMode } = videoModalState;
|
|
235
|
+
const mode = videoModalMode === "PIP" ? previousMode : videoModalMode;
|
|
236
236
|
|
|
237
237
|
switch (mode) {
|
|
238
238
|
case "MINIMIZED":
|
|
@@ -266,7 +266,7 @@ export const AnimationView = ({
|
|
|
266
266
|
isTablet,
|
|
267
267
|
isTabletLandscape,
|
|
268
268
|
isRTL,
|
|
269
|
-
fromMiniPlayer:
|
|
269
|
+
fromMiniPlayer: videoModalMode === "MINIMIZED",
|
|
270
270
|
inlineAudioPlayer,
|
|
271
271
|
}),
|
|
272
272
|
[
|
|
@@ -276,7 +276,7 @@ export const AnimationView = ({
|
|
|
276
276
|
defaultValue,
|
|
277
277
|
moveUpValue,
|
|
278
278
|
moveComponentHorizontalValue,
|
|
279
|
-
|
|
279
|
+
videoModalMode,
|
|
280
280
|
]
|
|
281
281
|
);
|
|
282
282
|
|
|
@@ -305,7 +305,7 @@ export const AnimationView = ({
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
if (
|
|
308
|
-
|
|
308
|
+
videoModalMode === "MAXIMIZED" &&
|
|
309
309
|
defaultValue.x !== screenWidth &&
|
|
310
310
|
width &&
|
|
311
311
|
height
|
|
@@ -318,10 +318,9 @@ export const AnimationView = ({
|
|
|
318
318
|
}, [screenWidth]);
|
|
319
319
|
|
|
320
320
|
React.useEffect(() => {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
) {
|
|
321
|
+
const { mode, previousMode } = videoModalState;
|
|
322
|
+
|
|
323
|
+
if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
|
|
325
324
|
// set animation to the minimize values if moving from the player to another screen
|
|
326
325
|
if (playerAnimationState === null) {
|
|
327
326
|
const value = getAnimationValue(
|
|
@@ -338,7 +337,7 @@ export const AnimationView = ({
|
|
|
338
337
|
if (
|
|
339
338
|
playerAnimationState === PlayerAnimationStateEnum.minimize &&
|
|
340
339
|
startComponentsAnimation &&
|
|
341
|
-
|
|
340
|
+
videoModalMode === "MAXIMIZED"
|
|
342
341
|
) {
|
|
343
342
|
Animated.timing(
|
|
344
343
|
animatedValue,
|
|
@@ -347,12 +346,7 @@ export const AnimationView = ({
|
|
|
347
346
|
} else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
|
|
348
347
|
animatedValue.setValue(defaultValue);
|
|
349
348
|
}
|
|
350
|
-
}, [
|
|
351
|
-
playerAnimationState,
|
|
352
|
-
startComponentsAnimation,
|
|
353
|
-
videoModalState.mode,
|
|
354
|
-
defaultValue,
|
|
355
|
-
]);
|
|
349
|
+
}, [playerAnimationState, startComponentsAnimation, defaultValue]);
|
|
356
350
|
|
|
357
351
|
React.useEffect(() => {
|
|
358
352
|
const dragVideoPlayerYListenerId = dragVideoPlayerY.addListener(
|
|
@@ -414,9 +408,9 @@ export const AnimationView = ({
|
|
|
414
408
|
ref={animationComponentRef}
|
|
415
409
|
style={[
|
|
416
410
|
...preparedStyles,
|
|
417
|
-
(
|
|
418
|
-
|
|
419
|
-
(
|
|
411
|
+
(videoModalMode === "MAXIMIZED" ||
|
|
412
|
+
videoModalMode === "MINIMIZED" ||
|
|
413
|
+
(videoModalMode === "PIP" && isAppActive)) &&
|
|
420
414
|
getAnimationStyle(animationType, animatedValue),
|
|
421
415
|
]}
|
|
422
416
|
>
|
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.132",
|
|
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.132",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-rc.132",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-rc.132",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-rc.132",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|