@applicaster/zapp-react-native-ui-components 13.0.0-alpha.4120155420 → 13.0.0-alpha.4422775072

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.
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import * as R from "ramda";
3
3
  import { View, StyleSheet } from "react-native";
4
4
 
5
- import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/FocusableTvOS";
5
+ import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
6
6
  import { FocusableCell } from "@applicaster/zapp-react-native-ui-components/Components/FocusableCell";
7
7
  import { getItemType } from "@applicaster/zapp-react-native-utils/navigationUtils";
8
8
  import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypes";
@@ -11,13 +11,6 @@ import {
11
11
  useInitialFocus,
12
12
  } from "@applicaster/zapp-react-native-utils/focusManager";
13
13
 
14
- export type FocusableScrollViewRenderItem = (info: {
15
- item: ZappUIComponent;
16
- index: number;
17
- focused: boolean;
18
- parentFocus: ParentFocus;
19
- }) => React.ReactElement;
20
-
21
14
  export type Props = ScrollViewProps & {
22
15
  id?: number | string;
23
16
  horizontal?: boolean;
@@ -39,7 +32,12 @@ export type Props = ScrollViewProps & {
39
32
  initialFocusDirection?: FocusManager.Android.FocusNavigationDirections;
40
33
  onAllComponentsLoaded?: () => void;
41
34
  omitPropsPropagation?: Array<keyof FlatListProps<any>>;
42
- renderItem: FocusableScrollViewRenderItem;
35
+ renderItem: (info: {
36
+ item: ZappUIComponent;
37
+ index: number;
38
+ focused: boolean;
39
+ parentFocus: ParentFocus;
40
+ }) => React.ReactElement;
43
41
  } & ParentFocus;
44
42
 
45
43
  type State = boolean[];
@@ -75,7 +73,7 @@ const extendScrollViewRef = (_ref, childCompsMeasurementsMap) => {
75
73
  };
76
74
 
77
75
  _ref.scrollToIndex = (params) => {
78
- const { index, viewOffset = 0 } = params;
76
+ const { index, viewOffset } = params;
79
77
 
80
78
  const itemByIndex = R.find(R.propEq("index", index))(
81
79
  R.values(childCompsMeasurementsMap)
@@ -131,14 +129,8 @@ function FocusableScrollViewComponent(props: Props, ref) {
131
129
  );
132
130
 
133
131
  const getFocusableEntryId = React.useCallback(
134
- (_entry: ZappEntry | null, index?: number) => {
135
- const entry = R.isNil(index)
136
- ? Array.isArray(_entry)
137
- ? _entry[0]
138
- : _entry
139
- : Array.isArray(data[index])
140
- ? data[index][0]
141
- : data[index];
132
+ (_entry: ZappEntry, index?: number) => {
133
+ const entry = R.isNil(index) ? _entry : data[index];
142
134
 
143
135
  return entry ? `${props.id}--${entry?.id}` : undefined;
144
136
  },
@@ -281,18 +273,11 @@ function FocusableScrollViewComponent(props: Props, ref) {
281
273
  const renderItem = React.useCallback(
282
274
  (item, index) => {
283
275
  const renderArgs = { item, index };
284
-
285
- const id = getFocusableEntryId(
286
- Array.isArray(item) ? item[0] : item,
287
- index
288
- );
289
-
290
- const nextFocus = getNextFocus(index);
276
+ const id = `${props.id}--${renderArgs?.item?.id}`;
277
+ const nextFocus = getNextFocus(renderArgs?.index);
291
278
 
292
279
  const onItemLayout = (event) => {
293
- childCompsMeasurementsMap.current[
294
- Array.isArray(item) ? index : item.id
295
- ] = {
280
+ childCompsMeasurementsMap.current[item.id] = {
296
281
  index,
297
282
  layout: event.nativeEvent.layout,
298
283
  };
@@ -46,6 +46,7 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
46
46
 
47
47
  return (
48
48
  <SafeAreaView
49
+ edges={["top", "left", "right"]}
49
50
  style={[style.view, isRTL ? style.rtlStyle : {}]}
50
51
  testID="BarView-safeAreaView"
51
52
  >
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.4120155420",
3
+ "version": "13.0.0-alpha.4422775072",
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.4120155420",
38
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.4120155420",
39
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.4120155420",
40
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.4120155420",
37
+ "@applicaster/applicaster-types": "13.0.0-alpha.4422775072",
38
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.4422775072",
39
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.4422775072",
40
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.4422775072",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",