@seafile/sdoc-editor 0.5.31 → 0.5.32

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.
@@ -1,3 +1,7 @@
1
+ .sdoc-article-container .sdoc-comment-list-container {
2
+ width: 312px;
3
+ }
4
+
1
5
  .sdoc-comment-list-container {
2
6
  position: absolute;
3
7
  }
@@ -1,18 +1,17 @@
1
1
  .sdoc-comment-drawer {
2
2
  position: relative;
3
+ width: 360px;
3
4
  min-width: 360px;
4
5
  max-width: 620px;
5
- z-index: 103;
6
+ border-left: 1px solid #e2e3e6;
6
7
  }
7
8
 
8
9
  .sdoc-comment-drawer .comments-panel-wrapper {
9
- /* 100vh - toolbar height - scroll height */
10
- height: calc(100vh - 100px - 2px);
10
+ /* 100vh - toolbar height*/
11
+ height: calc(100vh - 93px);
11
12
  display: flex;
12
- position: relative;
13
13
  flex-direction: column;
14
14
  background: #fff;
15
- box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
16
15
  }
17
16
 
18
17
  .sdoc-comment-drawer .sdoc-comment-resize-handler {
@@ -73,7 +72,6 @@
73
72
  display: flex;
74
73
  flex-direction: column;
75
74
  min-height: 0;
76
- position: relative;
77
75
  background-color: #F5F5F5;
78
76
  }
79
77
 
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useCallback, useMemo } from 'react';
3
3
  import { Editable, ReactEditor, Slate } from '@seafile/slate-react';
4
4
  import { Editor, Node, Range } from '@seafile/slate';
5
+ import scrollIntoView from 'scroll-into-view-if-needed';
5
6
  import { renderLeaf } from '../extension';
6
7
  import EventProxy from '../utils/event-handler';
7
8
  import { useCursors } from '../cursor/use-cursors';
@@ -49,8 +50,8 @@ const CommentArticle = _ref => {
49
50
  const focusedNode = Node.get(editor, selection.focus.path);
50
51
  const domNode = ReactEditor.toDOMNode(editor, focusedNode);
51
52
  if (!domNode) return;
52
- domNode.scrollIntoView({
53
- block: 'nearest'
53
+ scrollIntoView(domNode, {
54
+ 'scrollMode': 'if-needed'
54
55
  });
55
56
  } catch (error) {
56
57
  //
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useMemo, Fragment } from 'react';
2
2
  import { Editable, ReactEditor, Slate } from '@seafile/slate-react';
3
3
  import { Editor, Node, Range } from '@seafile/slate';
4
+ import scrollIntoView from 'scroll-into-view-if-needed';
4
5
  import { renderLeaf, renderElement, ContextToolbar, SideToolbar } from '../extension';
5
6
  import { getAboveBlockNode, getNextNode, getPrevNode, isSelectionAtBlockEnd, isSelectionAtBlockStart } from '../extension/core';
6
7
  import EventProxy from '../utils/event-handler';
@@ -154,8 +155,8 @@ const EditableArticle = _ref => {
154
155
  const focusedNode = Node.get(editor, selection.focus.path);
155
156
  const domNode = ReactEditor.toDOMNode(editor, focusedNode);
156
157
  if (!domNode) return;
157
- domNode.scrollIntoView({
158
- block: 'nearest'
158
+ scrollIntoView(domNode, {
159
+ 'scrollMode': 'if-needed'
159
160
  });
160
161
  } catch (error) {
161
162
  //
@@ -40,7 +40,7 @@ export const handleShortcut = (editor, text) => {
40
40
  });
41
41
  setListType(editor, ORDERED_LIST);
42
42
  focusEditor(editor);
43
- return;
43
+ return true;
44
44
  }
45
45
  // Record the order number of the shortcut that will be inserted as a list item
46
46
  const shortcutOrderNum = parseInt(matchResult[0].slice(0, -1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",