You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to put more effort :) to use more advanced features of CNRichTextEditor such as:
161
+
- Image Uploading
162
+
- Highlighting Text
163
+
- Change Text Color
164
+
165
+
Actually we did not implement 'Toolbar buttons and menus' and 'Image Uploading Process' because it totally depends on using expo or pure react-native and also what other packages you prefer to use.
166
+
167
+
To see an example of how to implement more advanced feature of this editor please check this [Link](https://github.com/imnapo/react-native-cn-richtext-editor/blob/master/expo-demo/App.js).
168
+
169
+
Also be noticed that this example is writen with expo and required 'react-native-popup-menu' package.
138
170
## Props
139
171
140
172
### CNRichTextEditor
141
173
142
-
| Name | Description |
143
-
| ------ | ----------- |
144
-
| onSelectedTagChanged | this prop triggers when selected tag of editor is changed. |
145
-
| onSelectedStyleChanged | this prop triggers when selected style of editor is changed. |
146
-
| value | javascript array object which keeps value of textinput |
174
+
| Name | Description | Required |
175
+
| ------ | ----------- | ---- |
176
+
| onSelectedTagChanged | this event triggers when selected tag of editor is changed. | No |
177
+
| onSelectedStyleChanged | this event triggers when selected style of editor is changed. | No |
178
+
| onValueChanged | this event triggers when value of editor is changed. | No |
179
+
| value | an array object which keeps value of the editor | Yes |
180
+
| styleList | an object consist of styles name and values (use getDefaultStyles function) | Yes |
147
181
148
182
### CNToolbar
149
183
150
184
| Name | Required | Description |
151
185
| ------ | ------ | ----------- |
152
-
| selectedTag | Yes | selected tag of RichTextEditor.|
153
-
| selectedStyles | Yes | selected style of RichTextEditor|
154
-
| onStyleKeyPress | Yes | this event will be triggered when user press one of toolbar keys.|
186
+
| selectedTag | Yes | selected tag of the editor|
187
+
| selectedStyles | Yes | selected style of the editor|
188
+
| onStyleKeyPress | Yes | this event triggers when user press one of toolbar keys |
155
189
| size | No | font size of toolbar buttons |
156
-
| bold | No | child component of bold button. you can use it to set an icon for bold button ( see expo-demo app) |
157
-
| italic | No | child component of italic button |
158
-
| underline | No | child component of underline button |
159
-
| lineThrough | No | child component of lineThrough button |
160
-
| body | No | child component of body button |
161
-
| title | No | child component of title button |
162
-
| ul | No | child component of ul button |
163
-
| ol | No | child component of ol button |
164
-
| image | No | child component of image button |
190
+
| bold | No | a component which renders as bold button |
191
+
| italic | No | a component which renders as italic button |
192
+
| underline | No | a component which renders as underline button |
193
+
| lineThrough | No | a component which renders as lineThrough button |
194
+
| body | No | a component which renders as body button |
195
+
| title | No | a component which renders as title button |
196
+
| ul | No | a component which renders as ul button |
197
+
| ol | No | a component which renders as ol button |
198
+
| image | No | a component which renders as image button |
199
+
| highlight | No | a component which renders as highlight button |
200
+
| foreColor | No | a component which renders as foreColor button |
165
201
166
202
167
203
### Functions
168
204
| Name | Param | Returns | Description |
169
205
| ------ | ------ | ------ |----------- |
170
-
| getInitialObject | - | javascript object | create a initial value for RichTextEditor. |
171
-
| convertToHtmlString | array | string | this function converts value of RichTextEditor to html string (use it to keep value as html in db) |
206
+
| getInitialObject | - | javascript object | create a initial value for the editor. |
207
+
| convertToHtmlString | array | string | this function converts value of editor to html string (use it to keep value as html in db) |
172
208
| convertToObject | string | array | converts html back to array for RichTextEditor value (use this function only for html string created by convertToHtmlString function) |
209
+
| getDefaultStyles | - | javascript object | creates required styles for the editor. |
173
210
174
211
## Expo Demo App
175
212
Checkout the
@@ -179,3 +216,6 @@ If you are looking to test and run expo-demo App locally, click
179
216
[here](https://github.com/imnapo/react-native-cn-richtext-editor/tree/master/expo-demo) to
0 commit comments