@seafile/sdoc-editor 1.0.41 → 1.0.42
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.
|
@@ -14,6 +14,7 @@ import '../assets/css/plugin-editor.css';
|
|
|
14
14
|
const DocumentPluginEditor = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
isReadOnly,
|
|
17
|
+
docUuid,
|
|
17
18
|
document,
|
|
18
19
|
showOutline,
|
|
19
20
|
tableId,
|
|
@@ -30,6 +31,9 @@ const DocumentPluginEditor = _ref => {
|
|
|
30
31
|
const withColumnPlugin = SeaTableColumnPlugin.editorPlugin;
|
|
31
32
|
const withViewsPlugin = SeaTableViewsPlugin.editorPlugin;
|
|
32
33
|
const defaultEditor = withViewsPlugin(withColumnPlugin(createDefaultEditor()));
|
|
34
|
+
|
|
35
|
+
// getEditorConfig cache the config, so we need to update the uuid,for plugin editor
|
|
36
|
+
docUuid && context.updateConfigUuid(docUuid);
|
|
33
37
|
const editorConfig = context.getEditorConfig();
|
|
34
38
|
const newEditor = withNodeId(withSocketIO(defaultEditor, {
|
|
35
39
|
document,
|
|
@@ -55,7 +59,13 @@ const DocumentPluginEditor = _ref => {
|
|
|
55
59
|
newEditor.editorType = DOCUMENT_PLUGIN_EDITOR;
|
|
56
60
|
return newEditor;
|
|
57
61
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
-
}, []);
|
|
62
|
+
}, [docUuid]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
validEditor.openConnection();
|
|
65
|
+
return () => {
|
|
66
|
+
validEditor.closeConnection();
|
|
67
|
+
};
|
|
68
|
+
}, [validEditor]);
|
|
59
69
|
useEffect(() => {
|
|
60
70
|
validEditor.getColumnCellValue = getColumnCellValue ? getColumnCellValue : null;
|
|
61
71
|
forceUpdate();
|