@applicaster/zapp-react-native-utils 15.0.0-rc.4 → 15.0.0-rc.40
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/accessibilityManager/const.ts +4 -0
- package/appUtils/accessibilityManager/hooks.ts +20 -13
- package/appUtils/accessibilityManager/index.ts +28 -1
- package/appUtils/accessibilityManager/utils.ts +36 -5
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +1 -0
- package/appUtils/focusManager/index.ios.ts +18 -1
- package/appUtils/focusManagerAux/utils/index.ts +18 -0
- package/appUtils/focusManagerAux/utils/utils.ios.ts +35 -0
- package/appUtils/platform/platformUtils.ts +116 -17
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +94 -4
- package/appUtils/playerManager/OverlayObserver/utils.ts +32 -20
- package/appUtils/playerManager/conts.ts +21 -0
- package/appUtils/playerManager/player.ts +4 -0
- package/appUtils/playerManager/usePlayerState.tsx +14 -2
- 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 +32 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +59 -1
- package/manifestUtils/keys.js +21 -0
- package/manifestUtils/sharedConfiguration/screenPicker/utils.js +1 -0
- package/navigationUtils/index.ts +19 -16
- package/package.json +2 -2
- package/playerUtils/usePlayerTTS.ts +8 -3
- package/reactHooks/feed/useBatchLoading.ts +7 -1
- package/reactHooks/feed/usePipesCacheReset.ts +3 -1
- package/reactHooks/layout/index.ts +1 -1
- package/reactHooks/player/TVSeekControlller/TVSeekController.ts +27 -10
- package/utils/__tests__/mapAccum.test.ts +73 -0
- package/utils/index.ts +7 -0
- package/utils/mapAccum.ts +23 -0
- package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +15 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { curry } from "lodash";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A native reimplementation of Ramda's mapAccum.
|
|
5
|
+
*
|
|
6
|
+
* @template A, B, C
|
|
7
|
+
* @param {(acc: A, value: B) => [A, C]} fn - Function returning [newAcc, mappedValue]
|
|
8
|
+
* @param {A} acc - Initial accumulator
|
|
9
|
+
* @param {B[]} list - List to process
|
|
10
|
+
* @returns {[A, C[]]} - Tuple of [final accumulator, mapped array]
|
|
11
|
+
*/
|
|
12
|
+
export const mapAccum = curry((fn, acc, list) => {
|
|
13
|
+
const result = [];
|
|
14
|
+
let currentAcc = acc;
|
|
15
|
+
|
|
16
|
+
for (let i = 0; i < list.length; i++) {
|
|
17
|
+
const [nextAcc, mapped] = fn(currentAcc, list[i]);
|
|
18
|
+
currentAcc = nextAcc;
|
|
19
|
+
result.push(mapped);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return [currentAcc, result];
|
|
23
|
+
});
|
|
@@ -56,9 +56,23 @@ const legacyMappingKeys = {
|
|
|
56
56
|
actionType: "logout_completion_action",
|
|
57
57
|
targetScreen: "navigate_to_logout_screen",
|
|
58
58
|
},
|
|
59
|
+
"quick-brick-storefront": {
|
|
60
|
+
actionType: "purchase_completion_action",
|
|
61
|
+
targetScreen: "navigate_to_screen_after_purchase",
|
|
62
|
+
},
|
|
63
|
+
"zapp_login_plugin_oauth_tv_2_0.login": {
|
|
64
|
+
actionType: "login_completion_action",
|
|
65
|
+
targetScreen: "navigate_to_login_screen",
|
|
66
|
+
},
|
|
67
|
+
"zapp_login_plugin_oauth_tv_2_0.logout": {
|
|
68
|
+
actionType: "logout_completion_action",
|
|
69
|
+
targetScreen: "navigate_to_logout_screen",
|
|
70
|
+
},
|
|
59
71
|
};
|
|
60
72
|
|
|
61
|
-
const NAV_ACTIONS =
|
|
73
|
+
const NAV_ACTIONS = (
|
|
74
|
+
Object.values(NavigationCallbackOptions) as string[]
|
|
75
|
+
).filter((value) => value !== NavigationCallbackOptions.DEFAULT);
|
|
62
76
|
|
|
63
77
|
const isNavAction = (v: unknown): v is NavigationCallbackOptions =>
|
|
64
78
|
typeof v === "string" && NAV_ACTIONS.includes(v);
|