@applicaster/zapp-react-native-utils 16.0.0-alpha.1836140445 → 16.0.0-alpha.2628821467

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
- export type ActionExecutorContextType = {
47
+ type ActionExecutorContextType = {
48
48
  registerAction: (
49
49
  type: string,
50
50
  handler: (
@@ -66,7 +66,6 @@ export type ActionExecutorContextType = {
66
66
  context?: Record<string, any>
67
67
  ) => Promise<ActionResult>;
68
68
  };
69
-
70
69
  type Props = {
71
70
  children: React.ReactNode;
72
71
  };
@@ -130,7 +129,7 @@ const prepareDefaultActions = (actionExecutor) => {
130
129
  getInflatedDataSourceUrl({
131
130
  source,
132
131
  contexts: {
133
- entry: context?.screenEntry,
132
+ entry: context?.entryContext,
134
133
  screen: context?.screenData,
135
134
  search: getSearchContext(null, mapping),
136
135
  },
@@ -199,7 +198,7 @@ const prepareDefaultActions = (actionExecutor) => {
199
198
 
200
199
  const entry = context?.entry || {};
201
200
  const entryResolver = new EntryResolver(entry);
202
- const screenData = context?.screenStateStore?.getState().data || {};
201
+ const screenData = context?.screenStateStore.getState().data || {};
203
202
  const screenResolver = new EntryResolver(screenData || {});
204
203
 
205
204
  const data =
@@ -308,41 +308,6 @@ 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
- },
346
311
  ],
347
312
  },
348
313
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "16.0.0-alpha.1836140445",
3
+ "version": "16.0.0-alpha.2628821467",
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-alpha.1836140445",
30
+ "@applicaster/applicaster-types": "16.0.0-alpha.2628821467",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -49,13 +49,12 @@ 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;
53
52
 
54
53
  const cellSelectable = toBooleanWithDefaultTrue(
55
54
  component?.rules?.component_cells_selectable
56
55
  );
57
56
 
58
- const [_entryContext, setEntryContext] =
57
+ const [entryContext, setEntryContext] =
59
58
  ZappPipesEntryContext.useZappPipesContext(pathname);
60
59
 
61
60
  const logTimestamp = useProfilerLogging();
@@ -90,8 +89,7 @@ export const useCellClick = ({
90
89
  screenState,
91
90
  screenRoute: pathname,
92
91
  screenStateStore,
93
- entryContext: selectedItem,
94
- screenEntry: entry,
92
+ entryContext,
95
93
  });
96
94
  }
97
95
 
@@ -119,20 +117,14 @@ export const useCellClick = ({
119
117
  }
120
118
  },
121
119
  [
122
- item,
120
+ onCellTap,
121
+ currentRoute,
123
122
  setEntryContext,
124
- sendAnalyticsOnPress,
125
- logTimestamp,
126
123
  pathname,
127
- component,
128
- onCellTap,
129
- entry,
130
- actionExecutor,
124
+ push,
125
+ sendAnalyticsOnPress,
131
126
  screenData,
132
127
  screenState,
133
- screenStateStore,
134
- currentRoute,
135
- push,
136
128
  ]
137
129
  );
138
130
 
@@ -146,5 +138,5 @@ export const useCellClick = ({
146
138
  onPressRef.current = onPress;
147
139
  }
148
140
 
149
- return React.useCallback(onPressRef.current, [item]);
141
+ return React.useCallback(onPressRef.current, []);
150
142
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { NativeModules, StyleSheet, View } from "react-native";
2
+ import { NativeModules, View } from "react-native";
3
3
  import { getXray } from "@applicaster/zapp-react-native-utils/logger";
4
4
 
5
5
  import { isApplePlatform, isWeb } from "../reactUtils";
@@ -30,12 +30,6 @@ type MeasurementContext = {
30
30
  onLayout: (index: number) => (event) => void;
31
31
  };
32
32
 
33
- const styles = StyleSheet.create({
34
- container: {
35
- flex: 1,
36
- },
37
- });
38
-
39
33
  const { Logger } = getXray();
40
34
 
41
35
  const logger = new Logger("general", "ui");
@@ -139,9 +133,7 @@ export const ScreenLoadingMeasurements = ({
139
133
 
140
134
  return (
141
135
  <MeasurementsSettersContext.Provider value={contextValue}>
142
- <View style={styles.container} onLayout={onListLayout}>
143
- {children}
144
- </View>
136
+ <View onLayout={onListLayout}>{children}</View>
145
137
  </MeasurementsSettersContext.Provider>
146
138
  );
147
139
  };
@@ -152,9 +144,5 @@ export const ScreenLoadingMeasurementsListItemWrapper = ({
152
144
  }: ItemProps) => {
153
145
  const { onLayout } = React.useContext(MeasurementsSettersContext);
154
146
 
155
- return (
156
- <View style={styles.container} onLayout={onLayout?.(index)}>
157
- {children}
158
- </View>
159
- );
147
+ return <View onLayout={onLayout?.(index)}>{children}</View>;
160
148
  };