@applicaster/zapp-react-native-ui-components 13.0.0-alpha.5718191297 → 13.0.0-alpha.5771418585

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.
@@ -0,0 +1,126 @@
1
+ /** TODO: Remove this file when tvos FocusableGroup
2
+ * behaviour is aligned to the web one
3
+ * FocusableGroup should only send onFocus and onBlur events when
4
+ * Focus enters and leaves the Focusables inside the branch
5
+ */
6
+ import * as React from "react";
7
+
8
+ import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
9
+ import * as FOCUS_EVENTS from "@applicaster/zapp-react-native-utils/appUtils/focusManager/events";
10
+ import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
11
+ import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
12
+
13
+ import { isAppleTV } from "../../Helpers/Platform";
14
+ import { useCellState } from "../MasterCell/utils";
15
+
16
+ const useCellFocusedState = (
17
+ skipFocusManagerRegistration: boolean,
18
+ groupId: string,
19
+ id: string
20
+ ) => {
21
+ const [currentCellFocused, setCurrentCellFocused] = React.useState(false);
22
+
23
+ React.useEffect(() => {
24
+ const isGroupItemFocused = () => {
25
+ if (!skipFocusManagerRegistration) {
26
+ const isFocused = focusManager.isGroupItemFocused(groupId, id);
27
+ setCurrentCellFocused(isFocused);
28
+ }
29
+ };
30
+
31
+ const handler = () => {
32
+ // tvOS hack for properly checking focus
33
+ if (isAppleTV()) {
34
+ setTimeout(() => {
35
+ isGroupItemFocused();
36
+ }, 0);
37
+ } else {
38
+ isGroupItemFocused();
39
+ }
40
+ };
41
+
42
+ focusManager.on(FOCUS_EVENTS.FOCUS, handler);
43
+
44
+ return () => {
45
+ focusManager.removeHandler(FOCUS_EVENTS.FOCUS, handler);
46
+ };
47
+ }, [groupId, skipFocusManagerRegistration]);
48
+
49
+ return currentCellFocused;
50
+ };
51
+
52
+ type Props = {
53
+ item: ZappEntry;
54
+ CellRenderer: React.FunctionComponent<any>;
55
+ id: string;
56
+ groupId: string;
57
+ onFocus: Function;
58
+ index: number;
59
+ scrollTo: Function;
60
+ preferredFocus?: boolean;
61
+ skipFocusManagerRegistration?: boolean;
62
+ isFocusable?: boolean;
63
+ behavior: Behavior;
64
+ focused?: boolean;
65
+ };
66
+
67
+ export function CellWithFocusable(props: Props) {
68
+ const {
69
+ index,
70
+ item,
71
+ CellRenderer,
72
+ id,
73
+ groupId,
74
+ onFocus,
75
+ scrollTo = noop,
76
+ preferredFocus,
77
+ skipFocusManagerRegistration,
78
+ isFocusable,
79
+ behavior,
80
+ focused,
81
+ } = props;
82
+
83
+ const isFocused = useCellFocusedState(
84
+ skipFocusManagerRegistration,
85
+ groupId,
86
+ id
87
+ );
88
+
89
+ const state = useCellState({
90
+ id: item.id,
91
+ behavior,
92
+ focused: isFocused || toBooleanWithDefaultFalse(focused),
93
+ });
94
+
95
+ const [focusedButtonId, setFocusedButtonId] = React.useState(undefined);
96
+
97
+ // for horizontal scrolling
98
+ React.useEffect(() => {
99
+ if (focusedButtonId) {
100
+ scrollTo(index);
101
+ }
102
+ }, [focusedButtonId]);
103
+
104
+ const handleToggleFocus = (value) => {
105
+ setFocusedButtonId(value.focusedButtonId);
106
+
107
+ if (value.focusable) {
108
+ onFocus(value.focusable, value.mouse);
109
+ }
110
+ };
111
+
112
+ return (
113
+ <CellRenderer
114
+ item={item}
115
+ groupId={groupId}
116
+ onToggleFocus={handleToggleFocus}
117
+ state={state}
118
+ prefixId={id}
119
+ focusedButtonId={focusedButtonId}
120
+ preferredFocus={preferredFocus}
121
+ skipFocusManagerRegistration={skipFocusManagerRegistration}
122
+ isFocusable={isFocusable}
123
+ focused={focused}
124
+ />
125
+ );
126
+ }
@@ -1,48 +1,10 @@
1
1
  import * as React from "react";
2
2
 
3
- import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
4
- import * as FOCUS_EVENTS from "@applicaster/zapp-react-native-utils/appUtils/focusManager/events";
5
3
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
6
4
  import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
7
5
 
8
- import { isAppleTV } from "../../Helpers/Platform";
9
6
  import { useCellState } from "../MasterCell/utils";
10
-
11
- const useCellFocusedState = (
12
- skipFocusManagerRegistration: boolean,
13
- groupId: string,
14
- id: string
15
- ) => {
16
- const [currentCellFocused, setCurrentCellFocused] = React.useState(false);
17
-
18
- React.useEffect(() => {
19
- const isGroupItemFocused = () => {
20
- if (!skipFocusManagerRegistration) {
21
- const isFocused = focusManager.isGroupItemFocused(groupId, id);
22
- setCurrentCellFocused(isFocused);
23
- }
24
- };
25
-
26
- const handler = () => {
27
- // tvOS hack for properly checking focus
28
- if (isAppleTV()) {
29
- setTimeout(() => {
30
- isGroupItemFocused();
31
- }, 0);
32
- } else {
33
- isGroupItemFocused();
34
- }
35
- };
36
-
37
- focusManager.on(FOCUS_EVENTS.FOCUS, handler);
38
-
39
- return () => {
40
- focusManager.removeHandler(FOCUS_EVENTS.FOCUS, handler);
41
- };
42
- }, [groupId, skipFocusManagerRegistration]);
43
-
44
- return currentCellFocused;
45
- };
7
+ import { FocusableGroup } from "../FocusableGroup";
46
8
 
47
9
  type Props = {
48
10
  item: ZappEntry;
@@ -75,11 +37,7 @@ export function CellWithFocusable(props: Props) {
75
37
  focused,
76
38
  } = props;
77
39
 
78
- const isFocused = useCellFocusedState(
79
- skipFocusManagerRegistration,
80
- groupId,
81
- id
82
- );
40
+ const [isFocused, setIsFocused] = React.useState(false);
83
41
 
84
42
  const state = useCellState({
85
43
  id: item.id,
@@ -96,26 +54,52 @@ export function CellWithFocusable(props: Props) {
96
54
  }
97
55
  }, [focusedButtonId]);
98
56
 
99
- const handleToggleFocus = (value) => {
100
- setFocusedButtonId(value.focusedButtonId);
57
+ const handleToggleFocus = React.useCallback(
58
+ (value) => {
59
+ setFocusedButtonId(value.focusedButtonId);
60
+
61
+ if (value.focusable) {
62
+ onFocus(value.focusable, value.mouse);
63
+ }
64
+ },
65
+ [onFocus]
66
+ );
67
+
68
+ const onGroupFocus = React.useCallback(() => {
69
+ if (!skipFocusManagerRegistration) {
70
+ setIsFocused(true);
71
+ }
72
+ }, [skipFocusManagerRegistration]);
101
73
 
102
- if (value.focusable) {
103
- onFocus(value.focusable, value.mouse);
74
+ const onGroupBlur = React.useCallback(() => {
75
+ if (!skipFocusManagerRegistration) {
76
+ setIsFocused(false);
104
77
  }
105
- };
78
+ }, [skipFocusManagerRegistration]);
106
79
 
107
80
  return (
108
- <CellRenderer
109
- item={item}
81
+ <FocusableGroup
82
+ id={`focusable-cell-wrapper-${id}`}
83
+ testID={"cell-with-focusable-cell-renderer-focusable-group"}
110
84
  groupId={groupId}
111
- onToggleFocus={handleToggleFocus}
112
- state={state}
113
- prefixId={id}
114
- focusedButtonId={focusedButtonId}
115
85
  preferredFocus={preferredFocus}
116
- skipFocusManagerRegistration={skipFocusManagerRegistration}
117
- isFocusable={isFocusable}
118
- focused={focused}
119
- />
86
+ shouldUsePreferredFocus
87
+ onFocus={onGroupFocus}
88
+ onBlur={onGroupBlur}
89
+ >
90
+ <CellRenderer
91
+ testID={"cell-with-focusable-cell-renderer"}
92
+ item={item}
93
+ groupId={`focusable-cell-wrapper-${id}`}
94
+ onToggleFocus={handleToggleFocus}
95
+ state={state}
96
+ prefixId={id}
97
+ focusedButtonId={focusedButtonId}
98
+ preferredFocus={true}
99
+ skipFocusManagerRegistration={skipFocusManagerRegistration}
100
+ isFocusable={isFocusable}
101
+ focused={focused}
102
+ />
103
+ </FocusableGroup>
120
104
  );
121
105
  }
@@ -1,7 +1,7 @@
1
1
  import { View } from "react-native";
2
2
  import React from "react";
3
3
  import { act, render } from "@testing-library/react-native";
4
- import { CellWithFocusable } from "../CellWithFocusable";
4
+ import { CellWithFocusable } from "../CellWithFocusable.tsx";
5
5
 
6
6
  import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
7
7
 
@@ -23,7 +23,9 @@ describe("CellWithFocusable", () => {
23
23
 
24
24
  const wrapper = renderWith(props);
25
25
 
26
- expect(wrapper.UNSAFE_getByType("View").props.state).toBe("default");
26
+ const element = wrapper.getByTestId("cell-with-focusable-cell-renderer");
27
+
28
+ expect(element.props.state).toBe("default");
27
29
  });
28
30
 
29
31
  it("should render in default state", () => {
@@ -40,8 +42,9 @@ describe("CellWithFocusable", () => {
40
42
  focusManager.isGroupItemFocused = jest.fn(() => true);
41
43
 
42
44
  const wrapper = renderWith(props);
45
+ const element = wrapper.getByTestId("cell-with-focusable-cell-renderer");
43
46
 
44
- expect(wrapper.UNSAFE_getByType("View").props.state).toBe("default");
47
+ expect(element.props.state).toBe("default");
45
48
  });
46
49
 
47
50
  it("should render in focused state", () => {
@@ -55,13 +58,17 @@ describe("CellWithFocusable", () => {
55
58
  scrollTo: jest.fn(),
56
59
  };
57
60
 
58
- focusManager.isGroupItemFocused = jest.fn(() => true);
59
61
  const wrapper = renderWith(props);
60
62
 
63
+ const focusableGroupComponent = wrapper.getByTestId(
64
+ "cell-with-focusable-cell-renderer-focusable-group"
65
+ );
66
+
61
67
  act(() => {
62
- focusManager.on.mock.calls[focusManager.on.mock.calls.length - 1][1]();
68
+ focusableGroupComponent.props.onFocus();
63
69
  });
64
70
 
65
- expect(wrapper.UNSAFE_getByType("View").props.state).toBe("focused");
71
+ const element = wrapper.getByTestId("cell-with-focusable-cell-renderer");
72
+ expect(element.props.state).toBe("focused");
66
73
  });
67
74
  });
@@ -1,13 +1,13 @@
1
1
  import React, { useMemo } from "react";
2
2
  import * as R from "ramda";
3
3
  import {
4
- View,
4
+ ImageStyle,
5
5
  StyleSheet,
6
6
  Text,
7
- ViewStyle,
8
- TextStyle,
9
- ImageStyle,
10
7
  TextProps,
8
+ TextStyle,
9
+ View,
10
+ ViewStyle,
11
11
  } from "react-native";
12
12
  import { defaultAsset } from "./defaultAsset";
13
13
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
@@ -150,13 +150,13 @@ export function ErrorScreen(props: Props) {
150
150
  return (
151
151
  <View style={[baseStyles.container, styles.screen]}>
152
152
  <View style={[baseStyles.container, styles.component]}>
153
- {assetEnabled && (
153
+ {assetEnabled ? (
154
154
  <Image
155
155
  fadeDuration={0}
156
156
  source={{ uri: asset }}
157
157
  style={styles.asset}
158
158
  />
159
- )}
159
+ ) : null}
160
160
  <Text style={styles.title} {...titleProps}>
161
161
  {title}
162
162
  </Text>
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/no-unknown-property */
1
2
  import * as React from "react";
2
3
 
3
4
  import { BaseFocusable } from "../BaseFocusable";
@@ -244,7 +244,7 @@ const LiveImageComponent = (props: LiveImageProps) => {
244
244
  return (
245
245
  <>
246
246
  <Image {...props} applyMaxSize />
247
- {isShouldRender && (
247
+ {isShouldRender ? (
248
248
  <View style={[style, positionAbsolute]}>
249
249
  <PlayerLiveImage
250
250
  uri={props.uri}
@@ -257,7 +257,7 @@ const LiveImageComponent = (props: LiveImageProps) => {
257
257
  audioMutedByDefault={audio_muted_by_default}
258
258
  />
259
259
  </View>
260
- )}
260
+ ) : null}
261
261
  </>
262
262
  );
263
263
  };
@@ -16,13 +16,13 @@ export class MasterCellAsyncRenderManager {
16
16
  }
17
17
 
18
18
  public emitAsyncElementRegistrate = () => {
19
- this.asyncElementRegistrate$.next();
19
+ this.asyncElementRegistrate$.next(null);
20
20
 
21
21
  return this.decrementAsyncElementRegistrationCount;
22
22
  };
23
23
 
24
24
  public emitAsyncElementLayout = () => {
25
- this.asyncElementLayout$.next();
25
+ this.asyncElementLayout$.next(null);
26
26
  };
27
27
 
28
28
  public decrementAsyncElementRegistrationCount = () => {
@@ -3,8 +3,8 @@ import { StyleSheet, TouchableOpacity, View } from "react-native";
3
3
  import { Item, ItemProps } from "./Item";
4
4
  import { ItemIcon, ItemIconProps } from "./ItemIcon";
5
5
  import { ItemLabel, ItemLabelProps } from "./ItemLabel";
6
- import { defaultSelectedAsset } from "./assets";
7
6
  import * as assets from "./assets";
7
+ import { defaultSelectedAsset } from "./assets";
8
8
 
9
9
  type ButtonProps = {
10
10
  configuration: any;
@@ -92,18 +92,18 @@ export function Button({
92
92
  >
93
93
  <Item {...itemProps} focused={focused} selected={selected}>
94
94
  <View style={styles.label_icon_container}>
95
- {itemIconProps.asset && itemIconProps.asset.length > 0 && (
95
+ {itemIconProps.asset && itemIconProps.asset.length > 0 ? (
96
96
  <ItemIcon {...itemIconProps} />
97
- )}
98
- {itemLabelProps.label && (
97
+ ) : null}
98
+ {itemLabelProps.label ? (
99
99
  <ItemLabel
100
100
  {...itemLabelProps}
101
101
  focused={focused}
102
102
  selected={selected}
103
103
  />
104
- )}
104
+ ) : null}
105
105
  </View>
106
- {selected && <ItemIcon {...selectedItemIconProps} />}
106
+ {selected ? <ItemIcon {...selectedItemIconProps} /> : null}
107
107
  </Item>
108
108
  </TouchableOpacity>
109
109
  </View>
@@ -90,7 +90,7 @@ export const NotificationView = (props: Props) => {
90
90
  return (
91
91
  <div onClick={onClose}>
92
92
  {children}
93
- {open && (
93
+ {open ? (
94
94
  <div style={styles.body}>
95
95
  <div style={styles.title}>
96
96
  <h2>{MSG}</h2>
@@ -98,7 +98,7 @@ export const NotificationView = (props: Props) => {
98
98
 
99
99
  <h4 style={styles.subtitle}>{EXTRA_MSG}</h4>
100
100
  </div>
101
- )}
101
+ ) : null}
102
102
  </div>
103
103
  );
104
104
  };
@@ -85,7 +85,7 @@ export const NotificationView = (props: Props) => {
85
85
  return (
86
86
  <div onClick={onClose}>
87
87
  {children}
88
- {shown && (
88
+ {shown ? (
89
89
  <div style={styles.body}>
90
90
  <div style={styles.title}>
91
91
  <h2>{title}</h2>
@@ -93,7 +93,7 @@ export const NotificationView = (props: Props) => {
93
93
 
94
94
  <h4 style={styles.subtitle}>{subtitle}</h4>
95
95
  </div>
96
- )}
96
+ ) : null}
97
97
  </div>
98
98
  );
99
99
  };
@@ -1,17 +1,17 @@
1
1
  import * as React from "react";
2
+ import { useEffect, useReducer } from "react";
2
3
  // @ts-ignore
3
- import { View, ViewStyle, TVMenuControl } from "react-native";
4
+ import { TVMenuControl, View, ViewStyle } from "react-native";
4
5
  import * as R from "ramda";
5
6
  import uuid from "uuid/v4";
6
7
  import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
7
8
  import {
8
9
  isApplePlatform,
9
- platformSelect,
10
10
  isTV,
11
+ platformSelect,
11
12
  } from "@applicaster/zapp-react-native-utils/reactUtils";
12
13
 
13
14
  import { TVEventHandlerComponent } from "@applicaster/zapp-react-native-tvos-ui-components/Components/TVEventHandlerComponent";
14
- import { useEffect, useReducer } from "react";
15
15
  import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
16
16
  import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
17
17
  import {
@@ -29,10 +29,10 @@ import {
29
29
  import { ProgramInfo } from "./ProgramInfo";
30
30
  import { AudioPlayer } from "../AudioPlayer";
31
31
  import {
32
- playerContainerLogger,
33
32
  log_debug,
34
33
  log_info,
35
34
  log_warning,
35
+ playerContainerLogger,
36
36
  } from "./logger";
37
37
  import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
38
38
  import { useSetNavbarState } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
@@ -53,8 +53,8 @@ import { usePlayNextOverlay } from "@applicaster/zapp-react-native-utils/appUtil
53
53
  import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
54
54
 
55
55
  import {
56
- useModalAnimationContext,
57
56
  PlayerAnimationStateEnum,
57
+ useModalAnimationContext,
58
58
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
59
59
 
60
60
  type Props = {
@@ -683,10 +683,10 @@ const PlayerContainerComponent = (props: Props) => {
683
683
 
684
684
  {renderRestPlayers(restPlayerProps)}
685
685
 
686
- {state.error && <ErrorDisplay error={state.error} />}
686
+ {state.error ? <ErrorDisplay error={state.error} /> : null}
687
687
  </View>
688
688
  {/* Components container */}
689
- {isInlineTV && context.showComponentsContainer && (
689
+ {isInlineTV && context.showComponentsContainer ? (
690
690
  <View
691
691
  style={styles.inlineRiver}
692
692
  testID={"inline-river-component-wrapper"}
@@ -717,7 +717,7 @@ const PlayerContainerComponent = (props: Props) => {
717
717
  )}
718
718
  </ComponentFocusableWrapperView>
719
719
  </View>
720
- )}
720
+ ) : null}
721
721
  </View>
722
722
  </FocusableGroup>
723
723
  </TVEventHandlerComponent>
@@ -114,12 +114,12 @@ function ProgramInfoComponent({
114
114
  return (
115
115
  <View style={container}>
116
116
  <View style={programStyles.programInfo.container}>
117
- {logo && (
117
+ {logo ? (
118
118
  <Image
119
119
  source={{ uri: logo }}
120
120
  style={programStyles.programInfo.logo}
121
121
  />
122
- )}
122
+ ) : null}
123
123
  {!isAudioContent && transportInfo}
124
124
  </View>
125
125
  </View>
@@ -22,126 +22,78 @@ exports[`componentsMap renders renders components map correctly 1`] = `
22
22
  flatListHeight={null}
23
23
  loadingState={
24
24
  BehaviorSubject {
25
- "_isScalar": false,
26
25
  "_value": {
27
26
  "done": false,
28
27
  "index": -1,
29
28
  "waitForAllComponents": false,
30
29
  },
31
30
  "closed": false,
31
+ "currentObservers": null,
32
32
  "hasError": false,
33
33
  "isStopped": false,
34
34
  "observers": [
35
- Subscriber {
36
- "_parentOrParents": null,
37
- "_subscriptions": [
38
- SubjectSubscription {
39
- "_parentOrParents": [Circular],
40
- "_subscriptions": null,
35
+ SafeSubscriber {
36
+ "_finalizers": [
37
+ Subscription {
38
+ "_finalizers": null,
39
+ "_parentage": [Circular],
41
40
  "closed": false,
42
- "subject": [Circular],
43
- "subscriber": [Circular],
41
+ "initialTeardown": [Function],
44
42
  },
45
43
  ],
44
+ "_parentage": null,
46
45
  "closed": false,
47
- "destination": SafeSubscriber {
48
- "_complete": undefined,
49
- "_context": [Circular],
50
- "_error": undefined,
51
- "_next": [Function],
52
- "_parentOrParents": null,
53
- "_parentSubscriber": [Circular],
54
- "_subscriptions": null,
55
- "closed": false,
56
- "destination": {
57
- "closed": true,
58
- "complete": [Function],
59
- "error": [Function],
46
+ "destination": ConsumerObserver {
47
+ "partialObserver": {
48
+ "complete": undefined,
49
+ "error": undefined,
60
50
  "next": [Function],
61
51
  },
62
- "isStopped": false,
63
- "syncErrorThrowable": false,
64
- "syncErrorThrown": false,
65
- "syncErrorValue": null,
66
52
  },
53
+ "initialTeardown": undefined,
67
54
  "isStopped": false,
68
- "syncErrorThrowable": true,
69
- "syncErrorThrown": false,
70
- "syncErrorValue": null,
71
55
  },
72
- Subscriber {
73
- "_parentOrParents": null,
74
- "_subscriptions": [
75
- SubjectSubscription {
76
- "_parentOrParents": [Circular],
77
- "_subscriptions": null,
56
+ SafeSubscriber {
57
+ "_finalizers": [
58
+ Subscription {
59
+ "_finalizers": null,
60
+ "_parentage": [Circular],
78
61
  "closed": false,
79
- "subject": [Circular],
80
- "subscriber": [Circular],
62
+ "initialTeardown": [Function],
81
63
  },
82
64
  ],
65
+ "_parentage": null,
83
66
  "closed": false,
84
- "destination": SafeSubscriber {
85
- "_complete": undefined,
86
- "_context": [Circular],
87
- "_error": undefined,
88
- "_next": [Function],
89
- "_parentOrParents": null,
90
- "_parentSubscriber": [Circular],
91
- "_subscriptions": null,
92
- "closed": false,
93
- "destination": {
94
- "closed": true,
95
- "complete": [Function],
96
- "error": [Function],
67
+ "destination": ConsumerObserver {
68
+ "partialObserver": {
69
+ "complete": undefined,
70
+ "error": undefined,
97
71
  "next": [Function],
98
72
  },
99
- "isStopped": false,
100
- "syncErrorThrowable": false,
101
- "syncErrorThrown": false,
102
- "syncErrorValue": null,
103
73
  },
74
+ "initialTeardown": undefined,
104
75
  "isStopped": false,
105
- "syncErrorThrowable": true,
106
- "syncErrorThrown": false,
107
- "syncErrorValue": null,
108
76
  },
109
- Subscriber {
110
- "_parentOrParents": null,
111
- "_subscriptions": [
112
- SubjectSubscription {
113
- "_parentOrParents": [Circular],
114
- "_subscriptions": null,
77
+ SafeSubscriber {
78
+ "_finalizers": [
79
+ Subscription {
80
+ "_finalizers": null,
81
+ "_parentage": [Circular],
115
82
  "closed": false,
116
- "subject": [Circular],
117
- "subscriber": [Circular],
83
+ "initialTeardown": [Function],
118
84
  },
119
85
  ],
86
+ "_parentage": null,
120
87
  "closed": false,
121
- "destination": SafeSubscriber {
122
- "_complete": undefined,
123
- "_context": [Circular],
124
- "_error": undefined,
125
- "_next": [Function],
126
- "_parentOrParents": null,
127
- "_parentSubscriber": [Circular],
128
- "_subscriptions": null,
129
- "closed": false,
130
- "destination": {
131
- "closed": true,
132
- "complete": [Function],
133
- "error": [Function],
88
+ "destination": ConsumerObserver {
89
+ "partialObserver": {
90
+ "complete": undefined,
91
+ "error": undefined,
134
92
  "next": [Function],
135
93
  },
136
- "isStopped": false,
137
- "syncErrorThrowable": false,
138
- "syncErrorThrown": false,
139
- "syncErrorValue": null,
140
94
  },
95
+ "initialTeardown": undefined,
141
96
  "isStopped": false,
142
- "syncErrorThrowable": true,
143
- "syncErrorThrown": false,
144
- "syncErrorValue": null,
145
97
  },
146
98
  ],
147
99
  "thrownError": null,
@@ -6,16 +6,16 @@ import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
6
6
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
7
7
  import { getComponentModule } from "@applicaster/zapp-react-native-utils/pluginUtils";
8
8
  import {
9
- shouldNavBarDisplayMenu,
10
9
  getNavBarProps,
11
10
  getScreenId,
11
+ shouldNavBarDisplayMenu,
12
12
  } from "@applicaster/zapp-react-native-utils/navigationUtils";
13
13
  import {
14
- useRoute,
15
14
  useCurrentScreenData,
16
15
  useNavbarState,
17
- useScreenData,
18
16
  useNavigation,
17
+ useRoute,
18
+ useScreenData,
19
19
  } from "@applicaster/zapp-react-native-utils/reactHooks";
20
20
  import { getNavigationPluginModule } from "@applicaster/zapp-react-native-app/App/Layout/layoutHelpers";
21
21
 
@@ -98,7 +98,7 @@ export function Screen(_props: Props) {
98
98
  <View style={style}>
99
99
  {isReady ? (
100
100
  <>
101
- {navBarProps && <NavBar {...navBarProps} hasMenu={hasMenu} />}
101
+ {navBarProps ? <NavBar {...navBarProps} hasMenu={hasMenu} /> : null}
102
102
 
103
103
  <OfflineFallbackScreen>
104
104
  {/* @TODO RouteManager doesn't use props, can they be removed ? */}
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react-native/no-unused-styles */
2
2
  import React from "react";
3
3
  import * as R from "ramda";
4
- import { View, Text, StyleSheet, TouchableWithoutFeedback } from "react-native";
4
+ import { StyleSheet, Text, TouchableWithoutFeedback, View } from "react-native";
5
5
  import { useConfiguration } from "@applicaster/zapp-react-native-utils/reactHooks/configuration";
6
6
  import {
7
- getStyleForPlatform,
8
7
  applyStringTransformation,
8
+ getStyleForPlatform,
9
9
  } from "@applicaster/zapp-react-native-utils/configurationUtils";
10
10
 
11
11
  type Props = {
@@ -148,7 +148,9 @@ const Tab = ({ title, selected, handleOnPress }: Props, ref: any) => {
148
148
  <Text numberOfLines={1} style={styles.label}>
149
149
  {tabTitle}
150
150
  </Text>
151
- {selected && <View testID="underline" style={styles.underline} />}
151
+ {selected ? (
152
+ <View testID="underline" style={styles.underline} />
153
+ ) : null}
152
154
  </View>
153
155
  </View>
154
156
  </TouchableWithoutFeedback>
@@ -174,7 +174,8 @@ function TextInputTV(props: Props, ref) {
174
174
 
175
175
  return isWebPlatform ? (
176
176
  <>
177
- {additional && additional()}
177
+ {additional ? additional() : null}
178
+ {/* eslint-disable-next-line react/no-unknown-property */}
178
179
  <input testID="TextInput-tv" ref={ref} {...inputProps} />
179
180
  </>
180
181
  ) : (
@@ -105,7 +105,7 @@ function SceneComponent({
105
105
  style={[style, contentStyle, dimensions]}
106
106
  >
107
107
  {children}
108
- {isAnimating && <Animated.View style={overlayStyle} />}
108
+ {isAnimating ? <Animated.View style={overlayStyle} /> : null}
109
109
  </Animated.View>
110
110
  );
111
111
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { View } from "react-native";
3
- import { update, compose, tail, append, take, identity, isNil } from "ramda";
3
+ import { append, compose, identity, isNil, tail, take, update } from "ramda";
4
4
 
5
5
  import { AnimationManager } from "./AnimationManager";
6
6
  import { Scene } from "./Scene";
@@ -289,7 +289,7 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
289
289
 
290
290
  return (
291
291
  <View style={styles.container}>
292
- {scenes[to.index] && (
292
+ {scenes[to.index] ? (
293
293
  <Scene
294
294
  {...{ style: to?.style || {} }}
295
295
  pathname={pathname}
@@ -301,7 +301,7 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
301
301
  >
302
302
  {scenes[to.index].children}
303
303
  </Scene>
304
- )}
304
+ ) : null}
305
305
  </View>
306
306
  );
307
307
  }
@@ -1,6 +1,7 @@
1
1
  // /// <reference types="@applicaster/applicaster-types" />
2
2
  //
3
3
  import * as React from "react";
4
+ import { useEffect } from "react";
4
5
 
5
6
  import { AppState, AppStateStatus, View } from "react-native";
6
7
  import { TrackedView } from "../TrackedView";
@@ -25,7 +26,6 @@ import { PlayerRole } from "@applicaster/zapp-react-native-utils/appUtils/player
25
26
  import { getAutoplaySettings } from "./utils";
26
27
  import { isString } from "@applicaster/zapp-react-native-utils/stringUtils";
27
28
  import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
28
- import { useEffect } from "react";
29
29
 
30
30
  const { log_error, log_debug } = loggerLiveImageComponent;
31
31
 
@@ -330,7 +330,7 @@ const PlayerLiveImageComponent = (props: Props) => {
330
330
  onPositionUpdated={onPositionUpdated}
331
331
  >
332
332
  <View ref={trackViewRef}>
333
- {isVideoMode && (
333
+ {isVideoMode ? (
334
334
  <Player
335
335
  autoplay={false}
336
336
  ref={_assignRoot}
@@ -342,7 +342,7 @@ const PlayerLiveImageComponent = (props: Props) => {
342
342
  resizeMode={"cover"}
343
343
  {...platformSpecificProps}
344
344
  />
345
- )}
345
+ ) : null}
346
346
  {
347
347
  <AnimatedInOut
348
348
  visible={isBackgroundImageVisible}
@@ -1,26 +1,26 @@
1
1
  import React from "react";
2
- import { Animated, StyleSheet, View, Platform } from "react-native";
2
+ import { Animated, Platform, StyleSheet, View } from "react-native";
3
3
 
4
4
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
5
5
  import {
6
+ GestureHandlerRootView,
6
7
  NativeViewGestureHandler,
7
8
  PanGestureHandler,
8
9
  State,
9
10
  TapGestureHandler,
10
- GestureHandlerRootView,
11
11
  } from "react-native-gesture-handler";
12
12
 
13
13
  import { PlayerContainerContext } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainerContext";
14
14
  import {
15
- useModalAnimationContext,
16
15
  PlayerAnimationStateEnum,
16
+ useModalAnimationContext,
17
17
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
18
18
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
19
19
  import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
20
20
 
21
21
  import {
22
- setScrollModalAnimatedValue,
23
22
  resetScrollAnimatedValues,
23
+ setScrollModalAnimatedValue,
24
24
  } from "./utils";
25
25
 
26
26
  const getAnimatedConfig = (toValue) => {
@@ -71,8 +71,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
71
71
  useNavigation();
72
72
 
73
73
  const { mode: videoModalMode, item: videoModalItem } = videoModalState;
74
- const isMaximazedModal = videoModalMode === "MAXIMIZED";
75
- const isMinimizedModal = videoModalMode === "MINIMIZED";
74
+ const isMaximizedModal: boolean = videoModalMode === "MAXIMIZED";
75
+ const isMinimizedModal: boolean = videoModalMode === "MINIMIZED";
76
76
  const previousItemId = usePrevious(videoModalItem?.id);
77
77
 
78
78
  const isNotMinimizeMaximazeAnimation =
@@ -84,7 +84,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
84
84
  !isLanguageOverlayVisible &&
85
85
  isNotMinimizeMaximazeAnimation &&
86
86
  !isSeekBarTouch &&
87
- (isMaximazedModal || isMinimizedModal);
87
+ (isMaximizedModal || isMinimizedModal);
88
88
 
89
89
  const isAudioItem = React.useMemo(
90
90
  () =>
@@ -346,6 +346,8 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
346
346
  []
347
347
  );
348
348
 
349
+ const scrollEnabled = isMaximizedModal && isNotMinimizeMaximazeAnimation;
350
+
349
351
  return (
350
352
  <Wrapper style={generalStyles.container}>
351
353
  <TapGestureHandler
@@ -359,7 +361,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
359
361
  enabled={isEnablePanGesture}
360
362
  ref={panHandlerRef}
361
363
  simultaneousHandlers={[scrollRef, tapHandlerRef]}
362
- shouldCancelWhenOutside={isMaximazedModal}
364
+ shouldCancelWhenOutside={isMaximizedModal}
363
365
  onGestureEvent={onGestureEvent}
364
366
  onHandlerStateChange={onHandlerStateChange}
365
367
  activeOffsetY={[-5, 5]}
@@ -371,9 +373,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
371
373
  simultaneousHandlers={panHandlerRef}
372
374
  >
373
375
  <Animated.ScrollView
374
- scrollEnabled={
375
- isMaximazedModal && isNotMinimizeMaximazeAnimation
376
- }
376
+ scrollEnabled={scrollEnabled}
377
377
  bounces={false}
378
378
  onScrollBeginDrag={onRegisterLastScroll}
379
379
  onScroll={onScroll}
@@ -4,26 +4,26 @@ import { Animated, View } from "react-native";
4
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
5
 
6
6
  import {
7
- useModalAnimationContext,
8
7
  PlayerAnimationStateEnum,
8
+ useModalAnimationContext,
9
9
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
10
10
 
11
11
  import {
12
+ useDimensions,
12
13
  useGetBottomTabBarHeight,
13
14
  useNavigation,
14
- useDimensions,
15
15
  } from "@applicaster/zapp-react-native-utils/reactHooks";
16
16
  import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
17
17
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
18
18
  import { useAppState } from "@applicaster/zapp-react-native-utils/reactHooks/app";
19
19
 
20
20
  import {
21
- gestureListenerHelper,
22
- getAnimationStyle,
21
+ AUDIO_PLAYER_HORIZONTAL_PADDING,
22
+ ComponentAnimationType,
23
23
  defaultAspectRatioWidth,
24
+ gestureListenerHelper,
24
25
  getAnimationDefaultValue,
25
- ComponentAnimationType,
26
- AUDIO_PLAYER_HORIZONTAL_PADDING,
26
+ getAnimationStyle,
27
27
  } from "./utils";
28
28
 
29
29
  type Props = {
@@ -405,7 +405,7 @@ export const AnimationView = ({
405
405
 
406
406
  return (
407
407
  <Animated.View
408
- onLayout={additionalData.useLayoutMeasure && measureView}
408
+ onLayout={additionalData.useLayoutMeasure ? measureView : undefined}
409
409
  ref={animationComponentRef}
410
410
  style={[
411
411
  ...preparedStyles,
@@ -1,10 +1,10 @@
1
1
  import React, { useEffect, useRef } from "react";
2
2
  import {
3
- StyleProp,
4
- ViewStyle,
5
3
  Animated,
6
- Easing,
7
4
  Dimensions,
5
+ Easing,
6
+ StyleProp,
7
+ ViewStyle,
8
8
  } from "react-native";
9
9
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
10
10
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
@@ -94,13 +94,13 @@ export const PlayerDetails = ({
94
94
  },
95
95
  ]}
96
96
  >
97
- {screenData && (
97
+ {screenData ? (
98
98
  <ComponentsMap
99
99
  riverId={screenData.id}
100
100
  feed={screenData?.data?.source}
101
101
  riverComponents={screenData.ui_components}
102
102
  />
103
- )}
103
+ ) : null}
104
104
  </Animated.View>
105
105
  );
106
106
  };
@@ -227,7 +227,7 @@ const PlayerWrapperComponent = (props: Props) => {
227
227
  </View>
228
228
 
229
229
  <AnimatedScrollModal>
230
- {isShowPlayerDetails && (
230
+ {isShowPlayerDetails ? (
231
231
  <AnimationComponent
232
232
  animationType={ComponentAnimationType.componentFade}
233
233
  style={defaultStyles.flex}
@@ -240,7 +240,7 @@ const PlayerWrapperComponent = (props: Props) => {
240
240
  isTablet={isTablet}
241
241
  />
242
242
  </AnimationComponent>
243
- )}
243
+ ) : null}
244
244
  </AnimatedScrollModal>
245
245
  </AnimationComponent>
246
246
  </WrapperView>
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.5718191297",
3
+ "version": "13.0.0-alpha.5771418585",
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": "13.0.0-alpha.5718191297",
38
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.5718191297",
39
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.5718191297",
40
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5718191297",
37
+ "@applicaster/applicaster-types": "13.0.0-alpha.5771418585",
38
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.5771418585",
39
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.5771418585",
40
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5771418585",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",