@applicaster/zapp-react-native-ui-components 12.0.11 → 12.0.12-rc.0

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.
@@ -337,9 +337,9 @@ const PlayerContainerComponent = (props: Props) => {
337
337
 
338
338
  const resumeTime = Number(item?.extensions?.resumeTime);
339
339
 
340
- // TODO: This is temp hack, will be removed on next pr with player refactoring
340
+ // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
341
341
  if (
342
- !!playerManager.getActivePlayer()?.getContinueWatchingOffset === false &&
342
+ !playerManager.getActivePlayer()?.hasResumePosition() &&
343
343
  !isNaN(resumeTime)
344
344
  ) {
345
345
  player?.seekTo(resumeTime);
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, useEffect, useState } from "react";
1
+ import React, { PropsWithChildren } from "react";
2
2
  import { ImageBackground, View } from "react-native";
3
3
 
4
4
  import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
@@ -12,7 +12,6 @@ import {
12
12
  type Props = PropsWithChildren<{
13
13
  entry: ZappEntry;
14
14
  style?: { [K: string]: any };
15
- docked?: boolean;
16
15
  imageStyle?: { [K: string]: any };
17
16
  imageKey?: string;
18
17
  defaultImageDimensions?: { [K: string]: any };
@@ -24,7 +23,6 @@ const PlayerImageBackgroundComponent = ({
24
23
  entry,
25
24
  children,
26
25
  style,
27
- docked,
28
26
  imageStyle,
29
27
  imageKey,
30
28
  defaultImageDimensions,
@@ -36,42 +34,24 @@ const PlayerImageBackgroundComponent = ({
36
34
 
37
35
  const { playerAnimationState } = useModalAnimationContext();
38
36
 
39
- const [lastNonNullAnimationState, setLastNonNullAnimationState] =
40
- useState(playerAnimationState);
41
-
42
- useEffect(() => {
43
- if (playerAnimationState !== null) {
44
- setLastNonNullAnimationState(playerAnimationState);
45
- }
46
- }, [playerAnimationState]);
47
-
48
37
  if (!source) return <>{children}</>;
49
38
 
50
- const imageBackgroundStyle =
51
- lastNonNullAnimationState !== PlayerAnimationStateEnum.minimize && !docked
52
- ? defaultImageDimensions
53
- : imageSize;
54
-
55
39
  return (
56
40
  <View
57
41
  style={
58
- playerAnimationState === PlayerAnimationStateEnum.maximaze
42
+ playerAnimationState === PlayerAnimationStateEnum.maximize
59
43
  ? defaultImageDimensions
60
44
  : style
61
45
  }
62
46
  >
63
47
  <AnimationComponent
64
- style={
65
- playerAnimationState === PlayerAnimationStateEnum.maximaze
66
- ? defaultImageDimensions
67
- : style
68
- }
48
+ style={style}
69
49
  animationType={ComponentAnimationType.player}
70
50
  additionalData={defaultImageDimensions}
71
51
  >
72
52
  <ImageBackground
73
53
  resizeMode="cover"
74
- style={imageBackgroundStyle}
54
+ style={imageSize}
75
55
  imageStyle={imageStyle}
76
56
  source={source}
77
57
  >
@@ -21,6 +21,7 @@ import {
21
21
  useNavbarState,
22
22
  useScreenData,
23
23
  useNavigation,
24
+ useIsTablet,
24
25
  } from "@applicaster/zapp-react-native-utils/reactHooks";
25
26
  import { getNavigationPluginModule } from "@applicaster/zapp-react-native-app/App/Layout/layoutHelpers";
26
27
 
@@ -50,11 +51,7 @@ export function Screen(_props: Props) {
50
51
  const currentScreenData = useCurrentScreenData();
51
52
  const { backgroundColor } = useScreenConfiguration(currentScreenData.id);
52
53
 
53
- const {
54
- width: screenWidth,
55
- height,
56
- deviceInfo,
57
- } = useDimensions("screen", {
54
+ const { width: screenWidth, height } = useDimensions("screen", {
58
55
  fullDimensions: true,
59
56
  });
60
57
 
@@ -66,7 +63,7 @@ export function Screen(_props: Props) {
66
63
 
67
64
  const { title } = useNavbarState();
68
65
 
69
- const isTablet = deviceInfo?.isTablet;
66
+ const isTablet = useIsTablet();
70
67
 
71
68
  const { appData } = usePickFromState(["appData"]);
72
69
  const isTabletPortrait = appData?.isTabletPortrait;
@@ -46,7 +46,7 @@ export const AnimatedPlayerModalWrapper = (props: Props) => {
46
46
 
47
47
  React.useEffect(() => {
48
48
  (playerAnimationState === PlayerAnimationStateEnum.minimize ||
49
- playerAnimationState === PlayerAnimationStateEnum.maximaze) &&
49
+ playerAnimationState === PlayerAnimationStateEnum.maximize) &&
50
50
  setStartComponentsAnimation(true);
51
51
  }, [playerAnimationState]);
52
52
 
@@ -77,7 +77,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
77
77
 
78
78
  const isNotMinimizeMaximazeAnimation =
79
79
  playerAnimationState !== PlayerAnimationStateEnum.minimize &&
80
- playerAnimationState !== PlayerAnimationStateEnum.maximaze;
80
+ playerAnimationState !== PlayerAnimationStateEnum.maximize;
81
81
 
82
82
  const isEnablePanGesture =
83
83
  enableGesture &&
@@ -143,7 +143,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
143
143
  translateYOffset.flattenOffset();
144
144
  dragScrollY.setValue(0);
145
145
 
146
- setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
146
+ setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
147
147
  } else {
148
148
  setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
149
149
  }
@@ -158,7 +158,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
158
158
 
159
159
  dragScrollY.setValue(0);
160
160
 
161
- setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
161
+ setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
162
162
  } else {
163
163
  resetPlayerAnimationState();
164
164
  }
@@ -252,7 +252,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
252
252
  (previousMode === "MINIMIZED" || previousMode === "MAXIMIZED")) ||
253
253
  (previousItemId !== item?.id && mode !== "FULLSCREEN"))
254
254
  ) {
255
- setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
255
+ setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
256
256
  }
257
257
  }, [videoModalState]);
258
258
 
@@ -296,7 +296,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
296
296
 
297
297
  resetPlayerAnimationState();
298
298
  });
299
- } else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
299
+ } else if (playerAnimationState === PlayerAnimationStateEnum.maximize) {
300
300
  Animated.timing(translateYOffset, getAnimatedConfig(0)).start(() => {
301
301
  maximiseVideoModal();
302
302
  setScrollModalAnimatedValue(translateYOffset, 0, setLastSnap);
@@ -50,7 +50,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
50
50
 
51
51
  const isNotMinimizeMaximazeAnimation =
52
52
  playerAnimationState !== PlayerAnimationStateEnum.minimize &&
53
- playerAnimationState !== PlayerAnimationStateEnum.maximaze;
53
+ playerAnimationState !== PlayerAnimationStateEnum.maximize;
54
54
 
55
55
  const isEnablePanGesture =
56
56
  !isLanguageOverlayVisible &&
@@ -89,7 +89,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
89
89
  setLastSnap(destSnapPoint);
90
90
 
91
91
  if (destSnapPoint === modalSnapPoints[0]) {
92
- setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
92
+ setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
93
93
  } else {
94
94
  lastScrollY.setValue(0);
95
95
  lastScrollYValue.current = 0;
@@ -105,7 +105,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
105
105
  modalSnapPoints[1] - preparedTranslationY
106
106
  );
107
107
 
108
- setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
108
+ setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
109
109
  } else {
110
110
  resetPlayerAnimationState();
111
111
  }
@@ -246,7 +246,7 @@ export const AnimationView = ({
246
246
  default:
247
247
  return getAnimationValue(
248
248
  animationType,
249
- PlayerAnimationStateEnum.maximaze
249
+ PlayerAnimationStateEnum.maximize
250
250
  ).toValue;
251
251
  }
252
252
  }, [defaultValue, videoModalState]);
@@ -344,7 +344,7 @@ export const AnimationView = ({
344
344
  animatedValue,
345
345
  getAnimationValue(animationType, playerAnimationState)
346
346
  ).start();
347
- } else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
347
+ } else if (playerAnimationState === PlayerAnimationStateEnum.maximize) {
348
348
  animatedValue.setValue(defaultValue);
349
349
  }
350
350
  }, [playerAnimationState, startComponentsAnimation, defaultValue]);
@@ -16,12 +16,12 @@ import { useConfiguration } from "../utils";
16
16
 
17
17
  export enum PlayerAnimationStateEnum {
18
18
  minimize = "minimize",
19
- maximaze = "maximaze",
19
+ maximize = "maximize",
20
20
  drag_player = "drag_player",
21
21
  drag_scroll = "drag_scroll",
22
22
  }
23
23
 
24
- type PlayerAnimationStateT = number | PlayerAnimationStateEnum | null;
24
+ export type PlayerAnimationStateT = number | PlayerAnimationStateEnum | null;
25
25
 
26
26
  export type ModalAnimationContextT = {
27
27
  isActiveGesture: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "12.0.11",
3
+ "version": "12.0.12-rc.0",
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.11",
38
- "@applicaster/zapp-react-native-bridge": "12.0.11",
39
- "@applicaster/zapp-react-native-redux": "12.0.11",
40
- "@applicaster/zapp-react-native-utils": "12.0.11",
37
+ "@applicaster/applicaster-types": "12.0.12-rc.0",
38
+ "@applicaster/zapp-react-native-bridge": "12.0.12-rc.0",
39
+ "@applicaster/zapp-react-native-redux": "12.0.12-rc.0",
40
+ "@applicaster/zapp-react-native-utils": "12.0.12-rc.0",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",