@callstack/react-native-brownfield 0.0.2 → 0.1.0
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/README.md +2 -0
- package/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeActivity.kt +23 -5
- package/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt +10 -5
- package/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeFragment.kt +7 -5
- package/ios/ReactNativeBrownfield.m +1 -1
- package/ios/ReactNativeViewController.m +3 -1
- package/lib/commonjs/index.js +29 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +23 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +120 -17
- package/src/{index.js → index.ts} +3 -2
- package/.eslintrc.js +0 -6
- package/.flowconfig +0 -100
- package/CODE_OF_CONDUCT.md +0 -73
- package/android/.gradle/4.10/fileChanges/last-build.bin +0 -0
- package/android/.gradle/4.10/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/4.10/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/4.10/gc.properties +0 -0
- package/android/.gradle/5.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.1.1/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/encodings.xml +0 -4
- package/android/.idea/gradle.xml +0 -12
- package/android/.idea/misc.xml +0 -14
- package/android/.idea/runConfigurations.xml +0 -12
- package/android/.idea/vcs.xml +0 -6
- package/android/.idea/workspace.xml +0 -126
- package/android/android.iml +0 -16
- package/android/local.properties +0 -8
- package/android/react-native-brownfield.iml +0 -201
- package/babel.config.js +0 -13
- package/docs/JAVA.md +0 -305
- package/docs/KOTLIN.md +0 -274
- package/docs/OBJECTIVE_C.md +0 -150
- package/docs/SWIFT.md +0 -164
- package/prettier.config.js +0 -7
- package/react-native.config.js +0 -9
- package/types/index.d.ts +0 -11
package/README.md
CHANGED
|
@@ -83,6 +83,8 @@ ReactNativeBrownfield.popToNative(true);
|
|
|
83
83
|
|
|
84
84
|
React Native Brownfield is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack](https://callstack.com) is a group of React and React Native geeks, contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these or just want to say hi!
|
|
85
85
|
|
|
86
|
+
Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥
|
|
87
|
+
|
|
86
88
|
## Contributors
|
|
87
89
|
|
|
88
90
|
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
|
|
@@ -13,6 +13,7 @@ import com.facebook.react.devsupport.DoubleTapReloadRecognizer
|
|
|
13
13
|
import com.facebook.react.modules.core.PermissionListener
|
|
14
14
|
import com.facebook.react.bridge.Callback
|
|
15
15
|
import com.facebook.react.bridge.ReadableMap
|
|
16
|
+
import com.facebook.react.common.DebugServerException
|
|
16
17
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
17
18
|
import com.facebook.react.modules.core.PermissionAwareActivity
|
|
18
19
|
|
|
@@ -39,10 +40,9 @@ class ReactNativeActivity : ReactActivity(), DefaultHardwareBackBtnHandler, Perm
|
|
|
39
40
|
)
|
|
40
41
|
|
|
41
42
|
supportActionBar?.hide()
|
|
42
|
-
|
|
43
43
|
setContentView(reactRootView)
|
|
44
|
-
|
|
45
44
|
doubleTapReloadRecognizer = DoubleTapReloadRecognizer()
|
|
45
|
+
checkPackagerConnection()
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
override fun onDestroy() {
|
|
@@ -84,9 +84,11 @@ class ReactNativeActivity : ReactActivity(), DefaultHardwareBackBtnHandler, Perm
|
|
|
84
84
|
ReactNativeBrownfield.shared.reactNativeHost.reactInstanceManager.showDevOptionsDialog()
|
|
85
85
|
return true
|
|
86
86
|
}
|
|
87
|
-
val didDoubleTapR =
|
|
88
|
-
.
|
|
89
|
-
|
|
87
|
+
val didDoubleTapR = this.currentFocus?.let {
|
|
88
|
+
Assertions.assertNotNull(doubleTapReloadRecognizer)
|
|
89
|
+
.didDoubleTapR(keyCode, it)
|
|
90
|
+
}
|
|
91
|
+
if (didDoubleTapR == true) {
|
|
90
92
|
ReactNativeBrownfield.shared.reactNativeHost.reactInstanceManager.devSupportManager.handleReloadJS()
|
|
91
93
|
return true
|
|
92
94
|
}
|
|
@@ -132,6 +134,7 @@ class ReactNativeActivity : ReactActivity(), DefaultHardwareBackBtnHandler, Perm
|
|
|
132
134
|
permissions: Array<String>,
|
|
133
135
|
grantResults: IntArray
|
|
134
136
|
) {
|
|
137
|
+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
135
138
|
permissionsCallback = Callback {
|
|
136
139
|
if (permissionListener != null) {
|
|
137
140
|
permissionListener?.onRequestPermissionsResult(
|
|
@@ -145,6 +148,21 @@ class ReactNativeActivity : ReactActivity(), DefaultHardwareBackBtnHandler, Perm
|
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
150
|
|
|
151
|
+
private fun checkPackagerConnection() {
|
|
152
|
+
if (ReactNativeBrownfield.shared.reactNativeHost.hasInstance() && ReactNativeBrownfield.shared.reactNativeHost.useDeveloperSupport) {
|
|
153
|
+
val devSupportManager =
|
|
154
|
+
ReactNativeBrownfield.shared.reactNativeHost.reactInstanceManager.devSupportManager
|
|
155
|
+
val url = devSupportManager.sourceUrl
|
|
156
|
+
devSupportManager?.isPackagerRunning { isRunning ->
|
|
157
|
+
if (!isRunning) {
|
|
158
|
+
val error = Error()
|
|
159
|
+
val message = DebugServerException.makeGeneric(url, "Could not connect to development server.", "URL: $url", error).message
|
|
160
|
+
devSupportManager.showNewJavaError(message, error)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
148
166
|
companion object {
|
|
149
167
|
@JvmStatic
|
|
150
168
|
@JvmOverloads
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
package com.callstack.reactnativebrownfield
|
|
2
2
|
|
|
3
3
|
import android.app.Application
|
|
4
|
+
import com.facebook.react.ReactInstanceEventListener
|
|
4
5
|
import com.facebook.react.ReactNativeHost
|
|
5
6
|
import com.facebook.react.ReactPackage
|
|
7
|
+
import com.facebook.react.bridge.ReactContext
|
|
6
8
|
import com.facebook.soloader.SoLoader
|
|
7
9
|
import java.util.concurrent.atomic.AtomicBoolean
|
|
8
10
|
|
|
@@ -60,10 +62,13 @@ class ReactNativeBrownfield private constructor(val reactNativeHost: ReactNative
|
|
|
60
62
|
|
|
61
63
|
@JvmName("startReactNativeKotlin")
|
|
62
64
|
fun startReactNative(callback: ((initialized: Boolean) -> Unit)?) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
reactNativeHost.reactInstanceManager.addReactInstanceEventListener(object : ReactInstanceEventListener {
|
|
66
|
+
override fun onReactContextInitialized(reactContext: ReactContext) {
|
|
67
|
+
callback?.let { it(true) }
|
|
68
|
+
reactNativeHost.reactInstanceManager.removeReactInstanceEventListener(this)
|
|
69
|
+
}
|
|
70
|
+
})
|
|
67
71
|
reactNativeHost.reactInstanceManager?.createReactContextInBackground()
|
|
68
72
|
}
|
|
69
|
-
}
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -103,12 +103,12 @@ class ReactNativeFragment : Fragment(), PermissionAwareActivity {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
override fun checkPermission(permission: String, pid: Int, uid: Int): Int {
|
|
106
|
-
return
|
|
106
|
+
return requireActivity().checkPermission(permission, pid, uid)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
@TargetApi(Build.VERSION_CODES.M)
|
|
110
110
|
override fun checkSelfPermission(permission: String): Int {
|
|
111
|
-
return
|
|
111
|
+
return requireActivity().checkSelfPermission(permission)
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
@TargetApi(Build.VERSION_CODES.M)
|
|
@@ -128,9 +128,11 @@ class ReactNativeFragment : Fragment(), PermissionAwareActivity {
|
|
|
128
128
|
ReactNativeBrownfield.shared.reactNativeHost.reactInstanceManager.showDevOptionsDialog()
|
|
129
129
|
handled = true
|
|
130
130
|
}
|
|
131
|
-
val didDoubleTapR =
|
|
132
|
-
.
|
|
133
|
-
|
|
131
|
+
val didDoubleTapR = activity?.currentFocus?.let {
|
|
132
|
+
Assertions.assertNotNull(doubleTapReloadRecognizer)
|
|
133
|
+
.didDoubleTapR(keyCode, it)
|
|
134
|
+
}
|
|
135
|
+
if (didDoubleTapR == true) {
|
|
134
136
|
ReactNativeBrownfield.shared.reactNativeHost.reactInstanceManager.devSupportManager.handleReloadJS()
|
|
135
137
|
handled = true
|
|
136
138
|
}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
|
|
64
64
|
#if DEBUG
|
|
65
|
-
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:_entryFile
|
|
65
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:_entryFile];
|
|
66
66
|
#else
|
|
67
67
|
NSArray<NSString *> *resourceURLComponents = [_bundlePath componentsSeparatedByString:@"."];
|
|
68
68
|
NSRange withoutLast;
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
- (void)togglePopGestureRecognizer:(NSNotification*)notification {
|
|
50
50
|
NSDictionary *userInfo = notification.userInfo;
|
|
51
51
|
BOOL enabled = [[userInfo objectForKey:@"enabled"] boolValue];
|
|
52
|
-
|
|
52
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
53
|
+
self.navigationController.interactivePopGestureRecognizer.enabled = enabled;
|
|
54
|
+
});
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
- (void)popToNative:(NSNotification*)notification {
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
const ReactNativeBrownfield = {
|
|
9
|
+
popToNative: animated => {
|
|
10
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
11
|
+
_reactNative.NativeModules.ReactNativeBrownfield.popToNative(animated);
|
|
12
|
+
} else if (_reactNative.Platform.OS === 'android') {
|
|
13
|
+
_reactNative.NativeModules.ReactNativeBrownfield.popToNative();
|
|
14
|
+
} else {
|
|
15
|
+
console.warn('Not implemented: popToNative');
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setNativeBackGestureAndButtonEnabled: enabled => {
|
|
19
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
20
|
+
_reactNative.NativeModules.ReactNativeBrownfield.setPopGestureRecognizerEnabled(enabled);
|
|
21
|
+
} else if (_reactNative.Platform.OS === 'android') {
|
|
22
|
+
_reactNative.NativeModules.ReactNativeBrownfield.setHardwareBackButtonEnabled(enabled);
|
|
23
|
+
} else {
|
|
24
|
+
console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = ReactNativeBrownfield;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","ReactNativeBrownfield","popToNative","animated","Platform","OS","NativeModules","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled","_default","exports","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,qBAAqB,GAAG;EAC5BC,WAAW,EAAGC,QAAkB,IAAW;IACzC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBC,0BAAa,CAACL,qBAAqB,CAACC,WAAW,CAACC,QAAQ,CAAC;IAC3D,CAAC,MAAM,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MACpCC,0BAAa,CAACL,qBAAqB,CAACC,WAAW,CAAC,CAAC;IACnD,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,0BAAa,CAACL,qBAAqB,CAACU,8BAA8B,CAChED,OACF,CAAC;IACH,CAAC,MAAM,IAAIN,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MACpCC,0BAAa,CAACL,qBAAqB,CAACW,4BAA4B,CAACF,OAAO,CAAC;IAC3E,CAAC,MAAM;MACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;IACrE;EACF;AACF,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const ReactNativeBrownfield = {
|
|
3
|
+
popToNative: animated => {
|
|
4
|
+
if (Platform.OS === 'ios') {
|
|
5
|
+
NativeModules.ReactNativeBrownfield.popToNative(animated);
|
|
6
|
+
} else if (Platform.OS === 'android') {
|
|
7
|
+
NativeModules.ReactNativeBrownfield.popToNative();
|
|
8
|
+
} else {
|
|
9
|
+
console.warn('Not implemented: popToNative');
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setNativeBackGestureAndButtonEnabled: enabled => {
|
|
13
|
+
if (Platform.OS === 'ios') {
|
|
14
|
+
NativeModules.ReactNativeBrownfield.setPopGestureRecognizerEnabled(enabled);
|
|
15
|
+
} else if (Platform.OS === 'android') {
|
|
16
|
+
NativeModules.ReactNativeBrownfield.setHardwareBackButtonEnabled(enabled);
|
|
17
|
+
} else {
|
|
18
|
+
console.warn('Not implemented: setNativeGesturesAndButtonsEnabled');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default ReactNativeBrownfield;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","ReactNativeBrownfield","popToNative","animated","OS","console","warn","setNativeBackGestureAndButtonEnabled","enabled","setPopGestureRecognizerEnabled","setHardwareBackButtonEnabled"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAAQA,aAAa,EAAEC,QAAQ,QAAO,cAAc;AAEpD,MAAMC,qBAAqB,GAAG;EAC5BC,WAAW,EAAGC,QAAkB,IAAW;IACzC,IAAIH,QAAQ,CAACI,EAAE,KAAK,KAAK,EAAE;MACzBL,aAAa,CAACE,qBAAqB,CAACC,WAAW,CAACC,QAAQ,CAAC;IAC3D,CAAC,MAAM,IAAIH,QAAQ,CAACI,EAAE,KAAK,SAAS,EAAE;MACpCL,aAAa,CAACE,qBAAqB,CAACC,WAAW,CAAC,CAAC;IACnD,CAAC,MAAM;MACLG,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;IAC9C;EACF,CAAC;EAEDC,oCAAoC,EAAGC,OAAgB,IAAW;IAChE,IAAIR,QAAQ,CAACI,EAAE,KAAK,KAAK,EAAE;MACzBL,aAAa,CAACE,qBAAqB,CAACQ,8BAA8B,CAChED,OACF,CAAC;IACH,CAAC,MAAM,IAAIR,QAAQ,CAACI,EAAE,KAAK,SAAS,EAAE;MACpCL,aAAa,CAACE,qBAAqB,CAACS,4BAA4B,CAACF,OAAO,CAAC;IAC3E,CAAC,MAAM;MACLH,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;IACrE;EACF;AACF,CAAC;AAED,eAAeL,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,qBAAqB;6BACA,OAAO,KAAG,IAAI;oDAUS,OAAO,KAAG,IAAI;CAW/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": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://github.com/callstack/react-native-brownfield",
|
|
10
10
|
"description": "Brownfield helpers for React Native",
|
|
11
|
-
"main": "
|
|
11
|
+
"main": "lib/commonjs/index",
|
|
12
|
+
"module": "lib/module/index",
|
|
13
|
+
"types": "lib/typescript/src/index.d.ts",
|
|
14
|
+
"react-native": "src/index",
|
|
12
15
|
"scripts": {
|
|
13
16
|
"start": "react-native start --reset-cache",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
17
|
+
"lint": "eslint . --fix",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"release": "release-it",
|
|
20
|
+
"prepare": "bob build"
|
|
16
21
|
},
|
|
17
22
|
"keywords": [
|
|
18
23
|
"react-native-brownfield",
|
|
@@ -20,25 +25,123 @@
|
|
|
20
25
|
"native",
|
|
21
26
|
"react native integration"
|
|
22
27
|
],
|
|
28
|
+
"files": [
|
|
29
|
+
"src",
|
|
30
|
+
"lib",
|
|
31
|
+
"android",
|
|
32
|
+
"ios",
|
|
33
|
+
"cpp",
|
|
34
|
+
"*.podspec",
|
|
35
|
+
"!ios/build",
|
|
36
|
+
"!android/build",
|
|
37
|
+
"!android/gradle",
|
|
38
|
+
"!android/gradlew",
|
|
39
|
+
"!android/gradlew.bat",
|
|
40
|
+
"!android/local.properties",
|
|
41
|
+
"!**/__tests__",
|
|
42
|
+
"!**/__fixtures__",
|
|
43
|
+
"!**/__mocks__",
|
|
44
|
+
"!**/.*"
|
|
45
|
+
],
|
|
23
46
|
"publishConfig": {
|
|
24
47
|
"access": "public"
|
|
25
48
|
},
|
|
26
|
-
"
|
|
49
|
+
"resolutions": {
|
|
50
|
+
"@types/react": "18.2.0"
|
|
51
|
+
},
|
|
27
52
|
"peerDependencies": {
|
|
28
53
|
"react": "*",
|
|
29
54
|
"react-native": "*"
|
|
30
55
|
},
|
|
31
56
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "7.
|
|
33
|
-
"@babel/
|
|
34
|
-
"@
|
|
35
|
-
"babel-
|
|
36
|
-
"eslint": "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"react": "
|
|
40
|
-
"react-native": "
|
|
41
|
-
"
|
|
42
|
-
"react
|
|
43
|
-
|
|
57
|
+
"@babel/core": "^7.20.0",
|
|
58
|
+
"@babel/preset-env": "^7.20.0",
|
|
59
|
+
"@babel/runtime": "^7.20.0",
|
|
60
|
+
"@react-native/babel-preset": "0.74.84",
|
|
61
|
+
"@react-native/eslint-config": "0.74.84",
|
|
62
|
+
"@react-native/metro-config": "0.74.84",
|
|
63
|
+
"@react-native/typescript-config": "0.74.84",
|
|
64
|
+
"@react-navigation/native": "^6.1.17",
|
|
65
|
+
"@react-navigation/native-stack": "^6.9.17",
|
|
66
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
67
|
+
"@types/react": "^18.2.6",
|
|
68
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
69
|
+
"babel-jest": "^29.6.3",
|
|
70
|
+
"babel-plugin-module-resolver": "5.0.0",
|
|
71
|
+
"eslint": "^8.19.0",
|
|
72
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
73
|
+
"jest": "^29.6.3",
|
|
74
|
+
"metro-react-native-babel-preset": "0.77.0",
|
|
75
|
+
"prettier": "^3.0.2",
|
|
76
|
+
"react": "18.2.0",
|
|
77
|
+
"react-native": "0.74.2",
|
|
78
|
+
"react-native-builder-bob": "^0.20.0",
|
|
79
|
+
"react-native-gesture-handler": "2.16.2",
|
|
80
|
+
"react-native-safe-area-context": "^4.10.4",
|
|
81
|
+
"react-native-screens": "^3.31.1",
|
|
82
|
+
"react-test-renderer": "18.2.0",
|
|
83
|
+
"release-it": "^15.0.0",
|
|
84
|
+
"typescript": "^5.0.4"
|
|
85
|
+
},
|
|
86
|
+
"release-it": {
|
|
87
|
+
"git": {
|
|
88
|
+
"commitMessage": "chore: release ${version}",
|
|
89
|
+
"tagName": "v${version}"
|
|
90
|
+
},
|
|
91
|
+
"npm": {
|
|
92
|
+
"publish": true
|
|
93
|
+
},
|
|
94
|
+
"github": {
|
|
95
|
+
"release": true
|
|
96
|
+
},
|
|
97
|
+
"plugins": {
|
|
98
|
+
"@release-it/conventional-changelog": {
|
|
99
|
+
"preset": "angular"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"eslintConfig": {
|
|
104
|
+
"root": true,
|
|
105
|
+
"extends": [
|
|
106
|
+
"@react-native",
|
|
107
|
+
"prettier"
|
|
108
|
+
],
|
|
109
|
+
"rules": {
|
|
110
|
+
"prettier/prettier": [
|
|
111
|
+
"error",
|
|
112
|
+
{
|
|
113
|
+
"quoteProps": "consistent",
|
|
114
|
+
"singleQuote": true,
|
|
115
|
+
"tabWidth": 2,
|
|
116
|
+
"trailingComma": "es5",
|
|
117
|
+
"useTabs": false
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"prettier": {
|
|
123
|
+
"quoteProps": "consistent",
|
|
124
|
+
"singleQuote": true,
|
|
125
|
+
"tabWidth": 2,
|
|
126
|
+
"trailingComma": "es5",
|
|
127
|
+
"useTabs": false
|
|
128
|
+
},
|
|
129
|
+
"react-native-builder-bob": {
|
|
130
|
+
"source": "src",
|
|
131
|
+
"output": "lib",
|
|
132
|
+
"targets": [
|
|
133
|
+
"commonjs",
|
|
134
|
+
"module",
|
|
135
|
+
[
|
|
136
|
+
"typescript",
|
|
137
|
+
{
|
|
138
|
+
"project": "tsconfig.build.json"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"engines": {
|
|
144
|
+
"node": ">=18"
|
|
145
|
+
},
|
|
146
|
+
"packageManager": "yarn@3.6.4"
|
|
44
147
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/* @flow */
|
|
2
1
|
import {NativeModules, Platform} from 'react-native';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const ReactNativeBrownfield = {
|
|
5
4
|
popToNative: (animated?: boolean): void => {
|
|
6
5
|
if (Platform.OS === 'ios') {
|
|
7
6
|
NativeModules.ReactNativeBrownfield.popToNative(animated);
|
|
@@ -24,3 +23,5 @@ module.exports = {
|
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
25
|
};
|
|
26
|
+
|
|
27
|
+
export default ReactNativeBrownfield;
|
package/.eslintrc.js
DELETED
package/.flowconfig
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
[ignore]
|
|
2
|
-
; We fork some components by platform
|
|
3
|
-
.*/*[.]android.js
|
|
4
|
-
|
|
5
|
-
; Ignore "BUCK" generated dirs
|
|
6
|
-
<PROJECT_ROOT>/\.buckd/
|
|
7
|
-
|
|
8
|
-
; Ignore unexpected extra "@providesModule"
|
|
9
|
-
.*/node_modules/.*/node_modules/fbjs/.*
|
|
10
|
-
|
|
11
|
-
; Ignore duplicate module providers
|
|
12
|
-
; For RN Apps installed via npm, "Libraries" folder is inside
|
|
13
|
-
; "node_modules/react-native" but in the source repo it is in the root
|
|
14
|
-
node_modules/react-native/Libraries/react-native/React.js
|
|
15
|
-
|
|
16
|
-
; Ignore polyfills
|
|
17
|
-
node_modules/react-native/Libraries/polyfills/.*
|
|
18
|
-
|
|
19
|
-
; These should not be required directly
|
|
20
|
-
; require from fbjs/lib instead: require('fbjs/lib/warning')
|
|
21
|
-
node_modules/warning/.*
|
|
22
|
-
|
|
23
|
-
; Flow doesn't support platforms
|
|
24
|
-
.*/Libraries/Utilities/HMRLoadingView.js
|
|
25
|
-
|
|
26
|
-
[untyped]
|
|
27
|
-
.*/node_modules/@react-native-community/cli/.*/.*
|
|
28
|
-
|
|
29
|
-
[include]
|
|
30
|
-
|
|
31
|
-
[libs]
|
|
32
|
-
node_modules/react-native/Libraries/react-native/react-native-interface.js
|
|
33
|
-
node_modules/react-native/flow/
|
|
34
|
-
|
|
35
|
-
[options]
|
|
36
|
-
emoji=true
|
|
37
|
-
|
|
38
|
-
esproposal.optional_chaining=enable
|
|
39
|
-
esproposal.nullish_coalescing=enable
|
|
40
|
-
|
|
41
|
-
module.file_ext=.js
|
|
42
|
-
module.file_ext=.json
|
|
43
|
-
module.file_ext=.ios.js
|
|
44
|
-
|
|
45
|
-
module.system=haste
|
|
46
|
-
module.system.haste.use_name_reducers=true
|
|
47
|
-
# get basename
|
|
48
|
-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
|
|
49
|
-
# strip .js or .js.flow suffix
|
|
50
|
-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
|
|
51
|
-
# strip .ios suffix
|
|
52
|
-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
|
|
53
|
-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
|
|
54
|
-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
|
|
55
|
-
module.system.haste.paths.blacklist=.*/__tests__/.*
|
|
56
|
-
module.system.haste.paths.blacklist=.*/__mocks__/.*
|
|
57
|
-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
|
|
58
|
-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
|
|
59
|
-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
|
|
60
|
-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
|
|
61
|
-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
|
|
62
|
-
|
|
63
|
-
munge_underscores=true
|
|
64
|
-
|
|
65
|
-
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
|
|
66
|
-
module.name_mapper='^\@react-native-community/slider\(.*\)$' -> '<PROJECT_ROOT>/js/Slider.js\1'
|
|
67
|
-
|
|
68
|
-
suppress_type=$FlowIssue
|
|
69
|
-
suppress_type=$FlowFixMe
|
|
70
|
-
suppress_type=$FlowFixMeProps
|
|
71
|
-
suppress_type=$FlowFixMeState
|
|
72
|
-
|
|
73
|
-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
|
|
74
|
-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
|
|
75
|
-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
|
76
|
-
|
|
77
|
-
[lints]
|
|
78
|
-
sketchy-null-number=warn
|
|
79
|
-
sketchy-null-mixed=warn
|
|
80
|
-
sketchy-number=warn
|
|
81
|
-
untyped-type-import=warn
|
|
82
|
-
nonstrict-import=warn
|
|
83
|
-
deprecated-type=warn
|
|
84
|
-
unsafe-getters-setters=warn
|
|
85
|
-
inexact-spread=warn
|
|
86
|
-
unnecessary-invariant=warn
|
|
87
|
-
signature-verification-failure=warn
|
|
88
|
-
deprecated-utility=error
|
|
89
|
-
|
|
90
|
-
[strict]
|
|
91
|
-
deprecated-type
|
|
92
|
-
nonstrict-import
|
|
93
|
-
sketchy-null
|
|
94
|
-
unclear-type
|
|
95
|
-
unsafe-getters-setters
|
|
96
|
-
untyped-import
|
|
97
|
-
untyped-type-import
|
|
98
|
-
|
|
99
|
-
[version]
|
|
100
|
-
^0.98.0
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
-
orientation.
|
|
11
|
-
|
|
12
|
-
## Our Standards
|
|
13
|
-
|
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
|
15
|
-
include:
|
|
16
|
-
|
|
17
|
-
* Using welcoming and inclusive language
|
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
|
19
|
-
* Gracefully accepting constructive criticism
|
|
20
|
-
* Focusing on what is best for the community
|
|
21
|
-
* Showing empathy towards other community members
|
|
22
|
-
|
|
23
|
-
Examples of unacceptable behavior by participants include:
|
|
24
|
-
|
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
-
advances
|
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
-
* Public or private harassment
|
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
|
30
|
-
address, without explicit permission
|
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
-
professional setting
|
|
33
|
-
|
|
34
|
-
## Our Responsibilities
|
|
35
|
-
|
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
-
response to any instances of unacceptable behavior.
|
|
39
|
-
|
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
-
threatening, offensive, or harmful.
|
|
45
|
-
|
|
46
|
-
## Scope
|
|
47
|
-
|
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
-
when an individual is representing the project or its community. Examples of
|
|
50
|
-
representing a project or community include using an official project e-mail
|
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
|
53
|
-
further defined and clarified by project maintainers.
|
|
54
|
-
|
|
55
|
-
## Enforcement
|
|
56
|
-
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at [oss@callstack.io](mailto:oss@callstack.io). All
|
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
|
63
|
-
|
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
-
members of the project's leadership.
|
|
67
|
-
|
|
68
|
-
## Attribution
|
|
69
|
-
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/
|
|
72
|
-
|
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/android/.idea/gradle.xml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleSettings">
|
|
4
|
-
<option name="linkedExternalProjectsSettings">
|
|
5
|
-
<GradleProjectSettings>
|
|
6
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
7
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
8
|
-
<option name="resolveModulePerSourceSet" value="false" />
|
|
9
|
-
</GradleProjectSettings>
|
|
10
|
-
</option>
|
|
11
|
-
</component>
|
|
12
|
-
</project>
|
package/android/.idea/misc.xml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="CMakeSettings">
|
|
4
|
-
<configurations>
|
|
5
|
-
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
|
6
|
-
</configurations>
|
|
7
|
-
</component>
|
|
8
|
-
<component name="ProjectRootManager">
|
|
9
|
-
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
10
|
-
</component>
|
|
11
|
-
<component name="ProjectType">
|
|
12
|
-
<option name="id" value="Android" />
|
|
13
|
-
</component>
|
|
14
|
-
</project>
|