@seafile/sdoc-editor 0.1.135 → 0.1.136
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.
|
@@ -25,7 +25,7 @@ var withCodeBlock = function withCodeBlock(editor) {
|
|
|
25
25
|
return insertText(data);
|
|
26
26
|
};
|
|
27
27
|
newEditor.insertData = function (data) {
|
|
28
|
-
if (!newEditor.insertFragmentData(data)) {
|
|
28
|
+
if (!newEditor.insertFragmentData(data) && !data.types.includes('text/code-block')) {
|
|
29
29
|
var plaintext = data.getData('text/plain') || '';
|
|
30
30
|
if (plaintext) {
|
|
31
31
|
var fragmentData = [];
|
|
@@ -48,7 +48,6 @@ var withCodeBlock = function withCodeBlock(editor) {
|
|
|
48
48
|
var codeBlockNode = JSON.parse(data.getData('text/code-block'));
|
|
49
49
|
return insertNode(codeBlockNode);
|
|
50
50
|
}
|
|
51
|
-
return insertData(data);
|
|
52
51
|
};
|
|
53
52
|
newEditor.insertFragment = function (data) {
|
|
54
53
|
// only selected code block content
|
|
@@ -48,12 +48,7 @@ export var getHeaderType = function getHeaderType(editor) {
|
|
|
48
48
|
};
|
|
49
49
|
export var setHeaderType = function setHeaderType(editor, type) {
|
|
50
50
|
if (!type) return;
|
|
51
|
-
|
|
52
|
-
type: type
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
if (type === TITLE || type === SUBTITLE) {
|
|
56
|
-
newProperties['align'] = 'center';
|
|
57
|
-
}
|
|
58
|
-
Transforms.setNodes(editor, newProperties);
|
|
51
|
+
Transforms.setNodes(editor, {
|
|
52
|
+
type: type
|
|
53
|
+
});
|
|
59
54
|
};
|
|
@@ -30,7 +30,7 @@ var TableMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
30
30
|
};
|
|
31
31
|
_this.createTable = function (size) {
|
|
32
32
|
var editor = _this.props.editor;
|
|
33
|
-
insertTable(editor, size,
|
|
33
|
+
insertTable(editor, size, editor.selection);
|
|
34
34
|
};
|
|
35
35
|
return _this;
|
|
36
36
|
}
|