react-native-navigation 7.36.0-rc.2 → 7.36.0-rc.3
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.
- package/Gemfile +6 -0
- package/ReactNativeNavigation.podspec +26 -9
- package/autolink/postlink/__snapshots__/appDelegateLinker.test.js.snap +2 -19
- package/autolink/postlink/appDelegateLinker.js +22 -39
- package/autolink/postlink/path.js +1 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/Events.kt +3 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt +3 -8
- package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +2 -25
- package/lib/dist/src/adapters/NativeEventsReceiver.js +0 -2
- package/lib/ios/RNNAppDelegate.h +20 -0
- package/lib/ios/RNNAppDelegate.mm +135 -0
- package/lib/ios/RNNComponentRootView.m +3 -11
- package/lib/ios/RNNComponentViewController.m +12 -20
- package/lib/ios/RNNOverlayWindow.m +2 -1
- package/lib/ios/RNNReactButtonView.m +32 -0
- package/lib/ios/RNNReactComponentRegistry.m +1 -2
- package/lib/ios/RNNReactRootViewCreator.m +11 -0
- package/lib/ios/RNNReactView.h +11 -2
- package/lib/ios/RNNReactView.m +14 -1
- package/lib/ios/RNNSideMenuChildVC.m +2 -9
- package/lib/ios/RNNUIBarButtonItem.m +3 -21
- package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +8 -0
- package/lib/src/adapters/NativeEventsReceiver.ts +3 -5
- package/metro.config.js +5 -1
- package/package.json +8 -6
package/Gemfile
ADDED
|
@@ -2,6 +2,8 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
|
|
5
|
+
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
6
|
+
|
|
5
7
|
Pod::Spec.new do |s|
|
|
6
8
|
s.name = "ReactNativeNavigation"
|
|
7
9
|
s.version = package['version']
|
|
@@ -17,19 +19,34 @@ Pod::Spec.new do |s|
|
|
|
17
19
|
|
|
18
20
|
s.subspec 'Core' do |ss|
|
|
19
21
|
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
|
|
20
|
-
s.source_files
|
|
22
|
+
s.source_files = 'lib/ios/**/*.{h,m,mm,cpp}'
|
|
21
23
|
s.exclude_files = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
|
|
22
24
|
end
|
|
23
|
-
|
|
24
|
-
# s.subspec 'Fabric' do |ss|
|
|
25
|
-
# ss.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/RCT-Folly\"",
|
|
26
|
-
# "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" }
|
|
27
|
-
# ss.dependency 'React-RCTFabric'
|
|
28
|
-
# ss.dependency 'React-Fabric'
|
|
29
|
-
# ss.dependency 'RCT-Folly/Fabric'
|
|
30
|
-
# end
|
|
31
25
|
|
|
26
|
+
if fabric_enabled
|
|
27
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
28
|
+
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
|
|
29
|
+
s.pod_target_xcconfig = {
|
|
30
|
+
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core"',
|
|
31
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
32
|
+
}
|
|
33
|
+
s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
|
|
34
|
+
s.requires_arc = true
|
|
35
|
+
|
|
36
|
+
s.dependency "React"
|
|
37
|
+
s.dependency "React-RCTFabric"
|
|
38
|
+
s.dependency "React-cxxreact"
|
|
39
|
+
s.dependency "React-Fabric"
|
|
40
|
+
s.dependency "React-Codegen"
|
|
41
|
+
s.dependency "RCT-Folly"
|
|
42
|
+
s.dependency "RCTRequired"
|
|
43
|
+
s.dependency "RCTTypeSafety"
|
|
44
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
45
|
+
s.dependency "React-runtimeexecutor"
|
|
46
|
+
s.dependency "React-rncore"
|
|
47
|
+
end
|
|
32
48
|
s.dependency 'React-Core'
|
|
49
|
+
s.dependency 'React-CoreModules'
|
|
33
50
|
s.dependency 'React-RCTImage'
|
|
34
51
|
s.dependency 'React-RCTText'
|
|
35
52
|
s.dependency 'HMSegmentedControl'
|
|
@@ -52,10 +52,6 @@ exports[`appDelegateLinker should work for RN 0.68 1`] = `
|
|
|
52
52
|
return YES;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
|
|
56
|
-
return [ReactNativeNavigation extraModulesForBridge:bridge];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
60
56
|
{
|
|
61
57
|
#if DEBUG
|
|
@@ -184,10 +180,6 @@ static NSString *const kRNConcurrentRoot = @\\"concurrentRoot\\";
|
|
|
184
180
|
return initProps;
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
|
|
188
|
-
return [ReactNativeNavigation extraModulesForBridge:bridge];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
183
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
192
184
|
{
|
|
193
185
|
#if DEBUG
|
|
@@ -250,17 +242,8 @@ exports[`appDelegateLinker should work for RN 0.71 1`] = `
|
|
|
250
242
|
|
|
251
243
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
252
244
|
{
|
|
253
|
-
|
|
254
|
-
[
|
|
255
|
-
// You can add your custom initial props in the dictionary below.
|
|
256
|
-
// They will be passed down to the ViewController used by React Native.
|
|
257
|
-
self.initialProps = @{};
|
|
258
|
-
|
|
259
|
-
return YES;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
|
|
263
|
-
return [ReactNativeNavigation extraModulesForBridge:bridge];
|
|
245
|
+
|
|
246
|
+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
264
247
|
}
|
|
265
248
|
|
|
266
249
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
@@ -6,6 +6,7 @@ var { warnn, logn, infon, debugn, errorn } = require('./log');
|
|
|
6
6
|
class AppDelegateLinker {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.appDelegatePath = path.appDelegate;
|
|
9
|
+
this.appDelegateHeaderPath = path.appDelegateHeader;
|
|
9
10
|
this.removeUnneededImportsSuccess = false;
|
|
10
11
|
this.removeApplicationLaunchContentSuccess = false;
|
|
11
12
|
}
|
|
@@ -22,6 +23,12 @@ class AppDelegateLinker {
|
|
|
22
23
|
|
|
23
24
|
var appDelegateContents = fs.readFileSync(this.appDelegatePath, 'utf8');
|
|
24
25
|
|
|
26
|
+
if (this.appDelegateHeaderPath) {
|
|
27
|
+
var appDelegateHeaderContents = fs.readFileSync(this.appDelegateHeaderPath, 'utf8');
|
|
28
|
+
appDelegateHeaderContents = this._extendRNNAppDelegate(appDelegateHeaderContents);
|
|
29
|
+
fs.writeFileSync(this.appDelegateHeaderPath, appDelegateHeaderContents);
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
try {
|
|
26
33
|
appDelegateContents = this._removeUnneededImports(appDelegateContents);
|
|
27
34
|
this.removeUnneededImportsSuccess = true;
|
|
@@ -33,8 +40,6 @@ class AppDelegateLinker {
|
|
|
33
40
|
|
|
34
41
|
appDelegateContents = this._bootstrapNavigation(appDelegateContents);
|
|
35
42
|
|
|
36
|
-
appDelegateContents = this._extraModulesForBridge(appDelegateContents);
|
|
37
|
-
|
|
38
43
|
try {
|
|
39
44
|
appDelegateContents = this._removeApplicationLaunchContent(appDelegateContents);
|
|
40
45
|
this.removeApplicationLaunchContentSuccess = true;
|
|
@@ -81,6 +86,18 @@ class AppDelegateLinker {
|
|
|
81
86
|
return content;
|
|
82
87
|
}
|
|
83
88
|
|
|
89
|
+
_extendRNNAppDelegate(content) {
|
|
90
|
+
return content
|
|
91
|
+
.replace(
|
|
92
|
+
/#import*.<RCTAppDelegate.h>/,
|
|
93
|
+
'#import "RNNAppDelegate.h"'
|
|
94
|
+
)
|
|
95
|
+
.replace(
|
|
96
|
+
/:*.RCTAppDelegate/,
|
|
97
|
+
': RNNAppDelegate'
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
84
101
|
_importNavigation(content) {
|
|
85
102
|
if (!this._doesImportNavigation(content)) {
|
|
86
103
|
debugn(' Importing ReactNativeNavigation.h');
|
|
@@ -105,16 +122,11 @@ class AppDelegateLinker {
|
|
|
105
122
|
.replace(
|
|
106
123
|
/RCTBridge.*];/,
|
|
107
124
|
'RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n' +
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
.replace(
|
|
111
|
-
/return \[super application:application didFinishLaunchingWithOptions:launchOptions\];/,
|
|
112
|
-
'return YES;'
|
|
125
|
+
'[ReactNativeNavigation bootstrapWithBridge:bridge];'
|
|
113
126
|
)
|
|
114
127
|
.replace(
|
|
115
|
-
/self.moduleName
|
|
116
|
-
'
|
|
117
|
-
' [ReactNativeNavigation bootstrapWithBridge:bridge];'
|
|
128
|
+
/self.moduleName.*;(.|\n)*@{};\n?/,
|
|
129
|
+
''
|
|
118
130
|
);
|
|
119
131
|
}
|
|
120
132
|
|
|
@@ -122,35 +134,6 @@ class AppDelegateLinker {
|
|
|
122
134
|
return /ReactNativeNavigation\s+bootstrap/.test(content);
|
|
123
135
|
}
|
|
124
136
|
|
|
125
|
-
_extraModulesForBridge(content) {
|
|
126
|
-
if (this._doesImplementsRNNExtraModulesForBridge(content)) {
|
|
127
|
-
warnn(' extraModulesForBridge already present.');
|
|
128
|
-
return content;
|
|
129
|
-
} else if (this._doesImplementsExtraModulesForBridge(content)) {
|
|
130
|
-
throw new Error(
|
|
131
|
-
'extraModulesForBridge implemented for a different module and needs manual linking. Check the manual installation docs to verify that everything is properly setup:\n https://wix.github.io/react-native-navigation/docs/installing#native-installation'
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
debugn(' Implementing extraModulesForBridge');
|
|
136
|
-
return content.replace(
|
|
137
|
-
/-.*\(NSURL.*\*\)sourceURLForBridge:\(RCTBridge.*\*\)bridge/,
|
|
138
|
-
'- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {\n\
|
|
139
|
-
return [ReactNativeNavigation extraModulesForBridge:bridge];\n\
|
|
140
|
-
}\n\
|
|
141
|
-
\n\
|
|
142
|
-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge'
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
_doesImplementsExtraModulesForBridge(content) {
|
|
147
|
-
return /-.*\(NSArray.*\*\)extraModulesForBridge:\(RCTBridge.*\*\)bridge/.test(content);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
_doesImplementsRNNExtraModulesForBridge(content) {
|
|
151
|
-
return /ReactNativeNavigation\s+extraModulesForBridge/.test(content);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
137
|
_removeApplicationLaunchContent(content) {
|
|
155
138
|
debugn(' Removing Application launch content');
|
|
156
139
|
|
|
@@ -14,5 +14,6 @@ exports.appDelegate = glob.sync(
|
|
|
14
14
|
reactNativeVersion < '0.68.0' ? '**/AppDelegate.m' : '**/AppDelegate.mm',
|
|
15
15
|
ignoreFolders
|
|
16
16
|
)[0];
|
|
17
|
+
exports.appDelegateHeader = glob.sync('**/AppDelegate.h', ignoreFolders)[0];
|
|
17
18
|
exports.podFile = glob.sync('**/Podfile', ignoreFolders)[0];
|
|
18
19
|
exports.plist = glob.sync('**/info.plist', ignoreFolders)[0];
|
|
@@ -8,6 +8,7 @@ import android.view.MotionEvent;
|
|
|
8
8
|
import com.facebook.react.ReactInstanceManager;
|
|
9
9
|
import com.facebook.react.ReactRootView;
|
|
10
10
|
import com.facebook.react.bridge.ReactContext;
|
|
11
|
+
import com.facebook.react.config.ReactFeatureFlags;
|
|
11
12
|
import com.facebook.react.uimanager.JSTouchDispatcher;
|
|
12
13
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
13
14
|
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
@@ -34,6 +35,7 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
34
35
|
this.componentId = componentId;
|
|
35
36
|
this.componentName = componentName;
|
|
36
37
|
jsTouchDispatcher = new JSTouchDispatcher(this);
|
|
38
|
+
setIsFabric(ReactFeatureFlags.enableFabricRenderer);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
@Override
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.reactnativenavigation.react.modal
|
|
2
2
|
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
3
4
|
import com.facebook.react.uimanager.events.Event
|
|
4
5
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
5
6
|
|
|
@@ -14,7 +15,7 @@ open class RequestCloseModalEvent(viewTag: Int) : Event<RequestCloseModalEvent>(
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
17
|
-
rctEventEmitter.receiveEvent(viewTag, eventName,
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -29,6 +30,6 @@ open class ShowModalEvent(viewTag: Int) : Event<ShowModalEvent>(viewTag) {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
32
|
-
rctEventEmitter.receiveEvent(viewTag, eventName,
|
|
33
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -14,14 +14,9 @@ fun MotionEvent.coordinatesInsideView(view: View?): Boolean {
|
|
|
14
14
|
view.getHitRect(hitRect)
|
|
15
15
|
return hitRect.contains(x.toInt(), y.toInt())
|
|
16
16
|
} else {
|
|
17
|
-
val viewGroup = (view as? ViewGroup)?.getChildAt(0) as? ViewGroup ?:
|
|
17
|
+
val viewGroup = (view as? ViewGroup)?.getChildAt(0) as? ViewGroup ?: view
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
content.getHitRect(hitRect)
|
|
22
|
-
hitRect.contains(x.toInt(), y.toInt())
|
|
23
|
-
} else {
|
|
24
|
-
false
|
|
25
|
-
}
|
|
19
|
+
viewGroup?.getHitRect(hitRect)
|
|
20
|
+
return hitRect.contains(x.toInt(), y.toInt())
|
|
26
21
|
}
|
|
27
22
|
}
|
|
@@ -6,13 +6,14 @@ import com.facebook.react.ReactInstanceManagerBuilder;
|
|
|
6
6
|
import com.facebook.react.ReactNativeHost;
|
|
7
7
|
import com.facebook.react.ReactPackage;
|
|
8
8
|
import com.facebook.react.common.LifecycleState;
|
|
9
|
+
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
9
10
|
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
|
|
10
11
|
import com.reactnativenavigation.NavigationApplication;
|
|
11
12
|
|
|
12
13
|
import androidx.annotation.NonNull;
|
|
13
14
|
import androidx.annotation.Nullable;
|
|
14
15
|
|
|
15
|
-
public abstract class NavigationReactNativeHost extends
|
|
16
|
+
public abstract class NavigationReactNativeHost extends DefaultReactNativeHost implements BundleDownloadListenerProvider {
|
|
16
17
|
|
|
17
18
|
private @Nullable NavigationDevBundleDownloadListener bundleListener;
|
|
18
19
|
private final DevBundleDownloadListener bundleListenerMediator = new DevBundleDownloadListenerAdapter() {
|
|
@@ -33,30 +34,6 @@ public abstract class NavigationReactNativeHost extends ReactNativeHost implemen
|
|
|
33
34
|
bundleListener = listener;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
protected ReactInstanceManager createReactInstanceManager() {
|
|
37
|
-
ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
|
|
38
|
-
.setApplication(getApplication())
|
|
39
|
-
.setJSMainModulePath(getJSMainModuleName())
|
|
40
|
-
.setUseDeveloperSupport(getUseDeveloperSupport())
|
|
41
|
-
.setRedBoxHandler(getRedBoxHandler())
|
|
42
|
-
.setJavaScriptExecutorFactory(getJavaScriptExecutorFactory())
|
|
43
|
-
.setInitialLifecycleState(LifecycleState.BEFORE_CREATE)
|
|
44
|
-
.setJSIModulesPackage(getJSIModulePackage())
|
|
45
|
-
.setDevBundleDownloadListener(getDevBundleDownloadListener());
|
|
46
|
-
|
|
47
|
-
for (ReactPackage reactPackage : getPackages()) {
|
|
48
|
-
builder.addPackage(reactPackage);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
String jsBundleFile = getJSBundleFile();
|
|
52
|
-
if (jsBundleFile != null) {
|
|
53
|
-
builder.setJSBundleFile(jsBundleFile);
|
|
54
|
-
} else {
|
|
55
|
-
builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));
|
|
56
|
-
}
|
|
57
|
-
return builder.build();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
37
|
@SuppressWarnings("WeakerAccess")
|
|
61
38
|
@NonNull
|
|
62
39
|
protected DevBundleDownloadListener getDevBundleDownloadListener() {
|
|
@@ -5,8 +5,6 @@ const react_native_1 = require("react-native");
|
|
|
5
5
|
class NativeEventsReceiver {
|
|
6
6
|
emitter;
|
|
7
7
|
constructor() {
|
|
8
|
-
// NOTE: This try catch is workaround for integration tests
|
|
9
|
-
// TODO: mock NativeEventEmitter in integration tests rather done adding try catch in source code
|
|
10
8
|
try {
|
|
11
9
|
this.emitter = new react_native_1.NativeEventEmitter(react_native_1.NativeModules.RNNEventEmitter);
|
|
12
10
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <React/RCTBridge.h>
|
|
3
|
+
#import <React/RCTBridgeDelegate.h>
|
|
4
|
+
|
|
5
|
+
@class RCTSurfacePresenterBridgeAdapter;
|
|
6
|
+
@class RCTTurboModuleManager;
|
|
7
|
+
|
|
8
|
+
@interface RNNAppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
|
|
9
|
+
|
|
10
|
+
@property(nonatomic, strong) UIWindow *window;
|
|
11
|
+
|
|
12
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
13
|
+
|
|
14
|
+
/// The TurboModule manager
|
|
15
|
+
@property(nonatomic, strong) RCTTurboModuleManager *turboModuleManager;
|
|
16
|
+
@property(nonatomic, strong) RCTSurfacePresenterBridgeAdapter *bridgeAdapter;
|
|
17
|
+
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
@end
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#import "RNNAppDelegate.h"
|
|
2
|
+
#import <ReactNativeNavigation/ReactNativeNavigation.h>
|
|
3
|
+
|
|
4
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import "RCTAppSetupUtils.h"
|
|
6
|
+
#import "RCTLegacyInteropComponents.h"
|
|
7
|
+
#import <React/CoreModulesPlugins.h>
|
|
8
|
+
#import <React/RCTCxxBridgeDelegate.h>
|
|
9
|
+
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
10
|
+
#import <React/RCTLegacyViewManagerInteropComponentView.h>
|
|
11
|
+
#import <React/RCTRuntimeExecutorFromBridge.h>
|
|
12
|
+
#import <React/RCTSurfacePresenter.h>
|
|
13
|
+
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
|
14
|
+
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
15
|
+
#import <react/config/ReactNativeConfig.h>
|
|
16
|
+
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
17
|
+
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
|
|
18
|
+
|
|
19
|
+
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
20
|
+
|
|
21
|
+
@interface RNNAppDelegate () <RCTTurboModuleManagerDelegate, RCTCxxBridgeDelegate> {
|
|
22
|
+
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
|
23
|
+
facebook::react::ContextContainer::Shared _contextContainer;
|
|
24
|
+
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
|
|
25
|
+
}
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
@implementation RNNAppDelegate
|
|
31
|
+
|
|
32
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
33
|
+
- (instancetype)init {
|
|
34
|
+
if (self = [super init]) {
|
|
35
|
+
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
|
|
36
|
+
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
|
|
37
|
+
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
|
38
|
+
}
|
|
39
|
+
return self;
|
|
40
|
+
}
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
- (BOOL)application:(UIApplication *)application
|
|
44
|
+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
45
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
46
|
+
RCTEnableTurboModule(true);
|
|
47
|
+
#endif
|
|
48
|
+
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
49
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
50
|
+
self.bridgeAdapter =
|
|
51
|
+
[[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge
|
|
52
|
+
contextContainer:_contextContainer];
|
|
53
|
+
bridge.surfacePresenter = self.bridgeAdapter.surfacePresenter;
|
|
54
|
+
|
|
55
|
+
[self unstable_registerLegacyComponents];
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
[ReactNativeNavigation bootstrapWithBridge:bridge];
|
|
59
|
+
|
|
60
|
+
return YES;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
|
|
64
|
+
return [ReactNativeNavigation extraModulesForBridge:bridge];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
68
|
+
#pragma mark - RCTCxxBridgeDelegate
|
|
69
|
+
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:
|
|
70
|
+
(RCTBridge *)bridge {
|
|
71
|
+
_runtimeScheduler = _runtimeScheduler =
|
|
72
|
+
std::make_shared<facebook::react::RuntimeScheduler>(RCTRuntimeExecutorFromBridge(bridge));
|
|
73
|
+
std::shared_ptr<facebook::react::CallInvoker> callInvoker =
|
|
74
|
+
std::make_shared<facebook::react::RuntimeSchedulerCallInvoker>(_runtimeScheduler);
|
|
75
|
+
self.turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
|
76
|
+
delegate:self
|
|
77
|
+
jsInvoker:callInvoker];
|
|
78
|
+
_contextContainer->erase("RuntimeScheduler");
|
|
79
|
+
_contextContainer->insert("RuntimeScheduler", _runtimeScheduler);
|
|
80
|
+
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager, _runtimeScheduler);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#pragma mark RCTTurboModuleManagerDelegate
|
|
84
|
+
|
|
85
|
+
- (Class)getModuleClassFromName:(const char *)name {
|
|
86
|
+
return RCTCoreModulesClassProvider(name);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (std::shared_ptr<facebook::react::TurboModule>)
|
|
90
|
+
getTurboModule:(const std::string &)name
|
|
91
|
+
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker {
|
|
92
|
+
return nullptr;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
- (std::shared_ptr<facebook::react::TurboModule>)
|
|
96
|
+
getTurboModule:(const std::string &)name
|
|
97
|
+
initParams:(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
98
|
+
return nullptr;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass {
|
|
102
|
+
return RCTAppSetupDefaultModuleFromClass(moduleClass);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#pragma mark - New Arch Enabled settings
|
|
106
|
+
|
|
107
|
+
- (BOOL)turboModuleEnabled {
|
|
108
|
+
return YES;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
- (BOOL)fabricEnabled {
|
|
112
|
+
return YES;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#pragma mark - New Arch Utilities
|
|
116
|
+
|
|
117
|
+
- (void)unstable_registerLegacyComponents {
|
|
118
|
+
for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
|
|
119
|
+
[RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#endif
|
|
124
|
+
|
|
125
|
+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
|
|
126
|
+
[NSException raise:@"RCTBridgeDelegate::sourceURLForBridge not implemented"
|
|
127
|
+
format:@"Subclasses must implement a valid sourceURLForBridge method"];
|
|
128
|
+
return nil;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
- (BOOL)concurrentRootEnabled {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@end
|
|
@@ -2,19 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
@implementation RNNComponentRootView
|
|
4
4
|
|
|
5
|
-
- (instancetype)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
9
|
-
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
10
|
-
self = [super initWithBridge:bridge
|
|
11
|
-
moduleName:moduleName
|
|
12
|
-
initialProperties:initialProperties
|
|
13
|
-
eventEmitter:eventEmitter
|
|
14
|
-
reactViewReadyBlock:reactViewReadyBlock];
|
|
5
|
+
- (instancetype)init {
|
|
6
|
+
self = [super init];
|
|
7
|
+
self.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
|
|
15
8
|
return self;
|
|
16
9
|
}
|
|
17
|
-
|
|
18
10
|
- (NSString *)componentType {
|
|
19
11
|
return ComponentTypeScreen;
|
|
20
12
|
}
|
|
@@ -94,9 +94,10 @@
|
|
|
94
94
|
}];
|
|
95
95
|
}];
|
|
96
96
|
self.reactView.backgroundColor = UIColor.clearColor;
|
|
97
|
-
self.reactView.
|
|
97
|
+
self.reactView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
|
98
|
+
[self.reactView setFrame:self.view.frame];
|
|
98
99
|
[self.view addSubview:self.reactView];
|
|
99
|
-
[self
|
|
100
|
+
[self updateReactViewFrame];
|
|
100
101
|
} else {
|
|
101
102
|
[self readyForPresentation];
|
|
102
103
|
}
|
|
@@ -108,30 +109,21 @@
|
|
|
108
109
|
|
|
109
110
|
- (void)viewSafeAreaInsetsDidChange {
|
|
110
111
|
[super viewSafeAreaInsetsDidChange];
|
|
111
|
-
[self
|
|
112
|
+
[self updateReactViewFrame];
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
- (void)viewDidLayoutSubviews {
|
|
115
116
|
[super viewDidLayoutSubviews];
|
|
116
117
|
[self.presenter applyOptionsOnViewDidLayoutSubviews:self.resolveOptions];
|
|
118
|
+
[self updateReactViewFrame];
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
- (void)
|
|
121
|
+
- (void)updateReactViewFrame {
|
|
120
122
|
if (self.isViewLoaded && self.reactView) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
? self.view.topAnchor
|
|
126
|
-
: self.view.safeAreaLayoutGuide.topAnchor],
|
|
127
|
-
[self.reactView.bottomAnchor
|
|
128
|
-
constraintEqualToAnchor:self.shouldDrawBehindBottomTabs
|
|
129
|
-
? self.view.bottomAnchor
|
|
130
|
-
: self.view.safeAreaLayoutGuide.bottomAnchor],
|
|
131
|
-
[self.reactView.leftAnchor constraintEqualToAnchor:self.view.leftAnchor],
|
|
132
|
-
[self.reactView.rightAnchor constraintEqualToAnchor:self.view.rightAnchor]
|
|
133
|
-
];
|
|
134
|
-
[NSLayoutConstraint activateConstraints:_reactViewConstraints];
|
|
123
|
+
CGFloat bottomInset = self.shouldDrawBehindBottomTabs ? 0 : self.view.safeAreaInsets.bottom;
|
|
124
|
+
CGFloat topInset = self.shouldDrawBehindTopBar ? 0 : self.view.safeAreaInsets.top;
|
|
125
|
+
[self.reactView setFrame:CGRectMake(0, topInset, self.view.frame.size.width,
|
|
126
|
+
self.view.frame.size.height - topInset - bottomInset)];
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
|
|
@@ -147,12 +139,12 @@
|
|
|
147
139
|
|
|
148
140
|
- (void)setDrawBehindTopBar:(BOOL)drawBehindTopBar {
|
|
149
141
|
_drawBehindTopBar = drawBehindTopBar;
|
|
150
|
-
[self
|
|
142
|
+
[self updateReactViewFrame];
|
|
151
143
|
}
|
|
152
144
|
|
|
153
145
|
- (void)setDrawBehindBottomTabs:(BOOL)drawBehindBottomTabs {
|
|
154
146
|
_drawBehindBottomTabs = drawBehindBottomTabs;
|
|
155
|
-
[self
|
|
147
|
+
[self updateReactViewFrame];
|
|
156
148
|
}
|
|
157
149
|
|
|
158
150
|
- (UIViewController *)getCurrentChild {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
if ([hitTestResult isKindOfClass:[UIWindow class]] ||
|
|
11
11
|
[hitTestResult.subviews.firstObject isKindOfClass:RNNReactView.class] ||
|
|
12
|
-
[hitTestResult isKindOfClass:[RCTModalHostView class]]
|
|
12
|
+
[hitTestResult isKindOfClass:[RCTModalHostView class]] ||
|
|
13
|
+
[hitTestResult isKindOfClass:NSClassFromString(@"RCTRootComponentView")]) {
|
|
13
14
|
return nil;
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
#import "RNNReactButtonView.h"
|
|
2
2
|
|
|
3
3
|
@implementation RNNReactButtonView
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
6
|
+
moduleName:(NSString *)moduleName
|
|
7
|
+
initialProperties:(NSDictionary *)initialProperties
|
|
8
|
+
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
9
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
10
|
+
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
11
|
+
self = [super initWithBridge:bridge
|
|
12
|
+
moduleName:moduleName
|
|
13
|
+
initialProperties:initialProperties
|
|
14
|
+
eventEmitter:eventEmitter
|
|
15
|
+
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthUndefined |
|
|
16
|
+
RCTSurfaceSizeMeasureModeHeightUndefined
|
|
17
|
+
reactViewReadyBlock:reactViewReadyBlock];
|
|
18
|
+
|
|
19
|
+
return self;
|
|
20
|
+
}
|
|
21
|
+
#else
|
|
22
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
23
|
+
moduleName:(NSString *)moduleName
|
|
24
|
+
initialProperties:(NSDictionary *)initialProperties
|
|
25
|
+
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
26
|
+
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
27
|
+
self = [super initWithBridge:bridge
|
|
28
|
+
moduleName:moduleName
|
|
29
|
+
initialProperties:initialProperties
|
|
30
|
+
eventEmitter:eventEmitter
|
|
31
|
+
reactViewReadyBlock:reactViewReadyBlock];
|
|
32
|
+
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
#endif
|
|
4
36
|
|
|
5
37
|
- (NSString *)componentType {
|
|
6
38
|
return ComponentTypeButton;
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
- (NSMapTable *)componentsForParentId:(NSString *)parentComponentId {
|
|
55
55
|
if (![_componentStore objectForKey:parentComponentId]) {
|
|
56
|
-
[_componentStore setObject:[NSMapTable
|
|
56
|
+
[_componentStore setObject:[NSMapTable strongToWeakObjectsMapTable]
|
|
57
57
|
forKey:parentComponentId];
|
|
58
58
|
;
|
|
59
59
|
}
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
|
|
65
65
|
- (void)clearComponentsForParentId:(NSString *)parentComponentId {
|
|
66
66
|
[_componentStore removeObjectForKey:parentComponentId];
|
|
67
|
-
;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
- (void)removeComponent:(NSString *)componentId {
|
|
@@ -21,12 +21,23 @@
|
|
|
21
21
|
ofType:(RNNComponentType)componentType
|
|
22
22
|
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
23
23
|
[self verifyRootViewId:rootViewId];
|
|
24
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
24
25
|
return [[[self resolveComponentViewClass:componentType] alloc]
|
|
25
26
|
initWithBridge:_bridge
|
|
26
27
|
moduleName:name
|
|
27
28
|
initialProperties:@{@"componentId" : rootViewId}
|
|
28
29
|
eventEmitter:_eventEmitter
|
|
30
|
+
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact |
|
|
31
|
+
RCTSurfaceSizeMeasureModeHeightExact
|
|
29
32
|
reactViewReadyBlock:reactViewReadyBlock];
|
|
33
|
+
#else
|
|
34
|
+
return [[[self resolveComponentViewClass:componentType] alloc]
|
|
35
|
+
initWithBridge:_bridge
|
|
36
|
+
moduleName:name
|
|
37
|
+
initialProperties:@{@"componentId" : rootViewId}
|
|
38
|
+
eventEmitter:_eventEmitter
|
|
39
|
+
reactViewReadyBlock:reactViewReadyBlock];
|
|
40
|
+
#endif
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
- (Class)resolveComponentViewClass:(RNNComponentType)componentType {
|
package/lib/ios/RNNReactView.h
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#ifdef
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
2
|
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
3
3
|
#else
|
|
4
4
|
#import <React/RCTRootView.h>
|
|
@@ -30,18 +30,27 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
|
|
|
30
30
|
|
|
31
31
|
@end
|
|
32
32
|
|
|
33
|
-
#ifdef
|
|
33
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
34
34
|
@interface RNNReactView
|
|
35
35
|
: RCTFabricSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
|
|
36
36
|
#else
|
|
37
37
|
@interface RNNReactView : RCTRootView <RCTRootViewDelegate, RNNComponentProtocol>
|
|
38
38
|
#endif
|
|
39
39
|
|
|
40
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
40
41
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
41
42
|
moduleName:(NSString *)moduleName
|
|
42
43
|
initialProperties:(NSDictionary *)initialProperties
|
|
43
44
|
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
45
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
44
46
|
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock;
|
|
47
|
+
#else
|
|
48
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
49
|
+
moduleName:(NSString *)moduleName
|
|
50
|
+
initialProperties:(NSDictionary *)initialProperties
|
|
51
|
+
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
52
|
+
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock;
|
|
53
|
+
#endif
|
|
45
54
|
|
|
46
55
|
@property(nonatomic, copy) RNNReactViewReadyCompletionBlock reactViewReadyBlock;
|
|
47
56
|
@property(nonatomic, strong) RNNEventEmitter *eventEmitter;
|
package/lib/ios/RNNReactView.m
CHANGED
|
@@ -4,13 +4,26 @@
|
|
|
4
4
|
@implementation RNNReactView {
|
|
5
5
|
BOOL _isAppeared;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
9
|
+
moduleName:(NSString *)moduleName
|
|
10
|
+
initialProperties:(NSDictionary *)initialProperties
|
|
11
|
+
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
12
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
13
|
+
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
14
|
+
self = [super initWithBridge:bridge
|
|
15
|
+
moduleName:moduleName
|
|
16
|
+
initialProperties:initialProperties
|
|
17
|
+
sizeMeasureMode:sizeMeasureMode];
|
|
18
|
+
#else
|
|
8
19
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
9
20
|
moduleName:(NSString *)moduleName
|
|
10
21
|
initialProperties:(NSDictionary *)initialProperties
|
|
11
22
|
eventEmitter:(RNNEventEmitter *)eventEmitter
|
|
12
23
|
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
|
|
13
24
|
self = [super initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
25
|
+
#endif
|
|
26
|
+
|
|
14
27
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
15
28
|
selector:@selector(contentDidAppear:)
|
|
16
29
|
name:RCTContentDidAppearNotification
|
|
@@ -34,17 +34,10 @@
|
|
|
34
34
|
|
|
35
35
|
[self addChildViewController:self.child];
|
|
36
36
|
[self.child.view setFrame:self.view.bounds];
|
|
37
|
+
self.child.view.autoresizingMask =
|
|
38
|
+
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
37
39
|
[self.view addSubview:self.child.view];
|
|
38
40
|
[self.view bringSubviewToFront:self.child.view];
|
|
39
|
-
self.child.view.translatesAutoresizingMaskIntoConstraints = NO;
|
|
40
|
-
|
|
41
|
-
[NSLayoutConstraint activateConstraints:@[
|
|
42
|
-
[self.child.view.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
|
|
43
|
-
[self.child.view.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
|
|
44
|
-
[self.child.view.topAnchor constraintEqualToAnchor:self.view.topAnchor],
|
|
45
|
-
[self.child.view.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
|
|
46
|
-
]];
|
|
47
|
-
|
|
48
41
|
[self.child didMoveToParentViewController:self];
|
|
49
42
|
}
|
|
50
43
|
|
|
@@ -87,31 +87,13 @@
|
|
|
87
87
|
buttonOptions:(RNNButtonOptions *)buttonOptions
|
|
88
88
|
onPress:(RNNButtonPressCallback)onPress {
|
|
89
89
|
self = [super initWithCustomView:reactView];
|
|
90
|
+
[reactView setFrame:CGRectMake(0, 0, 50, 50)];
|
|
90
91
|
[self applyOptions:buttonOptions];
|
|
91
92
|
|
|
92
|
-
reactView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
|
|
93
93
|
reactView.delegate = self;
|
|
94
|
+
|
|
94
95
|
reactView.backgroundColor = [UIColor clearColor];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
[NSLayoutConstraint deactivateConstraints:reactView.constraints];
|
|
98
|
-
self.widthConstraint =
|
|
99
|
-
[NSLayoutConstraint constraintWithItem:reactView
|
|
100
|
-
attribute:NSLayoutAttributeWidth
|
|
101
|
-
relatedBy:NSLayoutRelationEqual
|
|
102
|
-
toItem:nil
|
|
103
|
-
attribute:NSLayoutAttributeNotAnAttribute
|
|
104
|
-
multiplier:1.0
|
|
105
|
-
constant:reactView.intrinsicContentSize.width];
|
|
106
|
-
self.heightConstraint =
|
|
107
|
-
[NSLayoutConstraint constraintWithItem:reactView
|
|
108
|
-
attribute:NSLayoutAttributeHeight
|
|
109
|
-
relatedBy:NSLayoutRelationEqual
|
|
110
|
-
toItem:nil
|
|
111
|
-
attribute:NSLayoutAttributeNotAnAttribute
|
|
112
|
-
multiplier:1.0
|
|
113
|
-
constant:reactView.intrinsicContentSize.height];
|
|
114
|
-
[NSLayoutConstraint activateConstraints:@[ self.widthConstraint, self.heightConstraint ]];
|
|
96
|
+
|
|
115
97
|
self.onPress = onPress;
|
|
116
98
|
return self;
|
|
117
99
|
}
|
|
@@ -255,6 +255,8 @@
|
|
|
255
255
|
507ACB1223F44D1E00829911 /* RNNComponentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 507ACB1023F44D1E00829911 /* RNNComponentView.m */; };
|
|
256
256
|
507ACB1523F44E5200829911 /* RNNComponentRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 507ACB1323F44E5200829911 /* RNNComponentRootView.h */; };
|
|
257
257
|
507ACB1623F44E5200829911 /* RNNComponentRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 507ACB1423F44E5200829911 /* RNNComponentRootView.m */; };
|
|
258
|
+
507DBBDB2A31DE8400F1FC74 /* RNNAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */; };
|
|
259
|
+
507DBBDC2A31DE8400F1FC74 /* RNNAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */; };
|
|
258
260
|
507E7D57201DDD3000444E6C /* RNNSharedElementAnimationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */; };
|
|
259
261
|
507E7D58201DDD3000444E6C /* RNNSharedElementAnimationOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 507E7D56201DDD3000444E6C /* RNNSharedElementAnimationOptions.m */; };
|
|
260
262
|
507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */; };
|
|
@@ -792,6 +794,8 @@
|
|
|
792
794
|
507ACB1023F44D1E00829911 /* RNNComponentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNComponentView.m; sourceTree = "<group>"; };
|
|
793
795
|
507ACB1323F44E5200829911 /* RNNComponentRootView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNComponentRootView.h; sourceTree = "<group>"; };
|
|
794
796
|
507ACB1423F44E5200829911 /* RNNComponentRootView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNComponentRootView.m; sourceTree = "<group>"; };
|
|
797
|
+
507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNAppDelegate.h; sourceTree = "<group>"; };
|
|
798
|
+
507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNNAppDelegate.mm; sourceTree = "<group>"; };
|
|
795
799
|
507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSharedElementAnimationOptions.h; sourceTree = "<group>"; };
|
|
796
800
|
507E7D56201DDD3000444E6C /* RNNSharedElementAnimationOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSharedElementAnimationOptions.m; sourceTree = "<group>"; };
|
|
797
801
|
507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsViewController.h; sourceTree = "<group>"; };
|
|
@@ -1728,6 +1732,8 @@
|
|
|
1728
1732
|
50588B8723AA87E3001F6A5E /* Animations */,
|
|
1729
1733
|
7BA500731E2544B9001B9E1B /* ReactNativeNavigation.h */,
|
|
1730
1734
|
7BA500741E2544B9001B9E1B /* ReactNativeNavigation.m */,
|
|
1735
|
+
507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */,
|
|
1736
|
+
507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */,
|
|
1731
1737
|
5030B62023D5B4CA008F1642 /* Color+Interpolation.h */,
|
|
1732
1738
|
5030B61F23D5B4CA008F1642 /* Color+Interpolation.m */,
|
|
1733
1739
|
5030B62623D5B54D008F1642 /* LNInterpolable.h */,
|
|
@@ -2010,6 +2016,7 @@
|
|
|
2010
2016
|
50395593217485B000B0A663 /* Double.h in Headers */,
|
|
2011
2017
|
5050465421F8F4490035497A /* RNNReactComponentRegistry.h in Headers */,
|
|
2012
2018
|
506BF65C2600AE4200A22755 /* CenterTransition.h in Headers */,
|
|
2019
|
+
507DBBDB2A31DE8400F1FC74 /* RNNAppDelegate.h in Headers */,
|
|
2013
2020
|
504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
|
|
2014
2021
|
50E38DD723A7A2BE009817F6 /* AnimatedViewFactory.h in Headers */,
|
|
2015
2022
|
E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
|
|
@@ -2354,6 +2361,7 @@
|
|
|
2354
2361
|
50BCB29223F2C7CD00D6C8E5 /* AnchorTransition.m in Sources */,
|
|
2355
2362
|
50344D2923A03DB4004B6A7C /* BottomTabsAttachMode.m in Sources */,
|
|
2356
2363
|
501224072173592D000F5F98 /* RNNBottomTabsPresenter.m in Sources */,
|
|
2364
|
+
507DBBDC2A31DE8400F1FC74 /* RNNAppDelegate.mm in Sources */,
|
|
2357
2365
|
50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */,
|
|
2358
2366
|
50A5628B23DDAB5A0027C219 /* ScreenAnimationController.m in Sources */,
|
|
2359
2367
|
5039559C2174867000B0A663 /* DoubleParser.m in Sources */,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeModules, NativeEventEmitter,
|
|
1
|
+
import { NativeModules, NativeEventEmitter, EmitterSubscription } from 'react-native';
|
|
2
2
|
import {
|
|
3
3
|
ComponentWillAppearEvent,
|
|
4
4
|
ComponentDidAppearEvent,
|
|
@@ -19,10 +19,8 @@ import {
|
|
|
19
19
|
} from '../interfaces/Events';
|
|
20
20
|
|
|
21
21
|
export class NativeEventsReceiver {
|
|
22
|
-
private emitter:
|
|
22
|
+
private emitter: NativeEventEmitter;
|
|
23
23
|
constructor() {
|
|
24
|
-
// NOTE: This try catch is workaround for integration tests
|
|
25
|
-
// TODO: mock NativeEventEmitter in integration tests rather done adding try catch in source code
|
|
26
24
|
try {
|
|
27
25
|
this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
|
|
28
26
|
} catch (e) {
|
|
@@ -32,7 +30,7 @@ export class NativeEventsReceiver {
|
|
|
32
30
|
remove: () => undefined,
|
|
33
31
|
};
|
|
34
32
|
},
|
|
35
|
-
} as any) as
|
|
33
|
+
} as any) as NativeEventEmitter;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
|
package/metro.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-navigation",
|
|
3
|
-
"version": "7.36.0-rc.
|
|
3
|
+
"version": "7.36.0-rc.3",
|
|
4
4
|
"description": "React Native Navigation - truly native navigation for iOS and Android",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"nativePackage": true,
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"start": "node ./scripts/start",
|
|
34
34
|
"pretest-js": "npm run build",
|
|
35
35
|
"test-js": "node ./scripts/test-js",
|
|
36
|
-
"pod-install": "
|
|
36
|
+
"pod-install-new-arch": "cd playground/ios && BUNDLE_GEMFILE=../../Gemfile BUNDLE_PATH=~/gems/ bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
|
|
37
|
+
"pod-install": "cd playground/ios && pod install",
|
|
37
38
|
"test-unit-ios": "node ./scripts/test-unit --ios",
|
|
38
39
|
"test-snapshot-ios": "node ./scripts/test-snapshot --ios",
|
|
39
40
|
"test-unit-android": "node ./scripts/test-unit --android",
|
|
@@ -71,7 +72,8 @@
|
|
|
71
72
|
"@babel/plugin-proposal-export-default-from": "7.10.1",
|
|
72
73
|
"@babel/plugin-proposal-export-namespace-from": "7.10.1",
|
|
73
74
|
"@babel/runtime": "^7.20.0",
|
|
74
|
-
"@babel/types": "7.
|
|
75
|
+
"@babel/types": "7.22.5",
|
|
76
|
+
"@react-native/metro-config": "^0.73.0",
|
|
75
77
|
"@react-native-community/blur": "^3.6.0",
|
|
76
78
|
"@react-native-community/datetimepicker": "^3.4.7",
|
|
77
79
|
"@react-native-community/eslint-config": "2.0.0",
|
|
@@ -100,15 +102,15 @@
|
|
|
100
102
|
"identity-obj-proxy": "3.0.0",
|
|
101
103
|
"jest": "^27.5.1",
|
|
102
104
|
"lint-staged": "10.2.11",
|
|
103
|
-
"metro-react-native-babel-preset": "^0.
|
|
105
|
+
"metro-react-native-babel-preset": "^0.76.2",
|
|
104
106
|
"pixelmatch": "^5.2.1",
|
|
105
107
|
"pngjs": "^6.0.0",
|
|
106
108
|
"prettier": "2.1.2",
|
|
107
109
|
"react": "18.2.0",
|
|
108
|
-
"react-native": "0.
|
|
110
|
+
"react-native": "0.72.3",
|
|
109
111
|
"react-native-fast-image": "^8.6.3",
|
|
110
112
|
"react-native-gesture-handler": "^2.10.1",
|
|
111
|
-
"react-native-reanimated": "
|
|
113
|
+
"react-native-reanimated": "3.4.1",
|
|
112
114
|
"react-native-ui-lib": "7.3.6",
|
|
113
115
|
"react-redux": "5.x.x",
|
|
114
116
|
"react-test-renderer": "18.2.0",
|