@applicaster/zapp-react-native-utils 15.0.0-rc.128 → 15.0.0-rc.129

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.
@@ -24,6 +24,10 @@ import {
24
24
  resolveObjectValues,
25
25
  } from "../appUtils/contextKeysManager/contextResolver";
26
26
  import { useNavigation, useRivers } from "../reactHooks";
27
+ import {
28
+ getInflatedDataSourceUrl,
29
+ getSearchContext,
30
+ } from "../reactHooks/feed/useInflatedUrl";
27
31
 
28
32
  import { useContentTypes } from "@applicaster/zapp-react-native-redux/hooks";
29
33
  import { useSubscriberFor } from "../reactHooks/useSubscriberFor";
@@ -104,12 +108,42 @@ const prepareDefaultActions = (actionExecutor) => {
104
108
  async (_action, context) => {
105
109
  const dispatch = appStore.getDispatch();
106
110
 
107
- const dataSource =
108
- context?.component?.data?.source ||
109
- findParentComponent(context?.component.id, context?.screenData)?.data
110
- ?.source;
111
+ const parentComponent = findParentComponent(
112
+ context?.component?.id,
113
+ context?.screenData
114
+ );
115
+
116
+ const componentSource = context?.component?.data?.source;
117
+
118
+ const componentData = componentSource
119
+ ? context.component.data
120
+ : parentComponent?.data;
121
+
122
+ const source = componentData?.source;
123
+ const mapping = componentData?.mapping;
111
124
 
112
- log_info(`handleAction: refreshComponent for dataSource:${dataSource}`);
125
+ let dataSource = source;
126
+
127
+ if (source && mapping) {
128
+ dataSource =
129
+ getInflatedDataSourceUrl({
130
+ source,
131
+ contexts: {
132
+ entry: context?.entryContext,
133
+ screen: context?.screenData,
134
+ search: getSearchContext(null, mapping),
135
+ },
136
+ mapping,
137
+ }) || source;
138
+ }
139
+
140
+ log_info(`handleAction: refreshComponent for dataSource:${dataSource}`, {
141
+ source,
142
+ inflatedUrl: dataSource,
143
+ mapping,
144
+ entryContextId: context?.entryContext?.id,
145
+ entryId: context?.entry?.id,
146
+ });
113
147
 
114
148
  // TODO: In theory we should wait callback to complete, before completing the action, but now it's not needed
115
149
  // TODO: handle focused item removal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-rc.128",
3
+ "version": "15.0.0-rc.129",
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": "15.0.0-rc.128",
30
+ "@applicaster/applicaster-types": "15.0.0-rc.129",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -54,7 +54,7 @@ export const useCellClick = ({
54
54
  component?.rules?.component_cells_selectable
55
55
  );
56
56
 
57
- const [__, setEntryContext] =
57
+ const [entryContext, setEntryContext] =
58
58
  ZappPipesEntryContext.useZappPipesContext(pathname);
59
59
 
60
60
  const logTimestamp = useProfilerLogging();
@@ -89,6 +89,7 @@ export const useCellClick = ({
89
89
  screenState,
90
90
  screenRoute: pathname,
91
91
  screenStateStore,
92
+ entryContext,
92
93
  });
93
94
  }
94
95