@applicaster/zapp-react-native-utils 15.0.0-alpha.2239032089 → 15.0.0-alpha.2413435535
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.
- package/analyticsUtils/AnalyticPlayerListener.ts +5 -2
- package/appUtils/RiverFocusManager/{index.ts → index.js} +18 -25
- package/appUtils/accessibilityManager/hooks.ts +8 -6
- package/appUtils/accessibilityManager/index.ts +28 -1
- package/appUtils/accessibilityManager/utils.ts +36 -5
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +1 -3
- package/appUtils/focusManager/index.ios.ts +15 -33
- package/appUtils/focusManagerAux/utils/index.ts +18 -0
- package/appUtils/focusManagerAux/utils/utils.ios.ts +24 -52
- package/appUtils/platform/platformUtils.ts +107 -23
- package/appUtils/playerManager/conts.ts +21 -0
- package/arrayUtils/__tests__/allTruthy.test.ts +24 -0
- package/arrayUtils/__tests__/anyThruthy.test.ts +24 -0
- package/arrayUtils/index.ts +5 -0
- package/cellUtils/index.ts +40 -1
- package/navigationUtils/index.ts +19 -16
- package/package.json +2 -2
- package/playerUtils/usePlayerTTS.ts +5 -2
- package/reactHooks/feed/useBatchLoading.ts +7 -1
- package/reactHooks/feed/useFeedLoader.tsx +0 -9
- package/reactHooks/feed/useInflatedUrl.ts +23 -29
- package/reactHooks/feed/usePipesCacheReset.ts +3 -1
- package/reactHooks/layout/index.ts +1 -1
- package/utils/__tests__/mapAccum.test.ts +73 -0
- package/utils/index.ts +6 -0
- package/utils/mapAccum.ts +23 -0
- package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +98 -31
- package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +25 -9
- package/zappFrameworkUtils/HookCallback/useCallbackActions.ts +6 -9
- package/appUtils/focusManagerAux/utils/index.ios.ts +0 -104
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CallbackResult,
|
|
4
|
+
useCallbackNavigationAction,
|
|
5
|
+
} from "./callbackNavigationAction";
|
|
3
6
|
|
|
4
7
|
export const useCallbackActions = (
|
|
5
8
|
item?: ZappUIComponent | ZappRiver,
|
|
@@ -8,14 +11,8 @@ export const useCallbackActions = (
|
|
|
8
11
|
const navigationAction = useCallbackNavigationAction(item);
|
|
9
12
|
|
|
10
13
|
return useCallback(
|
|
11
|
-
async (data:
|
|
12
|
-
|
|
13
|
-
hookCallback?.({ ...data, success: false, cancelled: true });
|
|
14
|
-
|
|
15
|
-
navigationAction(data);
|
|
16
|
-
} else {
|
|
17
|
-
hookCallback?.(data);
|
|
18
|
-
}
|
|
14
|
+
async (data: CallbackResult) => {
|
|
15
|
+
navigationAction(data, hookCallback);
|
|
19
16
|
},
|
|
20
17
|
[navigationAction, hookCallback]
|
|
21
18
|
);
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { isNil, startsWith } from "@applicaster/zapp-react-native-utils/utils";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
QUICK_BRICK_CONTENT,
|
|
5
|
-
QUICK_BRICK_NAVBAR,
|
|
6
|
-
} from "@applicaster/quick-brick-core/const";
|
|
7
|
-
|
|
8
|
-
const isNavBar = (node) => startsWith(QUICK_BRICK_NAVBAR, node?.id);
|
|
9
|
-
const isContent = (node) => startsWith(QUICK_BRICK_CONTENT, node?.id);
|
|
10
|
-
const isRoot = (node) => node?.id === "root";
|
|
11
|
-
|
|
12
|
-
export const isPartOfTabsScreenContent = (
|
|
13
|
-
focusableTree,
|
|
14
|
-
screenPickerContentContainerId,
|
|
15
|
-
id
|
|
16
|
-
) => {
|
|
17
|
-
const node = focusableTree.findInTree(id);
|
|
18
|
-
|
|
19
|
-
if (isNil(node)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (isRoot(node)) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (isNavBar(node)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (isContent(node)) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (node?.id === screenPickerContentContainerId) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return isPartOfTabsScreenContent(
|
|
40
|
-
focusableTree,
|
|
41
|
-
screenPickerContentContainerId,
|
|
42
|
-
node.parent?.id
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const isPartOfMenu = (focusableTree, id): boolean => {
|
|
47
|
-
const node = focusableTree.findInTree(id);
|
|
48
|
-
|
|
49
|
-
if (isNil(node)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (isRoot(node)) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (isNavBar(node)) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (isContent(node)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return isPartOfMenu(focusableTree, node.parent.id);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const isPartOfContent = (focusableTree, id) => {
|
|
69
|
-
const node = focusableTree.findInTree(id);
|
|
70
|
-
|
|
71
|
-
if (isNil(node)) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (isRoot(node)) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (isNavBar(node)) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (isContent(node)) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return isPartOfContent(focusableTree, node.parent?.id);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const isCurrentFocusOn = (id, node) => {
|
|
91
|
-
if (!node) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (isRoot(node)) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (node?.id === id) {
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return isCurrentFocusOn(id, node.parent);
|
|
104
|
-
};
|