@applicaster/zapp-react-native-utils 16.0.0-rc.17 → 16.0.0-rc.19
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 =
|
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.19",
|
|
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.19",
|
|
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
|
};
|