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

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 (147) 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/AnalyticPlayerListener.ts +5 -2
  7. package/analyticsUtils/AnalyticsEvents/helper.ts +81 -0
  8. package/analyticsUtils/AnalyticsEvents/sendHeaderClickEvent.ts +1 -1
  9. package/analyticsUtils/AnalyticsEvents/sendMenuClickEvent.ts +2 -1
  10. package/analyticsUtils/AnalyticsEvents/sendOnClickEvent.ts +14 -4
  11. package/analyticsUtils/__tests__/analyticsUtils.test.js +3 -0
  12. package/analyticsUtils/events.ts +8 -0
  13. package/analyticsUtils/index.tsx +3 -4
  14. package/analyticsUtils/manager.ts +1 -1
  15. package/analyticsUtils/playerAnalyticsTracker.ts +2 -1
  16. package/appUtils/HooksManager/Hook.ts +4 -4
  17. package/appUtils/HooksManager/index.ts +11 -1
  18. package/appUtils/accessibilityManager/const.ts +13 -0
  19. package/appUtils/accessibilityManager/hooks.ts +35 -1
  20. package/appUtils/accessibilityManager/index.ts +154 -30
  21. package/appUtils/accessibilityManager/utils.ts +24 -0
  22. package/appUtils/contextKeysManager/contextResolver.ts +42 -1
  23. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +8 -0
  24. package/appUtils/focusManager/__tests__/focusManager.test.js +1 -1
  25. package/appUtils/focusManager/events.ts +2 -0
  26. package/appUtils/focusManager/index.ios.ts +27 -0
  27. package/appUtils/focusManager/index.ts +86 -11
  28. package/appUtils/focusManager/treeDataStructure/Tree/index.js +1 -1
  29. package/appUtils/focusManagerAux/utils/index.ts +112 -3
  30. package/appUtils/focusManagerAux/utils/utils.ios.ts +35 -0
  31. package/appUtils/platform/platformUtils.ts +33 -3
  32. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +0 -15
  33. package/appUtils/playerManager/conts.ts +21 -0
  34. package/appUtils/playerManager/player.ts +4 -0
  35. package/appUtils/playerManager/useChapterMarker.tsx +0 -1
  36. package/appUtils/playerManager/usePlayerControllerSetup.tsx +16 -0
  37. package/appUtils/playerManager/usePlayerState.tsx +14 -2
  38. package/arrayUtils/__tests__/allTruthy.test.ts +24 -0
  39. package/arrayUtils/__tests__/anyThruthy.test.ts +24 -0
  40. package/arrayUtils/__tests__/isEmptyArray.test.ts +63 -0
  41. package/arrayUtils/__tests__/isFilledArray.test.ts +1 -1
  42. package/arrayUtils/index.ts +13 -3
  43. package/audioPlayerUtils/__tests__/getArtworkImage.test.ts +144 -0
  44. package/audioPlayerUtils/__tests__/getBackgroundImage.test.ts +72 -0
  45. package/audioPlayerUtils/__tests__/getImageFromEntry.test.ts +110 -0
  46. package/audioPlayerUtils/assets/index.ts +2 -0
  47. package/audioPlayerUtils/index.ts +242 -0
  48. package/componentsUtils/__tests__/isTabsScreen.test.ts +38 -0
  49. package/componentsUtils/index.ts +4 -1
  50. package/conf/player/__tests__/selectors.test.ts +34 -0
  51. package/conf/player/selectors.ts +10 -0
  52. package/configurationUtils/__tests__/configurationUtils.test.js +0 -31
  53. package/configurationUtils/__tests__/getMediaItems.test.ts +65 -0
  54. package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +34 -0
  55. package/configurationUtils/__tests__/manifestKeyParser.test.ts +546 -0
  56. package/configurationUtils/index.ts +64 -35
  57. package/configurationUtils/manifestKeyParser.ts +57 -32
  58. package/focusManager/FocusManager.ts +104 -20
  59. package/focusManager/Tree.ts +25 -21
  60. package/focusManager/__tests__/FocusManager.test.ts +50 -8
  61. package/focusManager/aux/index.ts +98 -0
  62. package/focusManager/utils.ts +12 -6
  63. package/index.d.ts +1 -10
  64. package/manifestUtils/_internals/getDefaultConfiguration.js +28 -0
  65. package/manifestUtils/{_internals.js → _internals/index.js} +2 -25
  66. package/manifestUtils/createConfig.js +4 -1
  67. package/manifestUtils/defaultManifestConfigurations/player.js +2348 -1103
  68. package/manifestUtils/index.js +4 -0
  69. package/manifestUtils/keys.js +12 -0
  70. package/manifestUtils/progressBar/__tests__/mobileProgressBar.test.js +0 -30
  71. package/manifestUtils/sharedConfiguration/screenPicker/stylesFields.js +6 -0
  72. package/navigationUtils/__tests__/mapContentTypesToRivers.test.ts +130 -0
  73. package/navigationUtils/index.ts +26 -21
  74. package/package.json +2 -3
  75. package/playerUtils/PlayerTTS/PlayerTTS.ts +359 -0
  76. package/playerUtils/PlayerTTS/index.ts +1 -0
  77. package/playerUtils/__tests__/configurationUtils.test.ts +1 -65
  78. package/playerUtils/__tests__/getPlayerActionButtons.test.ts +54 -0
  79. package/playerUtils/_internals/__tests__/utils.test.ts +71 -0
  80. package/playerUtils/_internals/index.ts +1 -0
  81. package/playerUtils/_internals/utils.ts +31 -0
  82. package/playerUtils/configurationUtils.ts +0 -44
  83. package/playerUtils/getPlayerActionButtons.ts +17 -0
  84. package/playerUtils/index.ts +53 -0
  85. package/playerUtils/usePlayerTTS.ts +21 -0
  86. package/playerUtils/useValidatePlayerConfig.tsx +22 -19
  87. package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +15 -14
  88. package/reactHooks/cell-click/__tests__/index.test.js +3 -0
  89. package/reactHooks/cell-click/index.ts +8 -1
  90. package/reactHooks/debugging/__tests__/index.test.js +0 -1
  91. package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +47 -90
  92. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +71 -31
  93. package/reactHooks/feed/index.ts +2 -0
  94. package/reactHooks/feed/useBatchLoading.ts +23 -10
  95. package/reactHooks/feed/useFeedLoader.tsx +36 -43
  96. package/reactHooks/feed/useInflatedUrl.ts +23 -29
  97. package/reactHooks/feed/useLoadPipesDataDispatch.ts +63 -0
  98. package/reactHooks/feed/usePipesCacheReset.ts +6 -4
  99. package/reactHooks/flatList/useSequentialRenderItem.tsx +3 -3
  100. package/reactHooks/layout/__tests__/index.test.tsx +3 -1
  101. package/reactHooks/layout/index.ts +1 -1
  102. package/reactHooks/layout/isTablet/index.ts +12 -5
  103. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +34 -36
  104. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -3
  105. package/reactHooks/layout/useLayoutVersion.ts +5 -5
  106. package/reactHooks/navigation/index.ts +7 -5
  107. package/reactHooks/navigation/useIsScreenActive.ts +9 -5
  108. package/reactHooks/navigation/useRoute.ts +7 -2
  109. package/reactHooks/navigation/useScreenStateStore.ts +8 -0
  110. package/reactHooks/player/TVSeekControlller/TVSeekController.ts +27 -10
  111. package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +4 -0
  112. package/reactHooks/screen/useScreenContext.ts +1 -1
  113. package/reactHooks/state/__tests__/ZStoreProvider.test.tsx +2 -1
  114. package/reactHooks/state/index.ts +1 -1
  115. package/reactHooks/state/useHomeRiver.ts +4 -2
  116. package/reactHooks/state/useRivers.ts +7 -8
  117. package/riverComponetsMeasurementProvider/index.tsx +1 -1
  118. package/screenPickerUtils/index.ts +13 -0
  119. package/services/js2native.ts +1 -0
  120. package/storage/ScreenSingleValueProvider.ts +204 -0
  121. package/storage/ScreenStateMultiSelectProvider.ts +293 -0
  122. package/storage/StorageMultiSelectProvider.ts +192 -0
  123. package/storage/StorageSingleSelectProvider.ts +108 -0
  124. package/testUtils/index.tsx +7 -8
  125. package/time/BackgroundTimer.ts +6 -4
  126. package/utils/__tests__/endsWith.test.ts +30 -0
  127. package/utils/__tests__/find.test.ts +36 -0
  128. package/utils/__tests__/mapAccum.test.ts +73 -0
  129. package/utils/__tests__/omit.test.ts +19 -0
  130. package/utils/__tests__/path.test.ts +33 -0
  131. package/utils/__tests__/pathOr.test.ts +37 -0
  132. package/utils/__tests__/startsWith.test.ts +30 -0
  133. package/utils/__tests__/take.test.ts +40 -0
  134. package/utils/endsWith.ts +9 -0
  135. package/utils/find.ts +3 -0
  136. package/utils/index.ts +40 -1
  137. package/utils/mapAccum.ts +23 -0
  138. package/utils/omit.ts +5 -0
  139. package/utils/path.ts +5 -0
  140. package/utils/pathOr.ts +5 -0
  141. package/utils/startsWith.ts +9 -0
  142. package/utils/take.ts +5 -0
  143. package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +231 -0
  144. package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +76 -0
  145. package/zappFrameworkUtils/HookCallback/useCallbackActions.ts +19 -0
  146. package/zappFrameworkUtils/loginPluginUtils.ts +1 -1
  147. package/playerUtils/configurationGenerator.ts +0 -2572
package/utils/index.ts CHANGED
@@ -2,4 +2,43 @@ export { chunk } from "./chunk";
2
2
 
3
3
  export { times } from "./times";
4
4
 
5
- export { cloneDeep as clone, flatten, drop, size, isNil } from "lodash";
5
+ export { startsWith } from "./startsWith";
6
+
7
+ export { find } from "./find";
8
+
9
+ export { pathOr } from "./pathOr";
10
+
11
+ export { path } from "./path";
12
+
13
+ export { omit } from "./omit";
14
+
15
+ export { endsWith } from "./endsWith";
16
+
17
+ export { take } from "./take";
18
+
19
+ export { mapAccum } from "./mapAccum";
20
+
21
+ export {
22
+ cloneDeep as clone,
23
+ flatten,
24
+ drop,
25
+ size,
26
+ isNil,
27
+ isEmpty,
28
+ get,
29
+ has,
30
+ flatMap,
31
+ difference,
32
+ pick,
33
+ map,
34
+ trim,
35
+ toString,
36
+ last,
37
+ toLower,
38
+ isEqual as equals,
39
+ uniq,
40
+ uniqWith,
41
+ flowRight as compose,
42
+ partial,
43
+ reverse,
44
+ } from "lodash";
@@ -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
+ });
package/utils/omit.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { omit as Lodash_omit } from "lodash";
2
+
3
+ export const omit = (path, record) => {
4
+ return Lodash_omit(record, path);
5
+ };
package/utils/path.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { get } from "lodash";
2
+
3
+ export const path = (route, record) => {
4
+ return get(record, route, undefined);
5
+ };
@@ -0,0 +1,5 @@
1
+ import { get } from "lodash";
2
+
3
+ export const pathOr = (defaultValue, path, record) => {
4
+ return get(record, path, defaultValue);
5
+ };
@@ -0,0 +1,9 @@
1
+ import { isNil } from "lodash";
2
+
3
+ export const startsWith = (target, str) => {
4
+ if (isNil(str)) {
5
+ return false;
6
+ }
7
+
8
+ return str.startsWith(target);
9
+ };
package/utils/take.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { take as Ltake } from "lodash";
2
+
3
+ export function take<T>(n: number, xs: T[]): T[] {
4
+ return Ltake(xs, n);
5
+ }
@@ -0,0 +1,231 @@
1
+ import { useNavigation, useRivers, useScreenContext } from "../../reactHooks";
2
+ import { createLogger } from "../../logger";
3
+ import { useCallback, useMemo } from "react";
4
+
5
+ export enum NavigationCallbackOptions {
6
+ DEFAULT = "default",
7
+ GO_HOME = "go_home",
8
+ GO_BACK = "go_back",
9
+ GO_TO_SCREEN = "go_to_screen",
10
+ }
11
+
12
+ export enum ResultType {
13
+ login = "login",
14
+ logout = "logout",
15
+ }
16
+
17
+ export type CallbackResult = hookCallbackArgs & {
18
+ options?: {
19
+ resultType?: ResultType;
20
+ };
21
+ };
22
+
23
+ export type ScreenResultCallback = (args: CallbackResult) => void | undefined;
24
+
25
+ export const CALLBACK_NAVIGATION_KEY = "completion_action";
26
+
27
+ export const CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY =
28
+ "completion_action_navigation_go_to_screen";
29
+
30
+ type NavKeys = {
31
+ action: NavigationCallbackOptions;
32
+ targetScreenId: string | null;
33
+ } | null;
34
+
35
+ type General = Record<string, unknown>;
36
+
37
+ const LogPrefix = "useCallbackNavigationAction:";
38
+
39
+ const { log_info, log_verbose, log_debug } = createLogger({
40
+ subsystem: "hook-navigation-callback",
41
+ });
42
+
43
+ const legacyMappingKeys = {
44
+ "quick-brick-login-flow": {
45
+ actionType: "login_completion_action",
46
+ targetScreen: "navigate_to_login_screen",
47
+ },
48
+ "quick-brick-user-account-ui-component": {
49
+ actionType: "callbackAction",
50
+ },
51
+ "quick-brick-login-multi-login-providers.login": {
52
+ actionType: "login_completion_action",
53
+ targetScreen: "navigate_to_login_screen",
54
+ },
55
+ "quick-brick-login-multi-login-providers.logout": {
56
+ actionType: "logout_completion_action",
57
+ targetScreen: "navigate_to_logout_screen",
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
+ },
71
+ };
72
+
73
+ const NAV_ACTIONS = (
74
+ Object.values(NavigationCallbackOptions) as string[]
75
+ ).filter((value) => value !== NavigationCallbackOptions.DEFAULT);
76
+
77
+ const isNavAction = (v: unknown): v is NavigationCallbackOptions =>
78
+ typeof v === "string" && NAV_ACTIONS.includes(v);
79
+
80
+ export const getNavigationKeys = (
81
+ item?: ZappUIComponent | ZappRiver,
82
+ resultType: ResultType | null = null
83
+ ): NavKeys => {
84
+ const general = (item?.general ?? {}) as General;
85
+
86
+ const pluginIdentifier = (item as any).identifier ?? item?.type ?? "";
87
+
88
+ const legacy =
89
+ legacyMappingKeys[`${pluginIdentifier}.${resultType}`] ??
90
+ legacyMappingKeys[pluginIdentifier] ??
91
+ {};
92
+
93
+ const actionKey = resultType
94
+ ? `${resultType}_${CALLBACK_NAVIGATION_KEY}`
95
+ : CALLBACK_NAVIGATION_KEY;
96
+
97
+ const rawAction =
98
+ (general as General)[actionKey] ??
99
+ (legacy.actionType ? (general as General)[legacy.actionType] : undefined);
100
+
101
+ const action: NavigationCallbackOptions | null = isNavAction(rawAction)
102
+ ? rawAction
103
+ : null;
104
+
105
+ if (!action) return null;
106
+
107
+ let targetScreenId: string | null = null;
108
+
109
+ if (action === NavigationCallbackOptions.GO_TO_SCREEN) {
110
+ const screenKey = resultType
111
+ ? `${resultType}_${CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY}`
112
+ : CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY;
113
+
114
+ const screenId: string | null =
115
+ ((general as General)[screenKey] as string) ??
116
+ (legacy.targetScreen
117
+ ? ((general as General)[legacy.targetScreen] as string)
118
+ : undefined);
119
+
120
+ if (screenId) {
121
+ targetScreenId = screenId.length > 0 ? screenId : null;
122
+ }
123
+ }
124
+
125
+ return { action, targetScreenId };
126
+ };
127
+
128
+ export const useCallbackNavigationAction = (
129
+ item?: ZappUIComponent | ZappRiver
130
+ ): ((
131
+ args: CallbackResult,
132
+ hookCallback?: hookCallback
133
+ ) => void | undefined) => {
134
+ const navigation = useNavigation();
135
+ const rivers = useRivers();
136
+ const screenContext = useScreenContext();
137
+
138
+ const overrideCallbackFromComponent = useMemo(() => {
139
+ log_verbose(`${LogPrefix}: overridden callbackAction by component`);
140
+
141
+ // TODO: Check if we have better option where to store overridden callback action
142
+ return screenContext?.options?.callback;
143
+ }, [screenContext?.options?.callback]);
144
+
145
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
146
+ log_verbose(`${LogPrefix} screenContext`, { screenContext, item });
147
+ }
148
+
149
+ const callbackAction = useCallback<hookCallback>(
150
+ (args: CallbackResult, hookCallback: hookCallback = null) => {
151
+ if (!args.success) {
152
+ log_debug(
153
+ `${LogPrefix} callback called with no success, use original callback`
154
+ );
155
+
156
+ hookCallback?.(args);
157
+
158
+ return;
159
+ }
160
+
161
+ if (args.cancelled) {
162
+ log_debug(
163
+ `${LogPrefix} callback called but cancelled, use original callback`
164
+ );
165
+
166
+ hookCallback?.(args);
167
+
168
+ return;
169
+ }
170
+
171
+ const data = getNavigationKeys(item, args.options?.resultType ?? null);
172
+
173
+ if (!data) {
174
+ hookCallback?.(args);
175
+
176
+ return;
177
+ }
178
+
179
+ hookCallback?.({ ...args, success: false, cancelled: true });
180
+
181
+ switch (data.action) {
182
+ case NavigationCallbackOptions.GO_BACK: {
183
+ if (navigation.canGoBack()) {
184
+ navigation.goBack();
185
+ log_info(`${LogPrefix} performing 'GO BACK' action`);
186
+ } else {
187
+ log_info(`${LogPrefix} cannot perform 'GO BACK' action — ignoring`);
188
+ }
189
+
190
+ break;
191
+ }
192
+
193
+ case NavigationCallbackOptions.GO_HOME: {
194
+ navigation.goHome();
195
+ log_info(`${LogPrefix} performing 'GO HOME' action`);
196
+ break;
197
+ }
198
+
199
+ case NavigationCallbackOptions.GO_TO_SCREEN: {
200
+ const screenId = data.targetScreenId;
201
+
202
+ if (!screenId) {
203
+ log_info(`${LogPrefix} no screenId provided — ignoring`);
204
+ break;
205
+ }
206
+
207
+ const screen = rivers[screenId];
208
+
209
+ if (screen) {
210
+ navigation.replace(screen);
211
+
212
+ log_info(
213
+ `${LogPrefix} performing 'GO TO SCREEN' action to screen: ${screenId}`
214
+ );
215
+ } else {
216
+ log_info(`${LogPrefix} no screen provided — ignoring`);
217
+ }
218
+
219
+ break;
220
+ }
221
+
222
+ default: {
223
+ break;
224
+ }
225
+ }
226
+ },
227
+ [item, navigation, rivers]
228
+ );
229
+
230
+ return overrideCallbackFromComponent || callbackAction;
231
+ };
@@ -0,0 +1,76 @@
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 ResultType = {
9
+ login: "login",
10
+ logout: "logout",
11
+ };
12
+
13
+ const CALLBACK_NAVIGATION_KEY = "completion_action";
14
+
15
+ const CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY =
16
+ "completion_action_navigation_go_to_screen";
17
+
18
+ const callbackKeyPrefix = (key, prefix, keySeparator = "_") =>
19
+ prefix ? `${prefix}${keySeparator}${key}` : key;
20
+
21
+ const extendManifestWithHookCallback = (prefix = null) => ({
22
+ group: true,
23
+ label: "CallBack Navigation",
24
+ folded: true,
25
+ fields: [
26
+ {
27
+ type: "select",
28
+ key: callbackKeyPrefix(CALLBACK_NAVIGATION_KEY, prefix),
29
+ label: callbackKeyPrefix(
30
+ "Callback Navigation",
31
+ prefix?.toUpperCase(),
32
+ " "
33
+ ),
34
+ label_tooltip:
35
+ "Defines what navigation action should be performed after the callback is called.",
36
+ options: [
37
+ {
38
+ text: "Use default flow",
39
+ value: NavigationCallbackOptions.DEFAULT,
40
+ },
41
+ {
42
+ text: "Go Back to home screen",
43
+ value: NavigationCallbackOptions.GO_HOME,
44
+ },
45
+ {
46
+ text: "Go Back to previous screen",
47
+ value: NavigationCallbackOptions.GO_BACK,
48
+ },
49
+ {
50
+ text: "Move to specific screen",
51
+ value: NavigationCallbackOptions.GO_TO_SCREEN,
52
+ },
53
+ ],
54
+ initial_value: "default",
55
+ },
56
+ {
57
+ type: "screen_selector",
58
+ key: callbackKeyPrefix(CALLBACK_NAVIGATION_GO_TO_SCREEN_KEY, prefix),
59
+ label: callbackKeyPrefix(
60
+ "Navigate to screen",
61
+ prefix?.toUpperCase(),
62
+ " "
63
+ ),
64
+ label_tooltip: "Screen you wish to navigate to after success purchase",
65
+ rules: "conditional",
66
+ conditional_fields: [
67
+ {
68
+ key: `general/${callbackKeyPrefix(CALLBACK_NAVIGATION_KEY, prefix)}`,
69
+ condition_value: NavigationCallbackOptions.GO_TO_SCREEN,
70
+ },
71
+ ],
72
+ },
73
+ ],
74
+ });
75
+
76
+ module.exports = { extendManifestWithHookCallback, ResultType };
@@ -0,0 +1,19 @@
1
+ import { useCallback } from "react";
2
+ import {
3
+ CallbackResult,
4
+ useCallbackNavigationAction,
5
+ } from "./callbackNavigationAction";
6
+
7
+ export const useCallbackActions = (
8
+ item?: ZappUIComponent | ZappRiver,
9
+ hookCallback?: hookCallback
10
+ ): hookCallback => {
11
+ const navigationAction = useCallbackNavigationAction(item);
12
+
13
+ return useCallback(
14
+ async (data: CallbackResult) => {
15
+ navigationAction(data, hookCallback);
16
+ },
17
+ [navigationAction, hookCallback]
18
+ );
19
+ };
@@ -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;