@applicaster/zapp-react-native-utils 13.0.0-rc.90 → 13.0.0-rc.92

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.
@@ -234,6 +234,16 @@ const prepareDefaultActions = (actionExecutor) => {
234
234
  if (selectedItems.includes(tag)) {
235
235
  await multiSelectProvider.removeItem(tag);
236
236
  } else {
237
+ const maxItems = action.options?.max_items;
238
+
239
+ if (maxItems && selectedItems.length >= maxItems) {
240
+ log_info(
241
+ `handleAction: localStorageToggleFlag event reached max items limit: ${maxItems}, cannot add tag: ${tag}`
242
+ );
243
+
244
+ return ActionResult.Cancel;
245
+ }
246
+
237
247
  await multiSelectProvider.addItem(tag);
238
248
  }
239
249
  } else {
@@ -258,3 +258,28 @@ export const extractDataFromProperty = (property, data): any =>
258
258
  );
259
259
 
260
260
  export const then = (fn) => (promise) => promise.then(fn);
261
+
262
+ /**
263
+ * Returns a replacer function for JSON.stringify that handles circular references,
264
+ * functions, and React context objects
265
+ * @returns {Function} A replacer function that detects and handles circular references,
266
+ * functions, and React context objects
267
+ */
268
+ export const getJsonReplacer = () => {
269
+ return (_key, value) => {
270
+ if (typeof value === "function") {
271
+ return "[Function]";
272
+ }
273
+
274
+ if (
275
+ typeof value === "object" &&
276
+ value !== null &&
277
+ value.Provider &&
278
+ value.Consumer
279
+ ) {
280
+ return "[ReactContext]";
281
+ }
282
+
283
+ return value;
284
+ };
285
+ };
package/index.d.ts CHANGED
@@ -105,18 +105,6 @@ declare type NavBarState = {
105
105
  title: string;
106
106
  };
107
107
 
108
- declare type StorageValuesToAdd = Record<string, NamespaceValues>;
109
-
110
- declare type StorageValuesToRemove = {
111
- string?: string[];
112
- };
113
-
114
- declare type StorageOwnedValues = {
115
- string?: string[];
116
- };
117
-
118
- declare type NamespaceValues = Record<string, string>;
119
-
120
108
  declare type RefreshProps = {
121
109
  forceRefresh?: boolean;
122
110
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "13.0.0-rc.90",
3
+ "version": "13.0.0-rc.92",
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": "13.0.0-rc.90",
30
+ "@applicaster/applicaster-types": "13.0.0-rc.92",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",