sccoreui 6.2.95 → 6.2.97
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.
|
@@ -19,9 +19,9 @@ const FroalaTextEditor = ({ onChange, value, placeholderText, id, className, too
|
|
|
19
19
|
onChange(content);
|
|
20
20
|
// onChange(editorRef.current.editor.el.getInnerHTML())
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [value]);
|
|
22
|
+
// useEffect(() => {
|
|
23
|
+
// setEditorContent(value);
|
|
24
|
+
// }, [value]);
|
|
25
25
|
// const handleKeyUp = () => {
|
|
26
26
|
// // Access the current content of the editor
|
|
27
27
|
// debugger
|
|
@@ -34,15 +34,17 @@ const FroalaTextEditor = ({ onChange, value, placeholderText, id, className, too
|
|
|
34
34
|
// }
|
|
35
35
|
// };
|
|
36
36
|
(0, react_1.useEffect)(() => {
|
|
37
|
+
var _a, _b, _c, _d, _e, _f;
|
|
37
38
|
if (editorRef.current) {
|
|
38
|
-
editorRef.current.editor.$el.on("focus", () => {
|
|
39
|
+
(_c = (_b = (_a = editorRef === null || editorRef === void 0 ? void 0 : editorRef.current) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.$el) === null || _c === void 0 ? void 0 : _c.on("focus", () => {
|
|
39
40
|
document.getElementById(id).classList.add("focus-text-editor");
|
|
40
41
|
});
|
|
41
|
-
editorRef.current.editor.$el.on("focusout", () => {
|
|
42
|
+
(_f = (_e = (_d = editorRef === null || editorRef === void 0 ? void 0 : editorRef.current) === null || _d === void 0 ? void 0 : _d.editor) === null || _e === void 0 ? void 0 : _e.$el) === null || _f === void 0 ? void 0 : _f.on("focusout", () => {
|
|
42
43
|
document.getElementById(id).classList.remove("focus-text-editor");
|
|
43
44
|
});
|
|
45
|
+
setEditorContent(value);
|
|
44
46
|
}
|
|
45
|
-
}, []);
|
|
47
|
+
}, [value]);
|
|
46
48
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: `text-editor ${className}`, id: id }, { children: (0, jsx_runtime_1.jsx)(react_froala_wysiwyg_1.default, { tag: "textarea", config: {
|
|
47
49
|
events: {
|
|
48
50
|
initialized: toolbar
|