@seafile/sdoc-editor 0.2.29-beta → 0.2.30-beta
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/api/seafile-api.js +11 -18
- package/dist/basic-sdk/comment/components/comment-item-content.js +9 -1
- package/dist/basic-sdk/comment/components/comment-item-reply.js +9 -1
- package/dist/basic-sdk/comment/components/comment-item-wrapper.js +1 -1
- package/dist/basic-sdk/comment/components/comment-list.css +29 -0
- package/dist/basic-sdk/comment/components/comment-list.js +5 -3
- package/dist/basic-sdk/comment/components/editor-comment.js +5 -3
- package/dist/basic-sdk/comment/components/global-comment/index.js +10 -7
- package/dist/basic-sdk/comment/constants/index.js +8 -1
- package/dist/basic-sdk/comment/hooks/{use-comment-list.js → comment-hooks/use-comment-list.js} +1 -1
- package/dist/basic-sdk/comment/hooks/{use-comment-mount.js → comment-hooks/use-comment-mount.js} +36 -5
- package/dist/basic-sdk/comment/hooks/notification-hooks/index.js +2 -0
- package/dist/basic-sdk/comment/hooks/notification-hooks/use-notification-context.js +11 -0
- package/dist/basic-sdk/comment/hooks/notification-hooks/use-notification-mount.js +85 -0
- package/dist/basic-sdk/comment/index.js +46 -7
- package/dist/basic-sdk/comment/{comment-context-provider.js → provider/comment-context-provider.js} +3 -3
- package/dist/basic-sdk/comment/provider/index.js +8 -0
- package/dist/basic-sdk/comment/provider/notification-context-provider.js +26 -0
- package/dist/basic-sdk/comment/reducer/notification-reducer.js +70 -0
- package/dist/basic-sdk/comment/utils/index.js +2 -1
- package/dist/{utils → basic-sdk/comment/utils}/notification-utils.js +9 -3
- package/dist/basic-sdk/constants/index.js +5 -1
- package/dist/basic-sdk/editor/editable-article.js +1 -2
- package/dist/basic-sdk/editor/sdoc-editor.js +3 -2
- package/dist/components/doc-operations/{notifications-operation → comments-operation}/index.css +2 -2
- package/dist/components/doc-operations/comments-operation/index.js +23 -4
- package/dist/components/doc-operations/index.js +1 -2
- package/dist/components/doc-operations/revision-operations/view-changes/index.js +37 -2
- package/dist/context.js +7 -19
- package/dist/layout/index.js +1 -2
- package/dist/model/notification.js +6 -14
- package/dist/pages/simple-editor.js +3 -3
- package/dist/utils/index.js +1 -2
- package/package.json +3 -3
- package/public/locales/cs/sdoc-editor.json +4 -2
- package/public/locales/de/sdoc-editor.json +4 -2
- package/public/locales/en/sdoc-editor.json +1 -9
- package/public/locales/es/sdoc-editor.json +4 -2
- package/public/locales/fr/sdoc-editor.json +4 -2
- package/public/locales/it/sdoc-editor.json +4 -2
- package/public/locales/ru/sdoc-editor.json +6 -4
- package/public/locales/zh_CN/sdoc-editor.json +3 -3
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +0 -2
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +0 -4
- package/dist/components/doc-operations/notifications-operation/index.js +0 -170
- package/dist/components/doc-operations/notifications-operation/notifications-dialog/index.css +0 -97
- package/dist/components/doc-operations/notifications-operation/notifications-dialog/index.js +0 -107
- package/dist/components/doc-operations/notifications-operation/notifications-dialog/notification.js +0 -25
- package/dist/components/doc-operations/notifications-operation/notifications-popover/index.css +0 -173
- package/dist/components/doc-operations/notifications-operation/notifications-popover/index.js +0 -78
- package/dist/components/doc-operations/notifications-operation/notifications-popover/notification.js +0 -54
- package/dist/layout/other.js +0 -8
- /package/dist/basic-sdk/comment/hooks/{use-comment-context.js → comment-hooks/use-comment-context.js} +0 -0
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { EventBus } from '../../../basic-sdk';
|
|
5
|
-
import { EXTERNAL_EVENT } from '../../../constants';
|
|
6
|
-
import { createNotify, getErrorMsg } from '../../../utils';
|
|
7
|
-
import { useCollaborators } from '../../../hooks';
|
|
8
|
-
import context from '../../../context';
|
|
9
|
-
import { Notification } from '../../../model';
|
|
10
|
-
import NotificationPopover from './notifications-popover';
|
|
11
|
-
import AllNotificationsDialog from './notifications-dialog';
|
|
12
|
-
import toaster from '../../toast';
|
|
13
|
-
import './index.css';
|
|
14
|
-
var PER_PAGE = 25;
|
|
15
|
-
var NotificationOperation = function NotificationOperation() {
|
|
16
|
-
var _useState = useState([]),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
notifications = _useState2[0],
|
|
19
|
-
setNotifications = _useState2[1];
|
|
20
|
-
var _useState3 = useState(true),
|
|
21
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
22
|
-
hasMore = _useState4[0],
|
|
23
|
-
setHasMore = _useState4[1];
|
|
24
|
-
var _useState5 = useState(1),
|
|
25
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
26
|
-
page = _useState6[0],
|
|
27
|
-
setPage = _useState6[1];
|
|
28
|
-
var _useState7 = useState(false),
|
|
29
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
30
|
-
showNotificationsDialog = _useState8[0],
|
|
31
|
-
setShowNotificationsDialog = _useState8[1];
|
|
32
|
-
var _useTranslation = useTranslation(),
|
|
33
|
-
t = _useTranslation.t;
|
|
34
|
-
var _useCollaborators = useCollaborators(),
|
|
35
|
-
collaborators = _useCollaborators.collaborators;
|
|
36
|
-
var id = 'sdoc-notification';
|
|
37
|
-
var popupBrowserCommentNotification = useCallback(function (notification) {
|
|
38
|
-
if (!notification) return;
|
|
39
|
-
var author = notification.author,
|
|
40
|
-
msgType = notification.msg_type,
|
|
41
|
-
reply = notification.reply,
|
|
42
|
-
comment = notification.comment;
|
|
43
|
-
var authorInfo = collaborators.find(function (collaborator) {
|
|
44
|
-
return collaborator.email === author;
|
|
45
|
-
});
|
|
46
|
-
var notificationContent = comment || reply;
|
|
47
|
-
var titleKey = msgType === 'comment' ? 'xxx_added_a_new_comment' : 'xxx_added_a_reply';
|
|
48
|
-
var title = t(titleKey, {
|
|
49
|
-
author: authorInfo ? authorInfo.name : t('Unknown')
|
|
50
|
-
});
|
|
51
|
-
var options = {
|
|
52
|
-
body: "".concat(notificationContent)
|
|
53
|
-
};
|
|
54
|
-
createNotify(title, options);
|
|
55
|
-
}, [collaborators, t]);
|
|
56
|
-
var _listNotifications = useCallback(function (page) {
|
|
57
|
-
var perPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PER_PAGE;
|
|
58
|
-
var forceAcquisition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
59
|
-
if (!forceAcquisition && !hasMore) return;
|
|
60
|
-
var newNotifications = page === 1 ? [] : notifications.slice(0);
|
|
61
|
-
context.listNotifications(page, perPage).then(function (res) {
|
|
62
|
-
var _res$data = res.data,
|
|
63
|
-
loadedNotifications = _res$data.notifications,
|
|
64
|
-
total_count = _res$data.total_count;
|
|
65
|
-
var hasMore = total_count > notifications.length + newNotifications.length;
|
|
66
|
-
loadedNotifications.forEach(function (n) {
|
|
67
|
-
var notification = new Notification(n);
|
|
68
|
-
newNotifications.push(notification);
|
|
69
|
-
});
|
|
70
|
-
setHasMore(hasMore);
|
|
71
|
-
setPage(page + 1);
|
|
72
|
-
setNotifications(newNotifications);
|
|
73
|
-
}).catch(function (error) {
|
|
74
|
-
var errMsg = getErrorMsg(error, true);
|
|
75
|
-
if (!error.response || error.response.status !== 403) {
|
|
76
|
-
toaster.danger(t(errMsg));
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}, [notifications, hasMore, t]);
|
|
80
|
-
var onNewNotification = useCallback(function (notification) {
|
|
81
|
-
popupBrowserCommentNotification(notification);
|
|
82
|
-
_listNotifications(1, PER_PAGE, true);
|
|
83
|
-
}, [popupBrowserCommentNotification, _listNotifications]);
|
|
84
|
-
useEffect(function () {
|
|
85
|
-
_listNotifications(1, PER_PAGE);
|
|
86
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, []);
|
|
88
|
-
useEffect(function () {
|
|
89
|
-
var eventBus = EventBus.getInstance();
|
|
90
|
-
var unsubscribeNewNotification = eventBus.subscribe(EXTERNAL_EVENT.NEW_NOTIFICATION, onNewNotification);
|
|
91
|
-
return function () {
|
|
92
|
-
unsubscribeNewNotification();
|
|
93
|
-
};
|
|
94
|
-
}, [onNewNotification]);
|
|
95
|
-
var markAllNotificationsRead = useCallback(function () {
|
|
96
|
-
context.markAllNotificationsRead().then(function (res) {
|
|
97
|
-
var newNotifications = notifications.slice(0).map(function (n) {
|
|
98
|
-
n.seen = true;
|
|
99
|
-
return n;
|
|
100
|
-
});
|
|
101
|
-
setNotifications(newNotifications);
|
|
102
|
-
}).catch(function (error) {
|
|
103
|
-
var errMsg = getErrorMsg(error, true);
|
|
104
|
-
if (!error.response || error.response.status !== 403) {
|
|
105
|
-
toaster.danger(t(errMsg));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}, [notifications, t]);
|
|
109
|
-
var markNotificationRead = useCallback(function (notificationId) {
|
|
110
|
-
context.markNotificationRead(notificationId).then(function (res) {
|
|
111
|
-
var newNotifications = notifications.slice(0).map(function (n) {
|
|
112
|
-
if (n.id === notificationId) {
|
|
113
|
-
n.seen = true;
|
|
114
|
-
}
|
|
115
|
-
return n;
|
|
116
|
-
});
|
|
117
|
-
setNotifications(newNotifications);
|
|
118
|
-
}).catch(function (error) {
|
|
119
|
-
var errMsg = getErrorMsg(error, true);
|
|
120
|
-
if (!error.response || error.response.status !== 403) {
|
|
121
|
-
toaster.danger(t(errMsg));
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}, [notifications, t]);
|
|
125
|
-
var deleteAllNotifications = useCallback(function () {
|
|
126
|
-
context.deleteAllNotifications().then(function (res) {
|
|
127
|
-
setNotifications([]);
|
|
128
|
-
setPage(1);
|
|
129
|
-
setHasMore(true);
|
|
130
|
-
}).catch(function (error) {
|
|
131
|
-
var errMsg = getErrorMsg(error);
|
|
132
|
-
if (!error.response || error.response.status !== 403) {
|
|
133
|
-
toaster.danger(t(errMsg));
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}, [t]);
|
|
137
|
-
var toggleNotificationsDialog = useCallback(function () {
|
|
138
|
-
setShowNotificationsDialog(!showNotificationsDialog);
|
|
139
|
-
}, [showNotificationsDialog]);
|
|
140
|
-
var unreadNotificationsCount = notifications.filter(function (n) {
|
|
141
|
-
return !n.seen;
|
|
142
|
-
}).length;
|
|
143
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
144
|
-
className: "op-item sdoc-notification-icon-container",
|
|
145
|
-
id: id
|
|
146
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
147
|
-
className: "sdocfont sdoc-notification"
|
|
148
|
-
}), unreadNotificationsCount > 0 && /*#__PURE__*/React.createElement("span", {
|
|
149
|
-
className: "sdoc-notification-count"
|
|
150
|
-
}, unreadNotificationsCount)), /*#__PURE__*/React.createElement(NotificationPopover, {
|
|
151
|
-
target: id,
|
|
152
|
-
notifications: notifications,
|
|
153
|
-
listNotifications: function listNotifications() {
|
|
154
|
-
return _listNotifications(page, PER_PAGE);
|
|
155
|
-
},
|
|
156
|
-
markAllNotificationsRead: markAllNotificationsRead,
|
|
157
|
-
markNotificationRead: markNotificationRead,
|
|
158
|
-
onToggleNotificationsDialog: toggleNotificationsDialog
|
|
159
|
-
}), showNotificationsDialog && /*#__PURE__*/React.createElement(AllNotificationsDialog, {
|
|
160
|
-
notifications: notifications,
|
|
161
|
-
listNotifications: function listNotifications() {
|
|
162
|
-
return _listNotifications(page, PER_PAGE);
|
|
163
|
-
},
|
|
164
|
-
markNotificationRead: markNotificationRead,
|
|
165
|
-
markAllNotificationsRead: markAllNotificationsRead,
|
|
166
|
-
deleteAllNotifications: deleteAllNotifications,
|
|
167
|
-
toggle: toggleNotificationsDialog
|
|
168
|
-
}));
|
|
169
|
-
};
|
|
170
|
-
export default NotificationOperation;
|
package/dist/components/doc-operations/notifications-operation/notifications-dialog/index.css
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
.sdoc-all-notifications-dialog {
|
|
2
|
-
width: 720px;
|
|
3
|
-
max-width: 720px;
|
|
4
|
-
height: calc(100% - 56px);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.sdoc-all-notifications-dialog .modal-content {
|
|
8
|
-
height: 100%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.sdoc-all-notifications-dialog .sdoc-notification-header-close {
|
|
12
|
-
display: flex;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sdoc-all-notifications-dialog .sdoc-notification-dropdown-toggle {
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
height: 24px;
|
|
20
|
-
width: 24px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.sdoc-all-notifications-dialog .sdoc-notification-operation-btn {
|
|
24
|
-
height: 24px;
|
|
25
|
-
width: 24px;
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
color: #000;
|
|
30
|
-
opacity: .5;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.sdoc-all-notifications-dialog .sdoc-notification-operation-btn:hover {
|
|
34
|
-
opacity: .75;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-body {
|
|
39
|
-
height: 100%;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
padding: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container {
|
|
45
|
-
overflow: auto;
|
|
46
|
-
padding: 2rem 1rem;
|
|
47
|
-
height: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container table {
|
|
51
|
-
width: 100%;
|
|
52
|
-
table-layout: fixed;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container .sdoc-notifications-table-header-sm {
|
|
56
|
-
font-size: 13px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container table thead tr {
|
|
60
|
-
height: 2.1875rem;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container table th {
|
|
64
|
-
padding: 0.3125rem 0.1875rem;
|
|
65
|
-
border-bottom: 1px solid #eee;
|
|
66
|
-
text-align: left;
|
|
67
|
-
font-weight: 400;
|
|
68
|
-
line-height: 1.6;
|
|
69
|
-
color: #9c9c9c;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container table td {
|
|
73
|
-
padding: 0.5rem 0.1875rem;
|
|
74
|
-
border-bottom: 1px solid #eee;
|
|
75
|
-
color: #333;
|
|
76
|
-
font-size: 14px;
|
|
77
|
-
word-break: break-all;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sdoc-all-notifications-dialog .sdoc-all-notifications-container table tbody tr:hover {
|
|
81
|
-
background: #f5f5f5;
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.sdoc-all-notifications-dialog .sdoc-empty-notifications-tip {
|
|
86
|
-
height: 100%;
|
|
87
|
-
width: 100%;
|
|
88
|
-
padding: 5.5em 1em;
|
|
89
|
-
border-radius: 3px;
|
|
90
|
-
background-color: #fff;
|
|
91
|
-
text-align: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.sdoc-all-notifications-dialog .sdoc-empty-notifications-tip .sdoc-empty-notifications-img-tip {
|
|
95
|
-
width: 100px;
|
|
96
|
-
height: 100px;
|
|
97
|
-
}
|
package/dist/components/doc-operations/notifications-operation/notifications-dialog/index.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useCallback, useState, useRef } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Modal, ModalHeader, ModalBody, Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
5
|
-
import context from '../../../../context';
|
|
6
|
-
import Notification from './notification';
|
|
7
|
-
import './index.css';
|
|
8
|
-
var AllNotificationsDialog = function AllNotificationsDialog(_ref) {
|
|
9
|
-
var notifications = _ref.notifications,
|
|
10
|
-
toggle = _ref.toggle,
|
|
11
|
-
markAllNotificationsRead = _ref.markAllNotificationsRead,
|
|
12
|
-
deleteAllNotifications = _ref.deleteAllNotifications,
|
|
13
|
-
markNotificationRead = _ref.markNotificationRead,
|
|
14
|
-
listNotifications = _ref.listNotifications;
|
|
15
|
-
var _useTranslation = useTranslation(),
|
|
16
|
-
t = _useTranslation.t;
|
|
17
|
-
var _useState = useState(false),
|
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
-
isMenuShow = _useState2[0],
|
|
20
|
-
setMenuShow = _useState2[1];
|
|
21
|
-
var containerRef = useRef(null);
|
|
22
|
-
var tableRef = useRef(null);
|
|
23
|
-
var toggleMenu = useCallback(function () {
|
|
24
|
-
setMenuShow(!isMenuShow);
|
|
25
|
-
}, [isMenuShow]);
|
|
26
|
-
var onScroll = useCallback(function () {
|
|
27
|
-
if (containerRef.current.offsetHeight + containerRef.current.scrollTop + 1 >= tableRef.current.offsetHeight + 64) {
|
|
28
|
-
// 64 is padding height
|
|
29
|
-
listNotifications();
|
|
30
|
-
}
|
|
31
|
-
}, [listNotifications, containerRef, tableRef]);
|
|
32
|
-
var renderHeaderRowBtn = useCallback(function () {
|
|
33
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
-
className: "sdoc-notification-header-close"
|
|
35
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
36
|
-
isOpen: isMenuShow,
|
|
37
|
-
toggle: toggleMenu
|
|
38
|
-
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
39
|
-
tag: "span",
|
|
40
|
-
"data-toggle": "dropdown",
|
|
41
|
-
"aria-expanded": isMenuShow,
|
|
42
|
-
className: "sdoc-notification-dropdown-toggle"
|
|
43
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "sdoc-notification-operation-btn"
|
|
45
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
46
|
-
className: "sdocfont sdoc-more"
|
|
47
|
-
}))), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
48
|
-
right: true,
|
|
49
|
-
className: "sdoc-dropdown-menu large"
|
|
50
|
-
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
51
|
-
className: "sdoc-dropdown-menu-item",
|
|
52
|
-
onClick: markAllNotificationsRead
|
|
53
|
-
}, t('Mark_all_as_read')), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
54
|
-
className: "sdoc-dropdown-menu-item",
|
|
55
|
-
onClick: deleteAllNotifications
|
|
56
|
-
}, t('Delete_all_notifications')))), /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: "sdoc-notification-operation-btn",
|
|
58
|
-
onClick: toggle
|
|
59
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
60
|
-
className: "sdocfont sdoc-sm-close"
|
|
61
|
-
})));
|
|
62
|
-
}, [deleteAllNotifications, isMenuShow, markAllNotificationsRead, t, toggle, toggleMenu]);
|
|
63
|
-
var renderNotifications = useCallback(function () {
|
|
64
|
-
if (!Array.isArray(notifications) || notifications.length === 0) {
|
|
65
|
-
var mediaUrl = context.getSetting('mediaUrl');
|
|
66
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: "sdoc-empty-notifications-tip"
|
|
68
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
69
|
-
src: mediaUrl + 'img/no-items-tip.png',
|
|
70
|
-
className: "sdoc-empty-notifications-img-tip",
|
|
71
|
-
alt: ""
|
|
72
|
-
}), /*#__PURE__*/React.createElement("p", null, t('No_notification')));
|
|
73
|
-
}
|
|
74
|
-
return /*#__PURE__*/React.createElement("table", {
|
|
75
|
-
ref: tableRef
|
|
76
|
-
}, /*#__PURE__*/React.createElement("thead", {
|
|
77
|
-
className: "sdoc-notifications-table-header-sm"
|
|
78
|
-
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
79
|
-
width: "10%"
|
|
80
|
-
}), /*#__PURE__*/React.createElement("th", {
|
|
81
|
-
width: "70%"
|
|
82
|
-
}, t('News')), /*#__PURE__*/React.createElement("th", {
|
|
83
|
-
width: "20%"
|
|
84
|
-
}, t('Update_date')))), /*#__PURE__*/React.createElement("tbody", null, notifications.map(function (item) {
|
|
85
|
-
return /*#__PURE__*/React.createElement(Notification, {
|
|
86
|
-
key: item.id,
|
|
87
|
-
notification: item,
|
|
88
|
-
markNotificationRead: markNotificationRead
|
|
89
|
-
});
|
|
90
|
-
})));
|
|
91
|
-
}, [notifications, t, markNotificationRead]);
|
|
92
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
93
|
-
isOpen: true,
|
|
94
|
-
toggle: toggle,
|
|
95
|
-
className: "sdoc-all-notifications-dialog"
|
|
96
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
97
|
-
close: renderHeaderRowBtn(),
|
|
98
|
-
toggle: toggle
|
|
99
|
-
}, t('All_notifications')), /*#__PURE__*/React.createElement(ModalBody, {
|
|
100
|
-
className: "sdoc-all-notifications-body"
|
|
101
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className: "sdoc-all-notifications-container",
|
|
103
|
-
ref: containerRef,
|
|
104
|
-
onScroll: onScroll
|
|
105
|
-
}, renderNotifications())));
|
|
106
|
-
};
|
|
107
|
-
export default AllNotificationsDialog;
|
package/dist/components/doc-operations/notifications-operation/notifications-dialog/notification.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
var Notification = function Notification(_ref) {
|
|
4
|
-
var notification = _ref.notification,
|
|
5
|
-
markNotificationRead = _ref.markNotificationRead;
|
|
6
|
-
var _useTranslation = useTranslation(),
|
|
7
|
-
t = _useTranslation.t;
|
|
8
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
9
|
-
onClick: function onClick() {
|
|
10
|
-
return markNotificationRead(notification.id);
|
|
11
|
-
}
|
|
12
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
13
|
-
className: "pl-3"
|
|
14
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
15
|
-
style: {
|
|
16
|
-
borderRadius: '50%'
|
|
17
|
-
},
|
|
18
|
-
src: notification.userAvatarURL,
|
|
19
|
-
alt: "",
|
|
20
|
-
width: "30"
|
|
21
|
-
})), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className: "sdoc-notification-detail"
|
|
23
|
-
}, notification.msgType === 'comment' ? t('Added_a_new_comment') : t('Added_a_reply'))), /*#__PURE__*/React.createElement("td", null, notification.time));
|
|
24
|
-
};
|
|
25
|
-
export default Notification;
|
package/dist/components/doc-operations/notifications-operation/notifications-popover/index.css
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
.sdoc-notifications-popover {
|
|
2
|
-
max-width: 322px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.sdoc-notifications-popover .popover-inner {
|
|
6
|
-
width: 320px;
|
|
7
|
-
height: 386px;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.sdoc-notifications-popover.sdoc-notifications-empty-popover .popover-inner {
|
|
12
|
-
height: 126px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sdoc-notifications-popover .sdoc-notification-container {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.sdoc-notifications-popover .sdoc-notification-header {
|
|
26
|
-
width: 100%;
|
|
27
|
-
height: 50px;
|
|
28
|
-
border-bottom: 1px solid #ededed;
|
|
29
|
-
font-size: 16px;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
justify-content: space-between;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sdoc-notifications-popover .sdoc-notification-header .sdoc-notification-header-title {
|
|
37
|
-
flex: 1;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
text-align: center;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
white-space: nowrap;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.sdoc-notifications-popover .sdoc-notification-header .sdoc-notification-header-close-btn {
|
|
46
|
-
width: 24px;
|
|
47
|
-
height: 24px;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
margin-right: 14px;
|
|
52
|
-
color: #000;
|
|
53
|
-
opacity: .5;
|
|
54
|
-
font-weight: 700;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.sdoc-notifications-popover .sdoc-notification-header .sdoc-notification-header-close-btn:hover {
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
opacity: .75;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.sdoc-notifications-popover .sdoc-notification-body {
|
|
63
|
-
width: 100%;
|
|
64
|
-
flex: 1;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.sdoc-notifications-popover .sdoc-mark-notifications {
|
|
73
|
-
border-bottom: 1px solid #ededed;
|
|
74
|
-
height: 36px;
|
|
75
|
-
width: 100%;
|
|
76
|
-
display: flex;
|
|
77
|
-
align-items: center;
|
|
78
|
-
justify-content: flex-end;
|
|
79
|
-
padding-right: 1rem;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.sdoc-notifications-popover .sdoc-mark-notifications .sdoc-mark-notifications-tip {
|
|
83
|
-
color: #b4b4b4;
|
|
84
|
-
max-width: 100%;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
text-overflow: ellipsis;
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.sdoc-notifications-popover .sdoc-mark-notifications .sdoc-mark-notifications-tip:hover {
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
text-decoration: underline;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.sdoc-notifications-popover .sdoc-notification-list-container {
|
|
96
|
-
flex: 1;
|
|
97
|
-
overflow: hidden;
|
|
98
|
-
width: 100%;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.sdoc-notifications-popover .sdoc-notification-list-content {
|
|
102
|
-
height: 100%;
|
|
103
|
-
overflow: scroll;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.sdoc-notifications-popover .sdoc-notification-list-content .sdoc-notification-item {
|
|
107
|
-
width: 100%;
|
|
108
|
-
padding: 14px 16px 14px 10px;
|
|
109
|
-
border-bottom: 1px solid #ededed;
|
|
110
|
-
position: relative;
|
|
111
|
-
cursor: pointer;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-item-header {
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-point {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
width: 8px;
|
|
122
|
-
height: 8px;
|
|
123
|
-
border-radius: 50%;
|
|
124
|
-
background: red;
|
|
125
|
-
margin-right: 12px;
|
|
126
|
-
position: absolute;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-header-info {
|
|
130
|
-
display: flex;
|
|
131
|
-
justify-content: space-between;
|
|
132
|
-
flex: 1 1;
|
|
133
|
-
margin-left: 20px;
|
|
134
|
-
width: calc(100% - 20px);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-user-detail {
|
|
138
|
-
display: flex;
|
|
139
|
-
width: 65%;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-user-name {
|
|
143
|
-
text-overflow: ellipsis;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
white-space: nowrap;
|
|
146
|
-
font-weight: 500;
|
|
147
|
-
margin-left: 8px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-time {
|
|
151
|
-
color: #b4b4b4;
|
|
152
|
-
text-overflow: ellipsis;
|
|
153
|
-
overflow: hidden;
|
|
154
|
-
white-space: nowrap;
|
|
155
|
-
font-size: 13px;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.sdoc-notifications-popover .sdoc-notification-item .sdoc-notification-content-wrapper {
|
|
159
|
-
font-size: 13px;
|
|
160
|
-
margin-left: 3rem;
|
|
161
|
-
display: flex;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.sdoc-notifications-popover .sdoc-notification-footer {
|
|
165
|
-
width: 100%;
|
|
166
|
-
height: 40px;
|
|
167
|
-
display: flex;
|
|
168
|
-
align-items: center;
|
|
169
|
-
justify-content: center;
|
|
170
|
-
background: #f9f9f9;
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
border-top: 1px solid #ededed;
|
|
173
|
-
}
|
package/dist/components/doc-operations/notifications-operation/notifications-popover/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useCallback } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { UncontrolledPopover } from 'reactstrap';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
import Notification from './notification';
|
|
6
|
-
import './index.css';
|
|
7
|
-
var NotificationPopover = function NotificationPopover(_ref) {
|
|
8
|
-
var target = _ref.target,
|
|
9
|
-
notifications = _ref.notifications,
|
|
10
|
-
markAllNotificationsRead = _ref.markAllNotificationsRead,
|
|
11
|
-
listNotifications = _ref.listNotifications,
|
|
12
|
-
markNotificationRead = _ref.markNotificationRead,
|
|
13
|
-
onToggleNotificationsDialog = _ref.onToggleNotificationsDialog;
|
|
14
|
-
var _useTranslation = useTranslation(),
|
|
15
|
-
t = _useTranslation.t;
|
|
16
|
-
var ref = useRef(null);
|
|
17
|
-
var notificationContainerRef = useRef(null);
|
|
18
|
-
var notificationContentRef = useRef(null);
|
|
19
|
-
var onNotificationListToggle = useCallback(function () {
|
|
20
|
-
ref.current && ref.current.toggle();
|
|
21
|
-
}, [ref]);
|
|
22
|
-
var onScroll = useCallback(function () {
|
|
23
|
-
if (notificationContainerRef.current.offsetHeight + notificationContainerRef.current.scrollTop + 1 >= notificationContentRef.current.offsetHeight) {
|
|
24
|
-
listNotifications && listNotifications();
|
|
25
|
-
}
|
|
26
|
-
}, [listNotifications, notificationContainerRef, notificationContentRef]);
|
|
27
|
-
var toggleNotificationsDialog = useCallback(function () {
|
|
28
|
-
onToggleNotificationsDialog();
|
|
29
|
-
onNotificationListToggle();
|
|
30
|
-
}, [onToggleNotificationsDialog, onNotificationListToggle]);
|
|
31
|
-
return /*#__PURE__*/React.createElement(UncontrolledPopover, {
|
|
32
|
-
ref: ref,
|
|
33
|
-
target: target,
|
|
34
|
-
placement: "bottom-end",
|
|
35
|
-
popperClassName: classnames('sdoc-notifications-popover', {
|
|
36
|
-
'sdoc-notifications-empty-popover': notifications.length === 0
|
|
37
|
-
}),
|
|
38
|
-
trigger: "legacy",
|
|
39
|
-
hideArrow: true,
|
|
40
|
-
fade: false,
|
|
41
|
-
security: "fixed"
|
|
42
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: "sdoc-notification-container"
|
|
44
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
-
className: "sdoc-notification-header"
|
|
46
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: "sdoc-notification-header-title"
|
|
48
|
-
}, t('Notification')), /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: "sdoc-notification-header-close-btn"
|
|
50
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
51
|
-
className: "sdocfont sdoc-sm-close",
|
|
52
|
-
onClick: onNotificationListToggle
|
|
53
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "sdoc-notification-body"
|
|
55
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: "sdoc-mark-notifications"
|
|
57
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "sdoc-mark-notifications-tip",
|
|
59
|
-
onClick: markAllNotificationsRead
|
|
60
|
-
}, t('Mark_all_as_read'))), /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "sdoc-notification-list-container",
|
|
62
|
-
ref: notificationContainerRef,
|
|
63
|
-
onScroll: onScroll
|
|
64
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: "sdoc-notification-list-content",
|
|
66
|
-
ref: notificationContentRef
|
|
67
|
-
}, Array.isArray(notifications) && notifications.map(function (n) {
|
|
68
|
-
return /*#__PURE__*/React.createElement(Notification, {
|
|
69
|
-
key: n.id,
|
|
70
|
-
notification: n,
|
|
71
|
-
markNotificationRead: markNotificationRead
|
|
72
|
-
});
|
|
73
|
-
})))), /*#__PURE__*/React.createElement("div", {
|
|
74
|
-
className: "sdoc-notification-footer",
|
|
75
|
-
onClick: toggleNotificationsDialog
|
|
76
|
-
}, t('View_all_notifications'))));
|
|
77
|
-
};
|
|
78
|
-
export default NotificationPopover;
|