Skip to content

Commit fded31e

Browse files
authored
Merge pull request #79 from taskrabbit/release/0.0.22
[Release] 0.0.22
2 parents 9e92287 + 45e24fc commit fded31e

14 files changed

+8370
-245
lines changed

.eslintrc.js

+80-112
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,95 @@
1-
{
2-
"rules": {
3-
"indent": [
1+
module.exports = {
2+
rules: {
3+
indent: [
44
2,
5-
2, {
6-
"SwitchCase": 1
7-
}
8-
],
9-
"quotes": [
10-
2,
11-
"single",
12-
"avoid-escape"
13-
],
14-
"comma-dangle": [
15-
2,
16-
"always-multiline"
17-
],
18-
"linebreak-style": [
19-
2,
20-
"unix"
21-
],
22-
"semi": [
23-
2,
24-
"always"
25-
],
26-
"space-before-function-paren": [
27-
2,
28-
"never",
29-
],
30-
"space-return-throw-case": [
31-
2
32-
],
33-
"array-bracket-spacing": [
345
2,
35-
"never"
36-
],
37-
"space-before-blocks": [
38-
2
6+
{
7+
SwitchCase: 1,
8+
},
399
],
10+
quotes: [2, 'single', 'avoid-escape'],
11+
'comma-dangle': [2, 'always-multiline'],
12+
'linebreak-style': [2, 'unix'],
13+
semi: [2, 'always'],
14+
'space-before-function-paren': [2, 'never'],
15+
'space-return-throw-case': [2],
16+
'array-bracket-spacing': [2, 'never'],
17+
'space-before-blocks': [2],
4018

41-
"jsx-quotes": [
19+
'jsx-quotes': [2, 'prefer-single'],
20+
'key-spacing': [
4221
2,
43-
"prefer-single",
44-
],
45-
"key-spacing": [
46-
2, {
47-
"beforeColon": false,
48-
"afterColon": true
22+
{
23+
beforeColon: false,
24+
afterColon: true,
4925
},
5026
],
51-
"comma-spacing": [
52-
2, {
53-
"before": false,
54-
"after": true
55-
}
56-
],
57-
"space-after-keywords": [
27+
'comma-spacing': [
5828
2,
59-
"always",
29+
{
30+
before: false,
31+
after: true,
32+
},
6033
],
61-
"block-spacing": [
34+
'space-after-keywords': [2, 'always'],
35+
'block-spacing': [2, 'always'],
36+
'no-unused-vars': [
6237
2,
63-
"always"
64-
],
65-
"no-unused-vars": [
66-
2, {
67-
"vars": "all",
68-
"varsIgnorePattern": "React"
69-
}
70-
],
71-
"no-cond-assign": [
72-
0
38+
{
39+
vars: 'all',
40+
varsIgnorePattern: 'React',
41+
},
7342
],
74-
"eqeqeq": [2, "allow-null"],
75-
"react/display-name": 1,
76-
"react/forbid-prop-types": 1,
77-
"react/jsx-boolean-value": [2, "always"],
78-
"react/jsx-closing-bracket-location": 2,
79-
"react/jsx-curly-spacing": 1,
80-
"react/jsx-indent-props": [2, 2],
81-
"react/jsx-max-props-per-line": 1,
82-
"react/jsx-no-bind": 1,
83-
"react/jsx-no-duplicate-props": 1,
84-
"react/jsx-no-undef": 1,
85-
"react/jsx-quotes": 1,
86-
"react/jsx-uses-react": 1,
87-
"react/jsx-uses-vars": 1,
88-
"react/no-danger": 1,
89-
"react/no-did-mount-set-state": 1,
90-
"react/no-did-update-set-state": 1,
91-
"react/no-direct-mutation-state": 1,
92-
"react/no-multi-comp": 1,
93-
"react/no-set-state": 1,
94-
"react/no-unknown-property": 1,
95-
"react/prefer-es6-class": 1,
96-
"react/prop-types": 1,
97-
"react/react-in-jsx-scope": 1,
98-
"react/require-extension": 1,
99-
"react/self-closing-comp": 1,
100-
"react/sort-comp": 1,
101-
"react/wrap-multilines": 1,
43+
'no-cond-assign': [0],
44+
eqeqeq: [2, 'allow-null'],
45+
'react/display-name': 1,
46+
'react/forbid-prop-types': 1,
47+
'react/jsx-boolean-value': [2, 'always'],
48+
'react/jsx-closing-bracket-location': 2,
49+
'react/jsx-curly-spacing': 1,
50+
'react/jsx-indent-props': [2, 2],
51+
'react/jsx-max-props-per-line': 1,
52+
'react/jsx-no-bind': 1,
53+
'react/jsx-no-duplicate-props': 1,
54+
'react/jsx-no-undef': 1,
55+
'react/jsx-quotes': 1,
56+
'react/jsx-uses-react': 1,
57+
'react/jsx-uses-vars': 1,
58+
'react/no-danger': 1,
59+
'react/no-did-mount-set-state': 1,
60+
'react/no-did-update-set-state': 1,
61+
'react/no-direct-mutation-state': 1,
62+
'react/no-multi-comp': 1,
63+
'react/no-set-state': 1,
64+
'react/no-unknown-property': 1,
65+
'react/prefer-es6-class': 1,
66+
'react/prop-types': 1,
67+
'react/react-in-jsx-scope': 1,
68+
'react/require-extension': 1,
69+
'react/self-closing-comp': 1,
70+
'react/sort-comp': 1,
71+
'react/wrap-multilines': 1,
10272
},
103-
"env": {
104-
"es6": true,
105-
"browser": true,
106-
"amd": true,
73+
env: {
74+
es6: true,
75+
browser: true,
76+
amd: true,
10777
},
108-
"globals": {
109-
"module": true,
110-
"describe": true,
111-
"beforeEach": true,
112-
"afterEach": true,
113-
"global": true,
114-
"expect": true,
115-
"it": true,
78+
globals: {
79+
module: true,
80+
describe: true,
81+
beforeEach: true,
82+
afterEach: true,
83+
global: true,
84+
expect: true,
85+
it: true,
11686
},
117-
"extends": "eslint:recommended",
118-
"ecmaFeatures": {
119-
"jsx": true,
120-
"modules": true,
121-
"experimentalObjectRestSpread": true
87+
extends: 'eslint:recommended',
88+
ecmaFeatures: {
89+
jsx: true,
90+
modules: true,
91+
experimentalObjectRestSpread: true,
12292
},
123-
"parser": "babel-eslint",
124-
"plugins": [
125-
"react"
126-
]
127-
}
93+
parser: 'babel-eslint',
94+
plugins: ['react'],
95+
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
assets
33
.idea
44
package-lock.json
5+
yarn.lock

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Example/ios/*
2+
Example/android/*
3+
node_modules/*

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cSpell.words": ["jrichardlai", "taskrabbit"]
3+
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
This project hasn't kept a changelog historically, and it would be infeasible to retroactively create one.
4+
5+
Instead, for the near future, releases will be encapsulated by a [milestone](https://github.com/taskrabbit/react-native-parsed-text/milestones) and [Github Releases](https://github.com/taskrabbit/react-native-parsed-text/releases)

Example/index.android.js

+33-22
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
'use strict';
66

77
import React from 'react';
8-
import ReactNative from 'react-native';
9-
const {
10-
AppRegistry,
11-
StyleSheet,
12-
View,
13-
} = ReactNative;
8+
import { AppRegistry, StyleSheet, View } from 'react-native';
149

1510
import ParsedText from 'react-native-parsed-text';
1611

@@ -45,22 +40,39 @@ class Example extends React.Component {
4540
<View style={styles.container}>
4641
<ParsedText
4742
style={styles.text}
48-
parse={
49-
[
50-
{type: 'url', style: styles.url, onPress: this.handleUrlPress},
51-
{type: 'phone', style: styles.phone, onPress: this.handlePhonePress},
52-
{type: 'email', style: styles.email, onPress: this.handleEmailPress},
53-
{pattern: /Bob|David/, style: styles.name, onPress: this.handleNamePress},
54-
{pattern: /\[(@[^:]+):([^\]]+)\]/i, style: styles.username, onPress: this.handleNamePress, renderText: this.renderText},
55-
{pattern: /42/, style: styles.magicNumber},
56-
{pattern: /#(\w+)/, style: styles.hashTag},
57-
]
58-
}
43+
parse={[
44+
{ type: 'url', style: styles.url, onPress: this.handleUrlPress },
45+
{
46+
type: 'phone',
47+
style: styles.phone,
48+
onPress: this.handlePhonePress,
49+
},
50+
{
51+
type: 'email',
52+
style: styles.email,
53+
onPress: this.handleEmailPress,
54+
},
55+
{
56+
pattern: /Bob|David/,
57+
style: styles.name,
58+
onPress: this.handleNamePress,
59+
},
60+
{
61+
pattern: /\[(@[^:]+):([^\]]+)\]/i,
62+
style: styles.username,
63+
onPress: this.handleNamePress,
64+
renderText: this.renderText,
65+
},
66+
{ pattern: /42/, style: styles.magicNumber },
67+
{ pattern: /#(\w+)/, style: styles.hashTag },
68+
]}
5969
>
60-
Hello this is an example of the ParsedText, links like http://www.google.com or http://www.facebook.com are clickable and phone number 444-555-6666 can call too.
61-
But you can also do more with this package, for example Bob will change style and David too. You should mention [@michel:5455345] about that. [email protected]
62-
And the magic number is 42!
63-
#react #react-native
70+
Hello this is an example of the ParsedText, links like
71+
http://www.google.com or http://www.facebook.com are clickable and
72+
phone number 444-555-6666 can call too. But you can also do more with
73+
this package, for example Bob will change style and David too. You
74+
should mention [@michel:5455345] about that. [email protected] And the
75+
magic number is 42! #react #react-native
6476
</ParsedText>
6577
</View>
6678
);
@@ -111,7 +123,6 @@ const styles = StyleSheet.create({
111123
hashTag: {
112124
fontStyle: 'italic',
113125
},
114-
115126
});
116127

117128
AppRegistry.registerComponent('Example', () => Example);

Example/index.ios.js

+34-19
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
'use strict';
66

77
import React from 'react';
8-
import ReactNative from 'react-native';
9-
const {
8+
import {
109
AppRegistry,
1110
StyleSheet,
1211
View,
1312
LinkingIOS,
1413
AlertIOS,
15-
} = ReactNative;
14+
} from 'react-native';
1615

1716
import ParsedText from 'react-native-parsed-text';
1817

@@ -47,22 +46,39 @@ class Example extends React.Component {
4746
<View style={styles.container}>
4847
<ParsedText
4948
style={styles.text}
50-
parse={
51-
[
52-
{type: 'url', style: styles.url, onPress: this.handleUrlPress},
53-
{type: 'phone', style: styles.phone, onPress: this.handlePhonePress},
54-
{type: 'email', style: styles.email, onPress: this.handleEmailPress},
55-
{pattern: /Bob|David/, style: styles.name, onPress: this.handleNamePress},
56-
{pattern: /\[(@[^:]+):([^\]]+)\]/i, style: styles.username, onPress: this.handleNamePress, renderText: this.renderText},
57-
{pattern: /42/, style: styles.magicNumber},
58-
{pattern: /#(\w+)/, style: styles.hashTag},
59-
]
60-
}
49+
parse={[
50+
{ type: 'url', style: styles.url, onPress: this.handleUrlPress },
51+
{
52+
type: 'phone',
53+
style: styles.phone,
54+
onPress: this.handlePhonePress,
55+
},
56+
{
57+
type: 'email',
58+
style: styles.email,
59+
onPress: this.handleEmailPress,
60+
},
61+
{
62+
pattern: /Bob|David/,
63+
style: styles.name,
64+
onPress: this.handleNamePress,
65+
},
66+
{
67+
pattern: /\[(@[^:]+):([^\]]+)\]/i,
68+
style: styles.username,
69+
onPress: this.handleNamePress,
70+
renderText: this.renderText,
71+
},
72+
{ pattern: /42/, style: styles.magicNumber },
73+
{ pattern: /#(\w+)/, style: styles.hashTag },
74+
]}
6175
>
62-
Hello this is an example of the ParsedText, links like http://www.google.com or http://www.facebook.com are clickable and phone number 444-555-6666 can call too.
63-
But you can also do more with this package, for example Bob will change style and David too. You should mention [@michel:5455345] about that. [email protected]
64-
And the magic number is 42!
65-
#react #react-native
76+
Hello this is an example of the ParsedText, links like
77+
http://www.google.com or http://www.facebook.com are clickable and
78+
phone number 444-555-6666 can call too. But you can also do more with
79+
this package, for example Bob will change style and David too. You
80+
should mention [@michel:5455345] about that. [email protected] And the
81+
magic number is 42! #react #react-native
6682
</ParsedText>
6783
</View>
6884
);
@@ -113,7 +129,6 @@ const styles = StyleSheet.create({
113129
hashTag: {
114130
fontStyle: 'italic',
115131
},
116-
117132
});
118133

119134
AppRegistry.registerComponent('Example', () => Example);

0 commit comments

Comments
 (0)