@seafile/sdoc-editor 1.0.149 → 1.0.150
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.
|
@@ -60,6 +60,7 @@ const RenderQuickInsert = (_ref, editor) => {
|
|
|
60
60
|
handleInsertMenuStyle();
|
|
61
61
|
}, [handleInsertMenuStyle]);
|
|
62
62
|
(0, _react.useEffect)(() => {
|
|
63
|
+
if (readonly) return;
|
|
63
64
|
const scrollDom = scrollRef.current;
|
|
64
65
|
handleInsertMenuStyle();
|
|
65
66
|
document.addEventListener('click', handleClick);
|
|
@@ -68,7 +69,7 @@ const RenderQuickInsert = (_ref, editor) => {
|
|
|
68
69
|
document.removeEventListener('click', handleClick);
|
|
69
70
|
scrollDom.removeEventListener('scroll', handleScroll);
|
|
70
71
|
};
|
|
71
|
-
}, [editor, element, handleClick, handleInsertMenuStyle, handleScroll, scrollRef]);
|
|
72
|
+
}, [editor, element, handleClick, handleInsertMenuStyle, handleScroll, readonly, scrollRef]);
|
|
72
73
|
const handleInsertBlock = node => {
|
|
73
74
|
_slate.Transforms.delete(editor, {
|
|
74
75
|
at: _slateReact.ReactEditor.findPath(editor, element)
|
|
@@ -78,7 +79,7 @@ const RenderQuickInsert = (_ref, editor) => {
|
|
|
78
79
|
ref: insertElmRef
|
|
79
80
|
}, /*#__PURE__*/_react.default.createElement("span", Object.assign({}, attributes, {
|
|
80
81
|
className: ""
|
|
81
|
-
}), /*#__PURE__*/_react.default.createElement(_InlineBugFixWrapper.default, null), /*#__PURE__*/_react.default.createElement("span", null, "/", children), /*#__PURE__*/_react.default.createElement(_InlineBugFixWrapper.default, null), /*#__PURE__*/_react.default.createElement(_commons.ElementPopover, {
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_InlineBugFixWrapper.default, null), /*#__PURE__*/_react.default.createElement("span", null, "/", children), /*#__PURE__*/_react.default.createElement(_InlineBugFixWrapper.default, null), !readonly && /*#__PURE__*/_react.default.createElement(_commons.ElementPopover, {
|
|
82
83
|
className: "sdoc-side-menu-popover",
|
|
83
84
|
style: menuStyle
|
|
84
85
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -193,7 +193,7 @@ const CustomRenderElement = props => {
|
|
|
193
193
|
case _constants.QUICK_INSERT:
|
|
194
194
|
{
|
|
195
195
|
const [renderQuickInsert] = _plugins.QuickInsertPlugin.renderElements;
|
|
196
|
-
return renderQuickInsert(props, editor);
|
|
196
|
+
return renderQuickInsert(props, editor, readonly);
|
|
197
197
|
}
|
|
198
198
|
case _elementType.WIKI_LINK:
|
|
199
199
|
{
|
|
@@ -28,5 +28,6 @@ const SHORT_INSERT_ELEMENT_USER_INPUT_MAP = exports.SHORT_INSERT_ELEMENT_USER_IN
|
|
|
28
28
|
[_constants.TWO_COLUMN]: 'two_column',
|
|
29
29
|
[_constants.THREE_COLUMN]: 'three_column',
|
|
30
30
|
[_constants.FOUR_COLUMN]: 'four_column',
|
|
31
|
-
[_constants.FIVE_COLUMN]: 'five_column'
|
|
31
|
+
[_constants.FIVE_COLUMN]: 'five_column',
|
|
32
|
+
[_constants.VIDEO]: 'video'
|
|
32
33
|
};
|