@applicaster/zapp-react-native-utils 13.0.0-rc.89 → 13.0.0-rc.90

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.
@@ -227,7 +227,9 @@ class FocusManager {
227
227
 
228
228
  const nextNextFocus = FocusManager.getNextFocusable(direction, nextFocus);
229
229
 
230
- FocusManager.instance.setFocus(nextNextFocus, options);
230
+ if (nextNextFocus) {
231
+ FocusManager.instance.setFocus(nextNextFocus, options);
232
+ }
231
233
  } else {
232
234
  FocusManager.instance.setFocusLocal(nextFocus);
233
235
 
@@ -8,8 +8,6 @@ import { isNilOrEmpty } from "../reactUtils/helpers";
8
8
  import { isAndroidTVPlatform } from "../reactUtils";
9
9
  import { noop } from "../functionUtils";
10
10
 
11
- const EMPTY_GROUP_COMPONENT = "empty_group_component";
12
-
13
11
  export function useFocusManager() {
14
12
  return focusManager;
15
13
  }
@@ -76,14 +74,6 @@ export function useFocusEffect(onFocus, focusWatcher) {
76
74
  }, focusWatcher);
77
75
  }
78
76
 
79
- export function shouldShowEmptyGroup(component) {
80
- return (
81
- component?.ui_components?.filter(
82
- ({ component_type }) => component_type === EMPTY_GROUP_COMPONENT
83
- )?.length > 0
84
- );
85
- }
86
-
87
77
  export const isFocusable = (component: ZappEntry | ZappUIComponent | any) =>
88
78
  R.tryCatch(
89
79
  R.compose(
@@ -101,6 +91,7 @@ type Props = {
101
91
 
102
92
  export const useIsFocusable = (props: Props): void => {
103
93
  const { component, zappPipesData } = props;
94
+
104
95
  const { setIsFocusable } = useFocusable();
105
96
 
106
97
  const componentCellsFocusable = toBooleanWithDefaultTrue(
@@ -117,33 +108,18 @@ export const useIsFocusable = (props: Props): void => {
117
108
  isNilOrEmpty(zappPipesData?.data) ||
118
109
  isNilOrEmpty(zappPipesData?.data?.entry);
119
110
 
120
- const hasNoUIComponents = isNilOrEmpty(component?.ui_components);
121
-
122
111
  const hasDataError = !!zappPipesData?.error;
123
112
 
124
- const hasEmptyGroup = shouldShowEmptyGroup(component);
125
-
126
- const isGallery = component?.component_type === "gallery-qb";
127
-
128
- const isGroup = component?.component_type === "group-qb";
129
-
130
- const isHiddenDueToEmptyData =
131
- !isLoadingData && hasNoData && hideIfDataEmpty && !hasEmptyGroup;
132
-
133
- const isEmptyGroup = isGroup && hasNoUIComponents;
113
+ const isHiddenDueToEmptyData = !isLoadingData && hasNoData && hideIfDataEmpty;
134
114
 
135
115
  const defaultFocusableLogic =
136
- componentCellsFocusable &&
137
- (!hasNoData || !hideIfDataEmpty) &&
138
- !isEmptyGroup;
116
+ componentCellsFocusable && (!hasNoData || !hideIfDataEmpty);
139
117
 
140
118
  React.useEffect(() => {
141
119
  if (isAndroidTVPlatform()) {
142
120
  let isFocusableNew = false;
143
121
 
144
- if (isGallery) {
145
- isFocusableNew = true;
146
- } else if (isFocusable(component)) {
122
+ if (isFocusable(component)) {
147
123
  isFocusableNew = defaultFocusableLogic;
148
124
  }
149
125
 
@@ -152,9 +128,7 @@ export const useIsFocusable = (props: Props): void => {
152
128
  }, [
153
129
  defaultFocusableLogic,
154
130
  isHiddenDueToEmptyData,
155
- isGallery,
156
131
  setIsFocusable,
157
132
  hasDataError,
158
- hasEmptyGroup,
159
133
  ]);
160
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "13.0.0-rc.89",
3
+ "version": "13.0.0-rc.90",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "13.0.0-rc.89",
30
+ "@applicaster/applicaster-types": "13.0.0-rc.90",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -1,6 +1,12 @@
1
1
  import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
2
2
  import { isNilOrEmpty } from "../reactUtils/helpers";
3
3
  import { parseJsonIfNeeded } from "@applicaster/zapp-react-native-utils/functionUtils";
4
+ import {
5
+ StorageOwnedValues,
6
+ NamespaceValues,
7
+ StorageValuesToRemove,
8
+ StorageValuesToAdd,
9
+ } from "./types";
4
10
 
5
11
  const defaultOwnedKey = "owned_keys";
6
12
  const DEFAULT_NAMESPACE = "applicaster.v2";
@@ -0,0 +1,11 @@
1
+ export type StorageValuesToAdd = Record<string, NamespaceValues>;
2
+
3
+ export type StorageValuesToRemove = {
4
+ string?: string[];
5
+ };
6
+
7
+ export type StorageOwnedValues = {
8
+ string?: string[];
9
+ };
10
+
11
+ export type NamespaceValues = Record<string, string>;