Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit 7bb463b

Browse files
authored
Merge pull request #102 from matei-radu/development
Release 3.2.0
2 parents 976de97 + 2359bff commit 7bb463b

53 files changed

Lines changed: 4476 additions & 4200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codebeatignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
example/**
2-
release-manager/**
32
scripts/**

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [3.2.0] - 2020-02-29
9+
10+
### Added
11+
12+
- iOS specific: `entersReaderIfAvailable` setting to instruct Safari to enter in Reader mode, if available (thanks to [@fonov](https://github.com/fonov)).
13+
- iOS specific: `dismissButtonStyle` setting to change the label of the dismiss button.
914

1015
## [3.1.4] - 2020-01-12
1116

@@ -194,6 +199,7 @@ The following functions have been deprecated. Please see
194199

195200
- `openInApp`: open a valid http(s) URL with an in-app browser.
196201

202+
[3.2.0]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.4...v3.2.0
197203
[3.1.4]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.3...v3.1.4
198204
[3.1.3]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.2...v3.1.3
199205
[3.1.2]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.1...v3.1.2

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ supported by the iOS version at runtime will be ignored as well.
201201
| --------------------------- | --------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
202202
| `preferredBarTintColor` | `string` | `undefined` | The color to tint the background of the navigation bar and the toolbar.<br/>Provided color can be in any [@ctrl/tinycolor][tinycolor] supported format.<br/><br/>**Available on**: iOS >= 10.0. |
203203
| `preferredControlTintColor` | `string` | `undefined` | The color to tint the control buttons on the navigation bar and the toolbar.<br/>Provided color can be in any [@ctrl/tinycolor][tinycolor] supported format.<br/><br/>**Available on**: iOS >= 10.0. |
204-
| `barCollapsingEnabled` | `boolean` | `true` | **Available on**: iOS >= 11.0. |
204+
| `barCollapsingEnabled` | `boolean` | `true` | **Available on**: iOS >= 11.0. |
205+
| `dismissButtonStyle` | `string` | `undefined` | **Available on**: iOS >= 11.0. |
206+
| `entersReaderIfAvailable` | `boolean` | `false` | A value that specifies whether Safari should enter Reader mode, if it is available.<br/><br/>**Available on**: iOS >= 11.0. |
207+
205208

206209
## Example
207210

@@ -213,8 +216,9 @@ and run the app.
213216
```sh
214217
git clone https://github.com/matei-radu/react-native-in-app-browser.git
215218
cd react-native-in-app-browser/example
216-
npm install #or yarn install
217-
$ react-native run-android #or react-native run-ios
219+
yarn install
220+
yarn start
221+
yarn android # or yarn ios
218222
```
219223

220224
## License

example/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

example/.flowconfig

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,71 @@
55
; Ignore "BUCK" generated dirs
66
<PROJECT_ROOT>/\.buckd/
77

8-
; Ignore unexpected extra "@providesModule"
9-
.*/node_modules/.*/node_modules/fbjs/.*
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
1010

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-
.*/Libraries/react-native/React.js
11+
; These should not be required directly
12+
; require from fbjs/lib instead: require('fbjs/lib/warning')
13+
node_modules/warning/.*
1514

16-
; Ignore polyfills
17-
.*/Libraries/polyfills/.*
15+
; Flow doesn't support platforms
16+
.*/Libraries/Utilities/LoadingView.js
1817

19-
; Ignore metro
20-
.*/node_modules/metro/.*
18+
[untyped]
19+
.*/node_modules/@react-native-community/cli/.*/.*
2120

2221
[include]
2322

2423
[libs]
2524
node_modules/react-native/Libraries/react-native/react-native-interface.js
2625
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2826

2927
[options]
3028
emoji=true
3129

3230
esproposal.optional_chaining=enable
3331
esproposal.nullish_coalescing=enable
3432

35-
module.system=haste
36-
module.system.haste.use_name_reducers=true
37-
# get basename
38-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39-
# strip .js or .js.flow suffix
40-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41-
# strip .ios suffix
42-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45-
module.system.haste.paths.blacklist=.*/__tests__/.*
46-
module.system.haste.paths.blacklist=.*/__mocks__/.*
47-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
33+
module.file_ext=.js
34+
module.file_ext=.json
35+
module.file_ext=.ios.js
4936

5037
munge_underscores=true
5138

52-
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'
53-
54-
module.file_ext=.js
55-
module.file_ext=.jsx
56-
module.file_ext=.json
57-
module.file_ext=.native.js
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
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\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
5842

5943
suppress_type=$FlowIssue
6044
suppress_type=$FlowFixMe
6145
suppress_type=$FlowFixMeProps
6246
suppress_type=$FlowFixMeState
6347

64-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
65-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
66-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
48+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
6750
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6851

52+
[lints]
53+
sketchy-null-number=warn
54+
sketchy-null-mixed=warn
55+
sketchy-number=warn
56+
untyped-type-import=warn
57+
nonstrict-import=warn
58+
deprecated-type=warn
59+
unsafe-getters-setters=warn
60+
inexact-spread=warn
61+
unnecessary-invariant=warn
62+
signature-verification-failure=warn
63+
deprecated-utility=error
64+
65+
[strict]
66+
deprecated-type
67+
nonstrict-import
68+
sketchy-null
69+
unclear-type
70+
unsafe-getters-setters
71+
untyped-import
72+
untyped-type-import
73+
6974
[version]
70-
^0.86.0
75+
^0.106.0

example/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
project.xcworkspace
2423

2524
# Android/IntelliJ
2625
#
@@ -40,6 +39,7 @@ yarn-error.log
4039
buck-out/
4140
\.buckd/
4241
*.keystore
42+
!debug.keystore
4343

4444
# fastlane
4545
#
@@ -54,3 +54,6 @@ buck-out/
5454

5555
# Bundle artifact
5656
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/

example/.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};

example/App.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,22 @@
44
*
55
* @format
66
* @flow
7-
* @lint-ignore-every XPLATJSCOPYRIGHT1
87
*/
98

10-
import React, {Component} from 'react';
11-
import {StyleSheet, Text, View, ScrollView} from 'react-native';
9+
import React from 'react';
10+
import {StyleSheet, ScrollView, View, Text} from 'react-native';
1211
import Configurator from './Config';
1312

14-
export default class App extends Component {
15-
render() {
16-
return (
17-
<ScrollView style={styles.scrollBackground}>
18-
<View style={styles.container}>
19-
<Text style={styles.welcome}>React Native In-App Browser</Text>
20-
<Configurator />
21-
</View>
22-
</ScrollView>
23-
);
24-
}
25-
}
13+
const App: () => React$Node = () => {
14+
return (
15+
<ScrollView style={styles.scrollBackground}>
16+
<View style={styles.container}>
17+
<Text style={styles.welcome}>React Native In-App Browser</Text>
18+
<Configurator />
19+
</View>
20+
</ScrollView>
21+
);
22+
};
2623

2724
const styles = StyleSheet.create({
2825
scrollBackground: {
@@ -46,3 +43,5 @@ const styles = StyleSheet.create({
4643
marginBottom: 5,
4744
},
4845
});
46+
47+
export default App;

example/Config.android.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, {Component} from 'react';
22
import {
33
View,
44
Text,
@@ -7,8 +7,8 @@ import {
77
TouchableOpacity,
88
StyleSheet,
99
} from 'react-native';
10-
import { InAppBrowser } from '@matt-block/react-native-in-app-browser';
11-
import { SlidersColorPicker } from 'react-native-color';
10+
import {InAppBrowser} from '@matt-block/react-native-in-app-browser';
11+
import {SlidersColorPicker} from 'react-native-color';
1212
import tinycolor from 'tinycolor2';
1313
import pizzaIcon from './pizza-icon.png';
1414

@@ -30,12 +30,12 @@ class Configurator extends Component {
3030
}
3131

3232
onOpen = () => {
33-
const { url, ...settings } = { ...this.state };
33+
const {url, ...settings} = {...this.state};
3434
if (settings.closeButtonIcon) {
3535
settings.closeButtonIcon = pizzaIcon;
3636
}
3737

38-
InAppBrowser.open(url, { android: settings });
38+
InAppBrowser.open(url, {android: settings});
3939
};
4040

4141
render() {
@@ -61,10 +61,9 @@ class Configurator extends Component {
6161
<View style={styles.settingRow}>
6262
<Text>Set toolbar color</Text>
6363
<TouchableOpacity
64-
onPress={() => this.setState({ modalVisible: true })}
65-
style={[styles.colorPreview, { backgroundColor: toolbarColor }]}
66-
>
67-
<Text style={[styles.colorString, { color: overlayTextColor }]}>
64+
onPress={() => this.setState({modalVisible: true})}
65+
style={[styles.colorPreview, {backgroundColor: toolbarColor}]}>
66+
<Text style={[styles.colorString, {color: overlayTextColor}]}>
6867
{!toolbarColor ? 'Click to set' : toolbarColor}
6968
</Text>
7069
</TouchableOpacity>
@@ -73,15 +72,15 @@ class Configurator extends Component {
7372
<Text>Show site title</Text>
7473
<Switch
7574
value={showTitle}
76-
onValueChange={newValue => this.setState({ showTitle: newValue })}
75+
onValueChange={newValue => this.setState({showTitle: newValue})}
7776
/>
7877
</View>
7978
<View style={styles.settingRow}>
8079
<Text>Add default share menu</Text>
8180
<Switch
8281
value={addDefaultShareMenu}
8382
onValueChange={newValue =>
84-
this.setState({ addDefaultShareMenu: newValue })
83+
this.setState({addDefaultShareMenu: newValue})
8584
}
8685
/>
8786
</View>
@@ -90,7 +89,7 @@ class Configurator extends Component {
9089
<Switch
9190
value={closeButtonIcon}
9291
onValueChange={newValue =>
93-
this.setState({ closeButtonIcon: newValue })
92+
this.setState({closeButtonIcon: newValue})
9493
}
9594
/>
9695
</View>
@@ -105,10 +104,10 @@ class Configurator extends Component {
105104
color={!toolbarColor ? defaultCustomToolbarColor : toolbarColor}
106105
returnMode={'hex'}
107106
onCancel={() => {
108-
this.setState({ toolbarColor: undefined, modalVisible: false });
107+
this.setState({toolbarColor: undefined, modalVisible: false});
109108
}}
110109
onOk={newValue => {
111-
this.setState({ toolbarColor: newValue, modalVisible: false });
110+
this.setState({toolbarColor: newValue, modalVisible: false});
112111
}}
113112
okLabel="Done"
114113
cancelLabel="Reset"

0 commit comments

Comments
 (0)