@applicaster/zapp-react-native-ui-components 13.0.0-alpha.3454305619 → 13.0.0-alpha.3582972440

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.
@@ -4,11 +4,9 @@ import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/uti
4
4
  import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
5
5
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
6
6
 
7
- type AnimatedInterpolatedStyle = any;
8
-
9
- // type AnimatedInterpolatedStyle =
10
- // | Animated.AnimatedInterpolation
11
- // | [{ [Key: string]: Animated.AnimatedInterpolation }];
7
+ type AnimatedInterpolatedStyle =
8
+ | Animated.AnimatedInterpolation
9
+ | [{ [Key: string]: Animated.AnimatedInterpolation }];
12
10
 
13
11
  type AnimationConfig = {
14
12
  duration: number;
@@ -73,6 +73,7 @@ export function elementMapper(
73
73
  : {};
74
74
 
75
75
  const componentProps = {
76
+ key,
76
77
  style,
77
78
  skipButtons: otherProps?.skipButtons,
78
79
  emitAsyncElementRegistrate: otherProps?.emitAsyncElementRegistrate,
@@ -90,7 +91,7 @@ export function elementMapper(
90
91
  const fn = mapElementWithKey(elementMapper(components, otherProps));
91
92
 
92
93
  return (
93
- <Component key={key} {...componentProps}>
94
+ <Component {...componentProps}>
94
95
  {focusableTypes.has(type) && elements.length > 0
95
96
  ? elements.map(fn)
96
97
  : null}
@@ -335,9 +335,9 @@ const PlayerContainerComponent = (props: Props) => {
335
335
 
336
336
  const resumeTime = Number(item?.extensions?.resumeTime);
337
337
 
338
- // TODO: This is temp hack, will be removed on next pr with player refactoring
338
+ // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
339
339
  if (
340
- !!playerManager.getActivePlayer()?.getContinueWatchingOffset === false &&
340
+ !playerManager.getActivePlayer()?.hasResumePosition() &&
341
341
  !isNaN(resumeTime)
342
342
  ) {
343
343
  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,22 +34,8 @@ 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={
@@ -61,17 +45,13 @@ const PlayerImageBackgroundComponent = ({
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
  >
@@ -279,6 +279,7 @@ function ComponentsMapComponent(props: Props) {
279
279
  initialNumToRender={3}
280
280
  maxToRenderPerBatch={10}
281
281
  windowSize={12}
282
+ listKey={riverId}
282
283
  keyExtractor={keyExtractor}
283
284
  renderItem={renderRiverItem}
284
285
  data={riverComponents}
@@ -1,8 +1,8 @@
1
1
  import { Animated, Easing, EasingFunction, StyleProp } from "react-native";
2
2
 
3
3
  type AnimatedInterpolatedStyle =
4
- | Animated.AnimatedInterpolation<number>
5
- | [{ [Key: string]: Animated.AnimatedInterpolation<number> }];
4
+ | Animated.AnimatedInterpolation
5
+ | [{ [Key: string]: Animated.AnimatedInterpolation }];
6
6
 
7
7
  type AnimationConfig = {
8
8
  duration: number;
@@ -31,7 +31,7 @@ const interpolate = (
31
31
  animatedValue: Animated.Value,
32
32
  from: number = 0,
33
33
  to: number = 1
34
- ): Animated.AnimatedInterpolation<number> =>
34
+ ): Animated.AnimatedInterpolation =>
35
35
  animatedValue.interpolate({
36
36
  inputRange: [0, 1],
37
37
  outputRange: [from, to],
@@ -21,13 +21,13 @@ const prepareConfiguration = (
21
21
  keys: [string]
22
22
  ) => R.compose(R.evolve(keysMap), R.pickAll(keys))(configuration);
23
23
 
24
- const configurationKeys = R.keys(keysMap);
25
-
26
24
  export function withConfigurationProvider(Component: React.ComponentType<any>) {
27
25
  return function WithConfigurationProvider(props: Props) {
28
26
  const styles = props?.screenData?.styles;
29
27
  const general = props?.screenData?.general;
30
28
 
29
+ const configurationKeys = React.useMemo(() => R.keys(keysMap), []);
30
+
31
31
  const configuration = React.useMemo(
32
32
  () => prepareConfiguration({ ...general, ...styles }, configurationKeys),
33
33
  []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-alpha.3454305619",
3
+ "version": "13.0.0-alpha.3582972440",
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",
@@ -32,10 +32,10 @@
32
32
  "redux-mock-store": "^1.5.3"
33
33
  },
34
34
  "dependencies": {
35
- "@applicaster/applicaster-types": "13.0.0-alpha.3454305619",
36
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3454305619",
37
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.3454305619",
38
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3454305619",
35
+ "@applicaster/applicaster-types": "13.0.0-alpha.3582972440",
36
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3582972440",
37
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.3582972440",
38
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3582972440",
39
39
  "promise": "^8.3.0",
40
40
  "react-router-native": "^5.1.2",
41
41
  "url": "^0.11.0",
@@ -47,6 +47,7 @@
47
47
  "immer": "*",
48
48
  "react": "*",
49
49
  "react-native": "*",
50
+ "react-native-safe-area-context": "*",
50
51
  "react-native-svg": "*",
51
52
  "uglify-js": "*",
52
53
  "validate-color": "*",