@callstack/react-native-brownfield 0.0.3 → 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/docs/OBJECTIVE_C.md
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
## Objective-C
|
|
2
|
-
|
|
3
|
-
React Native Brownfield provides first-class support for Objective-C.
|
|
4
|
-
|
|
5
|
-
### Linking
|
|
6
|
-
|
|
7
|
-
The library is meant to work with [auto linking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). In case you can't use this feature, please check out the following options:
|
|
8
|
-
|
|
9
|
-
<details>
|
|
10
|
-
<summary>react-native link</summary>
|
|
11
|
-
Run the following command in your terminal:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
react-native link @react-native-community/slider
|
|
15
|
-
```
|
|
16
|
-
</details>
|
|
17
|
-
|
|
18
|
-
<details>
|
|
19
|
-
<summary>CocoaPods</summary>
|
|
20
|
-
Add the following line to your `Podfile`:
|
|
21
|
-
|
|
22
|
-
```ruby
|
|
23
|
-
pod 'ReactNativeBrownfield', :path => '../node_modules/@callstack/react-native-brownfield/ios'
|
|
24
|
-
```
|
|
25
|
-
</details>
|
|
26
|
-
|
|
27
|
-
<details>
|
|
28
|
-
<summary>Manually link the library on iOS</summary>
|
|
29
|
-
|
|
30
|
-
### `Open project.xcodeproj in Xcode`
|
|
31
|
-
|
|
32
|
-
Drag `ReactNativeBrownfield.xcodeproj` to your project on Xcode (usually under the Libraries group on Xcode):
|
|
33
|
-
|
|
34
|
-

|
|
35
|
-
|
|
36
|
-
### Link `libReactNativeBrownfield.a` binary with libraries
|
|
37
|
-
|
|
38
|
-
Click on your main project file (the one that represents the `.xcodeproj`) select `Build Phases` and drag the static library from the `Products` folder inside the Library you are importing to `Link Binary With Libraries` (or use the `+` sign and choose library from the list):
|
|
39
|
-
|
|
40
|
-

|
|
41
|
-
</details>
|
|
42
|
-
|
|
43
|
-
### API Reference
|
|
44
|
-
|
|
45
|
-
#### ReactNativeBrownfield
|
|
46
|
-
|
|
47
|
-
You can import the object from:
|
|
48
|
-
|
|
49
|
-
```objc
|
|
50
|
-
#import <ReactNativeBrownfield/ReactNativeBrownfield.h>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
**Statics:**
|
|
56
|
-
|
|
57
|
-
`shared`
|
|
58
|
-
|
|
59
|
-
A singleton that keeps an instance of ReactNativeBrownfield object.
|
|
60
|
-
|
|
61
|
-
Examples:
|
|
62
|
-
|
|
63
|
-
```objc
|
|
64
|
-
[ReactNativeBrownfield shared]
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
**Properties:**
|
|
70
|
-
|
|
71
|
-
| Property | Type | Default | Description |
|
|
72
|
-
| -------------------- | --------- | -------------- | -------------------------------------------------- |
|
|
73
|
-
| bridge | RCTBridge | nil | Launch options, typically passed from AppDelegate. |
|
|
74
|
-
| entryFile | NSString | index | Path to JavaScript root. |
|
|
75
|
-
| fallbackResource | NSString | nil | Path to bundle fallback resource. |
|
|
76
|
-
| bundlePath | NSString | main.jsbundle | Path to bundle fallback resource. |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
**Methods:**
|
|
81
|
-
|
|
82
|
-
`startReactNative`
|
|
83
|
-
|
|
84
|
-
Starts React Native, produces an instance of a bridge. You can use it to initialize React Native in your app.
|
|
85
|
-
|
|
86
|
-
Params:
|
|
87
|
-
|
|
88
|
-
| Param | Required | Type | Description |
|
|
89
|
-
| ----------------------- | -------- | ------------- | ----------------------------------------------------- |
|
|
90
|
-
| onBundleLoaded | No | void(^)(void) | Callback invoked after JS bundle is fully loaded. |
|
|
91
|
-
| launchOptions | No | NSDictionary | Launch options, typically passed from AppDelegate. |
|
|
92
|
-
|
|
93
|
-
Examples:
|
|
94
|
-
|
|
95
|
-
```objc
|
|
96
|
-
[[ReactNativeBrownfield shared] startReactNative];
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
```objc
|
|
100
|
-
[[ReactNativeBrownfield shared] startReactNative:^(void){
|
|
101
|
-
NSLog(@"React Native started");
|
|
102
|
-
}];
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
```objc
|
|
106
|
-
[[ReactNativeBrownfield shared] startReactNative:^(void){
|
|
107
|
-
NSLog(@"React Native started");
|
|
108
|
-
}, launchOptions];
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
#### ReactNativeViewController
|
|
114
|
-
|
|
115
|
-
A view controller that's rendering `RCTRootView` within its bounds. It automatically uses an instance of a bridge created in `startReactNative` method. It works well with exposed JavaScript module. It's the simplest way to embed React Native into your navigation stack.
|
|
116
|
-
|
|
117
|
-
You can import it from:
|
|
118
|
-
|
|
119
|
-
```objc
|
|
120
|
-
#import <ReactNativeBrownfield/ReactNativeViewController.h>
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
**Constructors:**
|
|
126
|
-
|
|
127
|
-
`[ReactNativeViewController initWithModuleName:moduleName andInitialProperties:initialProps]`
|
|
128
|
-
|
|
129
|
-
| Param | Required | Type | Description |
|
|
130
|
-
| ------------------ | --------- | ------------- | ------------------------------------------------------------- |
|
|
131
|
-
| moduleName | Yes | NSString | Name of React Native component registered to `AppRegistry`. |
|
|
132
|
-
| initialProperties | No | NSString | Initial properties to be passed to React Native component. |
|
|
133
|
-
|
|
134
|
-
Examples:
|
|
135
|
-
|
|
136
|
-
```objc
|
|
137
|
-
[[ReactNativeViewController alloc] initWithModuleName:@"ReactNative"]
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```objc
|
|
141
|
-
[[ReactNativeViewController alloc] initWithModuleName:@"ReactNative" andInitialProperties:@{@"score": 12}]
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
### Example
|
|
147
|
-
|
|
148
|
-
You can find an example app [here](../example/objc).
|
|
149
|
-
|
|
150
|
-
|
package/docs/SWIFT.md
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
## Swift
|
|
2
|
-
|
|
3
|
-
React Native Brownfield provides first-class support for Swift.
|
|
4
|
-
|
|
5
|
-
### `use_frameworks!` support
|
|
6
|
-
|
|
7
|
-
It is possible to build `react-native-brownfield` with `use_frameworks!` directive in CocoaPods as long as `React` can be built this way.
|
|
8
|
-
|
|
9
|
-
| React Native version | `use_frameworks!` compatibility |
|
|
10
|
-
| -------------------------- | ------------------------------- |
|
|
11
|
-
| <= 0.59.X | Compatible |
|
|
12
|
-
| 0.60.X | Not compatible |
|
|
13
|
-
| 0.61.0-rc.0 | Not compatible |
|
|
14
|
-
|
|
15
|
-
Please reffer to [this issue](https://github.com/facebook/react-native/issues/25349) to learn more about `use_frameworks!` state in React Native.
|
|
16
|
-
|
|
17
|
-
Until this behavior is fixed, you can access `react-native-brownfield` API in Swift via [Bridging Header](../example/swift/BridgingHeader.h).
|
|
18
|
-
|
|
19
|
-
### Linking
|
|
20
|
-
|
|
21
|
-
The library is meant to work with [auto linking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). In case you can't use this feature, please check out the following options:
|
|
22
|
-
|
|
23
|
-
<details>
|
|
24
|
-
<summary>react-native link</summary>
|
|
25
|
-
Run the following command in your terminal:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
react-native link @react-native-community/slider
|
|
29
|
-
```
|
|
30
|
-
</details>
|
|
31
|
-
|
|
32
|
-
<details>
|
|
33
|
-
<summary>CocoaPods</summary>
|
|
34
|
-
Add the following line to your `Podfile`:
|
|
35
|
-
|
|
36
|
-
```ruby
|
|
37
|
-
pod 'ReactNativeBrownfield', :path => '../node_modules/@callstack/react-native-brownfield/ios'
|
|
38
|
-
```
|
|
39
|
-
</details>
|
|
40
|
-
|
|
41
|
-
<details>
|
|
42
|
-
<summary>Manually link the library on iOS</summary>
|
|
43
|
-
|
|
44
|
-
### `Open project.xcodeproj in Xcode`
|
|
45
|
-
|
|
46
|
-
Drag `ReactNativeBrownfield.xcodeproj` to your project on Xcode (usually under the Libraries group on Xcode):
|
|
47
|
-
|
|
48
|
-

|
|
49
|
-
|
|
50
|
-
### Link `libReactNativeBrownfield.a` binary with libraries
|
|
51
|
-
|
|
52
|
-
Click on your main project file (the one that represents the `.xcodeproj`) select `Build Phases` and drag the static library from the `Products` folder inside the Library you are importing to `Link Binary With Libraries` (or use the `+` sign and choose library from the list):
|
|
53
|
-
|
|
54
|
-

|
|
55
|
-
</details>
|
|
56
|
-
|
|
57
|
-
### API Reference
|
|
58
|
-
|
|
59
|
-
#### ReactNativeBrownfield
|
|
60
|
-
|
|
61
|
-
You can import the object from:
|
|
62
|
-
|
|
63
|
-
```swift
|
|
64
|
-
import ReactNativeBrownfield
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
**Statics:**
|
|
70
|
-
|
|
71
|
-
`shared()`
|
|
72
|
-
|
|
73
|
-
A singleton that keeps an instance of ReactNativeBrownfield object.
|
|
74
|
-
|
|
75
|
-
Examples:
|
|
76
|
-
|
|
77
|
-
```swift
|
|
78
|
-
ReactNativeBrownfield.shared()
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
**Properties:**
|
|
84
|
-
|
|
85
|
-
| Property | Type | Default | Description |
|
|
86
|
-
| -------------------- | --------- | -------------- | -------------------------------------------------- |
|
|
87
|
-
| bridge | RCTBridge | nil | Launch options, typically passed from AppDelegate. |
|
|
88
|
-
| entryFile | NSString | index | Path to JavaScript root. |
|
|
89
|
-
| fallbackResource | NSString | nil | Path to bundle fallback resource. |
|
|
90
|
-
| bundlePath | NSString | main.jsbundle | Path to bundle fallback resource. |
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
**Methods:**
|
|
95
|
-
|
|
96
|
-
`startReactNative`
|
|
97
|
-
|
|
98
|
-
Starts React Native, produces an instance of a bridge. You can use it to initialize React Native in your app.
|
|
99
|
-
|
|
100
|
-
Params:
|
|
101
|
-
|
|
102
|
-
| Param | Required | Type | Description |
|
|
103
|
-
| ----------------------- | -------- | ------------- | ----------------------------------------------------- |
|
|
104
|
-
| onBundleLoaded | No | () -> void | Callback invoked after JS bundle is fully loaded. |
|
|
105
|
-
| launchOptions | No | NSDictionary | Launch options, typically passed from AppDelegate. |
|
|
106
|
-
|
|
107
|
-
Examples:
|
|
108
|
-
|
|
109
|
-
```swift
|
|
110
|
-
ReactNativeBrownfield.shared().startReactNative()
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
```swift
|
|
114
|
-
ReactNativeBrownfield.shared().startReactNative {
|
|
115
|
-
print("React Native started")
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
```swift
|
|
120
|
-
ReactNativeBrownfield.shared().startReactNative({
|
|
121
|
-
print("React Native started")
|
|
122
|
-
}, launchOptions)
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
#### ReactNativeViewController
|
|
128
|
-
|
|
129
|
-
A view controller that's rendering `RCTRootView` within its bounds. It automatically uses an instance of a bridge created in `startReactNative` method. It works well with exposed JavaScript module. It's the simplest way to embed React Native into your navigation stack.
|
|
130
|
-
|
|
131
|
-
You can import it from:
|
|
132
|
-
|
|
133
|
-
```swift
|
|
134
|
-
import ReactNativeBrownfield
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
**Constructors:**
|
|
140
|
-
|
|
141
|
-
`ReactNativeViewController(moduleName: moduleName, initialProperites:initialProperties)`
|
|
142
|
-
|
|
143
|
-
| Param | Required | Type | Description |
|
|
144
|
-
| ------------------ | --------- | ------------- | ------------------------------------------------------------- |
|
|
145
|
-
| moduleName | Yes | NSString | Name of React Native component registered to `AppRegistry`. |
|
|
146
|
-
| initialProperties | No | NSString | Initial properties to be passed to React Native component. |
|
|
147
|
-
|
|
148
|
-
Examples:
|
|
149
|
-
|
|
150
|
-
```swift
|
|
151
|
-
ReactNativeViewController(moduleName: "ReactNative")
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
```swift
|
|
155
|
-
ReactNativeViewController(moduleName: "ReactNative", initialProperites:["score": 12])
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
### Example
|
|
161
|
-
|
|
162
|
-
You can find an example app [here](../example/swift).
|
|
163
|
-
|
|
164
|
-
|
package/prettier.config.js
DELETED
package/react-native.config.js
DELETED
package/types/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare module 'react-native-brownfield' {
|
|
2
|
-
/**
|
|
3
|
-
* A method to pop to native screen used to push React Native experience.
|
|
4
|
-
*/
|
|
5
|
-
export function popToNative(animated?: boolean): void;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A method used to toggle iOS native back gesture and Android hardware back button.
|
|
9
|
-
*/
|
|
10
|
-
export function setNativeGesturesAndButtonsEnabled(enabled: boolean): void;
|
|
11
|
-
}
|