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

Commit

Permalink
Merge pull request #102 from matei-radu/development
Browse files Browse the repository at this point in the history
Release 3.2.0
  • Loading branch information
matei-radu authored Feb 29, 2020
2 parents 976de97 + 2359bff commit 7bb463b
Show file tree
Hide file tree
Showing 53 changed files with 4,476 additions and 4,200 deletions.
1 change: 0 additions & 1 deletion .codebeatignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
example/**
release-manager/**
scripts/**
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [3.2.0] - 2020-02-29

### Added

- iOS specific: `entersReaderIfAvailable` setting to instruct Safari to enter in Reader mode, if available (thanks to [@fonov](https://github.com/fonov)).
- iOS specific: `dismissButtonStyle` setting to change the label of the dismiss button.

## [3.1.4] - 2020-01-12

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

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

[3.2.0]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.4...v3.2.0
[3.1.4]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.3...v3.1.4
[3.1.3]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.2...v3.1.3
[3.1.2]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.1...v3.1.2
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ supported by the iOS version at runtime will be ignored as well.
| --------------------------- | --------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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. |
| `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. |
| `barCollapsingEnabled` | `boolean` | `true` | **Available on**: iOS >= 11.0. |
| `barCollapsingEnabled` | `boolean` | `true` | **Available on**: iOS >= 11.0. |
| `dismissButtonStyle` | `string` | `undefined` | **Available on**: iOS >= 11.0. |
| `entersReaderIfAvailable` | `boolean` | `false` | A value that specifies whether Safari should enter Reader mode, if it is available.<br/><br/>**Available on**: iOS >= 11.0. |


## Example

Expand All @@ -213,8 +216,9 @@ and run the app.
```sh
git clone https://github.com/matei-radu/react-native-in-app-browser.git
cd react-native-in-app-browser/example
npm install #or yarn install
$ react-native run-android #or react-native run-ios
yarn install
yarn start
yarn android # or yarn ios
```

## License
Expand Down
4 changes: 4 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
75 changes: 40 additions & 35 deletions example/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,71 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

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

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

; Ignore metro
.*/node_modules/metro/.*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

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'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
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'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

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

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.86.0
^0.106.0
5 changes: 4 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -40,6 +39,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -54,3 +54,6 @@ buck-out/

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
6 changes: 6 additions & 0 deletions example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
29 changes: 14 additions & 15 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/

import React, {Component} from 'react';
import {StyleSheet, Text, View, ScrollView} from 'react-native';
import React from 'react';
import {StyleSheet, ScrollView, View, Text} from 'react-native';
import Configurator from './Config';

export default class App extends Component {
render() {
return (
<ScrollView style={styles.scrollBackground}>
<View style={styles.container}>
<Text style={styles.welcome}>React Native In-App Browser</Text>
<Configurator />
</View>
</ScrollView>
);
}
}
const App: () => React$Node = () => {
return (
<ScrollView style={styles.scrollBackground}>
<View style={styles.container}>
<Text style={styles.welcome}>React Native In-App Browser</Text>
<Configurator />
</View>
</ScrollView>
);
};

const styles = StyleSheet.create({
scrollBackground: {
Expand All @@ -46,3 +43,5 @@ const styles = StyleSheet.create({
marginBottom: 5,
},
});

export default App;
27 changes: 13 additions & 14 deletions example/Config.android.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React, {Component} from 'react';
import {
View,
Text,
Expand All @@ -7,8 +7,8 @@ import {
TouchableOpacity,
StyleSheet,
} from 'react-native';
import { InAppBrowser } from '@matt-block/react-native-in-app-browser';
import { SlidersColorPicker } from 'react-native-color';
import {InAppBrowser} from '@matt-block/react-native-in-app-browser';
import {SlidersColorPicker} from 'react-native-color';
import tinycolor from 'tinycolor2';
import pizzaIcon from './pizza-icon.png';

Expand All @@ -30,12 +30,12 @@ class Configurator extends Component {
}

onOpen = () => {
const { url, ...settings } = { ...this.state };
const {url, ...settings} = {...this.state};
if (settings.closeButtonIcon) {
settings.closeButtonIcon = pizzaIcon;
}

InAppBrowser.open(url, { android: settings });
InAppBrowser.open(url, {android: settings});
};

render() {
Expand All @@ -61,10 +61,9 @@ class Configurator extends Component {
<View style={styles.settingRow}>
<Text>Set toolbar color</Text>
<TouchableOpacity
onPress={() => this.setState({ modalVisible: true })}
style={[styles.colorPreview, { backgroundColor: toolbarColor }]}
>
<Text style={[styles.colorString, { color: overlayTextColor }]}>
onPress={() => this.setState({modalVisible: true})}
style={[styles.colorPreview, {backgroundColor: toolbarColor}]}>
<Text style={[styles.colorString, {color: overlayTextColor}]}>
{!toolbarColor ? 'Click to set' : toolbarColor}
</Text>
</TouchableOpacity>
Expand All @@ -73,15 +72,15 @@ class Configurator extends Component {
<Text>Show site title</Text>
<Switch
value={showTitle}
onValueChange={newValue => this.setState({ showTitle: newValue })}
onValueChange={newValue => this.setState({showTitle: newValue})}
/>
</View>
<View style={styles.settingRow}>
<Text>Add default share menu</Text>
<Switch
value={addDefaultShareMenu}
onValueChange={newValue =>
this.setState({ addDefaultShareMenu: newValue })
this.setState({addDefaultShareMenu: newValue})
}
/>
</View>
Expand All @@ -90,7 +89,7 @@ class Configurator extends Component {
<Switch
value={closeButtonIcon}
onValueChange={newValue =>
this.setState({ closeButtonIcon: newValue })
this.setState({closeButtonIcon: newValue})
}
/>
</View>
Expand All @@ -105,10 +104,10 @@ class Configurator extends Component {
color={!toolbarColor ? defaultCustomToolbarColor : toolbarColor}
returnMode={'hex'}
onCancel={() => {
this.setState({ toolbarColor: undefined, modalVisible: false });
this.setState({toolbarColor: undefined, modalVisible: false});
}}
onOk={newValue => {
this.setState({ toolbarColor: newValue, modalVisible: false });
this.setState({toolbarColor: newValue, modalVisible: false});
}}
okLabel="Done"
cancelLabel="Reset"
Expand Down
Loading

0 comments on commit 7bb463b

Please sign in to comment.