@applicaster/zapp-react-native-utils 15.0.0-alpha.3564837831 → 15.0.0-alpha.4043532513

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.
@@ -63,10 +63,14 @@ class StateHolder {
63
63
  return value as string;
64
64
  }
65
65
 
66
+ public get analyticsCustomPropertiesConsumed(): boolean {
67
+ return this._cap !== undefined;
68
+ }
69
+
66
70
  private acp(prefix: string, suffix: string): string | null {
67
71
  if (this._cap === undefined) {
68
- this._cap = this.pluckedParams[prefix]
69
- ? JSON.parse(this.pluckedParams[prefix])
72
+ this._cap = this.event.params[prefix]
73
+ ? JSON.parse(this.event.params[prefix])
70
74
  : null;
71
75
 
72
76
  delete this.pluckedParams[prefix];
@@ -254,6 +258,10 @@ export class Mapper {
254
258
 
255
259
  let params = resultParams.size ? Object.fromEntries(resultParams) : {};
256
260
 
261
+ if (state.analyticsCustomPropertiesConsumed) {
262
+ delete params[sourceType.analyticsCustomProperties];
263
+ }
264
+
257
265
  // deal with the remaining params
258
266
  if (!isEmptyOrNil(state.pluckedParams)) {
259
267
  if (rule.strategy) {
@@ -73,7 +73,7 @@ exports[`focusManagerIOS should be defined 1`] = `
73
73
  "isFocusOn": [Function],
74
74
  "isFocusOnContent": [Function],
75
75
  "isFocusOnMenu": [Function],
76
- "isFocusOnTabsScreen": [Function],
76
+ "isFocusOnTabsScreenContent": [Function],
77
77
  "isGroupItemFocused": [Function],
78
78
  "moveFocus": [Function],
79
79
  "on": [Function],
@@ -6,7 +6,7 @@ import {
6
6
  isChildOf as isChildOfUtils,
7
7
  isPartOfMenu,
8
8
  isPartOfContent,
9
- isPartOfTabsScreen,
9
+ isPartOfTabsScreenContent,
10
10
  } from "../focusManagerAux/utils/index.ios";
11
11
 
12
12
  import { Tree } from "./treeDataStructure/Tree";
@@ -17,7 +17,6 @@ import { findChild } from "./utils";
17
17
  import {
18
18
  emitRegistered,
19
19
  emitUnregistered,
20
- emitWillFocused,
21
20
  } from "../focusManagerAux/utils/utils.ios";
22
21
 
23
22
  const { FocusableManagerModule } = NativeModules;
@@ -292,8 +291,6 @@ export const focusManager = (function () {
292
291
  blur(direction);
293
292
  currentFocus = id;
294
293
 
295
- emitWillFocused(id);
296
-
297
294
  // Extract groupFocusedChanged with a default value of false
298
295
  let groupFocusedChanged = false;
299
296
 
@@ -439,12 +436,14 @@ export const focusManager = (function () {
439
436
  return isPartOfContent(focusableTree, currentFocusable?.props?.id);
440
437
  }
441
438
 
442
- function isFocusOnTabsScreen(tabsScreenContainerId: string): boolean {
439
+ function isFocusOnTabsScreenContent(
440
+ screenPickerContentContainerId: string
441
+ ): boolean {
443
442
  const currentFocusable = getCurrentFocus();
444
443
 
445
- return isPartOfTabsScreen(
444
+ return isPartOfTabsScreenContent(
446
445
  focusableTree,
447
- tabsScreenContainerId,
446
+ screenPickerContentContainerId,
448
447
  currentFocusable?.props?.id
449
448
  );
450
449
  }
@@ -477,7 +476,7 @@ export const focusManager = (function () {
477
476
  isFocusOn,
478
477
  isFocusOnMenu,
479
478
  isFocusOnContent,
480
- isFocusOnTabsScreen,
479
+ isFocusOnTabsScreenContent,
481
480
  isChildOf,
482
481
  };
483
482
  })();
@@ -9,9 +9,9 @@ const isNavBar = (node) => startsWith(QUICK_BRICK_NAVBAR, node?.id);
9
9
  const isContent = (node) => startsWith(QUICK_BRICK_CONTENT, node?.id);
10
10
  const isRoot = (node) => node?.id === "root";
11
11
 
12
- export const isPartOfTabsScreen = (
12
+ export const isPartOfTabsScreenContent = (
13
13
  focusableTree,
14
- tabsScreenContainerId,
14
+ screenPickerContentContainerId,
15
15
  id
16
16
  ) => {
17
17
  const node = focusableTree.findInTree(id);
@@ -32,13 +32,13 @@ export const isPartOfTabsScreen = (
32
32
  return false;
33
33
  }
34
34
 
35
- if (node?.id === tabsScreenContainerId) {
35
+ if (node?.id === screenPickerContentContainerId) {
36
36
  return true;
37
37
  }
38
38
 
39
- return isPartOfTabsScreen(
39
+ return isPartOfTabsScreenContent(
40
40
  focusableTree,
41
- tabsScreenContainerId,
41
+ screenPickerContentContainerId,
42
42
  node.parent?.id
43
43
  );
44
44
  };
@@ -178,34 +178,27 @@ export const emitNativeRegistered = ({
178
178
  }
179
179
  };
180
180
 
181
- // Focusable has been focused
182
- const willFocusedSubject$ = new Subject<FocusableID>();
183
- const didFocusedSubject$ = new Subject<FocusableID>();
181
+ // /////
184
182
 
185
- export const willFocused$ = willFocusedSubject$.asObservable();
183
+ const focusedSubject$ = new Subject<FocusableID>();
186
184
 
187
- export const didFocused$ = didFocusedSubject$.asObservable();
185
+ const focused$ = focusedSubject$.asObservable();
188
186
 
189
- export const emitWillFocused = (id: FocusableID): void => {
190
- willFocusedSubject$.next(id);
187
+ export const emitFocused = (id: FocusableID): void => {
188
+ focusedSubject$.next(id);
191
189
  };
192
190
 
193
- export const emitDidFocused = (id: FocusableID): void => {
194
- didFocusedSubject$.next(id);
195
- };
196
-
197
- export const topMenuItemDidFocused$ = didFocused$.pipe(
191
+ export const topMenuItemFocused$ = focused$.pipe(
198
192
  filter((id) => id && isPartOfMenu(focusManager.focusableTree, id))
199
193
  );
200
194
 
201
- export const contentDidFocused$ = didFocused$.pipe(
195
+ export const contentFocused$ = focused$.pipe(
202
196
  filter((id) => {
203
197
  const isContent = isPartOfContent(focusManager.focusableTree, id);
204
198
 
205
199
  return id && isContent;
206
200
  })
207
201
  );
208
- // Focusable has been focused
209
202
 
210
203
  const createFocusableRegistry = () => {
211
204
  const subject$ = new ReplaySubject<FocusableID | undefined>(1);
@@ -226,17 +219,13 @@ const createFocusableRegistry = () => {
226
219
  /// HOME_TOP_MENU_ITEM
227
220
  export const HomeTopMenuItemRegistry = createFocusableRegistry();
228
221
 
229
- export const homeTopMenuItemDidFocused$ = topMenuItemDidFocused$.pipe(
222
+ export const homeTopMenuItemFocused$ = topMenuItemFocused$.pipe(
230
223
  withLatestFrom(HomeTopMenuItemRegistry.observable$),
231
224
  filter(([id, homeId]) => id === homeId)
232
225
  );
233
226
 
234
- /// TABS SCREEN
235
- export const TabsScreenContentContainerRegistry = createFocusableRegistry();
236
-
237
- export const TabsScreenScreenSelectorContainerRegistry =
238
- createFocusableRegistry();
239
- /// TABS SCREEN
227
+ /// SCREEN_PICKER
228
+ export const ScreenPickerContentContainerRegistry = createFocusableRegistry();
240
229
 
241
230
  /// SEARCH_INPUT
242
231
  export const SearchInputRegistry = createFocusableRegistry();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-alpha.3564837831",
3
+ "version": "15.0.0-alpha.4043532513",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "15.0.0-alpha.3564837831",
30
+ "@applicaster/applicaster-types": "15.0.0-alpha.4043532513",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
34
+ "handlebars": "4.7.8",
34
35
  "memoizee": "0.4.15",
35
- "prop-types": "^15.0.0",
36
- "react-native-handlebars": "^5.0.0-alpha.1"
36
+ "prop-types": "^15.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@applicaster/zapp-pipes-v2-client": "*",
@@ -4,7 +4,7 @@ declare const global;
4
4
  import * as R from "ramda";
5
5
  import camelize from "camelize";
6
6
  // @ts-ignore
7
- import Handlebars from "react-native-handlebars";
7
+ import Handlebars from "handlebars";
8
8
 
9
9
  global.Buffer = global.Buffer || require("buffer").Buffer;
10
10