@seafile/seafile-editor 1.0.45 → 1.0.46
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.
- package/dist/extension/plugins/header/menu/index.js +1 -2
- package/dist/extension/plugins/link/plugin.js +5 -5
- package/dist/extension/plugins/list/menu/index.js +1 -3
- package/dist/extension/plugins/table/helper.js +1 -1
- package/dist/extension/plugins/table/menu/style.css +2 -2
- package/package.json +1 -1
|
@@ -28,8 +28,7 @@ const HeaderMenu = _ref => {
|
|
|
28
28
|
t
|
|
29
29
|
} = (0, _reactI18next.useTranslation)(_constants2.TRANSLATE_NAMESPACE);
|
|
30
30
|
const currentHeaderType = (0, _helper.getHeaderType)(editor);
|
|
31
|
-
|
|
32
|
-
const isDisabled = (0, _react.useMemo)(() => (0, _helper.isMenuDisabled)(editor, readonly), [editor.selection, readonly]);
|
|
31
|
+
const isDisabled = (0, _helper.isMenuDisabled)(editor, readonly);
|
|
33
32
|
const onHideHeaderMenu = (0, _react.useCallback)(e => {
|
|
34
33
|
setIsShowHeaderPopover(false);
|
|
35
34
|
unregisterEventHandler();
|
|
@@ -73,12 +73,12 @@ const withLink = editor => {
|
|
|
73
73
|
const isDeletingLinkNode = (0, _helper.isLinkType)(editor);
|
|
74
74
|
if (isDeletingLinkNode) {
|
|
75
75
|
const linkNodeInfo = (0, _helper.getLinkInfo)(editor);
|
|
76
|
-
const next = _slate.Editor.next(editor);
|
|
77
|
-
const nextPath = _slate.Path.next(linkNodeInfo.path);
|
|
78
|
-
const nextNode = _slate.Editor.node(editor, nextPath);
|
|
79
|
-
(0, _focusEditor.focusEditor)(editor, next[1]);
|
|
80
|
-
_slate.Transforms.select(editor, nextNode[1]);
|
|
81
76
|
if (linkNodeInfo && linkNodeInfo.linkTitle.length === 1) {
|
|
77
|
+
const next = _slate.Editor.next(editor);
|
|
78
|
+
const nextPath = _slate.Path.next(linkNodeInfo.path);
|
|
79
|
+
const nextNode = _slate.Editor.node(editor, nextPath);
|
|
80
|
+
(0, _focusEditor.focusEditor)(editor, next[1]);
|
|
81
|
+
_slate.Transforms.select(editor, nextNode[1]);
|
|
82
82
|
_slate.Transforms.delete(newEditor, {
|
|
83
83
|
at: linkNodeInfo.path
|
|
84
84
|
});
|
|
@@ -22,8 +22,6 @@ const ListMenu = _ref => {
|
|
|
22
22
|
className
|
|
23
23
|
} = _ref;
|
|
24
24
|
const isActive = (0, _helpers.getActiveListType)(editor, type) === type;
|
|
25
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
-
const isDisabled = (0, _react.useMemo)(() => (0, _helpers.isMenuDisabled)(editor, readonly), [editor.selection, readonly]);
|
|
27
25
|
|
|
28
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
27
|
const menuConfig = (0, _react.useMemo)(() => _constants.MENUS_CONFIG_MAP[type], []);
|
|
@@ -36,7 +34,7 @@ const ListMenu = _ref => {
|
|
|
36
34
|
return /*#__PURE__*/_react.default.createElement(_menuItem.default, Object.assign({
|
|
37
35
|
isRichEditor: isRichEditor,
|
|
38
36
|
isActive: isActive,
|
|
39
|
-
disabled:
|
|
37
|
+
disabled: (0, _helpers.isMenuDisabled)(editor, readonly),
|
|
40
38
|
className: className,
|
|
41
39
|
onMouseDown: onMouseDown
|
|
42
40
|
}, menuConfig));
|
|
@@ -16,7 +16,7 @@ const isDisabled = (editor, readonly) => {
|
|
|
16
16
|
selection
|
|
17
17
|
} = editor;
|
|
18
18
|
if (readonly || !selection) return true;
|
|
19
|
-
const disableTypes = [_elementTypes.TABLE, _elementTypes.TABLE_ROW, _elementTypes.TABLE_CELL, _elementTypes.FORMULA, _elementTypes.CODE_BLOCK, _elementTypes.COLUMN, _elementTypes.BLOCKQUOTE];
|
|
19
|
+
const disableTypes = [_elementTypes.TABLE, _elementTypes.TABLE_ROW, _elementTypes.TABLE_CELL, _elementTypes.FORMULA, _elementTypes.CODE_BLOCK, _elementTypes.COLUMN, _elementTypes.BLOCKQUOTE, _elementTypes.UNORDERED_LIST, _elementTypes.ORDERED_LIST, _elementTypes.LIST_ITEM];
|
|
20
20
|
const [nodeEntry] = _slate.Editor.nodes(editor, {
|
|
21
21
|
match: n => disableTypes.includes(n.type),
|
|
22
22
|
mode: 'highest'
|