├── .gitignore ├── Example └── RNRichTextEditor │ ├── index.android.js │ ├── index.ios.js │ ├── ios │ ├── RNRichTextEditor.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── guyeldar.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── RNRichTextEditor.xcscheme │ │ └── xcuserdata │ │ │ └── guyeldar.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── RNRichTextEditor │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── HoneyBook.ttf │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── RNRichTextEditorTests │ │ ├── Info.plist │ │ └── RNRichTextEditorTests.m │ └── package.json ├── HBEditorConstants.js ├── HBEditorEventEmitter.js ├── HBRichTextEditor.js ├── HBToolbar.js ├── HBToolbarItem.js ├── Images ├── HBbold@2x.png ├── HBbold_selected@2x.png ├── HBcenterjustify@2x.png ├── HBclearstyle@2x.png ├── HBitalic@2x.png ├── HBleftjustify@2x.png ├── HBlink@2x.png ├── HBrightjustify@2x.png ├── HBunderline@2x.png ├── HBunlink@2x.png ├── bold_asset@2x.png ├── bold_asset@3x.png ├── bold_asset_padded@2x.png ├── bold_asset_padded@3x.png ├── bullets_asset@2x.png ├── bullets_asset@3x.png ├── italic_asset@2x.png ├── italic_asset_padded@2x.png ├── italic_asset_padded@3x.png ├── link_asset@2x.png ├── link_asset@3x.png ├── link_asset_padded@2x.png ├── remove_styling@2x.png ├── remove_styling@3x.png ├── underline_asset@2x.png ├── underline_asset@3x.png ├── underline_padded@2x.png └── underline_padded@3x.png ├── LICENSE ├── README.md ├── demo.gif ├── editor.html ├── npm-debug.log └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | Pods/ 25 | localfiles/ 26 | 27 | # Android/IJ 28 | # 29 | .idea 30 | .gradle 31 | local.properties 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | local-config.json 38 | ios/main.jsbundle 39 | Playground.js 40 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | class RNRichTextEditor extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.android.js 24 | 25 | 26 | Shake or press menu button for dev menu 27 | 28 | 29 | ); 30 | } 31 | } 32 | 33 | const styles = StyleSheet.create({ 34 | container: { 35 | flex: 1, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: '#F5FCFF', 39 | }, 40 | welcome: { 41 | fontSize: 20, 42 | textAlign: 'center', 43 | margin: 10, 44 | }, 45 | instructions: { 46 | textAlign: 'center', 47 | color: '#333333', 48 | marginBottom: 5, 49 | }, 50 | }); 51 | 52 | AppRegistry.registerComponent('RNRichTextEditor', () => RNRichTextEditor); 53 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * react-native-richtext-editor Example 3 | * https://github.com/HoneyBook/react-native-richtext-editor 4 | * HoneyBook Inc. 5 | * @flow 6 | */ 7 | 8 | import React, { Component } from 'react'; 9 | var HBRichTextEditor = require('react-native-richtext-editor'); 10 | var HBToolbar = require('react-native-richtext-editor/HBToolbar'); 11 | import KeyboardSpacer from 'react-native-keyboard-spacer'; 12 | 13 | import { 14 | AppRegistry, 15 | StyleSheet, 16 | Text, 17 | View 18 | } from 'react-native'; 19 | 20 | class RNRichTextEditor extends Component { 21 | 22 | render() { 23 | var bodyForDisplay = "

Wow this is an AMAZING demo!

"; 24 | return ( 25 | 26 | 33 | 34 | 35 | 36 | ); 37 | } 38 | } 39 | 40 | const styles = StyleSheet.create({ 41 | container: { 42 | flex: 1, 43 | backgroundColor: '#fff', 44 | flexDirection: "column" 45 | } 46 | }); 47 | 48 | AppRegistry.registerComponent('RNRichTextEditor', () => RNRichTextEditor); 49 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* RNRichTextEditorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* RNRichTextEditorTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | CCB31E0BE57742EBA7E87110 /* libReact-Native-Webview-Bridge.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EBE49A2AB7C49618DE25D73 /* libReact-Native-Webview-Bridge.a */; }; 27 | D8808BF81D3AC4720065CA49 /* HoneyBook.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D8808BF71D3AC4310065CA49 /* HoneyBook.ttf */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 34 | proxyType = 2; 35 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 36 | remoteInfo = RCTActionSheet; 37 | }; 38 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 41 | proxyType = 2; 42 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 43 | remoteInfo = RCTGeolocation; 44 | }; 45 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 48 | proxyType = 2; 49 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 50 | remoteInfo = RCTImage; 51 | }; 52 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 53 | isa = PBXContainerItemProxy; 54 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 55 | proxyType = 2; 56 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 57 | remoteInfo = RCTNetwork; 58 | }; 59 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 60 | isa = PBXContainerItemProxy; 61 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 62 | proxyType = 2; 63 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 64 | remoteInfo = RCTVibration; 65 | }; 66 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 67 | isa = PBXContainerItemProxy; 68 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 69 | proxyType = 1; 70 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 71 | remoteInfo = RNRichTextEditor; 72 | }; 73 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 74 | isa = PBXContainerItemProxy; 75 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 76 | proxyType = 2; 77 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 78 | remoteInfo = RCTSettings; 79 | }; 80 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 81 | isa = PBXContainerItemProxy; 82 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 83 | proxyType = 2; 84 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 85 | remoteInfo = RCTWebSocket; 86 | }; 87 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 88 | isa = PBXContainerItemProxy; 89 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 90 | proxyType = 2; 91 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 92 | remoteInfo = React; 93 | }; 94 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 95 | isa = PBXContainerItemProxy; 96 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 97 | proxyType = 2; 98 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 99 | remoteInfo = RCTLinking; 100 | }; 101 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 102 | isa = PBXContainerItemProxy; 103 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 104 | proxyType = 2; 105 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 106 | remoteInfo = RCTText; 107 | }; 108 | D8808BF41D3AC33F0065CA49 /* PBXContainerItemProxy */ = { 109 | isa = PBXContainerItemProxy; 110 | containerPortal = 4B834EC0CF3F477590131FB8 /* React-Native-Webview-Bridge.xcodeproj */; 111 | proxyType = 2; 112 | remoteGlobalIDString = 4114DC4C1C187C3A003CD988; 113 | remoteInfo = "React-Native-Webview-Bridge"; 114 | }; 115 | /* End PBXContainerItemProxy section */ 116 | 117 | /* Begin PBXFileReference section */ 118 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 119 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 120 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 121 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 122 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 123 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 124 | 00E356EE1AD99517003FC87E /* RNRichTextEditorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNRichTextEditorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 125 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 126 | 00E356F21AD99517003FC87E /* RNRichTextEditorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNRichTextEditorTests.m; sourceTree = ""; }; 127 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 128 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 129 | 13B07F961A680F5B00A75B9A /* RNRichTextEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNRichTextEditor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 130 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNRichTextEditor/AppDelegate.h; sourceTree = ""; }; 131 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = RNRichTextEditor/AppDelegate.m; sourceTree = ""; }; 132 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 133 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNRichTextEditor/Images.xcassets; sourceTree = ""; }; 134 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNRichTextEditor/Info.plist; sourceTree = ""; }; 135 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNRichTextEditor/main.m; sourceTree = ""; }; 136 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 137 | 2EBE49A2AB7C49618DE25D73 /* libReact-Native-Webview-Bridge.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libReact-Native-Webview-Bridge.a"; sourceTree = ""; }; 138 | 4B834EC0CF3F477590131FB8 /* React-Native-Webview-Bridge.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = "React-Native-Webview-Bridge.xcodeproj"; path = "../node_modules/react-native-webview-bridge/ios/React-Native-Webview-Bridge.xcodeproj"; sourceTree = ""; }; 139 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 140 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 141 | D8808BF71D3AC4310065CA49 /* HoneyBook.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = HoneyBook.ttf; path = RNRichTextEditor/HoneyBook.ttf; sourceTree = ""; }; 142 | /* End PBXFileReference section */ 143 | 144 | /* Begin PBXFrameworksBuildPhase section */ 145 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 146 | isa = PBXFrameworksBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 154 | isa = PBXFrameworksBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 158 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 159 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 160 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 161 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 162 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 163 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 164 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 165 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 166 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 167 | CCB31E0BE57742EBA7E87110 /* libReact-Native-Webview-Bridge.a in Frameworks */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXFrameworksBuildPhase section */ 172 | 173 | /* Begin PBXGroup section */ 174 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 186 | ); 187 | name = Products; 188 | sourceTree = ""; 189 | }; 190 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 194 | ); 195 | name = Products; 196 | sourceTree = ""; 197 | }; 198 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 202 | ); 203 | name = Products; 204 | sourceTree = ""; 205 | }; 206 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 210 | ); 211 | name = Products; 212 | sourceTree = ""; 213 | }; 214 | 00E356EF1AD99517003FC87E /* RNRichTextEditorTests */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 00E356F21AD99517003FC87E /* RNRichTextEditorTests.m */, 218 | 00E356F01AD99517003FC87E /* Supporting Files */, 219 | ); 220 | path = RNRichTextEditorTests; 221 | sourceTree = ""; 222 | }; 223 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | 00E356F11AD99517003FC87E /* Info.plist */, 227 | ); 228 | name = "Supporting Files"; 229 | sourceTree = ""; 230 | }; 231 | 139105B71AF99BAD00B5F7CC /* Products */ = { 232 | isa = PBXGroup; 233 | children = ( 234 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 235 | ); 236 | name = Products; 237 | sourceTree = ""; 238 | }; 239 | 139FDEE71B06529A00C62182 /* Products */ = { 240 | isa = PBXGroup; 241 | children = ( 242 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 243 | ); 244 | name = Products; 245 | sourceTree = ""; 246 | }; 247 | 13B07FAE1A68108700A75B9A /* RNRichTextEditor */ = { 248 | isa = PBXGroup; 249 | children = ( 250 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 251 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 252 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 253 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 254 | 13B07FB61A68108700A75B9A /* Info.plist */, 255 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 256 | 13B07FB71A68108700A75B9A /* main.m */, 257 | ); 258 | name = RNRichTextEditor; 259 | sourceTree = ""; 260 | }; 261 | 146834001AC3E56700842450 /* Products */ = { 262 | isa = PBXGroup; 263 | children = ( 264 | 146834041AC3E56700842450 /* libReact.a */, 265 | ); 266 | name = Products; 267 | sourceTree = ""; 268 | }; 269 | 78C398B11ACF4ADC00677621 /* Products */ = { 270 | isa = PBXGroup; 271 | children = ( 272 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 273 | ); 274 | name = Products; 275 | sourceTree = ""; 276 | }; 277 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 278 | isa = PBXGroup; 279 | children = ( 280 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 281 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 282 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 283 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 284 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 285 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 286 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 287 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 288 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 289 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 290 | 4B834EC0CF3F477590131FB8 /* React-Native-Webview-Bridge.xcodeproj */, 291 | ); 292 | name = Libraries; 293 | sourceTree = ""; 294 | }; 295 | 832341B11AAA6A8300B99B32 /* Products */ = { 296 | isa = PBXGroup; 297 | children = ( 298 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 299 | ); 300 | name = Products; 301 | sourceTree = ""; 302 | }; 303 | 83CBB9F61A601CBA00E9B192 = { 304 | isa = PBXGroup; 305 | children = ( 306 | D8808BF71D3AC4310065CA49 /* HoneyBook.ttf */, 307 | 13B07FAE1A68108700A75B9A /* RNRichTextEditor */, 308 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 309 | 00E356EF1AD99517003FC87E /* RNRichTextEditorTests */, 310 | 83CBBA001A601CBA00E9B192 /* Products */, 311 | ); 312 | indentWidth = 2; 313 | sourceTree = ""; 314 | tabWidth = 2; 315 | }; 316 | 83CBBA001A601CBA00E9B192 /* Products */ = { 317 | isa = PBXGroup; 318 | children = ( 319 | 13B07F961A680F5B00A75B9A /* RNRichTextEditor.app */, 320 | 00E356EE1AD99517003FC87E /* RNRichTextEditorTests.xctest */, 321 | ); 322 | name = Products; 323 | sourceTree = ""; 324 | }; 325 | D8808BE81D3AC33F0065CA49 /* Products */ = { 326 | isa = PBXGroup; 327 | children = ( 328 | D8808BF51D3AC33F0065CA49 /* libReact-Native-Webview-Bridge.a */, 329 | ); 330 | name = Products; 331 | sourceTree = ""; 332 | }; 333 | /* End PBXGroup section */ 334 | 335 | /* Begin PBXNativeTarget section */ 336 | 00E356ED1AD99517003FC87E /* RNRichTextEditorTests */ = { 337 | isa = PBXNativeTarget; 338 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "RNRichTextEditorTests" */; 339 | buildPhases = ( 340 | 00E356EA1AD99517003FC87E /* Sources */, 341 | 00E356EB1AD99517003FC87E /* Frameworks */, 342 | 00E356EC1AD99517003FC87E /* Resources */, 343 | ); 344 | buildRules = ( 345 | ); 346 | dependencies = ( 347 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 348 | ); 349 | name = RNRichTextEditorTests; 350 | productName = RNRichTextEditorTests; 351 | productReference = 00E356EE1AD99517003FC87E /* RNRichTextEditorTests.xctest */; 352 | productType = "com.apple.product-type.bundle.unit-test"; 353 | }; 354 | 13B07F861A680F5B00A75B9A /* RNRichTextEditor */ = { 355 | isa = PBXNativeTarget; 356 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNRichTextEditor" */; 357 | buildPhases = ( 358 | 13B07F871A680F5B00A75B9A /* Sources */, 359 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 360 | 13B07F8E1A680F5B00A75B9A /* Resources */, 361 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 362 | ); 363 | buildRules = ( 364 | ); 365 | dependencies = ( 366 | ); 367 | name = RNRichTextEditor; 368 | productName = "Hello World"; 369 | productReference = 13B07F961A680F5B00A75B9A /* RNRichTextEditor.app */; 370 | productType = "com.apple.product-type.application"; 371 | }; 372 | /* End PBXNativeTarget section */ 373 | 374 | /* Begin PBXProject section */ 375 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 376 | isa = PBXProject; 377 | attributes = { 378 | LastUpgradeCheck = 610; 379 | ORGANIZATIONNAME = Facebook; 380 | TargetAttributes = { 381 | 00E356ED1AD99517003FC87E = { 382 | CreatedOnToolsVersion = 6.2; 383 | TestTargetID = 13B07F861A680F5B00A75B9A; 384 | }; 385 | }; 386 | }; 387 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNRichTextEditor" */; 388 | compatibilityVersion = "Xcode 3.2"; 389 | developmentRegion = English; 390 | hasScannedForEncodings = 0; 391 | knownRegions = ( 392 | en, 393 | Base, 394 | ); 395 | mainGroup = 83CBB9F61A601CBA00E9B192; 396 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 397 | projectDirPath = ""; 398 | projectReferences = ( 399 | { 400 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 401 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 402 | }, 403 | { 404 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 405 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 406 | }, 407 | { 408 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 409 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 410 | }, 411 | { 412 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 413 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 414 | }, 415 | { 416 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 417 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 418 | }, 419 | { 420 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 421 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 422 | }, 423 | { 424 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 425 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 426 | }, 427 | { 428 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 429 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 430 | }, 431 | { 432 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 433 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 434 | }, 435 | { 436 | ProductGroup = D8808BE81D3AC33F0065CA49 /* Products */; 437 | ProjectRef = 4B834EC0CF3F477590131FB8 /* React-Native-Webview-Bridge.xcodeproj */; 438 | }, 439 | { 440 | ProductGroup = 146834001AC3E56700842450 /* Products */; 441 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 442 | }, 443 | ); 444 | projectRoot = ""; 445 | targets = ( 446 | 13B07F861A680F5B00A75B9A /* RNRichTextEditor */, 447 | 00E356ED1AD99517003FC87E /* RNRichTextEditorTests */, 448 | ); 449 | }; 450 | /* End PBXProject section */ 451 | 452 | /* Begin PBXReferenceProxy section */ 453 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 454 | isa = PBXReferenceProxy; 455 | fileType = archive.ar; 456 | path = libRCTActionSheet.a; 457 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 458 | sourceTree = BUILT_PRODUCTS_DIR; 459 | }; 460 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 461 | isa = PBXReferenceProxy; 462 | fileType = archive.ar; 463 | path = libRCTGeolocation.a; 464 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 465 | sourceTree = BUILT_PRODUCTS_DIR; 466 | }; 467 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 468 | isa = PBXReferenceProxy; 469 | fileType = archive.ar; 470 | path = libRCTImage.a; 471 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 472 | sourceTree = BUILT_PRODUCTS_DIR; 473 | }; 474 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 475 | isa = PBXReferenceProxy; 476 | fileType = archive.ar; 477 | path = libRCTNetwork.a; 478 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 479 | sourceTree = BUILT_PRODUCTS_DIR; 480 | }; 481 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 482 | isa = PBXReferenceProxy; 483 | fileType = archive.ar; 484 | path = libRCTVibration.a; 485 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 486 | sourceTree = BUILT_PRODUCTS_DIR; 487 | }; 488 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 489 | isa = PBXReferenceProxy; 490 | fileType = archive.ar; 491 | path = libRCTSettings.a; 492 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 493 | sourceTree = BUILT_PRODUCTS_DIR; 494 | }; 495 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 496 | isa = PBXReferenceProxy; 497 | fileType = archive.ar; 498 | path = libRCTWebSocket.a; 499 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 500 | sourceTree = BUILT_PRODUCTS_DIR; 501 | }; 502 | 146834041AC3E56700842450 /* libReact.a */ = { 503 | isa = PBXReferenceProxy; 504 | fileType = archive.ar; 505 | path = libReact.a; 506 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 507 | sourceTree = BUILT_PRODUCTS_DIR; 508 | }; 509 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 510 | isa = PBXReferenceProxy; 511 | fileType = archive.ar; 512 | path = libRCTLinking.a; 513 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 514 | sourceTree = BUILT_PRODUCTS_DIR; 515 | }; 516 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 517 | isa = PBXReferenceProxy; 518 | fileType = archive.ar; 519 | path = libRCTText.a; 520 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 521 | sourceTree = BUILT_PRODUCTS_DIR; 522 | }; 523 | D8808BF51D3AC33F0065CA49 /* libReact-Native-Webview-Bridge.a */ = { 524 | isa = PBXReferenceProxy; 525 | fileType = archive.ar; 526 | path = "libReact-Native-Webview-Bridge.a"; 527 | remoteRef = D8808BF41D3AC33F0065CA49 /* PBXContainerItemProxy */; 528 | sourceTree = BUILT_PRODUCTS_DIR; 529 | }; 530 | /* End PBXReferenceProxy section */ 531 | 532 | /* Begin PBXResourcesBuildPhase section */ 533 | 00E356EC1AD99517003FC87E /* Resources */ = { 534 | isa = PBXResourcesBuildPhase; 535 | buildActionMask = 2147483647; 536 | files = ( 537 | ); 538 | runOnlyForDeploymentPostprocessing = 0; 539 | }; 540 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 541 | isa = PBXResourcesBuildPhase; 542 | buildActionMask = 2147483647; 543 | files = ( 544 | D8808BF81D3AC4720065CA49 /* HoneyBook.ttf in Resources */, 545 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 546 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 547 | ); 548 | runOnlyForDeploymentPostprocessing = 0; 549 | }; 550 | /* End PBXResourcesBuildPhase section */ 551 | 552 | /* Begin PBXShellScriptBuildPhase section */ 553 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 554 | isa = PBXShellScriptBuildPhase; 555 | buildActionMask = 2147483647; 556 | files = ( 557 | ); 558 | inputPaths = ( 559 | ); 560 | name = "Bundle React Native code and images"; 561 | outputPaths = ( 562 | ); 563 | runOnlyForDeploymentPostprocessing = 0; 564 | shellPath = /bin/sh; 565 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 566 | }; 567 | /* End PBXShellScriptBuildPhase section */ 568 | 569 | /* Begin PBXSourcesBuildPhase section */ 570 | 00E356EA1AD99517003FC87E /* Sources */ = { 571 | isa = PBXSourcesBuildPhase; 572 | buildActionMask = 2147483647; 573 | files = ( 574 | 00E356F31AD99517003FC87E /* RNRichTextEditorTests.m in Sources */, 575 | ); 576 | runOnlyForDeploymentPostprocessing = 0; 577 | }; 578 | 13B07F871A680F5B00A75B9A /* Sources */ = { 579 | isa = PBXSourcesBuildPhase; 580 | buildActionMask = 2147483647; 581 | files = ( 582 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 583 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 584 | ); 585 | runOnlyForDeploymentPostprocessing = 0; 586 | }; 587 | /* End PBXSourcesBuildPhase section */ 588 | 589 | /* Begin PBXTargetDependency section */ 590 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 591 | isa = PBXTargetDependency; 592 | target = 13B07F861A680F5B00A75B9A /* RNRichTextEditor */; 593 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 594 | }; 595 | /* End PBXTargetDependency section */ 596 | 597 | /* Begin PBXVariantGroup section */ 598 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 599 | isa = PBXVariantGroup; 600 | children = ( 601 | 13B07FB21A68108700A75B9A /* Base */, 602 | ); 603 | name = LaunchScreen.xib; 604 | path = RNRichTextEditor; 605 | sourceTree = ""; 606 | }; 607 | /* End PBXVariantGroup section */ 608 | 609 | /* Begin XCBuildConfiguration section */ 610 | 00E356F61AD99517003FC87E /* Debug */ = { 611 | isa = XCBuildConfiguration; 612 | buildSettings = { 613 | BUNDLE_LOADER = "$(TEST_HOST)"; 614 | GCC_PREPROCESSOR_DEFINITIONS = ( 615 | "DEBUG=1", 616 | "$(inherited)", 617 | ); 618 | INFOPLIST_FILE = RNRichTextEditorTests/Info.plist; 619 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 620 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 621 | LIBRARY_SEARCH_PATHS = ( 622 | "$(inherited)", 623 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 624 | ); 625 | PRODUCT_NAME = "$(TARGET_NAME)"; 626 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNRichTextEditor.app/RNRichTextEditor"; 627 | }; 628 | name = Debug; 629 | }; 630 | 00E356F71AD99517003FC87E /* Release */ = { 631 | isa = XCBuildConfiguration; 632 | buildSettings = { 633 | BUNDLE_LOADER = "$(TEST_HOST)"; 634 | COPY_PHASE_STRIP = NO; 635 | INFOPLIST_FILE = RNRichTextEditorTests/Info.plist; 636 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 637 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 638 | LIBRARY_SEARCH_PATHS = ( 639 | "$(inherited)", 640 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 641 | ); 642 | PRODUCT_NAME = "$(TARGET_NAME)"; 643 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNRichTextEditor.app/RNRichTextEditor"; 644 | }; 645 | name = Release; 646 | }; 647 | 13B07F941A680F5B00A75B9A /* Debug */ = { 648 | isa = XCBuildConfiguration; 649 | buildSettings = { 650 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 651 | CODE_SIGN_IDENTITY = "iPhone Developer"; 652 | DEAD_CODE_STRIPPING = NO; 653 | HEADER_SEARCH_PATHS = ( 654 | "$(inherited)", 655 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 656 | "$(SRCROOT)/../node_modules/react-native/React/**", 657 | "$(SRCROOT)/../node_modules/react-native-webview-bridge/ios", 658 | ); 659 | INFOPLIST_FILE = RNRichTextEditor/Info.plist; 660 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 661 | ONLY_ACTIVE_ARCH = YES; 662 | OTHER_LDFLAGS = ( 663 | "$(inherited)", 664 | "-ObjC", 665 | "-lc++", 666 | ); 667 | PRODUCT_NAME = RNRichTextEditor; 668 | }; 669 | name = Debug; 670 | }; 671 | 13B07F951A680F5B00A75B9A /* Release */ = { 672 | isa = XCBuildConfiguration; 673 | buildSettings = { 674 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 675 | CODE_SIGN_IDENTITY = "iPhone Developer"; 676 | HEADER_SEARCH_PATHS = ( 677 | "$(inherited)", 678 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 679 | "$(SRCROOT)/../node_modules/react-native/React/**", 680 | "$(SRCROOT)/../node_modules/react-native-webview-bridge/ios", 681 | ); 682 | INFOPLIST_FILE = RNRichTextEditor/Info.plist; 683 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 684 | ONLY_ACTIVE_ARCH = NO; 685 | OTHER_LDFLAGS = ( 686 | "$(inherited)", 687 | "-ObjC", 688 | "-lc++", 689 | ); 690 | PRODUCT_NAME = RNRichTextEditor; 691 | }; 692 | name = Release; 693 | }; 694 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 695 | isa = XCBuildConfiguration; 696 | buildSettings = { 697 | ALWAYS_SEARCH_USER_PATHS = NO; 698 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 699 | CLANG_CXX_LIBRARY = "libc++"; 700 | CLANG_ENABLE_MODULES = YES; 701 | CLANG_ENABLE_OBJC_ARC = YES; 702 | CLANG_WARN_BOOL_CONVERSION = YES; 703 | CLANG_WARN_CONSTANT_CONVERSION = YES; 704 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 705 | CLANG_WARN_EMPTY_BODY = YES; 706 | CLANG_WARN_ENUM_CONVERSION = YES; 707 | CLANG_WARN_INT_CONVERSION = YES; 708 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 709 | CLANG_WARN_UNREACHABLE_CODE = YES; 710 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 711 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 712 | COPY_PHASE_STRIP = NO; 713 | ENABLE_STRICT_OBJC_MSGSEND = YES; 714 | GCC_C_LANGUAGE_STANDARD = gnu99; 715 | GCC_DYNAMIC_NO_PIC = NO; 716 | GCC_OPTIMIZATION_LEVEL = 0; 717 | GCC_PREPROCESSOR_DEFINITIONS = ( 718 | "DEBUG=1", 719 | "$(inherited)", 720 | ); 721 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 722 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 723 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 724 | GCC_WARN_UNDECLARED_SELECTOR = YES; 725 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 726 | GCC_WARN_UNUSED_FUNCTION = YES; 727 | GCC_WARN_UNUSED_VARIABLE = YES; 728 | HEADER_SEARCH_PATHS = ( 729 | "$(inherited)", 730 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 731 | "$(SRCROOT)/../node_modules/react-native/React/**", 732 | "$(SRCROOT)/../node_modules/react-native-webview-bridge/ios", 733 | ); 734 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 735 | MTL_ENABLE_DEBUG_INFO = YES; 736 | ONLY_ACTIVE_ARCH = YES; 737 | SDKROOT = iphoneos; 738 | }; 739 | name = Debug; 740 | }; 741 | 83CBBA211A601CBA00E9B192 /* Release */ = { 742 | isa = XCBuildConfiguration; 743 | buildSettings = { 744 | ALWAYS_SEARCH_USER_PATHS = NO; 745 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 746 | CLANG_CXX_LIBRARY = "libc++"; 747 | CLANG_ENABLE_MODULES = YES; 748 | CLANG_ENABLE_OBJC_ARC = YES; 749 | CLANG_WARN_BOOL_CONVERSION = YES; 750 | CLANG_WARN_CONSTANT_CONVERSION = YES; 751 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 752 | CLANG_WARN_EMPTY_BODY = YES; 753 | CLANG_WARN_ENUM_CONVERSION = YES; 754 | CLANG_WARN_INT_CONVERSION = YES; 755 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 756 | CLANG_WARN_UNREACHABLE_CODE = YES; 757 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 758 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 759 | COPY_PHASE_STRIP = YES; 760 | ENABLE_NS_ASSERTIONS = NO; 761 | ENABLE_STRICT_OBJC_MSGSEND = YES; 762 | GCC_C_LANGUAGE_STANDARD = gnu99; 763 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 764 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 765 | GCC_WARN_UNDECLARED_SELECTOR = YES; 766 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 767 | GCC_WARN_UNUSED_FUNCTION = YES; 768 | GCC_WARN_UNUSED_VARIABLE = YES; 769 | HEADER_SEARCH_PATHS = ( 770 | "$(inherited)", 771 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 772 | "$(SRCROOT)/../node_modules/react-native/React/**", 773 | "$(SRCROOT)/../node_modules/react-native-webview-bridge/ios", 774 | ); 775 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 776 | MTL_ENABLE_DEBUG_INFO = NO; 777 | SDKROOT = iphoneos; 778 | VALIDATE_PRODUCT = YES; 779 | }; 780 | name = Release; 781 | }; 782 | /* End XCBuildConfiguration section */ 783 | 784 | /* Begin XCConfigurationList section */ 785 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "RNRichTextEditorTests" */ = { 786 | isa = XCConfigurationList; 787 | buildConfigurations = ( 788 | 00E356F61AD99517003FC87E /* Debug */, 789 | 00E356F71AD99517003FC87E /* Release */, 790 | ); 791 | defaultConfigurationIsVisible = 0; 792 | defaultConfigurationName = Release; 793 | }; 794 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNRichTextEditor" */ = { 795 | isa = XCConfigurationList; 796 | buildConfigurations = ( 797 | 13B07F941A680F5B00A75B9A /* Debug */, 798 | 13B07F951A680F5B00A75B9A /* Release */, 799 | ); 800 | defaultConfigurationIsVisible = 0; 801 | defaultConfigurationName = Release; 802 | }; 803 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNRichTextEditor" */ = { 804 | isa = XCConfigurationList; 805 | buildConfigurations = ( 806 | 83CBBA201A601CBA00E9B192 /* Debug */, 807 | 83CBBA211A601CBA00E9B192 /* Release */, 808 | ); 809 | defaultConfigurationIsVisible = 0; 810 | defaultConfigurationName = Release; 811 | }; 812 | /* End XCConfigurationList section */ 813 | }; 814 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 815 | } 816 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/project.xcworkspace/xcuserdata/guyeldar.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/project.xcworkspace/xcuserdata/guyeldar.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/xcshareddata/xcschemes/RNRichTextEditor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor.xcodeproj/xcuserdata/guyeldar.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RNRichTextEditor.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 00E356ED1AD99517003FC87E 16 | 17 | primary 18 | 19 | 20 | 13B07F861A680F5B00A75B9A 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 21 | 22 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 23 | moduleName:@"RNRichTextEditor" 24 | initialProperties:nil 25 | launchOptions:launchOptions]; 26 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 27 | 28 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 29 | UIViewController *rootViewController = [UIViewController new]; 30 | rootViewController.view = rootView; 31 | self.window.rootViewController = rootViewController; 32 | [self.window makeKeyAndVisible]; 33 | return YES; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/HoneyBook.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Example/RNRichTextEditor/ios/RNRichTextEditor/HoneyBook.ttf -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | NSAllowsArbitraryLoads 44 | 45 | 46 | UIAppFonts 47 | 48 | HoneyBook.ttf 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditor/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/ios/RNRichTextEditorTests/RNRichTextEditorTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface RNRichTextEditorTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation RNRichTextEditorTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/RNRichTextEditor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNRichTextEditor", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start" 7 | }, 8 | "dependencies": { 9 | "fbemitter": "^2.0.2", 10 | "lodash": "3.10.1", 11 | "react": "15.2.0", 12 | "react-native": "^0.29.2", 13 | "react-native-keyboard-spacer": "^0.3.0", 14 | "react-native-richtext-editor": "HoneyBook/react-native-richtext-editor", 15 | "react-native-webview-bridge": "HoneyBook/react-native-webview-bridge" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HBEditorConstants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by guyeldar on 02/06/2016. 3 | */ 4 | var HBEditorConstants = { 5 | 6 | HB_TOOLBAR_ITEM_STATE_NORMAL: 1, 7 | HB_TOOLBAR_ITEM_STATE_SELECTED: 2, 8 | 9 | // Button types 10 | TOOLBAR_ITEM_BOLD: "bold", 11 | TOOLBAR_ITEM_ITALIC: "italic", 12 | TOOLBAR_ITEM_UNDERLINE: "underline", 13 | TOOLBAR_ITEM_REMOVE_FORMATTING: "removeFormat", 14 | TOOLBAR_ITEM_INSERT_LINK: "link", 15 | TOOLBAR_ITEM_REMOVE_LINK: "unlink", 16 | TOOLBAR_ITEM_ALIGN_RIGHT: "justifyRight", 17 | TOOLBAR_ITEM_ALIGN_CENTER: "justifyCenter", 18 | TOOLBAR_ITEM_ALIGN_LEFT: "justifyLeft", 19 | TOOLBAR_ITEM_ALIGN_FULL: "justifyFull", 20 | TOOLBAR_ITEM_BULLETS_LIST: "insertUnorderedList", 21 | TOOLBAR_ITEM_HEADING_1: "h1", 22 | TOOLBAR_ITEM_HEADING_2: "h2", 23 | TOOLBAR_ITEM_HEADING_3: "h3", 24 | TOOLBAR_ITEM_HEADING_4: "h4", 25 | TOOLBAR_ITEM_HEADING_5: "h5", 26 | TOOLBAR_ITEM_HEADING_6: "h6", 27 | TOOLBAR_ITEM_PARAGRAPH: "paragraph", 28 | TOOLBAR_ITEM_SUBSCRIPT: "subscript", 29 | TOOLBAR_ITEM_SUPERSCRIPT: "superscript", 30 | TOOLBAR_ITEM_STRIKETHROUGH: "strikethrough", 31 | TOOLBAR_ITEM_ORDERED_LIST: "orderedList", 32 | TOOLBAR_ITEM_HR: "hr", 33 | TOOLBAR_ITEM_INDENT: "indent", 34 | TOOLBAR_ITEM_OUTDENT: "outdent", 35 | 36 | 37 | // Event Emitter event name 38 | TOOLBAR_ITEM_WAS_PRESSED: "toolbarItemWasPressed", 39 | TOOLBAR_ITEMS_STATE_HAS_BEEN_CHANGED: "toolbarItemsStateHasBeenChanged", 40 | HB_RICH_EDITOR_GOT_FOCUS: "hbRichEditorGotFocus", 41 | HB_RICH_EDITOR_TOOLBAR_BUTTON_WAS_PRESSED: "HbRichEditorToolbarButtonWasPressed" 42 | }; 43 | 44 | module.exports = HBEditorConstants; -------------------------------------------------------------------------------- /HBEditorEventEmitter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var {EventEmitter} = require('fbemitter'); 3 | 4 | let instance = null; 5 | 6 | class HBEditorEventEmitter extends EventEmitter { 7 | 8 | static get instance() { 9 | if (!instance) { 10 | instance = new HBEditorEventEmitter(); 11 | } 12 | return instance; 13 | } 14 | 15 | static syncEmit(eventName:string, metadata:object){ 16 | HBEditorEventEmitter.emitWrapper(eventName,metadata); 17 | } 18 | 19 | static emitWrapper(eventName:string, metadata:object){ 20 | try { 21 | HBEditorEventEmitter.instance.emit(eventName, metadata); 22 | }catch(exception){ 23 | console.log(exception); 24 | } 25 | } 26 | } 27 | module.exports = HBEditorEventEmitter; -------------------------------------------------------------------------------- /HBRichTextEditor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by guyeldar on 04/06/2016. 3 | */ 4 | import React, { Component } from 'react'; 5 | var ReactNative = require('react-native'); 6 | 7 | var WebViewBridge = require('react-native-webview-bridge'); 8 | var HBEditorConstants = require('./HBEditorConstants'); 9 | var HBEditorEventEmitter = require('./HBEditorEventEmitter'); 10 | 11 | var { 12 | StyleSheet, 13 | AlertIOS 14 | } = ReactNative; 15 | 16 | class HBRichTextEditor extends Component { 17 | 18 | constructor(props) { 19 | super(props); 20 | this.placeholder = null; 21 | } 22 | 23 | componentDidMount() { 24 | HBEditorEventEmitter.instance.addListener(HBEditorConstants.TOOLBAR_ITEM_WAS_PRESSED, function(itemType) { 25 | this._handleToolbarItemPress(itemType.type); 26 | }.bind(this)); 27 | } 28 | 29 | _replaceInputTags(html) { 30 | var anchorIndex = 0; 31 | while (html.indexOf("", startPos); 34 | 35 | var inputTag = html.slice(startPos, endPos + 1); 36 | html = html.replace(inputTag, ""); 37 | 38 | anchorIndex = endPos; 39 | } 40 | return html; 41 | } 42 | 43 | componentWillUnmount() { 44 | HBEditorEventEmitter.instance.removeAllListeners(HBEditorConstants.TOOLBAR_ITEM_WAS_PRESSED); 45 | } 46 | 47 | onBridgeMessage (message) { 48 | console.log(message); 49 | } 50 | 51 | getHTML() { 52 | var that = this; 53 | return new Promise(function (resolve, reject) { 54 | that.refs.webviewbridge.getElementHTML("zss_editor_content", (error, html) => { 55 | if (that.placeholder && html.indexOf(that.placeholder) != -1) { 56 | html = html.replace(that.placeholder,""); 57 | } 58 | if (html.trim().length == 0) { 59 | resolve(" "); 60 | } 61 | resolve(html); 62 | }); 63 | }); 64 | } 65 | 66 | getSelectedHTML() { 67 | var that = this; 68 | return new Promise(function (resolve, reject) { 69 | that.refs.webviewbridge.getSelectedHTML("zss_editor_content", (error, html) => { 70 | resolve(html); 71 | }); 72 | }); 73 | } 74 | 75 | setHTML(html) { 76 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHTML("${html}");`); 77 | } 78 | 79 | setPlaceholder(placeholderText) { 80 | this.placeholder = placeholderText; 81 | this.refs.webviewbridge.sendToBridge(`zss_editor.setPlaceholder("${placeholderText}");`); 82 | } 83 | 84 | _insertLinkWithDialog() { 85 | this.refs.webviewbridge.sendToBridge(`zss_editor.prepareInsert();`); 86 | 87 | this.getSelectedHTML() 88 | .then((html) => { 89 | AlertIOS.prompt( 90 | 'Insert link', 91 | 'Enter the URL for the link', 92 | [ 93 | {text: 'Cancel', onPress: () => console.log('Cancel Pressed')}, 94 | {text: 'Insert', onPress: (url) => { 95 | if (html.length > 0) { 96 | this.refs.webviewbridge.sendToBridge(`zss_editor.insertLink(\"` + url + `\", \"\");`); 97 | } else { 98 | this.refs.webviewbridge.sendToBridge(`zss_editor.insertLink(\"` + url + `\", \"` + url + `\");`); 99 | } 100 | 101 | }, type: "default"}, 102 | 103 | ], 104 | 'plain-text', 105 | 'http://' 106 | ); 107 | }) 108 | .catch((err) => { 109 | console.log("Error in getSelectedHTML : " + err); 110 | }); 111 | } 112 | 113 | render() { 114 | return ( 115 | 122 | ); 123 | } 124 | 125 | onShouldStartLoadRequest(event) { 126 | console.log("inside onShouldStartLoadRequest with url " + event.url); 127 | if (event.url.indexOf("callback://") != -1) { 128 | var urlParams = event.url.replace("callback://0/",""); 129 | var items = urlParams.split(","); 130 | 131 | HBEditorEventEmitter.instance.emit(HBEditorConstants.HB_RICH_EDITOR_GOT_FOCUS); 132 | HBEditorEventEmitter.instance.emit(HBEditorConstants.TOOLBAR_ITEMS_STATE_HAS_BEEN_CHANGED, items); 133 | 134 | return false; 135 | } 136 | else if (event.url.indexOf("scroll://") != -1) { 137 | HBEditorEventEmitter.instance.emit(HBEditorConstants.HB_RICH_EDITOR_GOT_FOCUS); 138 | 139 | return false; 140 | } 141 | 142 | return (event.url.indexOf("editor.html") != -1); 143 | } 144 | 145 | _handleToolbarItemPress(itemType) { 146 | HBEditorEventEmitter.instance.emit(HBEditorConstants.HB_RICH_EDITOR_TOOLBAR_BUTTON_WAS_PRESSED,{pressedButton:itemType}); 147 | 148 | switch (itemType) { 149 | case HBEditorConstants.TOOLBAR_ITEM_BOLD: 150 | { 151 | this.setBold(); 152 | break; 153 | } 154 | case HBEditorConstants.TOOLBAR_ITEM_ITALIC: 155 | { 156 | this.setItalic(); 157 | break; 158 | } 159 | case HBEditorConstants.TOOLBAR_ITEM_UNDERLINE: 160 | { 161 | this.setUnderline(); 162 | break; 163 | } 164 | case HBEditorConstants.TOOLBAR_ITEM_REMOVE_FORMATTING: 165 | { 166 | this.removeFormat(); 167 | break; 168 | } 169 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_LEFT: 170 | { 171 | this.alignLeft(); 172 | break; 173 | } 174 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_CENTER: 175 | { 176 | this.alignCenter(); 177 | break; 178 | } 179 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_RIGHT: 180 | { 181 | this.alignRight(); 182 | break; 183 | } 184 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_FULL: 185 | { 186 | this.alignFull(); 187 | break; 188 | } 189 | case HBEditorConstants.TOOLBAR_ITEM_BULLETS_LIST: 190 | { 191 | this.insertBulletsList(); 192 | break; 193 | } 194 | case HBEditorConstants.TOOLBAR_ITEM_ORDERED_LIST: 195 | { 196 | this.insertOrderedList(); 197 | break; 198 | } 199 | case HBEditorConstants.TOOLBAR_ITEM_INSERT_LINK: 200 | { 201 | this._insertLinkWithDialog(); 202 | break; 203 | } 204 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_1: 205 | { 206 | this.heading1(); 207 | break; 208 | } 209 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_2: 210 | { 211 | this.heading2(); 212 | break; 213 | } 214 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_3: 215 | { 216 | this.heading3(); 217 | break; 218 | } 219 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_4: 220 | { 221 | this.heading4(); 222 | break; 223 | } 224 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_5: 225 | { 226 | this.heading5(); 227 | break; 228 | } 229 | case HBEditorConstants.TOOLBAR_ITEM_HEADING_6: 230 | { 231 | this.heading6(); 232 | break; 233 | } 234 | case HBEditorConstants.TOOLBAR_ITEM_PARAGRAPH: 235 | { 236 | this.setParagraph(); 237 | break; 238 | } 239 | case HBEditorConstants.TOOLBAR_ITEM_SUBSCRIPT: 240 | { 241 | this.setSubscript(); 242 | break; 243 | } 244 | case HBEditorConstants.TOOLBAR_ITEM_SUPERSCRIPT: 245 | { 246 | this.setSuperscript(); 247 | break; 248 | } 249 | case HBEditorConstants.TOOLBAR_ITEM_STRIKETHROUGH: 250 | { 251 | this.setStrikethrough(); 252 | break; 253 | } 254 | case HBEditorConstants.TOOLBAR_ITEM_HR: 255 | { 256 | this.setHR(); 257 | break; 258 | } 259 | case HBEditorConstants.TOOLBAR_ITEM_INDENT: 260 | { 261 | this.setIndent(); 262 | break; 263 | } 264 | case HBEditorConstants.TOOLBAR_ITEM_OUTDENT: 265 | { 266 | this.setOutdent(); 267 | break; 268 | } 269 | } 270 | } 271 | 272 | blurEditor() { 273 | this.refs.webviewbridge.sendToBridge(`zss_editor.blurEditor();`); 274 | } 275 | 276 | setBold() { 277 | this.refs.webviewbridge.sendToBridge(`zss_editor.setBold();`); 278 | } 279 | 280 | setItalic() { 281 | this.refs.webviewbridge.sendToBridge(`zss_editor.setItalic();`); 282 | } 283 | 284 | setUnderline() { 285 | this.refs.webviewbridge.sendToBridge(`zss_editor.setUnderline();`); 286 | } 287 | 288 | heading1() { 289 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h1');`); 290 | } 291 | 292 | heading2() { 293 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h2');`); 294 | } 295 | 296 | heading3() { 297 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h3');`); 298 | } 299 | 300 | heading4() { 301 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h4');`); 302 | } 303 | 304 | heading5() { 305 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h5');`); 306 | } 307 | 308 | heading6() { 309 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHeading('h6');`); 310 | } 311 | 312 | setParagraph() { 313 | this.refs.webviewbridge.sendToBridge(`zss_editor.setParagraph();`); 314 | } 315 | 316 | removeFormat() { 317 | this.refs.webviewbridge.sendToBridge(`zss_editor.removeFormating();`); 318 | } 319 | 320 | alignLeft() { 321 | this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyLeft();`); 322 | } 323 | 324 | alignCenter() { 325 | this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyCenter();`); 326 | } 327 | 328 | alignRight() { 329 | this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyRight();`); 330 | } 331 | 332 | alignFull() { 333 | this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyFull();`); 334 | } 335 | 336 | insertBulletsList() { 337 | this.refs.webviewbridge.sendToBridge(`zss_editor.setUnorderedList();`); 338 | } 339 | 340 | insertOrderedList() { 341 | this.refs.webviewbridge.sendToBridge(`zss_editor.setOrderedList();`); 342 | } 343 | 344 | setSubscript() { 345 | this.refs.webviewbridge.sendToBridge(`zss_editor.setSubscript();`); 346 | } 347 | setSuperscript() { 348 | this.refs.webviewbridge.sendToBridge(`zss_editor.setSuperscript();`); 349 | } 350 | setStrikethrough() { 351 | this.refs.webviewbridge.sendToBridge(`zss_editor.setStrikeThrough();`); 352 | } 353 | setHR() { 354 | this.refs.webviewbridge.sendToBridge(`zss_editor.setHorizontalRule();`); 355 | } 356 | setIndent() { 357 | this.refs.webviewbridge.sendToBridge(`zss_editor.setIndent();`); 358 | } 359 | setOutdent() { 360 | this.refs.webviewbridge.sendToBridge(`zss_editor.setOutdent();`); 361 | } 362 | } 363 | 364 | var styles = StyleSheet.create({ 365 | }); 366 | 367 | module.exports = HBRichTextEditor; -------------------------------------------------------------------------------- /HBToolbar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by guyeldar on 02/06/2016. 3 | */ 4 | /** 5 | * Created by guyeldar on 02/06/2016. 6 | */ 7 | import React, { Component } from 'react'; 8 | var ReactNative = require('react-native'); 9 | var HBToolbarItem = require('./HBToolbarItem'); 10 | var HBEditorConstants = require('./HBEditorConstants'); 11 | var HBEditorEventEmitter = require("./HBEditorEventEmitter"); 12 | var _ = require("lodash"); 13 | 14 | var { 15 | ListView, 16 | StyleSheet, 17 | Image, 18 | View, 19 | TouchableOpacity, 20 | Text 21 | } = ReactNative; 22 | 23 | // this.props.toolbarItems 24 | class HBToolbar extends Component { 25 | 26 | constructor(props) { 27 | super(props); 28 | this.buttonStyle =[this.props.baseButtonStyle? 29 | this.props.baseButtonStyle: 30 | this._getDefaultButtonStyle(),this.props.defaultButtonStyle] 31 | 32 | this.selectedButtonStyle =[this.props.baseButtonStyle? 33 | this.props.baseButtonStyle: 34 | this._getDefaultSelectedButtonStyle(),this.props.selectedButtonStyle] 35 | 36 | 37 | this.types = this.props.toolbarItems && this.props.toolbarItems.length > 0 ? this.props.toolbarItems : 38 | this._getDefaultToolbarPreset({}); 39 | var ds = new ListView.DataSource({rowHasChanged: (row1, row2) => row1 !== row2}); 40 | this._pressData = {}; 41 | this.state = { 42 | dataSource: ds.cloneWithRows(this._genCols(this._pressData)) 43 | }; 44 | } 45 | 46 | componentDidMount() { 47 | HBEditorEventEmitter.instance.addListener(HBEditorConstants.TOOLBAR_ITEMS_STATE_HAS_BEEN_CHANGED, function (selectedItems) { 48 | console.log("TOOLBAR ITEMS STATE HAS BEEN CHANGED"); 49 | this._updateToolbarItemsSelectionState(selectedItems); 50 | }.bind(this)); 51 | } 52 | 53 | componentWillUnmount() { 54 | HBEditorEventEmitter.instance.removeAllListeners(HBEditorConstants.TOOLBAR_ITEMS_STATE_HAS_BEEN_CHANGED); 55 | } 56 | 57 | _getDefaultButtonStyle() { 58 | return { 59 | fontFamily: 'iconbasic', 60 | alignSelf: 'center', 61 | padding: 5, 62 | fontSize: 28 63 | }; 64 | } 65 | 66 | _getDefaultSelectedButtonStyle() { 67 | return { 68 | fontFamily: 'iconbasic', 69 | alignSelf: 'center', 70 | fontSize: 28 71 | }; 72 | } 73 | 74 | _getDefaultToolbarPreset() { 75 | return [ 76 | HBEditorConstants.TOOLBAR_ITEM_BOLD, 77 | HBEditorConstants.TOOLBAR_ITEM_ITALIC, 78 | HBEditorConstants.TOOLBAR_ITEM_UNDERLINE, 79 | HBEditorConstants.TOOLBAR_ITEM_REMOVE_FORMATTING, 80 | HBEditorConstants.TOOLBAR_ITEM_BULLETS_LIST, 81 | HBEditorConstants.TOOLBAR_ITEM_INSERT_LINK 82 | ]; 83 | } 84 | 85 | _genCols(pressedData) { 86 | var arr = []; 87 | this.types.forEach(function (type) { 88 | var selected = false; 89 | if (pressedData[type]) { 90 | selected = true; 91 | } 92 | arr.push({type: type, selected: selected}); 93 | }); 94 | return arr; 95 | } 96 | 97 | _updateToolbarItemsSelectionState(selectedItems) { 98 | var newPressedData = {}; 99 | selectedItems.forEach((item) => { 100 | newPressedData[item] = true; 101 | }); 102 | this._pressData = newPressedData; 103 | this.setState({ 104 | dataSource: this.state.dataSource.cloneWithRows( 105 | this._genCols(this._pressData) 106 | ) 107 | }); 108 | } 109 | 110 | _pressCol(data) { 111 | HBEditorEventEmitter.instance.emit(HBEditorConstants.TOOLBAR_ITEM_WAS_PRESSED, {type: data.type}); 112 | } 113 | 114 | _createIconForType(type,isSelected) { 115 | var style = [this.buttonStyle,isSelected?this.selectedButtonStyle:undefined]; 116 | switch (type) { 117 | case HBEditorConstants.TOOLBAR_ITEM_BOLD: 118 | { 119 | return (); 120 | } 121 | case HBEditorConstants.TOOLBAR_ITEM_ITALIC: 122 | { 123 | return (); 124 | } 125 | case HBEditorConstants.TOOLBAR_ITEM_UNDERLINE: 126 | { 127 | return (); 128 | } 129 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_CENTER : 130 | { 131 | return (); 132 | } 133 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_LEFT: 134 | { 135 | return (); 136 | } 137 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_RIGHT: 138 | { 139 | return (); 140 | } 141 | case HBEditorConstants.TOOLBAR_ITEM_INSERT_LINK: 142 | { 143 | return (); 144 | } 145 | case HBEditorConstants.TOOLBAR_ITEM_REMOVE_LINK: 146 | { 147 | return (); 148 | } 149 | case HBEditorConstants.TOOLBAR_ITEM_REMOVE_FORMATTING: 150 | { 151 | return (); 152 | } 153 | case HBEditorConstants.TOOLBAR_ITEM_BULLETS_LIST: 154 | { 155 | return (); 156 | } 157 | } 158 | 159 | return undefined; 160 | } 161 | 162 | _createImageForType(type) { 163 | var selectedStyle = {backgroundColor: "rgb(125,125,125)"}; 164 | switch (type) { 165 | case HBEditorConstants.TOOLBAR_ITEM_BOLD: 166 | { 167 | return (); 168 | } 169 | case HBEditorConstants.TOOLBAR_ITEM_ITALIC: 170 | { 171 | return (); 172 | } 173 | case HBEditorConstants.TOOLBAR_ITEM_UNDERLINE: 174 | { 175 | return (); 176 | } 177 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_CENTER : 178 | { 179 | return (); 180 | } 181 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_LEFT: 182 | { 183 | return (); 184 | } 185 | case HBEditorConstants.TOOLBAR_ITEM_ALIGN_RIGHT: 186 | { 187 | return (); 188 | } 189 | case HBEditorConstants.TOOLBAR_ITEM_INSERT_LINK: 190 | { 191 | return (); 192 | } 193 | case HBEditorConstants.TOOLBAR_ITEM_REMOVE_LINK: 194 | { 195 | return (); 196 | } 197 | case HBEditorConstants.TOOLBAR_ITEM_REMOVE_FORMATTING: 198 | { 199 | return (); 200 | } 201 | case HBEditorConstants.TOOLBAR_ITEM_BULLETS_LIST: 202 | { 203 | return (); 204 | } 205 | } 206 | 207 | return undefined; 208 | } 209 | 210 | _renderCol(colData) { 211 | return 221 | {this._createIconForType(colData.type,colData.selected)} 222 | 223 | } 224 | 225 | _renderFooter() { 226 | if (this.props.footerView) { 227 | return this.props.footerView; 228 | } 229 | 230 | return undefined; 231 | } 232 | 233 | render() { 234 | let bgColorStyle = this.props.toolbarBackgroundColor ? {backgroundColor:this.props.toolbarBackgroundColor} : 235 | {backgroundColor:'rgba(125,125,125,0.1)'}; 236 | return ( 237 | 238 | {this.props.fixedLeft} 239 | 247 | {this.props.fixedRight} 248 | 249 | 250 | 251 | ); 252 | } 253 | 254 | } 255 | 256 | var styles = StyleSheet.create({ 257 | toolbarHolder: { 258 | flexDirection: "row" 259 | }, 260 | buttons: { 261 | flex: 1, 262 | flexDirection: "row", 263 | paddingBottom: 4 264 | }, 265 | selectedIcon: { 266 | fontFamily: 'iconbasic', 267 | alignSelf: 'center', 268 | fontSize: 28 269 | }, 270 | icon: { 271 | fontFamily: 'iconbasic', 272 | alignSelf: 'center', 273 | padding: 5, 274 | fontSize: 28 275 | } 276 | }); 277 | 278 | module.exports = HBToolbar; 279 | -------------------------------------------------------------------------------- /HBToolbarItem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by guyeldar on 02/06/2016. 3 | */ 4 | import React, { Component } from 'react'; 5 | var ReactNative = require('react-native'); 6 | 7 | var { 8 | TouchableOpacity, 9 | } = ReactNative; 10 | 11 | // this.props.key 12 | // this.props.type (HBEditorConstants.TOOLBAR_ITEM_TYPES) 13 | // this.props.itemViewFragment 14 | // this.props.buttonStyle 15 | // this props.selectedButtonStyle 16 | // this.props.isSelected 17 | class HBToolbarItem extends Component { 18 | 19 | constructor(props) { 20 | super(props); 21 | } 22 | 23 | render() { 24 | return ( 25 | 28 | {this.props.itemViewFragment} 29 | 30 | ); 31 | } 32 | 33 | } 34 | 35 | module.exports = HBToolbarItem; 36 | -------------------------------------------------------------------------------- /Images/HBbold@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBbold@2x.png -------------------------------------------------------------------------------- /Images/HBbold_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBbold_selected@2x.png -------------------------------------------------------------------------------- /Images/HBcenterjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBcenterjustify@2x.png -------------------------------------------------------------------------------- /Images/HBclearstyle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBclearstyle@2x.png -------------------------------------------------------------------------------- /Images/HBitalic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBitalic@2x.png -------------------------------------------------------------------------------- /Images/HBleftjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBleftjustify@2x.png -------------------------------------------------------------------------------- /Images/HBlink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBlink@2x.png -------------------------------------------------------------------------------- /Images/HBrightjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBrightjustify@2x.png -------------------------------------------------------------------------------- /Images/HBunderline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBunderline@2x.png -------------------------------------------------------------------------------- /Images/HBunlink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/HBunlink@2x.png -------------------------------------------------------------------------------- /Images/bold_asset@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bold_asset@2x.png -------------------------------------------------------------------------------- /Images/bold_asset@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bold_asset@3x.png -------------------------------------------------------------------------------- /Images/bold_asset_padded@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bold_asset_padded@2x.png -------------------------------------------------------------------------------- /Images/bold_asset_padded@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bold_asset_padded@3x.png -------------------------------------------------------------------------------- /Images/bullets_asset@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bullets_asset@2x.png -------------------------------------------------------------------------------- /Images/bullets_asset@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/bullets_asset@3x.png -------------------------------------------------------------------------------- /Images/italic_asset@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/italic_asset@2x.png -------------------------------------------------------------------------------- /Images/italic_asset_padded@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/italic_asset_padded@2x.png -------------------------------------------------------------------------------- /Images/italic_asset_padded@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/italic_asset_padded@3x.png -------------------------------------------------------------------------------- /Images/link_asset@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/link_asset@2x.png -------------------------------------------------------------------------------- /Images/link_asset@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/link_asset@3x.png -------------------------------------------------------------------------------- /Images/link_asset_padded@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/link_asset_padded@2x.png -------------------------------------------------------------------------------- /Images/remove_styling@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/remove_styling@2x.png -------------------------------------------------------------------------------- /Images/remove_styling@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/remove_styling@3x.png -------------------------------------------------------------------------------- /Images/underline_asset@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/underline_asset@2x.png -------------------------------------------------------------------------------- /Images/underline_asset@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/underline_asset@3x.png -------------------------------------------------------------------------------- /Images/underline_padded@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/underline_padded@2x.png -------------------------------------------------------------------------------- /Images/underline_padded@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/Images/underline_padded@3x.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, HoneyBook 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of react-native-richtext-editor nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![npm version](https://badge.fury.io/js/react-native-richtext-editor.svg)](https://badge.fury.io/js/react-native-richtext-editor) 2 | 3 | # react-native-richtext-editor 4 | A Flexible Rich Text Editor for React Native. 5 | 6 | **This library currently supports iOS only** 7 | 8 | ### Demo 9 | ![](./demo.gif) 10 | 11 | Install 12 | -------------- 13 | 14 | ```npm install react-native-richtext-editor --save``` 15 | 16 | Usage 17 | -------------- 18 | It is strongly recommended to go through the Example project attached to this repo. 19 | 20 | In order to add both the editor and its toolbar separately, add these requires to your code: 21 | ``` 22 | var HBRichTextEditor = require('react-native-richtext-editor'); 23 | var HBToolbar = require('react-native-richtext-editor/HBToolbar'); 24 | ``` 25 | 26 | - In your render method, add the components like this: 27 | ``` 28 | 31 | 32 | ``` 33 | 34 | HBRichTextEditor Props Configuration 35 | -------------- 36 | - **initialHTML** : an HTML string to be displayed as the initial value in the editor. 37 | 38 | HBToolbar Props Configuration 39 | -------------- 40 | - **toolbarItems** : There is a default toolbar preset. If you don't want the default one, you can pass 'toolbarItems' which should be an array of string constants, reflecting the items that should appear in the toolbar. The supported toolbar items appear on HBEditorConstants file (under "Button Types"). 41 | - **baseButtonStyle** : Styling that should be applied to all buttons in the toolbar - regardless of the button's state. 42 | - **defaultButtonStyle** : Styling that should be applied to all **unselected** buttons in the toolbar. 43 | - **selectedButtonStyle** : Styling that should be applied to all **selected** buttons in the toolbar. 44 | 45 | Events emitted from the editor 46 | -------------- 47 | - **HBEditorConstants.HB_RICH_EDITOR_GOT_FOCUS** : Will fire when the editor gets focus, to give you an option of preparing the view. 48 | - **HBEditorConstants.HB_RICH_EDITOR_TOOLBAR_BUTTON_WAS_PRESSED** : Will fire every time a toolbar button has been pressed. As a payload you'll get "pressedButton" - the specific name of the button that was pressed. 49 | 50 | TODOs 51 | -------------- 52 | - Android Support 53 | - Improve link creation on editor. 54 | - Take out the 1000ms timeout when initing the editor. 55 | - Support tags parsing. 56 | - Add ability to change icons of buttons. 57 | - ... 58 | 59 | Attribution 60 | -------------- 61 | 62 | `react-native-richtext-editor` uses portions of code from the following sources: 63 | 64 | | Component | Description | License | 65 | | :------------- |:-------------| :-----| 66 | | [ZSSRichTextEditor](https://github.com/nnhubbard/ZSSRichTextEditor) | A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view | [MIT](https://github.com/nnhubbard/ZSSRichTextEditor/blob/master/LICENSE.txt) | 67 | | [jQuery](https://jquery.com) | jQuery is a fast, small, and feature-rich JavaScript library. | [MIT](http://jquery.org/license) | 68 | | [RN Webview Bridge](react-native-webview-bridge) | React Native Webview with Javascript Bridge | [MIT](https://github.com/alinz/react-native-webview-bridge/blob/master/LICENSE) | 69 | 70 | Contact 71 | -------------- 72 | Visit us online at [http://www.honeybook.com](http://www.honeybook.com) or contact me directly at [@guyeldar](https://twitter.com/guyeldar). 73 | 74 | License 75 | ---- 76 | BSD 3-Clause 77 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoneyBook/react-native-richtext-editor/6fbb758d7c3a2ca1be2800122d798e08686e3953/demo.gif -------------------------------------------------------------------------------- /npm-debug.log: -------------------------------------------------------------------------------- 1 | 0 info it worked if it ends with ok 2 | 1 verbose cli [ '/Users/guyeldar/.nvm/versions/node/v5.7.0/bin/node', 3 | 1 verbose cli '/Users/guyeldar/.nvm/versions/node/v5.7.0/bin/npm', 4 | 1 verbose cli 'start' ] 5 | 2 info using npm@3.7.3 6 | 3 info using node@v5.7.0 7 | 4 verbose stack Error: missing script: start 8 | 4 verbose stack at run (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/lib/run-script.js:147:19) 9 | 4 verbose stack at /Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/lib/run-script.js:57:5 10 | 4 verbose stack at /Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:345:5 11 | 4 verbose stack at checkBinReferences_ (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:309:45) 12 | 4 verbose stack at final (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:343:3) 13 | 4 verbose stack at then (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:113:5) 14 | 4 verbose stack at ReadFileContext. (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:284:20) 15 | 4 verbose stack at ReadFileContext.callback (/Users/guyeldar/.nvm/versions/node/v5.7.0/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16) 16 | 4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13) 17 | 5 verbose cwd /Users/guyeldar/Devl/react-native-richtext-editor 18 | 6 error Darwin 15.5.0 19 | 7 error argv "/Users/guyeldar/.nvm/versions/node/v5.7.0/bin/node" "/Users/guyeldar/.nvm/versions/node/v5.7.0/bin/npm" "start" 20 | 8 error node v5.7.0 21 | 9 error npm v3.7.3 22 | 10 error missing script: start 23 | 11 error If you need help, you may report this error at: 24 | 11 error 25 | 12 verbose exit [ 1, true ] 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-richtext-editor", 3 | "version": "0.1.14", 4 | "description": "A Flexible Rich Text Editor for React Native", 5 | "main": "HBRichTextEditor.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "dependencies": { 10 | "fbemitter": "^2.0.2", 11 | "react-native-webview-bridge": "HoneyBook/react-native-webview-bridge", 12 | "lodash": "3.10.1" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/HoneyBook/react-native-richtext-editor.git" 17 | }, 18 | "keywords": [ 19 | "rich", 20 | "text", 21 | "editor", 22 | "html", 23 | "editor", 24 | "react", 25 | "native", 26 | "rn" 27 | ], 28 | "author": "Guy Eldar", 29 | "license": "BSD-3-Clause", 30 | "bugs": { 31 | "url": "https://github.com/HoneyBook/react-native-richtext-editor/issues" 32 | }, 33 | "homepage": "https://github.com/HoneyBook/react-native-richtext-editor#readme" 34 | } 35 | --------------------------------------------------------------------------------