@applicaster/zapp-react-native-utils 12.0.0-alpha.4300857220 → 12.0.0-alpha.4355141911

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 (35) hide show
  1. package/analyticsUtils/AnalyticsEvents/index.ts +6 -0
  2. package/analyticsUtils/AnalyticsEvents/searchEvents.ts +21 -0
  3. package/analyticsUtils/events.ts +6 -0
  4. package/analyticsUtils/index.tsx +6 -0
  5. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +3 -3
  6. package/appUtils/focusManager/__tests__/focusManager.test.js +4 -24
  7. package/appUtils/focusManager/__tests__/index.test.ts +3 -3
  8. package/appUtils/focusManager/index.ts +141 -56
  9. package/appUtils/focusManager/treeDataStructure/Utils/index.js +74 -43
  10. package/appUtils/focusManager/utils/index.ts +100 -0
  11. package/appUtils/playerManager/usePlayerControllerSetup.tsx +6 -1
  12. package/arrayUtils/__tests__/isFilledArray.test.ts +63 -0
  13. package/arrayUtils/index.ts +5 -0
  14. package/cellUtils/__tests__/cellUtils.test.ts +9 -20
  15. package/cellUtils/index.ts +6 -12
  16. package/dateUtils/index.ts +11 -0
  17. package/inflatedUrlUtils/index.ts +4 -4
  18. package/localizationUtils/__tests__/localizationUtils.test.ts +72 -53
  19. package/localizationUtils/index.ts +13 -22
  20. package/numberUtils/__tests__/isLikeNumber.test.ts +18 -0
  21. package/numberUtils/index.ts +9 -18
  22. package/package.json +2 -2
  23. package/reactHooks/cell-click/__tests__/index.test.js +10 -1
  24. package/reactHooks/cell-click/index.ts +12 -12
  25. package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +30 -70
  26. package/reactHooks/feed/__tests__/useInflatedUrl.test.ts +18 -3
  27. package/reactHooks/feed/useBuildPipesUrl.ts +7 -10
  28. package/reactHooks/feed/useInflatedUrl.ts +44 -15
  29. package/reactHooks/navigation/__tests__/index.test.tsx +11 -8
  30. package/reactHooks/navigation/index.ts +49 -66
  31. package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +21 -23
  32. package/reactHooks/screen/index.ts +2 -0
  33. package/reactHooks/screen/useScreenBackgroundColor.ts +23 -0
  34. package/reactHooks/screen/useScreenContext.ts +2 -2
  35. package/types.ts +4 -0
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
3
+ import { useScreenConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/River/useScreenConfiguration";
4
+ import { ifEmptyUseFallback } from "@applicaster/zapp-react-native-utils/cellUtils";
5
+
6
+ export const useScreenBackgroundColor = (screenId: string): string => {
7
+ const { backgroundColor: screenBackgroundColor } =
8
+ useScreenConfiguration(screenId);
9
+
10
+ const theme = useTheme();
11
+
12
+ const themeBackgroundColor = React.useMemo(
13
+ () => theme.app_background_color,
14
+ [theme.app_background_color]
15
+ );
16
+
17
+ const backgroundColor = ifEmptyUseFallback(
18
+ screenBackgroundColor,
19
+ themeBackgroundColor
20
+ );
21
+
22
+ return backgroundColor;
23
+ };
@@ -5,6 +5,7 @@ import { useNestedNavigationContext } from "@applicaster/zapp-react-native-ui-co
5
5
  import { useNavigation } from "../navigation/useNavigation";
6
6
 
7
7
  import { ScreenContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenContext";
8
+ import { ScreenDataContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
8
9
 
9
10
  export function useScreenContextV2() {
10
11
  return useContext(ScreenContext);
@@ -44,9 +45,8 @@ export function useSetNavbarState() {
44
45
 
45
46
  export function useScreenContext(): NavigationScreenData {
46
47
  const navigator = useNavigation();
48
+ const screenData = useContext(ScreenDataContext);
47
49
 
48
- const screenKey = useMemo(() => navigator?.key, [navigator]);
49
- const screenData = useMemo(() => navigator?.data, [screenKey]);
50
50
  const modalScreenData = navigator?.modalData;
51
51
 
52
52
  const isModal = useModalNavigationContext();
package/types.ts CHANGED
@@ -5,3 +5,7 @@ export type ManifestField<T> = {
5
5
  group?: boolean;
6
6
  fields?: ManifestField<any>[];
7
7
  };
8
+
9
+ export enum ENDPOINT_TAGS {
10
+ allow_missing_keys = "allow_missing_keys",
11
+ }