rn-rich-text-editor 0.0.1 → 0.0.2
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.
- package/dist/RichEditor.js +99 -2
- package/dist/RichToolbar.d.ts +32 -1
- package/dist/RichToolbar.js +175 -7
- package/dist/editor/createHTML.js +38 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/RichEditor.js
CHANGED
|
@@ -36,14 +36,111 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.RichEditor = void 0;
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_webview_1 = require("react-native-webview");
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
39
40
|
const createHTML_1 = require("./editor/createHTML");
|
|
41
|
+
const messages_1 = require("./messages");
|
|
42
|
+
const PlatformIOS = react_native_1.Platform.OS === 'ios';
|
|
40
43
|
exports.RichEditor = (0, react_1.forwardRef)((props, ref) => {
|
|
41
44
|
const webRef = (0, react_1.useRef)(null);
|
|
45
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
46
|
+
const [keyboardOpen, setKeyboardOpen] = (0, react_1.useState)(false);
|
|
47
|
+
const selectionChangeListeners = (0, react_1.useRef)([]);
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
|
+
const keyboardEventListeners = PlatformIOS
|
|
50
|
+
? [
|
|
51
|
+
react_native_1.Keyboard.addListener('keyboardWillShow', () => setKeyboardOpen(true)),
|
|
52
|
+
react_native_1.Keyboard.addListener('keyboardWillHide', () => setKeyboardOpen(false)),
|
|
53
|
+
]
|
|
54
|
+
: [
|
|
55
|
+
react_native_1.Keyboard.addListener('keyboardDidShow', () => setKeyboardOpen(true)),
|
|
56
|
+
react_native_1.Keyboard.addListener('keyboardDidHide', () => setKeyboardOpen(false)),
|
|
57
|
+
];
|
|
58
|
+
return () => {
|
|
59
|
+
keyboardEventListeners.forEach(listener => listener.remove());
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
const handleMessage = (event) => {
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
64
|
+
try {
|
|
65
|
+
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));
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case messages_1.messages.CONTENT_CHANGE:
|
|
81
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, data);
|
|
82
|
+
break;
|
|
83
|
+
case messages_1.messages.CONTENT_FOCUSED:
|
|
84
|
+
(_b = props.onFocus) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
85
|
+
break;
|
|
86
|
+
case messages_1.messages.CONTENT_BLUR:
|
|
87
|
+
(_c = props.onBlur) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
88
|
+
break;
|
|
89
|
+
case messages_1.messages.OFFSET_HEIGHT:
|
|
90
|
+
(_d = props.onHeightChange) === null || _d === void 0 ? void 0 : _d.call(props, data);
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
(_e = props.onMessage) === null || _e === void 0 ? void 0 : _e.call(props, message);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (_f) {
|
|
98
|
+
// Non-JSON message, ignore
|
|
99
|
+
}
|
|
100
|
+
};
|
|
42
101
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
43
102
|
sendAction(type) {
|
|
44
103
|
var _a;
|
|
45
104
|
(_a = webRef.current) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({ type }));
|
|
46
|
-
}
|
|
105
|
+
},
|
|
106
|
+
registerToolbar(listener) {
|
|
107
|
+
selectionChangeListeners.current.push(listener);
|
|
108
|
+
},
|
|
109
|
+
focusContentEditor() {
|
|
110
|
+
var _a, _b, _c, _d;
|
|
111
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
112
|
+
!keyboardOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
113
|
+
(_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
114
|
+
}
|
|
115
|
+
(_d = webRef.current) === null || _d === void 0 ? void 0 : _d.postMessage(JSON.stringify({ type: 'focus' }));
|
|
116
|
+
},
|
|
117
|
+
dismissKeyboard() {
|
|
118
|
+
var _a;
|
|
119
|
+
(_a = webRef.current) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({ type: 'blur' }));
|
|
120
|
+
react_native_1.Keyboard.dismiss();
|
|
121
|
+
},
|
|
122
|
+
get isKeyboardOpen() {
|
|
123
|
+
return keyboardOpen;
|
|
124
|
+
},
|
|
125
|
+
showAndroidKeyboard() {
|
|
126
|
+
var _a, _b, _c;
|
|
127
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
128
|
+
!keyboardOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
129
|
+
(_c = (_b = webRef.current) === null || _b === void 0 ? void 0 : _b.requestFocus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
130
|
+
}
|
|
131
|
+
},
|
|
47
132
|
}));
|
|
48
|
-
return (react_1.default.createElement(
|
|
133
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
134
|
+
react_1.default.createElement(react_native_webview_1.WebView, { ref: webRef, originWhitelist: ['*'], javaScriptEnabled: true, scrollEnabled: false, source: (0, createHTML_1.createHTML)(), onMessage: handleMessage, ...props.webViewProps }),
|
|
135
|
+
react_native_1.Platform.OS === 'android' && (react_1.default.createElement(react_native_1.TextInput, { ref: inputRef, style: styles.hiddenInput }))));
|
|
136
|
+
});
|
|
137
|
+
const styles = react_native_1.StyleSheet.create({
|
|
138
|
+
hiddenInput: {
|
|
139
|
+
position: 'absolute',
|
|
140
|
+
width: 1,
|
|
141
|
+
height: 1,
|
|
142
|
+
zIndex: -999,
|
|
143
|
+
bottom: -999,
|
|
144
|
+
left: -999,
|
|
145
|
+
},
|
|
49
146
|
});
|
package/dist/RichToolbar.d.ts
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const defaultActions: ("bold" | "italic" | "underline" | "checkboxList" | "link" | "keyboard")[];
|
|
3
|
+
interface RichToolbarProps {
|
|
4
|
+
editor?: {
|
|
5
|
+
current: any;
|
|
6
|
+
};
|
|
7
|
+
getEditor?: () => any;
|
|
8
|
+
actions?: string[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
iconTint?: string;
|
|
11
|
+
selectedIconTint?: string;
|
|
12
|
+
disabledIconTint?: string;
|
|
13
|
+
iconSize?: number;
|
|
14
|
+
iconGap?: number;
|
|
15
|
+
style?: any;
|
|
16
|
+
itemStyle?: any;
|
|
17
|
+
selectedButtonStyle?: any;
|
|
18
|
+
unselectedButtonStyle?: any;
|
|
19
|
+
disabledButtonStyle?: any;
|
|
20
|
+
iconMap?: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
renderAction?: (action: string, selected: boolean) => React.ReactElement;
|
|
24
|
+
onPressAddImage?: () => void;
|
|
25
|
+
onInsertLink?: () => void;
|
|
26
|
+
insertVideo?: () => void;
|
|
27
|
+
flatContainerStyle?: any;
|
|
28
|
+
horizontal?: boolean;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
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 {};
|
package/dist/RichToolbar.js
CHANGED
|
@@ -1,13 +1,181 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.defaultActions = void 0;
|
|
6
37
|
exports.RichToolbar = RichToolbar;
|
|
7
|
-
const react_1 =
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
8
39
|
const react_native_1 = require("react-native");
|
|
9
40
|
const actions_1 = require("./actions");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
41
|
+
exports.defaultActions = [
|
|
42
|
+
actions_1.actions.keyboard,
|
|
43
|
+
actions_1.actions.setBold,
|
|
44
|
+
actions_1.actions.setItalic,
|
|
45
|
+
actions_1.actions.setUnderline,
|
|
46
|
+
actions_1.actions.checkboxList,
|
|
47
|
+
actions_1.actions.insertLink,
|
|
48
|
+
];
|
|
49
|
+
// Icons from img folder - direct require now that icons exist
|
|
50
|
+
function getDefaultIcon() {
|
|
51
|
+
return {
|
|
52
|
+
[actions_1.actions.setBold]: require('./img/bold.png'),
|
|
53
|
+
[actions_1.actions.setItalic]: require('./img/italic.png'),
|
|
54
|
+
[actions_1.actions.setUnderline]: require('./img/underline.png'),
|
|
55
|
+
[actions_1.actions.checkboxList]: require('./img/checkbox.png'),
|
|
56
|
+
[actions_1.actions.insertLink]: require('./img/link.png'),
|
|
57
|
+
[actions_1.actions.keyboard]: require('./img/keyboard.png'),
|
|
58
|
+
};
|
|
13
59
|
}
|
|
60
|
+
const defaultIcons = getDefaultIcon();
|
|
61
|
+
function RichToolbar({ editor, getEditor, actions: actionsProp = exports.defaultActions, disabled = false, iconTint = '#71787F', selectedIconTint, disabledIconTint, iconSize = 20, iconGap = 16, style, itemStyle, selectedButtonStyle, unselectedButtonStyle, disabledButtonStyle, iconMap, renderAction, onPressAddImage, onInsertLink, insertVideo, flatContainerStyle, horizontal = true, children, }) {
|
|
62
|
+
const editorRef = (0, react_1.useRef)(null);
|
|
63
|
+
const [items, setItems] = (0, react_1.useState)([]);
|
|
64
|
+
const [data, setData] = (0, react_1.useState)(actionsProp.map(action => ({ action, selected: false })));
|
|
65
|
+
const setSelectedItems = (newItems) => {
|
|
66
|
+
setItems(prev => (prev === newItems ? prev : newItems));
|
|
67
|
+
setData(actionsProp.map(action => ({
|
|
68
|
+
action,
|
|
69
|
+
selected: newItems.includes(action) || newItems.some(item => item && item === action),
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
72
|
+
const mount = () => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
const editorInstance = (_a = editor === null || editor === void 0 ? void 0 : editor.current) !== null && _a !== void 0 ? _a : getEditor === null || getEditor === void 0 ? void 0 : getEditor();
|
|
75
|
+
if (!editorInstance) {
|
|
76
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
77
|
+
console.warn('Toolbar has no editor. Please make sure the prop editor or getEditor returns a ref to the editor component.');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
(_b = editorInstance.registerToolbar) === null || _b === void 0 ? void 0 : _b.call(editorInstance, setSelectedItems);
|
|
82
|
+
editorRef.current = editorInstance;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
(0, react_1.useEffect)(() => {
|
|
86
|
+
const t = setTimeout(mount);
|
|
87
|
+
return () => clearTimeout(t);
|
|
88
|
+
}, []);
|
|
89
|
+
const getButtonIcon = (action) => {
|
|
90
|
+
if (iconMap === null || iconMap === void 0 ? void 0 : iconMap[action])
|
|
91
|
+
return iconMap[action];
|
|
92
|
+
return defaultIcons[action];
|
|
93
|
+
};
|
|
94
|
+
const handleKeyboard = () => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
const editorInstance = editorRef.current;
|
|
97
|
+
if (!editorInstance) {
|
|
98
|
+
mount();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (editorInstance.isKeyboardOpen) {
|
|
102
|
+
(_a = editorInstance.dismissKeyboard) === null || _a === void 0 ? void 0 : _a.call(editorInstance);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
(_b = editorInstance.focusContentEditor) === null || _b === void 0 ? void 0 : _b.call(editorInstance);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const onPress = (action) => {
|
|
109
|
+
var _a, _b, _c, _d, _e;
|
|
110
|
+
const editorInstance = editorRef.current;
|
|
111
|
+
if (!editorInstance) {
|
|
112
|
+
mount();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
switch (action) {
|
|
116
|
+
case actions_1.actions.insertLink:
|
|
117
|
+
if (onInsertLink) {
|
|
118
|
+
onInsertLink();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
(_a = editorInstance.showAndroidKeyboard) === null || _a === void 0 ? void 0 : _a.call(editorInstance);
|
|
122
|
+
(_b = editorInstance.sendAction) === null || _b === void 0 ? void 0 : _b.call(editorInstance, action);
|
|
123
|
+
break;
|
|
124
|
+
case actions_1.actions.keyboard:
|
|
125
|
+
handleKeyboard();
|
|
126
|
+
break;
|
|
127
|
+
case actions_1.actions.setBold:
|
|
128
|
+
case actions_1.actions.setItalic:
|
|
129
|
+
case actions_1.actions.setUnderline:
|
|
130
|
+
case actions_1.actions.checkboxList:
|
|
131
|
+
(_c = editorInstance.showAndroidKeyboard) === null || _c === void 0 ? void 0 : _c.call(editorInstance);
|
|
132
|
+
(_d = editorInstance.sendAction) === null || _d === void 0 ? void 0 : _d.call(editorInstance, action);
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
if (action === 'image' && onPressAddImage) {
|
|
136
|
+
onPressAddImage();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (action === 'video' && insertVideo) {
|
|
140
|
+
insertVideo();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
(_e = editorInstance.sendAction) === null || _e === void 0 ? void 0 : _e.call(editorInstance, action);
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const defaultRenderAction = (action, selected) => {
|
|
148
|
+
const icon = getButtonIcon(action);
|
|
149
|
+
const buttonStyle = selected ? selectedButtonStyle : unselectedButtonStyle;
|
|
150
|
+
let tintColor = iconTint;
|
|
151
|
+
if (disabled && disabledIconTint)
|
|
152
|
+
tintColor = disabledIconTint;
|
|
153
|
+
else if (selected && selectedIconTint)
|
|
154
|
+
tintColor = selectedIconTint;
|
|
155
|
+
return (react_1.default.createElement(react_native_1.TouchableOpacity, { key: action, disabled: disabled, style: [{ width: iconGap + iconSize }, styles.item, itemStyle, buttonStyle], testID: "button_action", accessible: true, onPress: () => onPress(action) }, icon ? (typeof icon === 'function' ? (icon({ selected, disabled, tintColor, iconSize, iconGap })) : (react_1.default.createElement(react_native_1.Image, { source: icon, style: {
|
|
156
|
+
tintColor,
|
|
157
|
+
height: iconSize,
|
|
158
|
+
width: iconSize,
|
|
159
|
+
} }))) : (react_1.default.createElement(react_native_1.View, { style: { padding: 4 } }))));
|
|
160
|
+
};
|
|
161
|
+
const renderActionItem = (action, selected) => renderAction ? renderAction(action, selected) : defaultRenderAction(action, selected);
|
|
162
|
+
const barStyle = [
|
|
163
|
+
styles.barContainer,
|
|
164
|
+
style,
|
|
165
|
+
disabled && disabledButtonStyle,
|
|
166
|
+
];
|
|
167
|
+
return (react_1.default.createElement(react_native_1.View, { style: barStyle },
|
|
168
|
+
react_1.default.createElement(react_native_1.FlatList, { horizontal: horizontal, style: flatContainerStyle, keyboardShouldPersistTaps: "always", keyExtractor: (item, index) => item.action + '-' + index, data: data, alwaysBounceHorizontal: false, showsHorizontalScrollIndicator: false, renderItem: ({ item }) => renderActionItem(item.action, item.selected) }),
|
|
169
|
+
children));
|
|
170
|
+
}
|
|
171
|
+
const styles = react_native_1.StyleSheet.create({
|
|
172
|
+
barContainer: {
|
|
173
|
+
height: 44,
|
|
174
|
+
backgroundColor: '#efefef',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
},
|
|
177
|
+
item: {
|
|
178
|
+
justifyContent: 'center',
|
|
179
|
+
alignItems: 'center',
|
|
180
|
+
},
|
|
181
|
+
});
|
|
@@ -48,11 +48,46 @@ ${(0, contentCSS_1.getContentCSS)()}
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
editor.addEventListener('focus', () => {
|
|
52
|
+
post('CONTENT_FOCUSED');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
editor.addEventListener('blur', () => {
|
|
56
|
+
post('CONTENT_BLUR');
|
|
57
|
+
});
|
|
58
|
+
|
|
51
59
|
window.addEventListener('message', e => {
|
|
52
60
|
const msg = JSON.parse(e.data);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (
|
|
61
|
+
const type = msg.type;
|
|
62
|
+
|
|
63
|
+
if (type === 'bold') document.execCommand('bold');
|
|
64
|
+
else if (type === 'italic') document.execCommand('italic');
|
|
65
|
+
else if (type === 'underline') document.execCommand('underline');
|
|
66
|
+
else if (type === 'link') {
|
|
67
|
+
const url = prompt('Enter link URL:');
|
|
68
|
+
if (url) {
|
|
69
|
+
const sel = window.getSelection();
|
|
70
|
+
const range = sel.getRangeAt(0);
|
|
71
|
+
const link = document.createElement('a');
|
|
72
|
+
link.href = url;
|
|
73
|
+
link.textContent = sel.toString() || url;
|
|
74
|
+
range.deleteContents();
|
|
75
|
+
range.insertNode(link);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else if (type === 'checkboxList') {
|
|
79
|
+
if (document.queryCommandState('insertOrderedList')) {
|
|
80
|
+
document.execCommand('insertOrderedList');
|
|
81
|
+
} else {
|
|
82
|
+
document.execCommand('insertOrderedList');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (type === 'focus') {
|
|
86
|
+
editor.focus();
|
|
87
|
+
}
|
|
88
|
+
else if (type === 'blur') {
|
|
89
|
+
editor.blur();
|
|
90
|
+
}
|
|
56
91
|
});
|
|
57
92
|
</script>
|
|
58
93
|
</body>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { RichEditor } from './RichEditor';
|
|
2
|
-
export { RichToolbar } from './RichToolbar';
|
|
2
|
+
export { RichToolbar, defaultActions } from './RichToolbar';
|
|
3
3
|
export { actions } from './actions';
|
|
4
4
|
export { createHTML } from './editor/createHTML';
|
|
5
5
|
export { getContentCSS } from './editor/contentCSS';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContentCSS = exports.createHTML = exports.actions = exports.RichToolbar = exports.RichEditor = void 0;
|
|
3
|
+
exports.getContentCSS = exports.createHTML = exports.actions = exports.defaultActions = exports.RichToolbar = exports.RichEditor = void 0;
|
|
4
4
|
var RichEditor_1 = require("./RichEditor");
|
|
5
5
|
Object.defineProperty(exports, "RichEditor", { enumerable: true, get: function () { return RichEditor_1.RichEditor; } });
|
|
6
6
|
var RichToolbar_1 = require("./RichToolbar");
|
|
7
7
|
Object.defineProperty(exports, "RichToolbar", { enumerable: true, get: function () { return RichToolbar_1.RichToolbar; } });
|
|
8
|
+
Object.defineProperty(exports, "defaultActions", { enumerable: true, get: function () { return RichToolbar_1.defaultActions; } });
|
|
8
9
|
var actions_1 = require("./actions");
|
|
9
10
|
Object.defineProperty(exports, "actions", { enumerable: true, get: function () { return actions_1.actions; } });
|
|
10
11
|
var createHTML_1 = require("./editor/createHTML");
|