@seafile/sdoc-editor 1.0.122 → 1.0.124

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.
@@ -32,6 +32,11 @@ const CommentItemCollapseWrapper = _ref => {
32
32
  const [commentContent, setCommentContent] = (0, _react.useState)('');
33
33
  const [replyContent, setReplyContent] = (0, _react.useState)('');
34
34
  const isUnseen = notificationsInfo.notifications_map[`sdoc_notification_${topLevelComment.id}`] ? true : false;
35
+ const isReplayUnseen = (0, _react.useMemo)(() => {
36
+ if (!latestReply) return false;
37
+ const isUnseen = notificationsInfo.notifications_map[`sdoc_notification_${topLevelComment.id}_${latestReply.id}`] ? true : false;
38
+ return isUnseen;
39
+ }, [latestReply, notificationsInfo.notifications_map, topLevelComment.id]);
35
40
  (0, _react.useEffect)(() => {
36
41
  const initCommentContent = async () => {
37
42
  const htmlString = await _mdToHtml.default.process(topLevelComment.comment);
@@ -106,11 +111,9 @@ const CommentItemCollapseWrapper = _ref => {
106
111
  className: "name"
107
112
  }, topLevelComment.user_name), /*#__PURE__*/_react.default.createElement("span", {
108
113
  className: "time"
109
- }, (0, _dayjs.default)(topLevelComment.updated_at).format('MM-DD HH:mm'), isUnseen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
114
+ }, (0, _dayjs.default)(topLevelComment.updated_at).format('MM-DD HH:mm')))), (isUnseen || isReplayUnseen) && /*#__PURE__*/_react.default.createElement("div", {
110
115
  className: "sdoc-unread-message-tip"
111
- }), /*#__PURE__*/_react.default.createElement("span", {
112
- className: "sdoc-unread-message-text-tip"
113
- }, t('New'))))))), /*#__PURE__*/_react.default.createElement("div", {
116
+ })), /*#__PURE__*/_react.default.createElement("div", {
114
117
  className: "comment-content"
115
118
  }, /*#__PURE__*/_react.default.createElement("div", {
116
119
  dangerouslySetInnerHTML: {
@@ -96,11 +96,9 @@ const CommentItem = _ref => {
96
96
  className: "name"
97
97
  }, comment.user_name), /*#__PURE__*/_react.default.createElement("span", {
98
98
  className: "time"
99
- }, (0, _dayjs.default)(comment.updated_at).format('MM-DD HH:mm'), isUnseen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
99
+ }, (0, _dayjs.default)(comment.updated_at).format('MM-DD HH:mm')))), isUnseen && !isActive && /*#__PURE__*/_react.default.createElement("span", {
100
100
  className: "sdoc-unread-message-tip"
101
- }), /*#__PURE__*/_react.default.createElement("span", {
102
- className: "sdoc-unread-message-text-tip"
103
- }, t('New')))))), isActive && /*#__PURE__*/_react.default.createElement("div", {
101
+ }), isActive && /*#__PURE__*/_react.default.createElement("div", {
104
102
  className: "d-flex comment-item-operation-wrapper"
105
103
  }, !comment.resolved && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
106
104
  id: `tooltip_${menuId}`,
@@ -84,11 +84,7 @@ const CommentItemReply = _ref => {
84
84
  className: "name"
85
85
  }, reply.user_name), /*#__PURE__*/_react.default.createElement("span", {
86
86
  className: "time"
87
- }, (0, _dayjs.default)(reply.updated_at).format('MM-DD HH:mm'), isUnseen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
88
- className: "sdoc-unread-message-tip"
89
- }), /*#__PURE__*/_react.default.createElement("span", {
90
- className: "sdoc-unread-message-text-tip"
91
- }, t('New')))))), isActive && user.username === reply.author && /*#__PURE__*/_react.default.createElement("div", {
87
+ }, (0, _dayjs.default)(reply.updated_at).format('MM-DD HH:mm')))), isActive && user.username === reply.author && /*#__PURE__*/_react.default.createElement("div", {
92
88
  className: "comment-item-operation-wrapper"
93
89
  }, /*#__PURE__*/_react.default.createElement(_reactstrap.Dropdown, {
94
90
  id: replyOpToolsId,
@@ -52,6 +52,7 @@
52
52
  overflow-y: auto;
53
53
  margin: 0;
54
54
  padding: 0;
55
+ padding-bottom: 16px;
55
56
  }
56
57
 
57
58
  .sdoc-comment-list-container .comment-item {
@@ -60,6 +61,10 @@
60
61
  cursor: pointer;
61
62
  }
62
63
 
64
+ .sdoc-comment-list-container .comment-item .comment-item-operation-wrapper {
65
+ margin-top: -12px;
66
+ }
67
+
63
68
  .comment-delete-popover .comment-delete-popover-container {
64
69
  padding: 16px;
65
70
  }
@@ -70,10 +75,6 @@
70
75
  width: 100%;
71
76
  }
72
77
 
73
- .sdoc-comment-list-container .comment-ui-container.active .comment-item:hover {
74
- background: #fafafa;
75
- }
76
-
77
78
  .sdoc-comment-list-container .comment-item .comment-header,
78
79
  .sdoc-comment-list-container .comment-item .comment-author {
79
80
  display: flex;
@@ -150,7 +151,7 @@
150
151
  width: 6px;
151
152
  border-radius: 50%;
152
153
  background-color: #fc6440;
153
- margin-left: 6px;
154
+ margin-right: 6px;
154
155
  }
155
156
 
156
157
  .sdoc-comment-list-container .comment-header .sdoc-unread-message-text-tip {
@@ -163,17 +164,9 @@
163
164
  color: #fff;
164
165
  }
165
166
 
166
- .sdoc-comment-list-container .comment-ui-container:hover .comment-header .sdoc-unread-message-tip {
167
- display: none;
168
- }
169
-
170
- .sdoc-comment-list-container .comment-ui-container:hover .comment-header .sdoc-unread-message-text-tip {
171
- display: inline-block;
172
- }
173
-
174
167
  .sdoc-comment-list-container .comment-ui-container .comment-operation {
175
- width: 32px;
176
- height: 32px;
168
+ width: 24px;
169
+ height: 24px;
177
170
  padding: 0 !important;
178
171
  display: flex;
179
172
  align-items: center;
@@ -189,11 +182,6 @@
189
182
  background-color: #f0f0f0;
190
183
  }
191
184
 
192
- .sdoc-comment-list-container .comment-ui-container .comment-operation .sdoc-confirm {
193
- color: #20a0ff;
194
- font-weight: 800;
195
- }
196
-
197
185
  .sdoc-comment-menu {
198
186
  padding: 0;
199
187
  border-radius: 2px;
@@ -322,7 +310,7 @@
322
310
  }
323
311
 
324
312
  .sdoc-article-container .sdoc-comment-list-container .comment-item {
325
- padding: 16px;
313
+ padding: 16px 16px 0px 16px;
326
314
  }
327
315
 
328
316
  .sdoc-article-container .sdoc-comment-list-container .comment-item .comment-editor-wrapper.pb-3 {
@@ -12,3 +12,15 @@
12
12
  transform: scale(.7);
13
13
  text-align: center;
14
14
  }
15
+
16
+ .sdoc-plugin-operation-btn-container .sdoc-unread-message-tip {
17
+ position: absolute;
18
+ left: 12px;
19
+ top: 4px;
20
+ display: inline-block;
21
+ height: 6px;
22
+ width: 6px;
23
+ border-radius: 50%;
24
+ background-color: #fc6440;
25
+ margin-left: 6px;
26
+ }
@@ -22,10 +22,9 @@ function CommentsOperation() {
22
22
  };
23
23
  // eslint-disable-next-line react-hooks/exhaustive-deps
24
24
  }, []);
25
- console.log(unseenNotificationsCount);
26
25
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
27
26
  className: "sdocfont sdoc-comments"
28
27
  }), unseenNotificationsCount > 0 && /*#__PURE__*/_react.default.createElement("span", {
29
- className: "sdoc-notification-count"
30
- }, unseenNotificationsCount));
28
+ className: "sdoc-unread-message-tip"
29
+ }));
31
30
  }
@@ -206,6 +206,10 @@
206
206
  background-color: #f5f5f5;
207
207
  }
208
208
 
209
+ .sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container .comment-item-list {
210
+ padding-bottom: 0px;
211
+ }
212
+
209
213
  .sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container .comment-item {
210
214
  padding: 0px
211
215
  }
@@ -235,6 +239,7 @@
235
239
  .sdoc-comment-drawer .sdoc-comment-list-container .comment-item .comment-footer .comments-count {
236
240
  display: flex;
237
241
  align-items: center;
242
+ position: relative;
238
243
  }
239
244
 
240
245
  .sdoc-comment-drawer .sdoc-comment-list-container .comment-item .comment-footer .comments-count .comments-count-number {
@@ -247,10 +252,6 @@
247
252
  align-items: unset;
248
253
  }
249
254
 
250
- .sdoc-comment-drawer .sdoc-comment-list-container .comment-item .comment-item-operation-wrapper {
251
- margin-top: -12px;
252
- }
253
-
254
255
  .sdoc-comment-drawer .sdoc-comment-list-container .comment-item .comment-item-operation-wrapper .comment-operation {
255
256
  width: 24px;
256
257
  height: 24px;
@@ -25,6 +25,7 @@ require("./index.css");
25
25
  const GlobalComment = _ref => {
26
26
  let {
27
27
  editor,
28
+ deleteUnseenNotifications,
28
29
  t
29
30
  } = _ref;
30
31
  const commentRef = (0, _react.useRef)(null);
@@ -120,10 +121,11 @@ const GlobalComment = _ref => {
120
121
  const activeCommentGroup = commentList.find(item => item.id === commentGroupId);
121
122
  if (activeCommentGroup) {
122
123
  setActiveCommentGroup(activeCommentGroup);
124
+ deleteUnseenNotifications && deleteUnseenNotifications(activeCommentGroup);
123
125
  } else {
124
126
  setActiveCommentGroup(null);
125
127
  }
126
- }, [commentList]);
128
+ }, [commentList, deleteUnseenNotifications]);
127
129
  const commentEditorPlaceholder = !activeCommentGroup ? t('Enter_comment_shift_enter_for_new_line_Enter_to_send') : t('Enter_reply_shift_Enter_for_new_line_Enter_to_send');
128
130
  return /*#__PURE__*/_react.default.createElement("div", {
129
131
  className: "sdoc-comment-drawer"
@@ -59,6 +59,7 @@ const CommentWrapper = _ref => {
59
59
  deleteUnseenNotifications: deleteUnseenNotifications,
60
60
  editor: editor
61
61
  }), type === 'global' && /*#__PURE__*/_react.default.createElement(_components.GlobalComment, {
62
+ deleteUnseenNotifications: deleteUnseenNotifications,
62
63
  editor: editor
63
64
  }));
64
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.122",
3
+ "version": "1.0.124",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",