@seafile/sdoc-editor 1.0.139 → 1.0.141
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.
|
@@ -159,7 +159,9 @@ const WikiEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
159
159
|
editor: validEditor,
|
|
160
160
|
slateValue: slateValue,
|
|
161
161
|
showComment: false
|
|
162
|
-
}))
|
|
162
|
+
})), !_utils.isMobile && isWikiReadOnly && /*#__PURE__*/_react.default.createElement(_wikiOutline.default, {
|
|
163
|
+
doc: slateValue
|
|
164
|
+
})))));
|
|
163
165
|
}
|
|
164
166
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_layout.EditorContainer, {
|
|
165
167
|
editor: validEditor
|
|
@@ -27,7 +27,6 @@ const Paragraph = _ref => {
|
|
|
27
27
|
} = element;
|
|
28
28
|
const editor = (0, _slateReact.useSlateStatic)();
|
|
29
29
|
const isSelected = (0, _slateReact.useSelected)();
|
|
30
|
-
const isCommentEditor = editor.editorType === _constants.COMMENT_EDITOR;
|
|
31
30
|
let isShowPlaceHolder = false;
|
|
32
31
|
if (editor.children.length === 1) {
|
|
33
32
|
const node = editor.children[0];
|
|
@@ -39,13 +38,14 @@ const Paragraph = _ref => {
|
|
|
39
38
|
const node = editor.children[1];
|
|
40
39
|
isShowPlaceHolder = _slate.Node.string(element) === '' && (node === null || node === void 0 ? void 0 : node.id) === (element === null || element === void 0 ? void 0 : element.id) && !isComposing;
|
|
41
40
|
}
|
|
41
|
+
const isCommentEditor = editor.editorType === _constants.COMMENT_EDITOR;
|
|
42
42
|
if (!isCommentEditor && isSelected && _slate.Range.isCollapsed(editor.selection) && (0, _helper.isEmptyNode)(element) && _slateReact.ReactEditor.findPath(editor, element).length === 1 && !isComposing) {
|
|
43
43
|
isShowPlaceHolder = true;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// Distinguish whether paragraph node is in multi_column node
|
|
47
|
-
const
|
|
48
|
-
if (!isComposing &&
|
|
47
|
+
const aboveNodeEntry = isSelected && (0, _core.getTopLevelBlockNode)(editor);
|
|
48
|
+
if (!isComposing && aboveNodeEntry && aboveNodeEntry[0].type === _constants2.ELEMENT_TYPE.MULTI_COLUMN && isSelected && (0, _helper.isEmptyNode)(element) && _slate.Range.isCollapsed(editor.selection)) {
|
|
49
49
|
isShowPlaceHolder = true;
|
|
50
50
|
}
|
|
51
51
|
const style = {
|
|
@@ -32,9 +32,9 @@ const CustomRenderElement = props => {
|
|
|
32
32
|
switch (element.type) {
|
|
33
33
|
case _constants.PARAGRAPH:
|
|
34
34
|
{
|
|
35
|
-
const parentNode = (0, _core.getParentNode)(editor.children, element.id);
|
|
36
35
|
let placeholder = undefined;
|
|
37
36
|
if (editor.editorType === _constants2.DIFF_VIEWER) placeholder = '';
|
|
37
|
+
const parentNode = (0, _core.getParentNode)(editor.children, element.id);
|
|
38
38
|
if (parentNode && parentNode.type === _constants.LIST_ITEM) {
|
|
39
39
|
const [renderParagraph] = _plugins.ParagraphPlugin.renderElements;
|
|
40
40
|
return renderParagraph({
|
|
@@ -120,7 +120,7 @@ class EventProxy {
|
|
|
120
120
|
});
|
|
121
121
|
(0, _defineProperty2.default)(this, "onCompositionEnd", event => {
|
|
122
122
|
const editor = this.editor;
|
|
123
|
-
if (editor.
|
|
123
|
+
if (editor.onCompositionEnd) {
|
|
124
124
|
const isHandled = editor.onCompositionEnd(event);
|
|
125
125
|
if (isHandled) return;
|
|
126
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.141",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is a sdoc editor",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@seafile/slate": "0.91.8",
|
|
11
11
|
"@seafile/slate-history": "0.86.2",
|
|
12
12
|
"@seafile/slate-hyperscript": "0.81.7",
|
|
13
|
-
"@seafile/slate-react": "0.92.
|
|
13
|
+
"@seafile/slate-react": "0.92.7",
|
|
14
14
|
"axios": "^1.7.4",
|
|
15
15
|
"classnames": "2.3.2",
|
|
16
16
|
"copy-to-clipboard": "^3.3.3",
|