@applicaster/zapp-react-native-utils 13.0.0-alpha.1291347678 → 13.0.0-alpha.1313712178

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.
Files changed (57) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +126 -6
  2. package/actionsExecutor/consts.ts +4 -0
  3. package/appUtils/HooksManager/Hook.ts +4 -0
  4. package/appUtils/HooksManager/index.ts +2 -0
  5. package/appUtils/__tests__/__snapshots__/localizationsHelper.test.ts.snap +151 -0
  6. package/appUtils/__tests__/allZappLocales.ts +79 -0
  7. package/appUtils/__tests__/{localizationsHelper.test.js → localizationsHelper.test.ts} +11 -0
  8. package/appUtils/contextKeysManager/contextResolver.ts +1 -12
  9. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +2 -0
  10. package/appUtils/focusManager/index.ios.ts +14 -4
  11. package/appUtils/focusManager/index.ts +13 -0
  12. package/appUtils/focusManager/utils/__tests__/findChild.test.ts +35 -0
  13. package/appUtils/focusManager/utils/index.ts +5 -0
  14. package/appUtils/localizationsHelper.ts +31 -0
  15. package/appUtils/playerManager/player.ts +20 -12
  16. package/appUtils/playerManager/playerHooks/usePlayerCurrentTime.tsx +11 -7
  17. package/appUtils/playerManager/playerNative.ts +12 -1
  18. package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +7 -1
  19. package/cellUtils/index.ts +9 -5
  20. package/componentsUtils/__tests__/isFirstComponentGallery.test.ts +33 -0
  21. package/componentsUtils/__tests__/isFirstComponentScreenPicker.test.ts +33 -0
  22. package/componentsUtils/__tests__/isGallery.test.ts +33 -0
  23. package/componentsUtils/__tests__/isScreenPicker.test.ts +33 -0
  24. package/componentsUtils/index.ts +39 -0
  25. package/dateUtils/index.ts +19 -0
  26. package/focusManager/FocusManager.ts +3 -1
  27. package/focusManager/index.ts +3 -21
  28. package/functionUtils/index.ts +25 -0
  29. package/index.d.ts +0 -12
  30. package/localizationUtils/index.ts +8 -13
  31. package/manifestUtils/defaultManifestConfigurations/generalContent.js +13 -0
  32. package/manifestUtils/defaultManifestConfigurations/player.js +14 -0
  33. package/manifestUtils/keys.js +27 -2
  34. package/modalState/__tests__/index.test.ts +51 -0
  35. package/modalState/index.ts +32 -2
  36. package/navigationUtils/__tests__/__snapshots__/navigationUtils.test.js.snap +1 -0
  37. package/navigationUtils/index.ts +3 -1
  38. package/numberUtils/__tests__/toPositiveNumberWithDefault.test.ts +23 -3
  39. package/numberUtils/index.ts +4 -0
  40. package/package.json +2 -3
  41. package/playerUtils/configurationGenerator.ts +14 -8
  42. package/reactHooks/advertising/index.ts +5 -5
  43. package/reactHooks/feed/useBatchLoading.ts +10 -12
  44. package/reactHooks/feed/useFeedLoader.tsx +17 -8
  45. package/reactHooks/hookModal/hooks/useHookModalScreenData.ts +39 -0
  46. package/reactHooks/navigation/index.ts +5 -3
  47. package/reactHooks/navigation/useRoute.ts +4 -6
  48. package/reactHooks/screen/__tests__/useScreenBackgroundColor.test.tsx +69 -0
  49. package/reactHooks/screen/useScreenBackgroundColor.ts +3 -15
  50. package/reactHooks/useListenEventBusEvent.ts +1 -1
  51. package/utils/README.md +30 -0
  52. package/utils/chunk.ts +5 -0
  53. package/utils/index.ts +5 -0
  54. package/utils/times.ts +5 -0
  55. package/zappFrameworkUtils/localStorageHelper.ts +6 -0
  56. package/zappFrameworkUtils/loginPluginUtils.ts +6 -2
  57. package/zappFrameworkUtils/types.ts +11 -0
@@ -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";
@@ -89,11 +89,15 @@ const runInBackground = async ({
89
89
  const shouldPresent = await hookPresentPolicy.shouldPresentScreen();
90
90
 
91
91
  if (!shouldPresent) {
92
+ const isRefreshed = await checkUserAuthenticated();
93
+
92
94
  log_info(
93
- "runInBackground: Background mode finished, hook plugin will be skipped"
95
+ `runInBackground: Background mode finished, ${isRefreshed ? "finish hook with completion true" : "refresh failed will presentUI"}`
94
96
  );
95
97
 
96
- await checkUserAuthenticated();
98
+ isRefreshed
99
+ ? callback({ success: isRefreshed, payload: item })
100
+ : presentUI();
97
101
 
98
102
  return;
99
103
  }
@@ -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>;