@seafile/sdoc-editor 2.0.124-test-0.0.1 → 2.0.125
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/LICENSE.txt +13 -0
- package/dist/assets/css/dropdown-menu.css +0 -1
- package/dist/comment/components/comment-operation/index.js +0 -1
- package/dist/comment/components/global-comment/global-comment-header.js +9 -11
- package/dist/editor/sdoc-comment-editor.js +11 -14
- package/dist/extension/commons/color-menu/index.css +0 -1
- package/dist/extension/plugins/table/menu/table-context-menu/index.css +0 -1
- package/package.json +3 -2
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) 2025 Seafile Ltd.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -17,7 +17,6 @@ function CommentsOperation() {
|
|
|
17
17
|
unseenNotificationsCount = _useState2[0],
|
|
18
18
|
setUnseenNotificationsCount = _useState2[1];
|
|
19
19
|
var updateUnseenNotificationsCount = (0, _react.useCallback)(function (count) {
|
|
20
|
-
console.log(55, count);
|
|
21
20
|
setUnseenNotificationsCount(count);
|
|
22
21
|
}, []);
|
|
23
22
|
(0, _react.useEffect)(function () {
|
|
@@ -44,30 +44,28 @@ var GlobalCommentHeader = function GlobalCommentHeader(_ref) {
|
|
|
44
44
|
case 0:
|
|
45
45
|
(0, _mouseEvent.eventStopPropagation)(event);
|
|
46
46
|
_context.prev = 1;
|
|
47
|
-
|
|
48
|
-
_context.next = 5;
|
|
47
|
+
_context.next = 4;
|
|
49
48
|
return _context2["default"].readAllNotifications();
|
|
50
|
-
case
|
|
51
|
-
_context.next =
|
|
49
|
+
case 4:
|
|
50
|
+
_context.next = 6;
|
|
52
51
|
return _context2["default"].listUnseenNotifications();
|
|
53
|
-
case
|
|
52
|
+
case 6:
|
|
54
53
|
res = _context.sent;
|
|
55
54
|
notifications = res.data.notifications;
|
|
56
55
|
eventBus = _eventBus["default"].getInstance();
|
|
57
56
|
eventBus.dispatch(_constants.INTERNAL_EVENT.UNSEEN_NOTIFICATIONS_COUNT, notifications === null || notifications === void 0 ? void 0 : notifications.length);
|
|
58
57
|
eventBus.dispatch(_constants.INTERNAL_EVENT.NEW_NOTIFICATION);
|
|
59
58
|
eventBus.dispatch(_constants.INTERNAL_EVENT.CLEAR_NOTIFICATION);
|
|
60
|
-
|
|
61
|
-
_context.next = 18;
|
|
59
|
+
_context.next = 16;
|
|
62
60
|
break;
|
|
63
|
-
case
|
|
64
|
-
_context.prev =
|
|
61
|
+
case 14:
|
|
62
|
+
_context.prev = 14;
|
|
65
63
|
_context.t0 = _context["catch"](1);
|
|
66
|
-
case
|
|
64
|
+
case 16:
|
|
67
65
|
case "end":
|
|
68
66
|
return _context.stop();
|
|
69
67
|
}
|
|
70
|
-
}, _callee, null, [[1,
|
|
68
|
+
}, _callee, null, [[1, 14]]);
|
|
71
69
|
}));
|
|
72
70
|
return function (_x) {
|
|
73
71
|
return _ref2.apply(this, arguments);
|
|
@@ -66,8 +66,7 @@ var SdocCommentEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
66
66
|
}, []);
|
|
67
67
|
(0, _react.useEffect)(function () {
|
|
68
68
|
if (!(commentEditorContainerRef !== null && commentEditorContainerRef !== void 0 && commentEditorContainerRef.current)) return;
|
|
69
|
-
|
|
70
|
-
if (Object.keys(notificationsInfo.notifications_map).length === 0) return;
|
|
69
|
+
if (Object.keys(notificationsInfo.notifications_map || {}).length === 0) return;
|
|
71
70
|
if (!commentEditorContainerRef.current.closest('.global-comment-input-wrapper')) return;
|
|
72
71
|
var clearAllNotification = /*#__PURE__*/function () {
|
|
73
72
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
@@ -76,32 +75,30 @@ var SdocCommentEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
76
75
|
while (1) switch (_context.prev = _context.next) {
|
|
77
76
|
case 0:
|
|
78
77
|
_context.prev = 0;
|
|
79
|
-
|
|
80
|
-
_context.next = 4;
|
|
78
|
+
_context.next = 3;
|
|
81
79
|
return _context2["default"].readAllNotifications();
|
|
82
|
-
case
|
|
83
|
-
_context.next =
|
|
80
|
+
case 3:
|
|
81
|
+
_context.next = 5;
|
|
84
82
|
return _context2["default"].listUnseenNotifications();
|
|
85
|
-
case
|
|
83
|
+
case 5:
|
|
86
84
|
res = _context.sent;
|
|
87
85
|
notifications = res.data.notifications;
|
|
88
86
|
eventBus = _eventBus["default"].getInstance();
|
|
89
87
|
eventBus.dispatch(_constants.INTERNAL_EVENT.UNSEEN_NOTIFICATIONS_COUNT, notifications === null || notifications === void 0 ? void 0 : notifications.length);
|
|
90
88
|
eventBus.dispatch(_constants.INTERNAL_EVENT.NEW_NOTIFICATION);
|
|
91
89
|
eventBus.dispatch(_constants.INTERNAL_EVENT.CLEAR_NOTIFICATION);
|
|
92
|
-
|
|
93
|
-
_context.next = 19;
|
|
90
|
+
_context.next = 17;
|
|
94
91
|
break;
|
|
95
|
-
case
|
|
96
|
-
_context.prev =
|
|
92
|
+
case 13:
|
|
93
|
+
_context.prev = 13;
|
|
97
94
|
_context.t0 = _context["catch"](0);
|
|
98
95
|
errorMessage = (0, _commonUtils.getErrorMsg)(_context.t0);
|
|
99
96
|
_toast["default"].danger(t(errorMessage));
|
|
100
|
-
case
|
|
97
|
+
case 17:
|
|
101
98
|
case "end":
|
|
102
99
|
return _context.stop();
|
|
103
100
|
}
|
|
104
|
-
}, _callee, null, [[0,
|
|
101
|
+
}, _callee, null, [[0, 13]]);
|
|
105
102
|
}));
|
|
106
103
|
return function clearAllNotification() {
|
|
107
104
|
return _ref2.apply(this, arguments);
|
|
@@ -130,7 +127,7 @@ var SdocCommentEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
130
127
|
commentTimeoutRef.current = null;
|
|
131
128
|
}
|
|
132
129
|
};
|
|
133
|
-
}, [notificationsInfo
|
|
130
|
+
}, [notificationsInfo]);
|
|
134
131
|
|
|
135
132
|
// useMount: focus editor
|
|
136
133
|
(0, _react.useEffect)(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.125",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -69,5 +69,6 @@
|
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
|
-
}
|
|
72
|
+
},
|
|
73
|
+
"gitHead": "54c9a98286c8be1ac424d31c8eea49de28ddae29"
|
|
73
74
|
}
|