react-native-navigation 7.40.2 → 7.40.3-snapshot.1472

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.
@@ -2,6 +2,7 @@ import {
2
2
  ComponentDidDisappearEvent,
3
3
  ComponentWillAppearEvent,
4
4
  ModalDismissedEvent,
5
+ ScreenPoppedEvent,
5
6
  } from '../../src/interfaces/ComponentEvents';
6
7
  import { ComponentDidAppearEvent, NavigationButtonPressedEvent } from '../../src/index';
7
8
  import { BottomTabPressedEvent, CommandCompletedEvent } from '../../src/interfaces/Events';
@@ -14,6 +15,8 @@ export const events = {
14
15
  modalDismissed: [(_event: ModalDismissedEvent) => {}],
15
16
  bottomTabPressed: [(_event: BottomTabPressedEvent) => {}],
16
17
  commandCompleted: [(_event: CommandCompletedEvent) => {}],
18
+ screenPopped: [(_event: ScreenPoppedEvent) => {}],
19
+
17
20
  invokeComponentWillAppear: (event: ComponentWillAppearEvent) => {
18
21
  events.componentWillAppear &&
19
22
  events.componentWillAppear.forEach((listener) => {
@@ -56,4 +59,10 @@ export const events = {
56
59
  listener(event);
57
60
  });
58
61
  },
62
+ invokeScreenPopped: (event: ScreenPoppedEvent) => {
63
+ events.screenPopped &&
64
+ events.screenPopped.forEach((listener) => {
65
+ listener(event);
66
+ });
67
+ },
59
68
  };
@@ -55,6 +55,9 @@ export class NativeCommandsSender {
55
55
  LayoutStore.getLayoutById(componentId).getStack().children
56
56
  ) as ComponentNode;
57
57
  LayoutStore.pop(componentId);
58
+ events.invokeScreenPopped({
59
+ componentId,
60
+ });
58
61
  resolve(poppedChild.nodeId);
59
62
  this.reportCommandCompletion(CommandName.Pop, commandId);
60
63
  });
@@ -152,8 +152,9 @@ export class NativeEventsReceiver {
152
152
  }
153
153
 
154
154
  public registerScreenPoppedListener(
155
- _callback: (event: ScreenPoppedEvent) => void
155
+ callback: (event: ScreenPoppedEvent) => void
156
156
  ): EmitterSubscription {
157
+ events.screenPopped.push(callback);
157
158
  return {
158
159
  remove: () => {},
159
160
  } as EmitterSubscription;
@@ -1,4 +1,4 @@
1
- import { ComponentDidDisappearEvent, ComponentWillAppearEvent, ModalDismissedEvent } from '../../src/interfaces/ComponentEvents';
1
+ import { ComponentDidDisappearEvent, ComponentWillAppearEvent, ModalDismissedEvent, ScreenPoppedEvent } from '../../src/interfaces/ComponentEvents';
2
2
  import { ComponentDidAppearEvent, NavigationButtonPressedEvent } from '../../src/index';
3
3
  import { BottomTabPressedEvent, CommandCompletedEvent } from '../../src/interfaces/Events';
4
4
  export declare const events: {
@@ -9,6 +9,7 @@ export declare const events: {
9
9
  modalDismissed: ((_event: ModalDismissedEvent) => void)[];
10
10
  bottomTabPressed: ((_event: BottomTabPressedEvent) => void)[];
11
11
  commandCompleted: ((_event: CommandCompletedEvent) => void)[];
12
+ screenPopped: ((_event: ScreenPoppedEvent) => void)[];
12
13
  invokeComponentWillAppear: (event: ComponentWillAppearEvent) => void;
13
14
  invokeComponentDidAppear: (event: ComponentDidAppearEvent) => void;
14
15
  invokeComponentDidDisappear: (event: ComponentDidDisappearEvent) => void;
@@ -16,4 +17,5 @@ export declare const events: {
16
17
  invokeNavigationButtonPressed: (event: NavigationButtonPressedEvent) => void;
17
18
  invokeBottomTabPressed: (event: BottomTabPressedEvent) => void;
18
19
  invokeCommandCompleted: (event: CommandCompletedEvent) => void;
20
+ invokeScreenPopped: (event: ScreenPoppedEvent) => void;
19
21
  };
@@ -9,6 +9,7 @@ exports.events = {
9
9
  modalDismissed: [(_event) => { }],
10
10
  bottomTabPressed: [(_event) => { }],
11
11
  commandCompleted: [(_event) => { }],
12
+ screenPopped: [(_event) => { }],
12
13
  invokeComponentWillAppear: (event) => {
13
14
  exports.events.componentWillAppear &&
14
15
  exports.events.componentWillAppear.forEach((listener) => {
@@ -51,4 +52,10 @@ exports.events = {
51
52
  listener(event);
52
53
  });
53
54
  },
55
+ invokeScreenPopped: (event) => {
56
+ exports.events.screenPopped &&
57
+ exports.events.screenPopped.forEach((listener) => {
58
+ listener(event);
59
+ });
60
+ },
54
61
  };
@@ -47,6 +47,9 @@ class NativeCommandsSender {
47
47
  }
48
48
  const poppedChild = lodash_1.default.last(LayoutStore_1.LayoutStore.getLayoutById(componentId).getStack().children);
49
49
  LayoutStore_1.LayoutStore.pop(componentId);
50
+ EventsStore_1.events.invokeScreenPopped({
51
+ componentId,
52
+ });
50
53
  resolve(poppedChild.nodeId);
51
54
  this.reportCommandCompletion(CommandName_1.CommandName.Pop, commandId);
52
55
  });
@@ -16,5 +16,5 @@ export declare class NativeEventsReceiver {
16
16
  registerCommandCompletedListener(callback: (data: CommandCompletedEvent) => void): EmitterSubscription;
17
17
  registerBottomTabSelectedListener(_callback: (data: BottomTabSelectedEvent) => void): EmitterSubscription;
18
18
  registerBottomTabLongPressedListener(_callback: (data: BottomTabLongPressedEvent) => void): EmitterSubscription;
19
- registerScreenPoppedListener(_callback: (event: ScreenPoppedEvent) => void): EmitterSubscription;
19
+ registerScreenPoppedListener(callback: (event: ScreenPoppedEvent) => void): EmitterSubscription;
20
20
  }
@@ -95,7 +95,8 @@ class NativeEventsReceiver {
95
95
  remove: () => { },
96
96
  };
97
97
  }
98
- registerScreenPoppedListener(_callback) {
98
+ registerScreenPoppedListener(callback) {
99
+ EventsStore_1.events.screenPopped.push(callback);
99
100
  return {
100
101
  remove: () => { },
101
102
  };
@@ -13,6 +13,8 @@
13
13
  NSUInteger _previousTabIndex;
14
14
  BottomTabsBaseAttacher *_bottomTabsAttacher;
15
15
  BOOL _tabBarNeedsRestore;
16
+ RNNNavigationOptions *_options;
17
+ BOOL _didFinishSetup;
16
18
  }
17
19
 
18
20
  - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
@@ -28,14 +30,24 @@
28
30
  _bottomTabsAttacher = bottomTabsAttacher;
29
31
  _bottomTabPresenter = bottomTabPresenter;
30
32
  _dotIndicatorPresenter = dotIndicatorPresenter;
33
+ _options = options;
34
+ _didFinishSetup = NO;
35
+
36
+ IntNumber *currentTabIndex = options.bottomTabs.currentTabIndex;
37
+ if ([currentTabIndex hasValue]) {
38
+ NSUInteger currentTabIndexValue = [currentTabIndex get];
39
+ _previousTabIndex = currentTabIndexValue;
40
+ _currentTabIndex = currentTabIndexValue;
41
+ }
31
42
 
32
43
  self = [super initWithLayoutInfo:layoutInfo
33
- creator:creator
34
- options:options
35
- defaultOptions:defaultOptions
36
- presenter:presenter
37
- eventEmitter:eventEmitter
38
- childViewControllers:childViewControllers];
44
+ creator:creator
45
+ options:options
46
+ defaultOptions:defaultOptions
47
+ presenter:presenter
48
+ eventEmitter:eventEmitter
49
+ childViewControllers:childViewControllers];
50
+
39
51
  if (@available(iOS 13.0, *)) {
40
52
  self.tabBar.standardAppearance = [UITabBarAppearance new];
41
53
  }
@@ -52,6 +64,7 @@
52
64
  action:@selector(handleLongPressGesture:)];
53
65
  [self.tabBar addGestureRecognizer:self.longPressRecognizer];
54
66
 
67
+ _didFinishSetup = YES;
55
68
  return self;
56
69
  }
57
70
 
@@ -124,8 +137,15 @@
124
137
  }
125
138
 
126
139
  - (void)setSelectedIndex:(NSUInteger)selectedIndex {
127
- _currentTabIndex = selectedIndex;
128
- [super setSelectedIndex:selectedIndex];
140
+ IntNumber *currentTabIndex = _options.bottomTabs.currentTabIndex;
141
+ if ([currentTabIndex hasValue] && !_didFinishSetup) {
142
+ NSUInteger currentTabIndexValue = [currentTabIndex get];
143
+ _currentTabIndex = currentTabIndexValue;
144
+ } else {
145
+ _currentTabIndex = selectedIndex;
146
+ }
147
+
148
+ [super setSelectedIndex:_currentTabIndex];
129
149
  }
130
150
 
131
151
  - (UIViewController *)selectedViewController {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.40.2",
3
+ "version": "7.40.3-snapshot.1472",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,
@@ -77,7 +77,7 @@
77
77
  "@react-native/metro-config": "^0.73.2",
78
78
  "@react-native/babel-preset": "^0.73.18",
79
79
  "@react-native/typescript-config": "^0.73.1",
80
- "@react-native-community/blur": "^3.6.0",
80
+ "@react-native-community/blur": "^4.4.1",
81
81
  "@react-native-community/datetimepicker": "^3.4.7",
82
82
  "@react-native-community/eslint-config": "2.0.0",
83
83
  "@react-native-community/netinfo": "^5.9.4",
@@ -111,8 +111,8 @@
111
111
  "react": "18.2.0",
112
112
  "react-native": "0.73.3",
113
113
  "react-native-fast-image": "^8.6.3",
114
- "react-native-gesture-handler": "^2.10.1",
115
- "react-native-reanimated": "^3.8.1",
114
+ "react-native-gesture-handler": "2.14.1",
115
+ "react-native-reanimated": "3.16.1",
116
116
  "react-native-ui-lib": "7.3.6",
117
117
  "react-redux": "5.x.x",
118
118
  "react-test-renderer": "18.2.0",