@flozy/editor 3.9.5 → 3.9.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -54,22 +54,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
54
54
|
if (editor) {
|
55
55
|
ReactEditor.focus(editor);
|
56
56
|
insertEmoji(editor, emoji?.native, editor.selection);
|
57
|
-
if (editor.selection) {
|
58
|
-
// const path = editor.selection.anchor.path;
|
59
|
-
// const offset = editor.selection.anchor.offset + emoji?.native.length;
|
60
|
-
const position = {
|
61
|
-
anchor: {
|
62
|
-
path: [0],
|
63
|
-
offset: 0
|
64
|
-
},
|
65
|
-
focus: {
|
66
|
-
path: [0],
|
67
|
-
offset: 0
|
68
|
-
}
|
69
|
-
};
|
70
|
-
// Create a new selection
|
71
|
-
Transforms.select(editor, position);
|
72
|
-
}
|
73
57
|
ReactEditor.focus(editor);
|
74
58
|
}
|
75
59
|
},
|
@@ -126,12 +110,12 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
126
110
|
}
|
127
111
|
}
|
128
112
|
}));
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
113
|
+
useEffect(() => {
|
114
|
+
setIsExternalUpdate(true);
|
115
|
+
setValue(draftToSlate({
|
116
|
+
data: content
|
117
|
+
}));
|
118
|
+
}, [content]);
|
135
119
|
useEffect(() => {
|
136
120
|
if (JSON.stringify(loadedValue) !== JSON.stringify(deboundedValue) && isInteracted && onSave) {
|
137
121
|
const {
|
@@ -194,9 +178,14 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
194
178
|
});
|
195
179
|
};
|
196
180
|
const handleEditorChange = newValue => {
|
197
|
-
|
198
|
-
|
199
|
-
|
181
|
+
if (isExternalUpdate) {
|
182
|
+
setIsExternalUpdate(false);
|
183
|
+
return;
|
184
|
+
} else {
|
185
|
+
setValue(newValue);
|
186
|
+
if (!isInteracted) {
|
187
|
+
setIsInteracted(true);
|
188
|
+
}
|
200
189
|
}
|
201
190
|
};
|
202
191
|
const Element = props => {
|
@@ -7,6 +7,7 @@ import DeleteIcon from "@mui/icons-material/Delete";
|
|
7
7
|
import { GridSettingsIcon } from "../../common/iconslist";
|
8
8
|
import Icon from "../../common/Icon";
|
9
9
|
import { useEditorSelection } from "../../hooks/useMouseMove";
|
10
|
+
import ArrowRightIcon from "@mui/icons-material/ArrowRight";
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
13
|
const accordionBtnStyleKeys = {
|
@@ -68,8 +68,7 @@ const CheckList = ({
|
|
68
68
|
style: {
|
69
69
|
flex: 1,
|
70
70
|
opacity: checked ? 1 : 1,
|
71
|
-
textDecoration: !checked ? "none" : "none"
|
72
|
-
width: '90%'
|
71
|
+
textDecoration: !checked ? "none" : "none"
|
73
72
|
},
|
74
73
|
className: `checkbox-list content-editable ${isEmpty ? "empty" : ""}`,
|
75
74
|
placeholder: nestedCheckList ? "" : "Todo List",
|