@seafile/seafile-editor 2.0.47-beta → 2.0.47-beta1
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.
|
@@ -29,8 +29,8 @@ function SlateViewer(_ref) {
|
|
|
29
29
|
containerStyle
|
|
30
30
|
} = (0, _useContainerStyle.default)(scrollRef, isShowOutline);
|
|
31
31
|
const editor = (0, _react.useMemo)(() => {
|
|
32
|
-
return (0, _extension.createSlateEditor)();
|
|
33
|
-
}, []);
|
|
32
|
+
return (0, _extension.createSlateEditor)(value);
|
|
33
|
+
}, [value]);
|
|
34
34
|
const containerScrollRef = externalScrollRef ? externalScrollRef : scrollRef;
|
|
35
35
|
const decorate = (0, _extension.useHighlight)(editor);
|
|
36
36
|
(0, _userLinkClick.default)(editor._id, onLinkClick);
|
package/dist/extension/editor.js
CHANGED
|
@@ -30,7 +30,7 @@ const inlineEditor = () => {
|
|
|
30
30
|
return editor;
|
|
31
31
|
};
|
|
32
32
|
exports.inlineEditor = inlineEditor;
|
|
33
|
-
const createSlateEditor =
|
|
33
|
+
const createSlateEditor = children => {
|
|
34
34
|
const editor = _plugins.default.reduce((editor, pluginItem) => {
|
|
35
35
|
const withPlugin = pluginItem.editorPlugin;
|
|
36
36
|
if (withPlugin) {
|
|
@@ -39,6 +39,9 @@ const createSlateEditor = () => {
|
|
|
39
39
|
return editor;
|
|
40
40
|
}, (0, _slateHistory.withHistory)((0, _slateReact.withReact)((0, _slate.createEditor)())));
|
|
41
41
|
editor._id = (0, _slugid.nice)();
|
|
42
|
+
if (children) {
|
|
43
|
+
editor.children = children;
|
|
44
|
+
}
|
|
42
45
|
return editor;
|
|
43
46
|
};
|
|
44
47
|
exports.createSlateEditor = createSlateEditor;
|