@applicaster/zapp-react-native-utils 15.0.0-alpha.8680244503 → 15.0.0-alpha.9300744523
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/appUtils/RiverFocusManager/{index.js → index.ts} +25 -18
- package/appUtils/accessibilityManager/__tests__/utils.test.ts +360 -0
- package/appUtils/accessibilityManager/utils.ts +25 -5
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +3 -0
- package/appUtils/focusManager/index.ios.ts +43 -4
- package/appUtils/focusManagerAux/utils/index.ios.ts +122 -0
- package/appUtils/focusManagerAux/utils/index.ts +1 -1
- package/appUtils/focusManagerAux/utils/utils.ios.ts +199 -3
- package/focusManager/aux/index.ts +1 -1
- package/manifestUtils/defaultManifestConfigurations/player.js +21 -10
- package/package.json +4 -4
- package/reactHooks/feed/__tests__/{useInflatedUrl.test.ts → useInflatedUrl.test.tsx} +62 -7
- package/reactHooks/feed/useInflatedUrl.ts +43 -17
- package/reactHooks/navigation/index.ts +4 -0
- package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +1 -1
- package/reactHooks/screen/__tests__/useTargetScreenData.test.tsx +1 -1
- package/searchUtils/const.ts +7 -0
- package/searchUtils/index.ts +3 -0
- package/stringUtils/index.ts +1 -1
- package/testUtils/index.tsx +1 -1
- package/utils/__tests__/mergeRight.test.ts +48 -0
- package/utils/index.ts +10 -0
- package/utils/mergeRight.ts +5 -0
- package/utils/path.ts +6 -3
- package/utils/pathOr.ts +5 -1
- package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +19 -5
- package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +1 -1
package/utils/pathOr.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { get } from "lodash";
|
|
2
2
|
|
|
3
|
-
export const pathOr =
|
|
3
|
+
export const pathOr = <T = any>(
|
|
4
|
+
defaultValue: T,
|
|
5
|
+
path: (number | string) | (number | string)[],
|
|
6
|
+
record: any
|
|
7
|
+
): T => {
|
|
4
8
|
return get(record, path, defaultValue);
|
|
5
9
|
};
|
|
@@ -46,7 +46,7 @@ const legacyMappingKeys = {
|
|
|
46
46
|
actionType: "login_completion_action",
|
|
47
47
|
targetScreen: "navigate_to_login_screen",
|
|
48
48
|
},
|
|
49
|
-
"quick-brick-user-account-ui-component": {
|
|
49
|
+
"quick-brick-user-account-ui-component.login": {
|
|
50
50
|
actionType: "callbackAction",
|
|
51
51
|
},
|
|
52
52
|
"quick-brick-login-multi-login-providers.login": {
|
|
@@ -84,7 +84,8 @@ export const getNavigationKeys = (
|
|
|
84
84
|
): NavKeys => {
|
|
85
85
|
const general = (item?.general ?? {}) as General;
|
|
86
86
|
|
|
87
|
-
const pluginIdentifier =
|
|
87
|
+
const pluginIdentifier =
|
|
88
|
+
(item as any).identifier ?? item?.type ?? item?.component_type ?? "";
|
|
88
89
|
|
|
89
90
|
const legacy =
|
|
90
91
|
legacyMappingKeys[`${pluginIdentifier}.${resultType}`] ??
|
|
@@ -175,12 +176,25 @@ export const useCallbackNavigationAction = (
|
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
let data = getNavigationKeys(item, args.options?.resultType ?? null);
|
|
179
180
|
|
|
180
181
|
if (!data) {
|
|
181
|
-
hookCallback
|
|
182
|
+
const isScreen = !hookCallback;
|
|
182
183
|
|
|
183
|
-
|
|
184
|
+
if (isScreen && args.options?.resultType === ResultType.login) {
|
|
185
|
+
log_debug(
|
|
186
|
+
`${LogPrefix} no navigation data found, applying GO BACK for login screen`
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
data = {
|
|
190
|
+
action: NavigationCallbackOptions.GO_BACK,
|
|
191
|
+
targetScreenId: null,
|
|
192
|
+
};
|
|
193
|
+
} else {
|
|
194
|
+
hookCallback?.(args);
|
|
195
|
+
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
184
198
|
}
|
|
185
199
|
|
|
186
200
|
hookCallback?.({ ...args, success: false, cancelled: true });
|