@applicaster/zapp-react-native-utils 13.0.0-rc.102 → 13.0.0-rc.103
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.
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
useContentTypes,
|
|
27
27
|
usePickFromState,
|
|
28
28
|
} from "@applicaster/zapp-react-native-redux/hooks";
|
|
29
|
+
import { TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT } from "./consts";
|
|
30
|
+
import { postEvent } from "../reactHooks/useSubscriberFor";
|
|
29
31
|
|
|
30
32
|
export const { log_error, log_info, log_debug } = createLogger({
|
|
31
33
|
subsystem: "ActionExecutorContext",
|
|
@@ -74,6 +76,19 @@ function findParentComponent(
|
|
|
74
76
|
return null;
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
// send all data just in case (like for message string formatting)
|
|
80
|
+
// Type is not exported for now
|
|
81
|
+
type MaxTagsReachedEvent = {
|
|
82
|
+
selectedItems: string[];
|
|
83
|
+
maxItems: number;
|
|
84
|
+
tag: string;
|
|
85
|
+
keyNamespace: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
async function onMaxTagsReached(data: MaxTagsReachedEvent) {
|
|
89
|
+
postEvent(TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT, [data]);
|
|
90
|
+
}
|
|
91
|
+
|
|
77
92
|
const prepareDefaultActions = (actionExecutor) => {
|
|
78
93
|
actionExecutor.registerAction("localStorageSet", async (action) => {
|
|
79
94
|
const namespaces = action.options.content;
|
|
@@ -241,6 +256,13 @@ const prepareDefaultActions = (actionExecutor) => {
|
|
|
241
256
|
`handleAction: localStorageToggleFlag event reached max items limit: ${maxItems}, cannot add tag: ${tag}`
|
|
242
257
|
);
|
|
243
258
|
|
|
259
|
+
await onMaxTagsReached({
|
|
260
|
+
selectedItems,
|
|
261
|
+
maxItems,
|
|
262
|
+
tag,
|
|
263
|
+
keyNamespace,
|
|
264
|
+
});
|
|
265
|
+
|
|
244
266
|
return ActionResult.Cancel;
|
|
245
267
|
}
|
|
246
268
|
|
|
@@ -251,6 +251,19 @@ const generalContent = () => ({
|
|
|
251
251
|
key: "screen_title",
|
|
252
252
|
initial_value: null,
|
|
253
253
|
},
|
|
254
|
+
{
|
|
255
|
+
type: "text_input",
|
|
256
|
+
label: "Maximum Selection Reached - Alert Description",
|
|
257
|
+
key: "msg_maximum_selection_reached_message",
|
|
258
|
+
initial_value:
|
|
259
|
+
"You’ve reached the maximum number of items you can select.",
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: "text_input",
|
|
263
|
+
label: "Maximum Selection Reached - Alert Button",
|
|
264
|
+
key: "msg_maximum_selection_reached_message_ok_button",
|
|
265
|
+
initial_value: "Got it",
|
|
266
|
+
},
|
|
254
267
|
],
|
|
255
268
|
},
|
|
256
269
|
advertising: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.103",
|
|
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.
|
|
30
|
+
"@applicaster/applicaster-types": "13.0.0-rc.103",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|