@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.
@@ -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
- // eslint-disable-next-line react-hooks/exhaustive-deps
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: isDisabled,
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'
@@ -6,9 +6,9 @@
6
6
  position: absolute;
7
7
  z-index: 1;
8
8
  top: 30px;
9
- padding: 12px;
9
+ padding: 5px 12px;
10
10
  background-color: #fff;
11
-
11
+ border: 1px solid #0028641f;
12
12
  }
13
13
 
14
14
  .sf-table-size-selector-card .sf-table-grid-info {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {