@seafile/sdoc-editor 1.0.193 → 1.0.194
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.
|
@@ -124,20 +124,12 @@
|
|
|
124
124
|
margin-top: 0px;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.sdoc-comment-drawer .comments-panel-body__content .comment-ui-container.sdoc-resolved {
|
|
128
|
-
background: #f5f5f5;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
127
|
.sdoc-comment-drawer .comments-panel-body__content .comment-ui-container.active {
|
|
132
128
|
left: 0;
|
|
133
129
|
background: #fff;
|
|
134
130
|
box-shadow: unset;
|
|
135
131
|
}
|
|
136
132
|
|
|
137
|
-
.sdoc-comment-drawer .comments-panel-body__content .comment-ui-container.active.sdoc-resolved {
|
|
138
|
-
background: #f5f5f5;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
133
|
.sdoc-dropdown-menu .dropdown-item {
|
|
142
134
|
font-size: 14px;
|
|
143
135
|
color: #212529;
|
|
@@ -13,11 +13,13 @@ class CheckListItem extends _react.default.PureComponent {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
(0, _defineProperty2.default)(this, "onChange", event => {
|
|
16
|
-
const checked = event.target.checked;
|
|
17
16
|
const {
|
|
18
17
|
editor,
|
|
19
|
-
element
|
|
18
|
+
element,
|
|
19
|
+
readOnly
|
|
20
20
|
} = this.props;
|
|
21
|
+
if (readOnly) return;
|
|
22
|
+
const checked = event.target.checked;
|
|
21
23
|
const path = _slateReact.ReactEditor.findPath(editor, element);
|
|
22
24
|
_slate.Transforms.setNodes(editor, {
|
|
23
25
|
checked
|
|
@@ -58,8 +60,11 @@ class CheckListItem extends _react.default.PureComponent {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
const renderCheckListItem = (props, editor) => {
|
|
63
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
64
|
+
const readOnly = (0, _slateReact.useReadOnly)();
|
|
61
65
|
return /*#__PURE__*/_react.default.createElement(CheckListItem, Object.assign({}, props, {
|
|
62
|
-
editor: editor
|
|
66
|
+
editor: editor,
|
|
67
|
+
readOnly: readOnly
|
|
63
68
|
}));
|
|
64
69
|
};
|
|
65
70
|
exports.renderCheckListItem = renderCheckListItem;
|
|
@@ -29,10 +29,15 @@ const SdocWikiEditor = _ref => {
|
|
|
29
29
|
// getEditorConfig cashe the config, so we need to update the uuid,for wiki editor
|
|
30
30
|
docUuid && _context.default.updateConfigUuid(docUuid);
|
|
31
31
|
const editorConfig = _context.default.getEditorConfig();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
let newEditor = null;
|
|
33
|
+
if (!isWikiReadOnly) {
|
|
34
|
+
newEditor = (0, _nodeId.default)((0, _socket.withSocketIO)(defaultEditor, {
|
|
35
|
+
document,
|
|
36
|
+
config: editorConfig
|
|
37
|
+
}));
|
|
38
|
+
} else {
|
|
39
|
+
newEditor = (0, _nodeId.default)(defaultEditor);
|
|
40
|
+
}
|
|
36
41
|
const {
|
|
37
42
|
cursors
|
|
38
43
|
} = document;
|
|
@@ -44,11 +49,12 @@ const SdocWikiEditor = _ref => {
|
|
|
44
49
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
50
|
}, [docUuid]);
|
|
46
51
|
(0, _react.useEffect)(() => {
|
|
52
|
+
if (isWikiReadOnly) return;
|
|
47
53
|
validEditor.openConnection();
|
|
48
54
|
return () => {
|
|
49
55
|
validEditor.closeConnection();
|
|
50
56
|
};
|
|
51
|
-
}, [validEditor]);
|
|
57
|
+
}, [isWikiReadOnly, validEditor]);
|
|
52
58
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_wikiEditor.default, {
|
|
53
59
|
document: document,
|
|
54
60
|
docUuid: docUuid,
|