@seafile/sdoc-editor 0.5.20 → 0.5.23

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,10 +1,11 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { eventStopPropagation } from '../../../utils/mouse-event';
4
4
  import context from '../../../../context';
5
5
  import { INTERNAL_EVENT } from '../../../constants';
6
6
  import EventBus from '../../../utils/event-bus';
7
7
  import { EXTERNAL_EVENT } from '../../../../constants';
8
+ import Tooltip from '../../../../components/tooltip';
8
9
  const GlobalCommentHeader = _ref => {
9
10
  let {
10
11
  toggle,
@@ -13,6 +14,13 @@ const GlobalCommentHeader = _ref => {
13
14
  const {
14
15
  t
15
16
  } = useTranslation();
17
+ const panelHeaderRef = useRef(null);
18
+ const [isMounted, setIsMounted] = useState(false);
19
+ useEffect(() => {
20
+ if (panelHeaderRef.current) {
21
+ setIsMounted(true);
22
+ }
23
+ }, []);
16
24
  const toggleADDComment = useCallback(event => {
17
25
  eventStopPropagation(event);
18
26
  toggleGlobalCommentEditor();
@@ -36,18 +44,25 @@ const GlobalCommentHeader = _ref => {
36
44
  }, /*#__PURE__*/React.createElement("span", {
37
45
  className: "title"
38
46
  }, t('Comments')), /*#__PURE__*/React.createElement("div", {
47
+ ref: panelHeaderRef,
39
48
  className: "comments-panel-header-right"
40
49
  }, /*#__PURE__*/React.createElement("div", {
50
+ id: "sdoc-read-all-btn",
41
51
  className: "sdoc-icon-btn",
42
52
  onClick: toggleReadAll
43
53
  }, /*#__PURE__*/React.createElement("i", {
44
54
  className: "sdocfont sdoc-all-read"
45
- })), /*#__PURE__*/React.createElement("div", {
55
+ }), isMounted && /*#__PURE__*/React.createElement(Tooltip, {
56
+ target: "sdoc-read-all-btn"
57
+ }, t('Mark_all_as_read'))), /*#__PURE__*/React.createElement("div", {
58
+ id: "sdoc-add-comment-btn",
46
59
  className: "sdoc-icon-btn",
47
60
  onClick: toggleADDComment
48
61
  }, /*#__PURE__*/React.createElement("i", {
49
62
  className: "sdocfont sdoc-add-comment"
50
- })), /*#__PURE__*/React.createElement("div", {
63
+ }), isMounted && /*#__PURE__*/React.createElement(Tooltip, {
64
+ target: "sdoc-add-comment-btn"
65
+ }, t('Add_comment'))), /*#__PURE__*/React.createElement("div", {
51
66
  className: "sdoc-icon-btn",
52
67
  onClick: toggle
53
68
  }, /*#__PURE__*/React.createElement("i", {
@@ -14,6 +14,7 @@
14
14
  .sdoc-callout-container .callout-content {
15
15
  flex: 1;
16
16
  position: relative;
17
+ overflow: auto;
17
18
  }
18
19
 
19
20
  .sdoc-callout-container .sdoc-callout-placeholder {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.5.20",
3
+ "version": "0.5.23",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Mark all as read"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Alle als gelesen markieren"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Mark all as read"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Mark all as read"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Mark all as read"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Middle",
451
451
  "Bottom_align": "Bottom",
452
452
  "Move_column_count": "Moving {{count}} column(s)",
453
- "Move_row_count": "Moving {{count}} row(s)"
453
+ "Move_row_count": "Moving {{count}} row(s)",
454
+ "Mark_all_as_read": "Mark all as read"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "Середина",
451
451
  "Bottom_align": "Низ",
452
452
  "Move_column_count": "Перемещение {{count}} столбцов",
453
- "Move_row_count": "Перемещение {{count}} строк"
453
+ "Move_row_count": "Перемещение {{count}} строк",
454
+ "Mark_all_as_read": "Отметить все как прочитанное"
454
455
  }
@@ -450,5 +450,6 @@
450
450
  "Center_align": "居中对齐",
451
451
  "Bottom_align": "底端对齐",
452
452
  "Move_column_count": "移动{{count}}列",
453
- "Move_row_count": "移动{{count}}行"
453
+ "Move_row_count": "移动{{count}}行",
454
+ "Mark_all_as_read": "全部标记为已读"
454
455
  }