@seafile/sdoc-editor 0.5.58 → 0.5.60
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.
|
@@ -38,7 +38,7 @@ export const FILE_TYPE = {
|
|
|
38
38
|
[FILE_LINK]: 'file',
|
|
39
39
|
[SDOC_LINK]: 'sdoc'
|
|
40
40
|
};
|
|
41
|
-
export const SUPPORTED_SIDE_OPERATION_TYPE = [PARAGRAPH, SUBTITLE, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, CHECK_LIST_ITEM, CODE_BLOCK, TABLE, BLOCKQUOTE, CALL_OUT];
|
|
41
|
+
export const SUPPORTED_SIDE_OPERATION_TYPE = [PARAGRAPH, SUBTITLE, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, CHECK_LIST_ITEM, CODE_BLOCK, TABLE, BLOCKQUOTE, CALL_OUT, IMAGE_BLOCK];
|
|
42
42
|
export const MOUSE_ENTER_EVENT_DISABLED_MAP = {
|
|
43
43
|
[PARAGRAPH]: [CALL_OUT],
|
|
44
44
|
[TITLE]: [CALL_OUT],
|
|
@@ -56,5 +56,5 @@ export const MOUSE_ENTER_EVENT_DISABLED_MAP = {
|
|
|
56
56
|
[HEADER6]: [CALL_OUT],
|
|
57
57
|
[CALL_OUT]: [CALL_OUT]
|
|
58
58
|
};
|
|
59
|
-
export const ROOT_ELEMENT_TYPES = [PARAGRAPH, TITLE, SUBTITLE, CHECK_LIST_ITEM, ORDERED_LIST, UNORDERED_LIST, BLOCKQUOTE, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, CALL_OUT, TABLE, CODE_BLOCK];
|
|
59
|
+
export const ROOT_ELEMENT_TYPES = [PARAGRAPH, TITLE, SUBTITLE, CHECK_LIST_ITEM, ORDERED_LIST, UNORDERED_LIST, BLOCKQUOTE, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, CALL_OUT, TABLE, CODE_BLOCK, IMAGE_BLOCK];
|
|
60
60
|
export { ELEMENT_TYPE, BLOCKQUOTE, TITLE, SUBTITLE, HEADER, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, PARAGRAPH, ORDERED_LIST, UNORDERED_LIST, LIST_ITEM, CHECK_LIST_ITEM, CODE_BLOCK, CODE_LINE, TABLE, TABLE_CELL, TABLE_ROW, LINK, SDOC_LINK, FILE_LINK, IMAGE, IMAGE_BLOCK, TOP_LEVEL_TYPES, INLINE_LEVEL_TYPES, CALL_OUT, MENTION, MENTION_TEMP, FILE_LINK_INSET_INPUT_TEMP };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ObjectUtils from './object-utils';
|
|
2
|
+
import deepCopy from 'deep-copy';
|
|
2
3
|
import context from '../../context';
|
|
3
4
|
import { generateDefaultText } from '../../basic-sdk/extension/core/utils/index';
|
|
4
5
|
import { CLIPBOARD_ORIGIN_SDOC_KEY, ELEMENT_TYPE } from '../extension/constants';
|
|
@@ -14,6 +15,10 @@ export const normalizeChildren = children => {
|
|
|
14
15
|
if (ObjectUtils.hasProperty(child, 'text') && !ObjectUtils.hasProperty(child, 'children')) {
|
|
15
16
|
return child;
|
|
16
17
|
}
|
|
18
|
+
// To resolve the issue that the children is not assigned to the new object
|
|
19
|
+
if (!Object.getOwnPropertyDescriptor(child, 'children').writable) {
|
|
20
|
+
child = deepCopy(child);
|
|
21
|
+
}
|
|
17
22
|
// child is element
|
|
18
23
|
child.children = normalizeChildren(child.children);
|
|
19
24
|
return child;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.60",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is a sdoc editor",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"css-minimizer-webpack-plugin": "5.0.1",
|
|
98
98
|
"dotenv": "6.2.0",
|
|
99
99
|
"dotenv-expand": "5.1.0",
|
|
100
|
-
"ejs": "3.1.
|
|
100
|
+
"ejs": "3.1.10",
|
|
101
101
|
"eslint": "6.8.0",
|
|
102
102
|
"eslint-config-react-app": "^5.0.2",
|
|
103
103
|
"eslint-loader": "4.0.2",
|