@callstack/react-native-brownfield 1.0.0-rc.0 → 1.0.0-rc.1

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.
Files changed (35) hide show
  1. package/ReactBrownfield.podspec +22 -0
  2. package/android/build.gradle +15 -0
  3. package/android/src/newarch/ReactNativeBrownfieldModule.kt +37 -0
  4. package/android/src/{main/java/com/callstack/reactnativebrownfield → oldarch}/ReactNativeBrownfieldModule.kt +6 -1
  5. package/ios/ReactNativeBrownfieldModule.h +7 -2
  6. package/ios/{ReactNativeBrownfieldModule.m → ReactNativeBrownfieldModule.mm} +7 -3
  7. package/ios/ReactNativeView.swift +5 -4
  8. package/lib/commonjs/NativeReactNativeBrownfieldModule.js +2 -0
  9. package/lib/commonjs/NativeReactNativeBrownfieldModule.js.map +1 -0
  10. package/lib/commonjs/index.js +1 -30
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/module/NativeReactNativeBrownfieldModule.js +2 -0
  13. package/lib/module/NativeReactNativeBrownfieldModule.js.map +1 -0
  14. package/lib/module/index.js +1 -25
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/typescript/{src/RNBrownfieldSpec.d.ts → commonjs/src/NativeReactNativeBrownfieldModule.d.ts} +2 -2
  17. package/lib/typescript/commonjs/src/NativeReactNativeBrownfieldModule.d.ts.map +1 -0
  18. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  19. package/lib/typescript/module/src/NativeReactNativeBrownfieldModule.d.ts +20 -0
  20. package/lib/typescript/module/src/NativeReactNativeBrownfieldModule.d.ts.map +1 -0
  21. package/lib/typescript/module/src/index.d.ts +6 -0
  22. package/lib/typescript/module/src/index.d.ts.map +1 -0
  23. package/package.json +33 -7
  24. package/src/{RNBrownfieldSpec.ts → NativeReactNativeBrownfieldModule.ts} +1 -1
  25. package/src/index.ts +3 -3
  26. package/ReactNativeBrownfield.podspec +0 -27
  27. package/lib/commonjs/RNBrownfieldSpec.js +0 -9
  28. package/lib/commonjs/RNBrownfieldSpec.js.map +0 -1
  29. package/lib/module/RNBrownfieldSpec.js +0 -5
  30. package/lib/module/RNBrownfieldSpec.js.map +0 -1
  31. package/lib/typescript/src/RNBrownfieldSpec.d.ts.map +0 -1
  32. package/lib/typescript/src/index.d.ts.map +0 -1
  33. /package/lib/{commonjs → typescript/commonjs}/package.json +0 -0
  34. /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
  35. /package/lib/{module → typescript/module}/package.json +0 -0
@@ -0,0 +1,22 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |spec|
6
+ spec.name = "ReactBrownfield"
7
+ spec.version = package['version']
8
+ spec.summary = package['description']
9
+ spec.license = package['license']
10
+
11
+ spec.authors = package['author']
12
+ spec.homepage = package['homepage']
13
+ spec.platform = :ios, "14.0"
14
+
15
+ spec.module_name = "ReactBrownfield"
16
+ spec.source = { :git => "git@github.com:callstack/react-native-brownfield.git", :tag => "#{spec.version}" }
17
+ spec.source_files = "ios/**/*.{h,m,mm,swift}"
18
+ spec.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
19
+
20
+ spec.dependency 'ReactAppDependencyProvider'
21
+ install_modules_dependencies(spec)
22
+ end
@@ -84,6 +84,21 @@ android {
84
84
  sourceCompatibility JavaVersion.VERSION_1_8
85
85
  targetCompatibility JavaVersion.VERSION_1_8
86
86
  }
87
+
88
+ sourceSets {
89
+ main {
90
+ if (isNewArchitectureEnabled()) {
91
+ java.srcDirs += [
92
+ "src/newarch",
93
+ // Codegen specs
94
+ "generated/java",
95
+ "generated/jni"
96
+ ]
97
+ } else {
98
+ java.srcDirs += ["src/oldarch"]
99
+ }
100
+ }
101
+ }
87
102
  }
88
103
 
89
104
  repositories {
@@ -0,0 +1,37 @@
1
+ package com.callstack.reactnativebrownfield
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactMethod
5
+
6
+ class ReactNativeBrownfieldModule(reactContext: ReactApplicationContext) :
7
+ NativeReactNativeBrownfieldModuleSpec(reactContext) {
8
+ companion object {
9
+ var shouldPopToNative: Boolean = false
10
+ }
11
+
12
+ @ReactMethod
13
+ override fun popToNative(animated: Boolean) {
14
+ shouldPopToNative = true
15
+ onBackPressed()
16
+ }
17
+
18
+ @ReactMethod
19
+ override fun setPopGestureRecognizerEnabled(enabled: Boolean) {
20
+ shouldPopToNative = enabled
21
+ }
22
+
23
+ @ReactMethod
24
+ override fun setHardwareBackButtonEnabled(enabled: Boolean) {
25
+ shouldPopToNative = enabled
26
+ }
27
+
28
+ private fun onBackPressed() {
29
+ reactApplicationContext.currentActivity?.runOnUiThread {
30
+ reactApplicationContext.currentActivity?.onBackPressed()
31
+ }
32
+ }
33
+
34
+ override fun getName(): String {
35
+ return "ReactNativeBrownfield"
36
+ }
37
+ }
@@ -11,11 +11,16 @@ class ReactNativeBrownfieldModule(reactContext: ReactApplicationContext) :
11
11
  }
12
12
 
13
13
  @ReactMethod
14
- fun popToNative() {
14
+ fun popToNative(animated: Boolean) {
15
15
  shouldPopToNative = true
16
16
  onBackPressed()
17
17
  }
18
18
 
19
+ @ReactMethod
20
+ fun setPopGestureRecognizerEnabled(enabled: Boolean) {
21
+ shouldPopToNative = enabled
22
+ }
23
+
19
24
  @ReactMethod
20
25
  fun setHardwareBackButtonEnabled(isFirstRoute: Boolean) {
21
26
  shouldPopToNative = isFirstRoute
@@ -1,4 +1,9 @@
1
- #import <React/RCTBridgeModule.h>
1
+ #ifdef __cplusplus
2
2
 
3
- @interface ReactNativeBrownfieldModule : NSObject <RCTBridgeModule>
3
+ #import <React-RCTAppDelegate/RCTDefaultReactNativeFactoryDelegate.h>
4
+ #import <ReactNativeBrownfield/ReactNativeBrownfield.h>
5
+
6
+ @interface ReactNativeBrownfieldModule : NSObject <NativeReactNativeBrownfieldModuleSpec>
4
7
  @end
8
+
9
+ #endif
@@ -1,9 +1,9 @@
1
1
  #import "ReactNativeBrownfieldModule.h"
2
2
 
3
- #if __has_include("ReactNativeBrownfield/ReactNativeBrownfield-Swift.h")
4
- #import "ReactNativeBrownfield/ReactNativeBrownfield-Swift.h"
3
+ #if __has_include("ReactBrownfield/ReactBrownfield-Swift.h")
4
+ #import "ReactBrownfield/ReactBrownfield-Swift.h"
5
5
  #else
6
- #import "ReactNativeBrownfield-Swift.h"
6
+ #import "ReactBrownfield-Swift.h"
7
7
  #endif
8
8
 
9
9
  @implementation ReactNativeBrownfieldModule
@@ -18,4 +18,8 @@ RCT_EXPORT_METHOD(popToNative:(BOOL)animated) {
18
18
  [ReactNativeBrownfieldModuleImpl popToNativeWithAnimated:animated];
19
19
  }
20
20
 
21
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
22
+ return std::make_shared<facebook::react::NativeReactNativeBrownfieldModuleSpecJSI>(params);
23
+ }
24
+
21
25
  @end
@@ -6,11 +6,11 @@ import SwiftUI
6
6
  struct ReactNativeViewRepresentable: UIViewControllerRepresentable {
7
7
  var moduleName: String
8
8
  var initialProperties: [String: Any] = [:]
9
-
9
+
10
10
  func makeUIViewController(context: Context) -> UIViewController {
11
11
  return ReactNativeViewController(moduleName: moduleName)
12
12
  }
13
-
13
+
14
14
  func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
15
15
  }
16
16
 
@@ -18,16 +18,17 @@ struct ReactNativeViewRepresentable: UIViewControllerRepresentable {
18
18
  Exposes React Native view to SwiftUI.
19
19
  Supports pop to native when using SwiftUI's NavigationView or NavigationStack.
20
20
  */
21
+ @available(iOS 15.0, *)
21
22
  public struct ReactNativeView: View {
22
23
  @Environment(\.dismiss) var dismiss
23
24
  var moduleName: String
24
25
  var initialProperties: [String: Any] = [:]
25
-
26
+
26
27
  public init(moduleName: String, initialProperties: [String : Any] = [:]) {
27
28
  self.moduleName = moduleName
28
29
  self.initialProperties = initialProperties
29
30
  }
30
-
31
+
31
32
  public var body: some View {
32
33
  ReactNativeViewRepresentable(
33
34
  moduleName: moduleName,
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=exports.default=_reactNative.TurboModuleRegistry.getEnforcing('ReactNativeBrownfield');
2
+ //# sourceMappingURL=NativeReactNativeBrownfieldModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeReactNativeBrownfieldModule.ts"],"mappings":"gFACA,IAAAA,YAAA,CAAAC,OAAA,iBAAmD,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAqBpCC,gCAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,31 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactNative = require("react-native");
8
- var _RNBrownfieldSpec = _interopRequireDefault(require("./RNBrownfieldSpec"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const ReactNativeBrownfield = {
11
- popToNative: animated => {
12
- if (_reactNative.Platform.OS === 'ios') {
13
- _RNBrownfieldSpec.default.popToNative(animated);
14
- } else if (_reactNative.Platform.OS === 'android') {
15
- _RNBrownfieldSpec.default.popToNative();
16
- } else {
17
- console.warn('Not implemented: popToNative');
18
- }
19
- },
20
- setNativeBackGestureAndButtonEnabled: enabled => {
21
- if (_reactNative.Platform.OS === 'ios') {
22
- _RNBrownfieldSpec.default.setPopGestureRecognizerEnabled(enabled);
23
- } else if (_reactNative.Platform.OS === 'android') {
24
- _RNBrownfieldSpec.default.setHardwareBackButtonEnabled(enabled);
25
- } else {
26
- console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');
27
- }
28
- }
29
- };
30
- var _default = exports.default = ReactNativeBrownfield;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _NativeReactNativeBrownfieldModule=_interopRequireDefault(require("./NativeReactNativeBrownfieldModule"));var ReactNativeBrownfield={popToNative:function popToNative(animated){if(_reactNative.Platform.OS==='ios'){_NativeReactNativeBrownfieldModule.default.popToNative(!!animated);}else if(_reactNative.Platform.OS==='android'){_NativeReactNativeBrownfieldModule.default.popToNative(false);}else{console.warn('Not implemented: popToNative');}},setNativeBackGestureAndButtonEnabled:function setNativeBackGestureAndButtonEnabled(enabled){if(_reactNative.Platform.OS==='ios'){_NativeReactNativeBrownfieldModule.default.setPopGestureRecognizerEnabled(enabled);}else if(_reactNative.Platform.OS==='android'){_NativeReactNativeBrownfieldModule.default.setHardwareBackButtonEnabled(enabled);}else{console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');}}};var _default=exports.default=ReactNativeBrownfield;
31
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_RNBrownfieldSpec","_interopRequireDefault","e","__esModule","default","ReactNativeBrownfield","popToNative","animated","Platform","OS","ReactNativeBrownfieldModule","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled","_default","exports"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA6D,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7D,MAAMG,qBAAqB,GAAG;EAC5BC,WAAW,EAAGC,QAAkB,IAAW;IACzC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBC,yBAA2B,CAACJ,WAAW,CAACC,QAAQ,CAAC;IACnD,CAAC,MAAM,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MACpCC,yBAA2B,CAACJ,WAAW,CAAC,CAAC;IAC3C,CAAC,MAAM;MACLK,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;IAC9C;EACF,CAAC;EAEDC,oCAAoC,EAAGC,OAAgB,IAAW;IAChE,IAAIN,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBC,yBAA2B,CAACK,8BAA8B,CAACD,OAAO,CAAC;IACrE,CAAC,MAAM,IAAIN,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MACpCC,yBAA2B,CAACM,4BAA4B,CAACF,OAAO,CAAC;IACnE,CAAC,MAAM;MACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;IACrE;EACF;AACF,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEaC,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_NativeReactNativeBrownfieldModule","_interopRequireDefault","ReactNativeBrownfield","popToNative","animated","Platform","OS","ReactNativeBrownfieldModule","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled","_default","exports","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"mKAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,kCAAA,CAAAC,sBAAA,CAAAF,OAAA,yCAEA,GAAM,CAAAG,qBAAqB,CAAG,CAC5BC,WAAW,CAAE,QAAb,CAAAA,WAAWA,CAAGC,QAAkB,CAAW,CACzC,GAAIC,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzBC,0CAA2B,CAACJ,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,CACrD,CAAC,IAAM,IAAIC,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpCC,0CAA2B,CAACJ,WAAW,CAAC,KAAK,CAAC,CAChD,CAAC,IAAM,CACLK,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC,CAC9C,CACF,CAAC,CAEDC,oCAAoC,CAAE,QAAtC,CAAAA,oCAAoCA,CAAGC,OAAgB,CAAW,CAChE,GAAIN,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzBC,0CAA2B,CAACK,8BAA8B,CAACD,OAAO,CAAC,CACrE,CAAC,IAAM,IAAIN,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpCC,0CAA2B,CAACM,4BAA4B,CAACF,OAAO,CAAC,CACnE,CAAC,IAAM,CACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC,CACrE,CACF,CACF,CAAC,CAAC,IAAAK,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEad,qBAAqB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=exports.default=_reactNative.TurboModuleRegistry.getEnforcing('ReactNativeBrownfield');
2
+ //# sourceMappingURL=NativeReactNativeBrownfieldModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeReactNativeBrownfieldModule.ts"],"mappings":"gFACA,IAAAA,YAAA,CAAAC,OAAA,iBAAmD,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAqBpCC,gCAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,26 +1,2 @@
1
- "use strict";
2
-
3
- import { Platform } from 'react-native';
4
- import ReactNativeBrownfieldModule from './RNBrownfieldSpec';
5
- const ReactNativeBrownfield = {
6
- popToNative: animated => {
7
- if (Platform.OS === 'ios') {
8
- ReactNativeBrownfieldModule.popToNative(animated);
9
- } else if (Platform.OS === 'android') {
10
- ReactNativeBrownfieldModule.popToNative();
11
- } else {
12
- console.warn('Not implemented: popToNative');
13
- }
14
- },
15
- setNativeBackGestureAndButtonEnabled: enabled => {
16
- if (Platform.OS === 'ios') {
17
- ReactNativeBrownfieldModule.setPopGestureRecognizerEnabled(enabled);
18
- } else if (Platform.OS === 'android') {
19
- ReactNativeBrownfieldModule.setHardwareBackButtonEnabled(enabled);
20
- } else {
21
- console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');
22
- }
23
- }
24
- };
25
- export default ReactNativeBrownfield;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _NativeReactNativeBrownfieldModule=_interopRequireDefault(require("./NativeReactNativeBrownfieldModule"));var ReactNativeBrownfield={popToNative:function popToNative(animated){if(_reactNative.Platform.OS==='ios'){_NativeReactNativeBrownfieldModule.default.popToNative(!!animated);}else if(_reactNative.Platform.OS==='android'){_NativeReactNativeBrownfieldModule.default.popToNative(false);}else{console.warn('Not implemented: popToNative');}},setNativeBackGestureAndButtonEnabled:function setNativeBackGestureAndButtonEnabled(enabled){if(_reactNative.Platform.OS==='ios'){_NativeReactNativeBrownfieldModule.default.setPopGestureRecognizerEnabled(enabled);}else if(_reactNative.Platform.OS==='android'){_NativeReactNativeBrownfieldModule.default.setHardwareBackButtonEnabled(enabled);}else{console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');}}};var _default=exports.default=ReactNativeBrownfield;
26
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","ReactNativeBrownfieldModule","ReactNativeBrownfield","popToNative","animated","OS","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,2BAA2B,MAAM,oBAAoB;AAE5D,MAAMC,qBAAqB,GAAG;EAC5BC,WAAW,EAAGC,QAAkB,IAAW;IACzC,IAAIJ,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;MACzBJ,2BAA2B,CAACE,WAAW,CAACC,QAAQ,CAAC;IACnD,CAAC,MAAM,IAAIJ,QAAQ,CAACK,EAAE,KAAK,SAAS,EAAE;MACpCJ,2BAA2B,CAACE,WAAW,CAAC,CAAC;IAC3C,CAAC,MAAM;MACLG,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;IAC9C;EACF,CAAC;EAEDC,oCAAoC,EAAGC,OAAgB,IAAW;IAChE,IAAIT,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;MACzBJ,2BAA2B,CAACS,8BAA8B,CAACD,OAAO,CAAC;IACrE,CAAC,MAAM,IAAIT,QAAQ,CAACK,EAAE,KAAK,SAAS,EAAE;MACpCJ,2BAA2B,CAACU,4BAA4B,CAACF,OAAO,CAAC;IACnE,CAAC,MAAM;MACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;IACrE;EACF;AACF,CAAC;AAED,eAAeL,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_NativeReactNativeBrownfieldModule","_interopRequireDefault","ReactNativeBrownfield","popToNative","animated","Platform","OS","ReactNativeBrownfieldModule","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled","_default","exports","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"mKAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,kCAAA,CAAAC,sBAAA,CAAAF,OAAA,yCAEA,GAAM,CAAAG,qBAAqB,CAAG,CAC5BC,WAAW,CAAE,QAAb,CAAAA,WAAWA,CAAGC,QAAkB,CAAW,CACzC,GAAIC,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzBC,0CAA2B,CAACJ,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,CACrD,CAAC,IAAM,IAAIC,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpCC,0CAA2B,CAACJ,WAAW,CAAC,KAAK,CAAC,CAChD,CAAC,IAAM,CACLK,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC,CAC9C,CACF,CAAC,CAEDC,oCAAoC,CAAE,QAAtC,CAAAA,oCAAoCA,CAAGC,OAAgB,CAAW,CAChE,GAAIN,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzBC,0CAA2B,CAACK,8BAA8B,CAACD,OAAO,CAAC,CACrE,CAAC,IAAM,IAAIN,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpCC,0CAA2B,CAACM,4BAA4B,CAACF,OAAO,CAAC,CACnE,CAAC,IAAM,CACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC,CACrE,CACF,CACF,CAAC,CAAC,IAAAK,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEad,qBAAqB","ignoreList":[]}
@@ -3,7 +3,7 @@ export interface Spec extends TurboModule {
3
3
  /**
4
4
  * Navigate back to the native part of the application.
5
5
  */
6
- popToNative(animated?: boolean): void;
6
+ popToNative(animated: boolean): void;
7
7
  /**
8
8
  * Enable or disable the iOS swipe back gesture.
9
9
  * @platform ios
@@ -17,4 +17,4 @@ export interface Spec extends TurboModule {
17
17
  }
18
18
  declare const _default: Spec;
19
19
  export default _default;
20
- //# sourceMappingURL=RNBrownfieldSpec.d.ts.map
20
+ //# sourceMappingURL=NativeReactNativeBrownfieldModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeReactNativeBrownfieldModule.d.ts","sourceRoot":"","sources":["../../../../src/NativeReactNativeBrownfieldModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACtD;;AAED,wBAA+E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB;6BACA,OAAO,KAAG,IAAI;oDAUS,OAAO,KAAG,IAAI;CAS/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ /**
4
+ * Navigate back to the native part of the application.
5
+ */
6
+ popToNative(animated: boolean): void;
7
+ /**
8
+ * Enable or disable the iOS swipe back gesture.
9
+ * @platform ios
10
+ */
11
+ setPopGestureRecognizerEnabled(enabled: boolean): void;
12
+ /**
13
+ * Enable or disable the Android hardware back button.
14
+ * @platform android
15
+ */
16
+ setHardwareBackButtonEnabled(enabled: boolean): void;
17
+ }
18
+ declare const _default: Spec;
19
+ export default _default;
20
+ //# sourceMappingURL=NativeReactNativeBrownfieldModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeReactNativeBrownfieldModule.d.ts","sourceRoot":"","sources":["../../../../src/NativeReactNativeBrownfieldModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACtD;;AAED,wBAA+E"}
@@ -0,0 +1,6 @@
1
+ declare const ReactNativeBrownfield: {
2
+ popToNative: (animated?: boolean) => void;
3
+ setNativeBackGestureAndButtonEnabled: (enabled: boolean) => void;
4
+ };
5
+ export default ReactNativeBrownfield;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB;6BACA,OAAO,KAAG,IAAI;oDAUS,OAAO,KAAG,IAAI;CAS/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "contributors": [
@@ -10,8 +10,21 @@
10
10
  "description": "Brownfield helpers for React Native",
11
11
  "main": "lib/commonjs/index",
12
12
  "module": "lib/module/index",
13
- "types": "lib/typescript/src/index.d.ts",
13
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
14
14
  "react-native": "src/index",
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./lib/typescript/module/src/index.d.ts",
19
+ "default": "./lib/module/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
23
+ "default": "./lib/commonjs/index.js"
24
+ }
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
15
28
  "scripts": {
16
29
  "lint": "eslint . --fix",
17
30
  "typecheck": "tsc --noEmit",
@@ -117,9 +130,9 @@
117
130
  }
118
131
  },
119
132
  "codegenConfig": {
120
- "name": "RNBrownfieldSpec",
133
+ "name": "ReactNativeBrownfield",
121
134
  "type": "modules",
122
- "jsSrcsDir": "src",
135
+ "jsSrcsDir": "./src",
123
136
  "android": {
124
137
  "javaPackageName": "com.callstack.reactnativebrownfield"
125
138
  }
@@ -135,12 +148,25 @@
135
148
  "source": "src",
136
149
  "output": "lib",
137
150
  "targets": [
138
- "commonjs",
139
- "module",
151
+ [
152
+ "commonjs",
153
+ {
154
+ "esm": true,
155
+ "configFile": true
156
+ }
157
+ ],
158
+ [
159
+ "module",
160
+ {
161
+ "esm": true,
162
+ "configFile": true
163
+ }
164
+ ],
140
165
  [
141
166
  "typescript",
142
167
  {
143
- "project": "tsconfig.build.json"
168
+ "project": "tsconfig.build.json",
169
+ "esm": true
144
170
  }
145
171
  ]
146
172
  ]
@@ -5,7 +5,7 @@ export interface Spec extends TurboModule {
5
5
  /**
6
6
  * Navigate back to the native part of the application.
7
7
  */
8
- popToNative(animated?: boolean): void;
8
+ popToNative(animated: boolean): void;
9
9
 
10
10
  /**
11
11
  * Enable or disable the iOS swipe back gesture.
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Platform } from 'react-native';
2
- import ReactNativeBrownfieldModule from './RNBrownfieldSpec';
2
+ import ReactNativeBrownfieldModule from './NativeReactNativeBrownfieldModule';
3
3
 
4
4
  const ReactNativeBrownfield = {
5
5
  popToNative: (animated?: boolean): void => {
6
6
  if (Platform.OS === 'ios') {
7
- ReactNativeBrownfieldModule.popToNative(animated);
7
+ ReactNativeBrownfieldModule.popToNative(!!animated);
8
8
  } else if (Platform.OS === 'android') {
9
- ReactNativeBrownfieldModule.popToNative();
9
+ ReactNativeBrownfieldModule.popToNative(false);
10
10
  } else {
11
11
  console.warn('Not implemented: popToNative');
12
12
  }
@@ -1,27 +0,0 @@
1
- require 'json'
2
-
3
- is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4
- new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
5
- other_cflags = "$(inherited)" + new_arch_enabled_flag
6
-
7
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
8
-
9
- Pod::Spec.new do |spec|
10
- spec.name = "ReactNativeBrownfield"
11
- spec.version = package['version']
12
- spec.summary = package['description']
13
- spec.license = package['license']
14
-
15
- spec.authors = package['author']
16
- spec.homepage = package['homepage']
17
- spec.platform = :ios, "9.0"
18
-
19
- # s.source = { :git => "git@github.com/michalchudziak/react-native-brownfield.git", :tag => "v#{s.version}" }
20
- spec.source = { :path => "." }
21
- spec.source_files = "ios/**/*.{h,m,mm,swift}"
22
- spec.compiler_flags = new_arch_enabled_flag
23
- spec.pod_target_xcconfig = { 'OTHER_CPLUSPLUSFLAGS' => other_cflags, 'DEFINES_MODULE' => 'YES' }
24
-
25
- install_modules_dependencies(spec)
26
- spec.dependency 'ReactAppDependencyProvider'
27
- end
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactNative = require("react-native");
8
- var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('ReactNativeBrownfield');
9
- //# sourceMappingURL=RNBrownfieldSpec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["RNBrownfieldSpec.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAqBpCC,gCAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('ReactNativeBrownfield');
5
- //# sourceMappingURL=RNBrownfieldSpec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["RNBrownfieldSpec.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAqBlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RNBrownfieldSpec.d.ts","sourceRoot":"","sources":["../../../src/RNBrownfieldSpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;OAEG;IACH,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACtD;;AAED,wBAA+E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB;6BACA,OAAO,KAAG,IAAI;oDAUS,OAAO,KAAG,IAAI;CAS/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
File without changes
File without changes