@applicaster/zapp-react-native-utils 14.0.0-rc.9 → 15.0.0-rc.1

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 (135) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +60 -84
  2. package/actionsExecutor/ScreenActions.ts +164 -0
  3. package/actionsExecutor/StorageActions.ts +110 -0
  4. package/actionsExecutor/feedDecorator.ts +171 -0
  5. package/actionsExecutor/screenResolver.ts +11 -0
  6. package/analyticsUtils/AnalyticsEvents/helper.ts +81 -0
  7. package/analyticsUtils/AnalyticsEvents/sendHeaderClickEvent.ts +1 -1
  8. package/analyticsUtils/AnalyticsEvents/sendMenuClickEvent.ts +2 -1
  9. package/analyticsUtils/AnalyticsEvents/sendOnClickEvent.ts +14 -4
  10. package/analyticsUtils/__tests__/analyticsUtils.test.js +3 -0
  11. package/analyticsUtils/events.ts +8 -0
  12. package/analyticsUtils/index.tsx +3 -4
  13. package/analyticsUtils/manager.ts +1 -1
  14. package/analyticsUtils/playerAnalyticsTracker.ts +2 -1
  15. package/appUtils/HooksManager/Hook.ts +4 -4
  16. package/appUtils/HooksManager/index.ts +11 -1
  17. package/appUtils/accessibilityManager/const.ts +13 -0
  18. package/appUtils/accessibilityManager/hooks.ts +35 -1
  19. package/appUtils/accessibilityManager/index.ts +154 -30
  20. package/appUtils/accessibilityManager/utils.ts +24 -0
  21. package/appUtils/contextKeysManager/contextResolver.ts +42 -1
  22. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +7 -0
  23. package/appUtils/focusManager/__tests__/focusManager.test.js +1 -1
  24. package/appUtils/focusManager/events.ts +2 -0
  25. package/appUtils/focusManager/index.ios.ts +10 -0
  26. package/appUtils/focusManager/index.ts +86 -11
  27. package/appUtils/focusManager/treeDataStructure/Tree/index.js +1 -1
  28. package/appUtils/focusManagerAux/utils/index.ts +94 -3
  29. package/appUtils/platform/platformUtils.ts +31 -1
  30. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +0 -15
  31. package/appUtils/playerManager/useChapterMarker.tsx +0 -1
  32. package/appUtils/playerManager/usePlayerControllerSetup.tsx +16 -0
  33. package/arrayUtils/__tests__/isEmptyArray.test.ts +63 -0
  34. package/arrayUtils/__tests__/isFilledArray.test.ts +1 -1
  35. package/arrayUtils/index.ts +8 -3
  36. package/audioPlayerUtils/__tests__/getArtworkImage.test.ts +144 -0
  37. package/audioPlayerUtils/__tests__/getBackgroundImage.test.ts +72 -0
  38. package/audioPlayerUtils/__tests__/getImageFromEntry.test.ts +110 -0
  39. package/audioPlayerUtils/assets/index.ts +2 -0
  40. package/audioPlayerUtils/index.ts +242 -0
  41. package/componentsUtils/__tests__/isTabsScreen.test.ts +38 -0
  42. package/componentsUtils/index.ts +4 -1
  43. package/conf/player/__tests__/selectors.test.ts +34 -0
  44. package/conf/player/selectors.ts +10 -0
  45. package/configurationUtils/__tests__/configurationUtils.test.js +0 -31
  46. package/configurationUtils/__tests__/getMediaItems.test.ts +65 -0
  47. package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +34 -0
  48. package/configurationUtils/__tests__/manifestKeyParser.test.ts +546 -0
  49. package/configurationUtils/index.ts +64 -35
  50. package/configurationUtils/manifestKeyParser.ts +57 -32
  51. package/focusManager/FocusManager.ts +104 -20
  52. package/focusManager/Tree.ts +25 -21
  53. package/focusManager/__tests__/FocusManager.test.ts +50 -8
  54. package/focusManager/aux/index.ts +98 -0
  55. package/focusManager/utils.ts +12 -6
  56. package/index.d.ts +1 -10
  57. package/manifestUtils/_internals/getDefaultConfiguration.js +28 -0
  58. package/manifestUtils/{_internals.js → _internals/index.js} +2 -25
  59. package/manifestUtils/createConfig.js +4 -1
  60. package/manifestUtils/defaultManifestConfigurations/player.js +2764 -1539
  61. package/manifestUtils/index.js +4 -0
  62. package/manifestUtils/keys.js +12 -0
  63. package/manifestUtils/progressBar/__tests__/mobileProgressBar.test.js +0 -30
  64. package/manifestUtils/sharedConfiguration/screenPicker/stylesFields.js +6 -0
  65. package/navigationUtils/__tests__/mapContentTypesToRivers.test.ts +130 -0
  66. package/navigationUtils/index.ts +7 -5
  67. package/package.json +2 -3
  68. package/playerUtils/PlayerTTS/PlayerTTS.ts +359 -0
  69. package/playerUtils/PlayerTTS/index.ts +1 -0
  70. package/playerUtils/__tests__/configurationUtils.test.ts +1 -65
  71. package/playerUtils/__tests__/getPlayerActionButtons.test.ts +54 -0
  72. package/playerUtils/_internals/__tests__/utils.test.ts +71 -0
  73. package/playerUtils/_internals/index.ts +1 -0
  74. package/playerUtils/_internals/utils.ts +31 -0
  75. package/playerUtils/configurationUtils.ts +0 -44
  76. package/playerUtils/getPlayerActionButtons.ts +17 -0
  77. package/playerUtils/index.ts +53 -0
  78. package/playerUtils/usePlayerTTS.ts +21 -0
  79. package/playerUtils/useValidatePlayerConfig.tsx +22 -19
  80. package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +15 -14
  81. package/reactHooks/cell-click/__tests__/index.test.js +3 -0
  82. package/reactHooks/cell-click/index.ts +8 -1
  83. package/reactHooks/debugging/__tests__/index.test.js +0 -1
  84. package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +47 -90
  85. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +71 -31
  86. package/reactHooks/feed/index.ts +2 -0
  87. package/reactHooks/feed/useBatchLoading.ts +17 -10
  88. package/reactHooks/feed/useFeedLoader.tsx +36 -34
  89. package/reactHooks/feed/useLoadPipesDataDispatch.ts +63 -0
  90. package/reactHooks/feed/usePipesCacheReset.ts +3 -3
  91. package/reactHooks/flatList/useSequentialRenderItem.tsx +3 -3
  92. package/reactHooks/layout/__tests__/index.test.tsx +3 -1
  93. package/reactHooks/layout/isTablet/index.ts +12 -5
  94. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +34 -36
  95. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -3
  96. package/reactHooks/layout/useLayoutVersion.ts +5 -5
  97. package/reactHooks/navigation/index.ts +7 -5
  98. package/reactHooks/navigation/useIsScreenActive.ts +9 -5
  99. package/reactHooks/navigation/useRoute.ts +7 -2
  100. package/reactHooks/navigation/useScreenStateStore.ts +8 -0
  101. package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +4 -0
  102. package/reactHooks/screen/useScreenContext.ts +1 -1
  103. package/reactHooks/state/__tests__/ZStoreProvider.test.tsx +2 -1
  104. package/reactHooks/state/index.ts +1 -1
  105. package/reactHooks/state/useHomeRiver.ts +4 -2
  106. package/reactHooks/state/useRivers.ts +7 -8
  107. package/riverComponetsMeasurementProvider/index.tsx +1 -1
  108. package/screenPickerUtils/index.ts +13 -0
  109. package/services/js2native.ts +1 -0
  110. package/storage/ScreenSingleValueProvider.ts +204 -0
  111. package/storage/ScreenStateMultiSelectProvider.ts +293 -0
  112. package/storage/StorageMultiSelectProvider.ts +192 -0
  113. package/storage/StorageSingleSelectProvider.ts +108 -0
  114. package/testUtils/index.tsx +7 -8
  115. package/time/BackgroundTimer.ts +6 -4
  116. package/utils/__tests__/endsWith.test.ts +30 -0
  117. package/utils/__tests__/find.test.ts +36 -0
  118. package/utils/__tests__/omit.test.ts +19 -0
  119. package/utils/__tests__/path.test.ts +33 -0
  120. package/utils/__tests__/pathOr.test.ts +37 -0
  121. package/utils/__tests__/startsWith.test.ts +30 -0
  122. package/utils/__tests__/take.test.ts +40 -0
  123. package/utils/endsWith.ts +9 -0
  124. package/utils/find.ts +3 -0
  125. package/utils/index.ts +33 -1
  126. package/utils/omit.ts +5 -0
  127. package/utils/path.ts +5 -0
  128. package/utils/pathOr.ts +5 -0
  129. package/utils/startsWith.ts +9 -0
  130. package/utils/take.ts +5 -0
  131. package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +164 -0
  132. package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +60 -0
  133. package/zappFrameworkUtils/HookCallback/useCallbackActions.ts +22 -0
  134. package/zappFrameworkUtils/loginPluginUtils.ts +1 -1
  135. package/playerUtils/configurationGenerator.ts +0 -2572
@@ -0,0 +1,60 @@
1
+ const NavigationCallbackOptions = {
2
+ DEFAULT: "default",
3
+ GO_HOME: "go_home",
4
+ GO_BACK: "go_back",
5
+ GO_TO_SCREEN: "go_to_screen",
6
+ };
7
+
8
+ const CALLBACK_NAVIGATION_KEY = "hook_callback_navigation";
9
+
10
+ const CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY =
11
+ "hook_callback_navigation_go_to_screen";
12
+
13
+ const extendManifestWithHookCallback = () => ({
14
+ group: true,
15
+ label: "CallBack Navigation",
16
+ folded: true,
17
+ fields: [
18
+ {
19
+ type: "select",
20
+ key: CALLBACK_NAVIGATION_KEY,
21
+ label: "Callback Navigation",
22
+ label_tooltip:
23
+ "Defines what navigation action should be performed after the callback is called.",
24
+ options: [
25
+ {
26
+ text: "Use default flow",
27
+ value: NavigationCallbackOptions.DEFAULT,
28
+ },
29
+ {
30
+ text: "Go Back to home screen",
31
+ value: NavigationCallbackOptions.GO_HOME,
32
+ },
33
+ {
34
+ text: "Go Back to previous screen",
35
+ value: NavigationCallbackOptions.GO_BACK,
36
+ },
37
+ {
38
+ text: "Move to specific screen",
39
+ value: NavigationCallbackOptions.GO_TO_SCREEN,
40
+ },
41
+ ],
42
+ initial_value: "default",
43
+ },
44
+ {
45
+ type: "screen_selector",
46
+ key: CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY,
47
+ label: "Navigate to screen",
48
+ label_tooltip: "Screen you wish to navigate to after success purchase",
49
+ rules: "conditional",
50
+ conditional_fields: [
51
+ {
52
+ key: `general/${CALLBACK_NAVIGATION_KEY}`,
53
+ condition_value: NavigationCallbackOptions.GO_TO_SCREEN,
54
+ },
55
+ ],
56
+ },
57
+ ],
58
+ });
59
+
60
+ module.exports = { extendManifestWithHookCallback };
@@ -0,0 +1,22 @@
1
+ import { useCallback } from "react";
2
+ import { useCallbackNavigationAction } from "./callbackNavigationAction";
3
+
4
+ export const useCallbackActions = (
5
+ item?: ZappUIComponent | ZappRiver,
6
+ hookCallback?: hookCallback
7
+ ): hookCallback => {
8
+ const navigationAction = useCallbackNavigationAction(item);
9
+
10
+ return useCallback(
11
+ async (data: hookCallbackArgs) => {
12
+ if (navigationAction && data.success) {
13
+ hookCallback?.({ ...data, success: false, cancelled: true });
14
+
15
+ navigationAction(data);
16
+ } else {
17
+ hookCallback?.(data);
18
+ }
19
+ },
20
+ [navigationAction, hookCallback]
21
+ );
22
+ };
@@ -20,7 +20,7 @@ const isAuthenticationRequired = ({ payload, logs }) => {
20
20
 
21
21
  if (!payload) {
22
22
  log_info(
23
- "isAuthenticationRequired: No payload exist, authentefication required"
23
+ "isAuthenticationRequired: No payload exist, authentication required"
24
24
  );
25
25
 
26
26
  return true;