Skip to content

Commit

Permalink
insert link of editor
Browse files Browse the repository at this point in the history
  • Loading branch information
stulip committed Jul 7, 2020
1 parent 36145a4 commit 43fdfc1
Show file tree
Hide file tree
Showing 11 changed files with 609 additions and 509 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

## 1.0.?
##

## 1.0.8
- Add `onInsertLink` event to toolbar, replace built-in processing
- Add `insertLink` props to the editor to support customization


## 1.0.7

### Added
- Add Optional `editor` props substitute `getEditor` function props
- Add `editor` props substitute `getEditor` function props
- Add `editorStyle` props styling for container or for Rich Editor more dark or light settings


## 1.0.6
Expand Down
6 changes: 3 additions & 3 deletions examples/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ PODS:
- React-cxxreact (= 0.62.2)
- React-jsi (= 0.62.2)
- React-jsinspector (0.62.2)
- react-native-webview (10.3.1):
- react-native-webview (10.3.2):
- React
- React-RCTActionSheet (0.62.2):
- React-Core/RCTActionSheetHeaders (= 0.62.2)
Expand Down Expand Up @@ -429,7 +429,7 @@ SPEC CHECKSUMS:
React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161
React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da
React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493
react-native-webview: 40bbeb6d011226f34cb83f845aeb0fdf515cfc5f
react-native-webview: 679b6f400176e2ea8a785acf7ae16cf282e7d1eb
React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c
React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0
React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71
Expand All @@ -445,4 +445,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 51652a7aa02732e67dad07e3d1f632bc50d699bf

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
21 changes: 11 additions & 10 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@
"dependencies": {
"react": "16.13.1",
"react-native": "0.62.2",
"react-native-webview": "^10.3.1"
"react-native-modal": "^11.5.6",
"react-native-webview": "^10.3.2"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-function-bind": "^7.10.1",
"@babel/runtime": "^7.10.2",
"@babel/core": "^7.10.4",
"@babel/plugin-proposal-function-bind": "^7.10.4",
"@babel/runtime": "^7.10.4",
"@react-native-community/eslint-config": "^1.0.0",
"@types/react-native": "^0.62.13",
"@types/react": "^16.9.38",
"babel-jest": "^26.0.1",
"@types/react-native": "^0.62.17",
"@types/react": "^16.9.41",
"babel-jest": "^26.1.0",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^6.8.0",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "^0.59.0",
"jest": "^26.1.0",
"metro-react-native-babel-preset": "^0.60.0",
"react-test-renderer": "16.13.1"
},
"peerDependencies": {
"react-native-pell-rich-editor": "^1.0.6"
"react-native-pell-rich-editor": "^1.0.7"
},
"jest": {
"preset": "react-native"
Expand Down
6 changes: 6 additions & 0 deletions examples/src/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Example extends React.Component {
that.save = ::that.save;
that.onTheme = ::that.onTheme;
that.onPressAddImage = ::that.onPressAddImage;
that.onInsertLink = ::that.onInsertLink;
that.themeChange = ::that.themeChange;
}

Expand Down Expand Up @@ -76,6 +77,10 @@ class Example extends React.Component {
this.richText.current?.blurContentEditor();
}

onInsertLink() {
this.richText.current?.insertLink('Google', 'http://google.com');
}

onHome() {
this.props.navigation.push('index');
}
Expand Down Expand Up @@ -145,6 +150,7 @@ class Example extends React.Component {
selectedIconTint={'#2095F2'}
selectedButtonStyle={{backgroundColor: 'transparent'}}
onPressAddImage={that.onPressAddImage}
onInsertLink={that.onInsertLink}
/>
</KeyboardAvoidingView>
</SafeAreaView>
Expand Down
Loading

0 comments on commit 43fdfc1

Please sign in to comment.