@applicaster/zapp-react-native-utils 16.0.0-rc.16 → 16.0.0-rc.18
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.
|
@@ -44,7 +44,7 @@ export const { log_error, log_info, log_debug } = createLogger({
|
|
|
44
44
|
category: "General",
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
type ActionExecutorContextType = {
|
|
47
|
+
export type ActionExecutorContextType = {
|
|
48
48
|
registerAction: (
|
|
49
49
|
type: string,
|
|
50
50
|
handler: (
|
|
@@ -66,6 +66,7 @@ type ActionExecutorContextType = {
|
|
|
66
66
|
context?: Record<string, any>
|
|
67
67
|
) => Promise<ActionResult>;
|
|
68
68
|
};
|
|
69
|
+
|
|
69
70
|
type Props = {
|
|
70
71
|
children: React.ReactNode;
|
|
71
72
|
};
|
|
@@ -129,7 +130,7 @@ const prepareDefaultActions = (actionExecutor) => {
|
|
|
129
130
|
getInflatedDataSourceUrl({
|
|
130
131
|
source,
|
|
131
132
|
contexts: {
|
|
132
|
-
entry: context?.
|
|
133
|
+
entry: context?.screenEntry,
|
|
133
134
|
screen: context?.screenData,
|
|
134
135
|
search: getSearchContext(null, mapping),
|
|
135
136
|
},
|
|
@@ -198,7 +199,7 @@ const prepareDefaultActions = (actionExecutor) => {
|
|
|
198
199
|
|
|
199
200
|
const entry = context?.entry || {};
|
|
200
201
|
const entryResolver = new EntryResolver(entry);
|
|
201
|
-
const screenData = context?.screenStateStore
|
|
202
|
+
const screenData = context?.screenStateStore?.getState().data || {};
|
|
202
203
|
const screenResolver = new EntryResolver(screenData || {});
|
|
203
204
|
|
|
204
205
|
const data =
|
|
@@ -308,6 +308,41 @@ const generalContent = () => ({
|
|
|
308
308
|
key: "pull_to_refresh_enabled",
|
|
309
309
|
initial_value: false,
|
|
310
310
|
},
|
|
311
|
+
{
|
|
312
|
+
type: "switch",
|
|
313
|
+
label: "Allow using this screen as a hook",
|
|
314
|
+
label_tooltip:
|
|
315
|
+
"Make sure that screen uses 'finishHook' action or performs navigation action to exit the screen after performing the hook action, or user will be stuck on the screen", // eslint-disable-line max-len
|
|
316
|
+
key: "available_as_hook",
|
|
317
|
+
initial_value: false,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
type: "data_source_selector",
|
|
321
|
+
label: "Skip hook endpoint",
|
|
322
|
+
key: "skip_hook_endpoint",
|
|
323
|
+
label_tooltip:
|
|
324
|
+
"If set, this endpoint will check with the server whether the hook should be skipped",
|
|
325
|
+
conditional_fields: [
|
|
326
|
+
{
|
|
327
|
+
key: "rules/available_as_hook",
|
|
328
|
+
condition_value: true,
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
key: "skip_hook_storage_key",
|
|
334
|
+
type: "text_input",
|
|
335
|
+
label: "Hook will be skipped if storage key is set",
|
|
336
|
+
initial_value: "",
|
|
337
|
+
label_tooltip:
|
|
338
|
+
"Comma-separated keys in namespace.key format (key without a dot uses the default namespace)", // eslint-disable-line max-len
|
|
339
|
+
conditional_fields: [
|
|
340
|
+
{
|
|
341
|
+
key: "rules/available_as_hook",
|
|
342
|
+
condition_value: true,
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
},
|
|
311
346
|
],
|
|
312
347
|
},
|
|
313
348
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "16.0.0-rc.
|
|
3
|
+
"version": "16.0.0-rc.18",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@applicaster/applicaster-types": "16.0.0-rc.
|
|
30
|
+
"@applicaster/applicaster-types": "16.0.0-rc.18",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|
|
@@ -49,12 +49,13 @@ export const useCellClick = ({
|
|
|
49
49
|
const actionExecutor = React.useContext(ActionExecutorContext);
|
|
50
50
|
const screenData = useCurrentScreenData();
|
|
51
51
|
const screenState = useScreenContext()?.options;
|
|
52
|
+
const entry = useScreenContext()?.entry;
|
|
52
53
|
|
|
53
54
|
const cellSelectable = toBooleanWithDefaultTrue(
|
|
54
55
|
component?.rules?.component_cells_selectable
|
|
55
56
|
);
|
|
56
57
|
|
|
57
|
-
const [
|
|
58
|
+
const [_entryContext, setEntryContext] =
|
|
58
59
|
ZappPipesEntryContext.useZappPipesContext(pathname);
|
|
59
60
|
|
|
60
61
|
const logTimestamp = useProfilerLogging();
|
|
@@ -89,7 +90,8 @@ export const useCellClick = ({
|
|
|
89
90
|
screenState,
|
|
90
91
|
screenRoute: pathname,
|
|
91
92
|
screenStateStore,
|
|
92
|
-
entryContext,
|
|
93
|
+
entryContext: selectedItem,
|
|
94
|
+
screenEntry: entry,
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -117,14 +119,20 @@ export const useCellClick = ({
|
|
|
117
119
|
}
|
|
118
120
|
},
|
|
119
121
|
[
|
|
120
|
-
|
|
121
|
-
currentRoute,
|
|
122
|
+
item,
|
|
122
123
|
setEntryContext,
|
|
123
|
-
pathname,
|
|
124
|
-
push,
|
|
125
124
|
sendAnalyticsOnPress,
|
|
125
|
+
logTimestamp,
|
|
126
|
+
pathname,
|
|
127
|
+
component,
|
|
128
|
+
onCellTap,
|
|
129
|
+
entry,
|
|
130
|
+
actionExecutor,
|
|
126
131
|
screenData,
|
|
127
132
|
screenState,
|
|
133
|
+
screenStateStore,
|
|
134
|
+
currentRoute,
|
|
135
|
+
push,
|
|
128
136
|
]
|
|
129
137
|
);
|
|
130
138
|
|
|
@@ -138,5 +146,5 @@ export const useCellClick = ({
|
|
|
138
146
|
onPressRef.current = onPress;
|
|
139
147
|
}
|
|
140
148
|
|
|
141
|
-
return React.useCallback(onPressRef.current, []);
|
|
149
|
+
return React.useCallback(onPressRef.current, [item]);
|
|
142
150
|
};
|