rn-rich-text-editor 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,31 @@
1
- export declare const RichEditor: any;
1
+ export interface RichTextEditorRef {
2
+ registerToolbar: (listener: (items: string[]) => void) => void;
3
+ setContentFocusHandler: (listener: () => void) => void;
4
+ setContentHTML: (html: string) => void;
5
+ setPlaceholder: (placeholder: string) => void;
6
+ setContentStyle: (styles: any) => void;
7
+ setDisable: (dis: boolean) => void;
8
+ blurContentEditor: () => void;
9
+ focusContentEditor: () => void;
10
+ showAndroidKeyboard: () => void;
11
+ insertImage: (attributes: any, style?: any) => void;
12
+ insertVideo: (attributes: any, style?: any) => void;
13
+ insertText: (text: string) => void;
14
+ insertHTML: (html: string) => void;
15
+ insertLink: (title: string, url: string) => void;
16
+ injectJavascript: (script: string) => void;
17
+ preCode: (type: any) => void;
18
+ setFontSize: (size: any) => void;
19
+ setForeColor: (color: string) => void;
20
+ setHiliteColor: (color: string) => void;
21
+ setFontName: (name: string) => void;
22
+ commandDOM: (command: any) => void;
23
+ command: (command: any) => void;
24
+ dismissKeyboard: () => void;
25
+ getContentHtml: () => Promise<string>;
26
+ isKeyboardOpen: boolean;
27
+ sendAction: (action: string) => void;
28
+ }
29
+ export declare const RichTextEditor: any;
30
+ export default RichTextEditor;
31
+ export { RichTextEditor as RichEditor };
@@ -33,117 +33,352 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.RichEditor = void 0;
36
+ exports.RichEditor = exports.RichTextEditor = void 0;
37
37
  const react_1 = __importStar(require("react"));
38
38
  const react_native_webview_1 = require("react-native-webview");
39
+ const actions_1 = require("./actions");
40
+ const messages_1 = require("./messages");
39
41
  const react_native_1 = require("react-native");
40
42
  const createHTML_1 = require("./editor/createHTML");
41
- const messages_1 = require("./messages");
42
43
  const PlatformIOS = react_native_1.Platform.OS === 'ios';
43
- exports.RichEditor = (0, react_1.forwardRef)((props, ref) => {
44
+ function buildCreateHTMLOptions(props) {
45
+ const { editorStyle: { backgroundColor, color, placeholderColor, initialCSSText, cssText, contentCSSText, caretColor, } = {}, html, pasteAsPlainText, onPaste, onKeyUp, onKeyDown, onInput, enterKeyHint, autoCapitalize, autoCorrect, defaultParagraphSeparator, firstFocusEnd, useContainer, initialFocus, disabled, styleWithCSS, useCharacter, defaultHttps, } = props;
46
+ return {
47
+ backgroundColor,
48
+ color,
49
+ caretColor,
50
+ placeholderColor,
51
+ initialCSSText,
52
+ cssText,
53
+ contentCSSText,
54
+ pasteAsPlainText,
55
+ pasteListener: !!onPaste,
56
+ keyUpListener: !!onKeyUp,
57
+ keyDownListener: !!onKeyDown,
58
+ inputListener: !!onInput,
59
+ enterKeyHint,
60
+ autoCapitalize,
61
+ autoCorrect,
62
+ initialFocus: initialFocus && !disabled,
63
+ defaultParagraphSeparator,
64
+ firstFocusEnd,
65
+ useContainer,
66
+ styleWithCSS,
67
+ useCharacter,
68
+ defaultHttps,
69
+ };
70
+ }
71
+ exports.RichTextEditor = (0, react_1.forwardRef)(function RichTextEditor({ contentInset = {}, style = {}, placeholder = '', initialContentHTML = '', initialFocus = false, disabled = false, useContainer = true, pasteAsPlainText = false, autoCapitalize = 'off', defaultParagraphSeparator = 'div', editorInitializedCallback = () => { }, initialHeight = 0, dataDetectorTypes = ['none'], editorStyle, html: htmlProp, onFocus, onBlur, onChange, onPaste, onKeyUp, onKeyDown, onInput, onMessage, onCursorPosition, onLink, onHeightChange, ...rest }, ref) {
44
72
  const webRef = (0, react_1.useRef)(null);
45
73
  const inputRef = (0, react_1.useRef)(null);
46
- const [keyboardOpen, setKeyboardOpen] = (0, react_1.useState)(false);
47
74
  const selectionChangeListeners = (0, react_1.useRef)([]);
75
+ const focusListeners = (0, react_1.useRef)([]);
76
+ const contentResolveRef = (0, react_1.useRef)();
77
+ const contentRejectRef = (0, react_1.useRef)();
78
+ const pendingContentHtmlRef = (0, react_1.useRef)();
79
+ const unmountRef = (0, react_1.useRef)(false);
80
+ const keyOpenRef = (0, react_1.useRef)(false);
81
+ const focusRef = (0, react_1.useRef)(false);
82
+ const layoutRef = (0, react_1.useRef)({});
83
+ const viewHTML = (0, react_1.useMemo)(() => htmlProp || (0, createHTML_1.createHTML)(buildCreateHTMLOptions({
84
+ editorStyle,
85
+ html: htmlProp,
86
+ pasteAsPlainText,
87
+ onPaste,
88
+ onKeyUp,
89
+ onKeyDown,
90
+ onInput,
91
+ enterKeyHint: rest.enterKeyHint,
92
+ autoCapitalize,
93
+ autoCorrect: rest.autoCorrect,
94
+ defaultParagraphSeparator,
95
+ firstFocusEnd: rest.firstFocusEnd,
96
+ useContainer,
97
+ initialFocus,
98
+ disabled,
99
+ styleWithCSS: rest.styleWithCSS,
100
+ useCharacter: rest.useCharacter,
101
+ defaultHttps: rest.defaultHttps,
102
+ })), []);
103
+ const [height, setHeight] = (0, react_1.useState)(initialHeight);
48
104
  (0, react_1.useEffect)(() => {
49
- const keyboardEventListeners = PlatformIOS
105
+ unmountRef.current = false;
106
+ const keyboardShow = () => {
107
+ keyOpenRef.current = true;
108
+ };
109
+ const keyboardHide = () => {
110
+ keyOpenRef.current = false;
111
+ };
112
+ const listeners = PlatformIOS
50
113
  ? [
51
- react_native_1.Keyboard.addListener('keyboardWillShow', () => setKeyboardOpen(true)),
52
- react_native_1.Keyboard.addListener('keyboardWillHide', () => setKeyboardOpen(false)),
114
+ react_native_1.Keyboard.addListener('keyboardWillShow', keyboardShow),
115
+ react_native_1.Keyboard.addListener('keyboardWillHide', keyboardHide),
53
116
  ]
54
117
  : [
55
- react_native_1.Keyboard.addListener('keyboardDidShow', () => setKeyboardOpen(true)),
56
- react_native_1.Keyboard.addListener('keyboardDidHide', () => setKeyboardOpen(false)),
118
+ react_native_1.Keyboard.addListener('keyboardDidShow', keyboardShow),
119
+ react_native_1.Keyboard.addListener('keyboardDidHide', keyboardHide),
57
120
  ];
58
121
  return () => {
59
- keyboardEventListeners.forEach(listener => listener.remove());
122
+ unmountRef.current = true;
123
+ listeners.forEach(l => l.remove());
60
124
  };
61
125
  }, []);
126
+ (0, react_1.useEffect)(() => {
127
+ if (editorStyle) {
128
+ sendAction(actions_1.actions.content, 'setContentStyle', editorStyle);
129
+ }
130
+ }, [editorStyle]);
131
+ (0, react_1.useEffect)(() => {
132
+ sendAction(actions_1.actions.content, 'setDisable', !!disabled);
133
+ }, [disabled]);
134
+ (0, react_1.useEffect)(() => {
135
+ sendAction(actions_1.actions.content, 'setPlaceholder', placeholder);
136
+ }, [placeholder]);
137
+ function sendAction(type, action, data, options) {
138
+ var _a, _b;
139
+ const jsonString = JSON.stringify({ type, name: action, data, options });
140
+ if (unmountRef.current || !webRef.current)
141
+ return;
142
+ const webRefAny = webRef.current;
143
+ if (typeof webRefAny.postMessage === 'function') {
144
+ webRefAny.postMessage(jsonString);
145
+ }
146
+ else {
147
+ (_b = (_a = webRef.current).injectJavaScript) === null || _b === void 0 ? void 0 : _b.call(_a, `window.dispatchEvent(new MessageEvent('message', { data: ${JSON.stringify(jsonString)} })); true;`);
148
+ }
149
+ }
62
150
  const handleMessage = (event) => {
63
- var _a, _b, _c, _d, _e;
151
+ var _a, _b;
64
152
  try {
65
153
  const message = JSON.parse(event.nativeEvent.data);
66
- const { type, data } = message;
67
- switch (type) {
68
- case messages_1.messages.SELECTION_CHANGE: {
69
- // Convert selection data to array of active actions
70
- const activeItems = [];
71
- if (data.bold)
72
- activeItems.push('bold');
73
- if (data.italic)
74
- activeItems.push('italic');
75
- if (data.underline)
76
- activeItems.push('underline');
77
- selectionChangeListeners.current.forEach(listener => listener(activeItems));
154
+ const data = message.data;
155
+ switch (message.type) {
156
+ case messages_1.messages.CONTENT_HTML_RESPONSE:
157
+ if (contentResolveRef.current) {
158
+ contentResolveRef.current(message.data);
159
+ contentResolveRef.current = undefined;
160
+ contentRejectRef.current = undefined;
161
+ if (pendingContentHtmlRef.current) {
162
+ clearTimeout(pendingContentHtmlRef.current);
163
+ pendingContentHtmlRef.current = undefined;
164
+ }
165
+ }
78
166
  break;
79
- }
80
- case messages_1.messages.CONTENT_CHANGE:
81
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, data);
167
+ case messages_1.messages.LINK_TOUCHED:
168
+ onLink === null || onLink === void 0 ? void 0 : onLink(data);
169
+ break;
170
+ case messages_1.messages.LOG:
171
+ console.log('FROM EDIT:', ...data);
172
+ break;
173
+ case messages_1.messages.SELECTION_CHANGE:
174
+ selectionChangeListeners.current.forEach(listener => listener(message.data));
82
175
  break;
83
176
  case messages_1.messages.CONTENT_FOCUSED:
84
- (_b = props.onFocus) === null || _b === void 0 ? void 0 : _b.call(props);
177
+ focusRef.current = true;
178
+ focusListeners.current.forEach(fn => fn());
179
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus();
85
180
  break;
86
181
  case messages_1.messages.CONTENT_BLUR:
87
- (_c = props.onBlur) === null || _c === void 0 ? void 0 : _c.call(props);
182
+ focusRef.current = false;
183
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur();
184
+ break;
185
+ case messages_1.messages.CONTENT_CHANGE:
186
+ onChange === null || onChange === void 0 ? void 0 : onChange(data);
187
+ break;
188
+ case messages_1.messages.CONTENT_PASTED:
189
+ onPaste === null || onPaste === void 0 ? void 0 : onPaste(data);
190
+ break;
191
+ case messages_1.messages.CONTENT_KEYUP:
192
+ onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(data);
193
+ break;
194
+ case messages_1.messages.CONTENT_KEYDOWN:
195
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(data);
196
+ break;
197
+ case messages_1.messages.ON_INPUT:
198
+ onInput === null || onInput === void 0 ? void 0 : onInput(data);
88
199
  break;
89
200
  case messages_1.messages.OFFSET_HEIGHT:
90
- (_d = props.onHeightChange) === null || _d === void 0 ? void 0 : _d.call(props, data);
201
+ if (data !== height) {
202
+ const maxHeight = Math.max(data, initialHeight);
203
+ if (!unmountRef.current && useContainer && maxHeight >= initialHeight) {
204
+ setHeight(maxHeight);
205
+ }
206
+ onHeightChange === null || onHeightChange === void 0 ? void 0 : onHeightChange(data);
207
+ }
208
+ break;
209
+ case messages_1.messages.OFFSET_Y:
210
+ const offsetY = Number(Number(data) + ((_b = (_a = layoutRef.current) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : 0));
211
+ if (offsetY > 0)
212
+ onCursorPosition === null || onCursorPosition === void 0 ? void 0 : onCursorPosition(offsetY);
91
213
  break;
92
214
  default:
93
- (_e = props.onMessage) === null || _e === void 0 ? void 0 : _e.call(props, message);
215
+ onMessage === null || onMessage === void 0 ? void 0 : onMessage(message);
94
216
  break;
95
217
  }
96
218
  }
97
- catch (_f) {
219
+ catch (_c) {
98
220
  // Non-JSON message, ignore
99
221
  }
100
222
  };
101
- const sendToWebView = (type) => {
102
- var _a;
103
- const data = JSON.stringify({ type });
104
- const script = `window.dispatchEvent(new MessageEvent('message', { data: ${JSON.stringify(data)} })); true;`;
105
- (_a = webRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(script);
106
- };
107
- (0, react_1.useImperativeHandle)(ref, () => ({
108
- sendAction(type) {
109
- sendToWebView(type);
110
- },
111
- registerToolbar(listener) {
112
- selectionChangeListeners.current.push(listener);
113
- },
114
- focusContentEditor() {
115
- var _a, _b, _c;
223
+ const init = () => {
224
+ var _a, _b, _c;
225
+ if (initialContentHTML)
226
+ sendAction(actions_1.actions.content, 'setHtml', initialContentHTML);
227
+ if (placeholder)
228
+ sendAction(actions_1.actions.content, 'setPlaceholder', placeholder);
229
+ sendAction(actions_1.actions.content, 'setDisable', !!disabled);
230
+ editorInitializedCallback();
231
+ if (initialFocus && !disabled) {
116
232
  if (react_native_1.Platform.OS === 'android') {
117
- !keyboardOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
233
+ if (!keyOpenRef.current)
234
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
118
235
  (_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
119
236
  }
120
- sendToWebView('focus');
121
- },
122
- dismissKeyboard() {
123
- sendToWebView('blur');
124
- react_native_1.Keyboard.dismiss();
125
- },
126
- get isKeyboardOpen() {
127
- return keyboardOpen;
128
- },
129
- showAndroidKeyboard() {
130
- var _a, _b, _c;
131
- if (react_native_1.Platform.OS === 'android') {
132
- !keyboardOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
133
- (_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
134
- }
135
- },
136
- }));
137
- return (react_1.default.createElement(react_1.default.Fragment, null,
138
- react_1.default.createElement(react_native_webview_1.WebView, { ref: webRef, originWhitelist: ['*'], javaScriptEnabled: true, scrollEnabled: false, source: (0, createHTML_1.createHTML)(), onMessage: handleMessage, style: [styles.editorWebView, props.style], ...props.webViewProps }),
139
- react_native_1.Platform.OS === 'android' && (react_1.default.createElement(react_native_1.TextInput, { ref: inputRef, style: styles.hiddenInput }))));
237
+ sendAction(actions_1.actions.content, 'focus');
238
+ }
239
+ sendAction(actions_1.actions.init);
240
+ };
241
+ (0, react_1.useImperativeHandle)(ref, () => {
242
+ const postActionToWebView = sendAction;
243
+ return {
244
+ registerToolbar(listener) {
245
+ selectionChangeListeners.current = [...selectionChangeListeners.current, listener];
246
+ },
247
+ setContentFocusHandler(listener) {
248
+ focusListeners.current.push(listener);
249
+ },
250
+ setContentHTML(html) {
251
+ sendAction(actions_1.actions.content, 'setHtml', html);
252
+ },
253
+ setPlaceholder(placeholderText) {
254
+ sendAction(actions_1.actions.content, 'setPlaceholder', placeholderText);
255
+ },
256
+ setContentStyle(styles) {
257
+ sendAction(actions_1.actions.content, 'setContentStyle', styles);
258
+ },
259
+ setDisable(dis) {
260
+ sendAction(actions_1.actions.content, 'setDisable', !!dis);
261
+ },
262
+ blurContentEditor() {
263
+ sendAction(actions_1.actions.content, 'blur');
264
+ },
265
+ focusContentEditor() {
266
+ var _a, _b, _c;
267
+ if (react_native_1.Platform.OS === 'android') {
268
+ if (!keyOpenRef.current)
269
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
270
+ (_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
271
+ }
272
+ sendAction(actions_1.actions.content, 'focus');
273
+ },
274
+ showAndroidKeyboard() {
275
+ var _a, _b, _c;
276
+ if (react_native_1.Platform.OS === 'android') {
277
+ if (!keyOpenRef.current)
278
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
279
+ (_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
280
+ }
281
+ },
282
+ insertImage(attributes, styleOpt) {
283
+ sendAction(actions_1.actions.insertImage, 'result', attributes, styleOpt);
284
+ },
285
+ insertVideo(attributes, styleOpt) {
286
+ sendAction(actions_1.actions.insertVideo, 'result', attributes, styleOpt);
287
+ },
288
+ insertText(text) {
289
+ sendAction(actions_1.actions.insertText, 'result', text);
290
+ },
291
+ insertHTML(html) {
292
+ sendAction(actions_1.actions.insertHTML, 'result', html);
293
+ },
294
+ insertLink(title, url) {
295
+ var _a, _b, _c;
296
+ if (url) {
297
+ if (react_native_1.Platform.OS === 'android') {
298
+ if (!keyOpenRef.current)
299
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
300
+ (_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
301
+ }
302
+ sendAction(actions_1.actions.insertLink, 'result', { title, url });
303
+ }
304
+ },
305
+ injectJavascript(script) {
306
+ var _a, _b;
307
+ return (_b = (_a = webRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript) === null || _b === void 0 ? void 0 : _b.call(_a, script);
308
+ },
309
+ preCode(type) {
310
+ sendAction(actions_1.actions.code, 'result', type);
311
+ },
312
+ setFontSize(size) {
313
+ sendAction(actions_1.actions.fontSize, 'result', size);
314
+ },
315
+ setForeColor(color) {
316
+ sendAction(actions_1.actions.foreColor, 'result', color);
317
+ },
318
+ setHiliteColor(color) {
319
+ sendAction(actions_1.actions.hiliteColor, 'result', color);
320
+ },
321
+ setFontName(name) {
322
+ sendAction(actions_1.actions.fontName, 'result', name);
323
+ },
324
+ commandDOM(command) {
325
+ if (command)
326
+ sendAction(actions_1.actions.content, 'commandDOM', command);
327
+ },
328
+ command(command) {
329
+ if (command)
330
+ sendAction(actions_1.actions.content, 'command', command);
331
+ },
332
+ dismissKeyboard() {
333
+ if (focusRef.current)
334
+ sendAction(actions_1.actions.content, 'blur');
335
+ else
336
+ react_native_1.Keyboard.dismiss();
337
+ },
338
+ get isKeyboardOpen() {
339
+ return keyOpenRef.current;
340
+ },
341
+ getContentHtml() {
342
+ return new Promise((resolve, reject) => {
343
+ contentResolveRef.current = resolve;
344
+ contentRejectRef.current = reject;
345
+ postActionToWebView(actions_1.actions.content, 'postHtml');
346
+ pendingContentHtmlRef.current = setTimeout(() => {
347
+ if (contentRejectRef.current)
348
+ contentRejectRef.current('timeout');
349
+ }, 5000);
350
+ });
351
+ },
352
+ sendAction(action) {
353
+ postActionToWebView(action, 'result');
354
+ },
355
+ };
356
+ });
357
+ const onViewLayout = ({ nativeEvent: { layout } }) => {
358
+ layoutRef.current = layout;
359
+ };
360
+ const renderWebView = () => {
361
+ var _a;
362
+ return (react_1.default.createElement(react_1.default.Fragment, null,
363
+ react_1.default.createElement(react_native_webview_1.WebView, { ref: webRef, useWebKit: true, scrollEnabled: false, hideKeyboardAccessoryView: true, keyboardDisplayRequiresUserAction: false, nestedScrollEnabled: !useContainer, style: [styles.webview, style], ...rest, onMessage: handleMessage, originWhitelist: ['*'], dataDetectorTypes: dataDetectorTypes, domStorageEnabled: false, bounces: false, javaScriptEnabled: true, source: { html: typeof viewHTML === 'string' ? viewHTML : (_a = viewHTML === null || viewHTML === void 0 ? void 0 : viewHTML.html) !== null && _a !== void 0 ? _a : '' }, onLoad: init, onShouldStartLoadWithRequest: (event) => {
364
+ var _a, _b, _c;
365
+ if (event.url !== 'about:blank') {
366
+ (_b = (_a = webRef.current) === null || _a === void 0 ? void 0 : _a.stopLoading) === null || _b === void 0 ? void 0 : _b.call(_a);
367
+ (_c = react_native_1.Linking === null || react_native_1.Linking === void 0 ? void 0 : react_native_1.Linking.openURL) === null || _c === void 0 ? void 0 : _c.call(react_native_1.Linking, event.url);
368
+ return false;
369
+ }
370
+ return true;
371
+ } }),
372
+ react_native_1.Platform.OS === 'android' && react_1.default.createElement(react_native_1.TextInput, { ref: inputRef, style: styles._input })));
373
+ };
374
+ if (useContainer) {
375
+ return (react_1.default.createElement(react_native_1.View, { style: [style, { height }], onLayout: onViewLayout }, renderWebView()));
376
+ }
377
+ return renderWebView();
140
378
  });
379
+ exports.RichEditor = exports.RichTextEditor;
141
380
  const styles = react_native_1.StyleSheet.create({
142
- editorWebView: {
143
- minHeight: 150,
144
- backgroundColor: '#fff',
145
- },
146
- hiddenInput: {
381
+ _input: {
147
382
  position: 'absolute',
148
383
  width: 1,
149
384
  height: 1,
@@ -151,4 +386,8 @@ const styles = react_native_1.StyleSheet.create({
151
386
  bottom: -999,
152
387
  left: -999,
153
388
  },
389
+ webview: {
390
+ backgroundColor: 'transparent',
391
+ },
154
392
  });
393
+ exports.default = exports.RichTextEditor;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare const defaultActions: ("bold" | "italic" | "underline" | "strikethrough" | "removeFormat" | "checkboxList" | "insertUnorderedList" | "insertOrderedList" | "blockquote" | "code" | "link" | "indent" | "outdent" | "justifyLeft" | "justifyCenter" | "justifyRight" | "justifyFull" | "undo" | "redo" | "keyboard")[];
2
+ export declare const defaultActions: string[];
3
3
  interface RichToolbarProps {
4
4
  editor?: {
5
5
  current: any;
@@ -27,6 +27,7 @@ interface RichToolbarProps {
27
27
  flatContainerStyle?: any;
28
28
  horizontal?: boolean;
29
29
  children?: React.ReactNode;
30
+ [key: string]: any;
30
31
  }
31
- export declare function RichToolbar({ editor, getEditor, actions: actionsProp, disabled, iconTint, selectedIconTint, disabledIconTint, iconSize, iconGap, style, itemStyle, selectedButtonStyle, unselectedButtonStyle, disabledButtonStyle, iconMap, renderAction, onPressAddImage, onInsertLink, insertVideo, flatContainerStyle, horizontal, children, }: Readonly<RichToolbarProps>): any;
32
- export {};
32
+ export declare function RichToolbar({ editor: editorProp, getEditor, actions: actionsProp, disabled, iconTint, selectedIconTint, disabledIconTint, iconSize, iconGap, style, itemStyle, selectedButtonStyle, unselectedButtonStyle, disabledButtonStyle, iconMap, renderAction, onPressAddImage, onInsertLink, insertVideo, flatContainerStyle, horizontal, children, ...restProps }: Readonly<RichToolbarProps>): any;
33
+ export default RichToolbar;