@seafile/comment-editor 0.0.1-alpha.3 → 0.0.1-alpha.4
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.
|
@@ -137,7 +137,7 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
137
137
|
const elementId = (0, _helper.getPrimaryElementId)(comment.detail);
|
|
138
138
|
for (let i = 0; i < replies.length; i++) {
|
|
139
139
|
const reply = replies[i];
|
|
140
|
-
const res = await
|
|
140
|
+
const res = await api.insertReply(commentId, reply);
|
|
141
141
|
const {
|
|
142
142
|
reply: returnReply
|
|
143
143
|
} = res.data;
|
|
@@ -164,7 +164,7 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
164
164
|
const newComment = {
|
|
165
165
|
resolved: false
|
|
166
166
|
};
|
|
167
|
-
await
|
|
167
|
+
await api.updateComment(commentId, newComment);
|
|
168
168
|
dispatch({
|
|
169
169
|
type: 'UPDATE_COMMENT_STATE',
|
|
170
170
|
payload: {
|
|
@@ -181,7 +181,7 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
181
181
|
};
|
|
182
182
|
listRef.current.scrollTo(options);
|
|
183
183
|
}, 0);
|
|
184
|
-
}, [comment.detail, dispatch]);
|
|
184
|
+
}, [api, comment.detail, dispatch]);
|
|
185
185
|
const insertContent = (0, _react.useCallback)(content => {
|
|
186
186
|
const user = _context.default.getUserInfo();
|
|
187
187
|
const replies = [];
|
|
@@ -215,7 +215,7 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
215
215
|
const deleteReply = (0, _react.useCallback)(async replyId => {
|
|
216
216
|
const commentId = comment.id;
|
|
217
217
|
const elementId = (0, _helper.getPrimaryElementId)(comment.detail);
|
|
218
|
-
await
|
|
218
|
+
await api.deleteReply(commentId, replyId);
|
|
219
219
|
dispatch({
|
|
220
220
|
type: 'DELETE_REPLY',
|
|
221
221
|
payload: {
|
|
@@ -224,11 +224,11 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
224
224
|
reply_id: replyId
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
|
-
}, [comment.detail, comment.id, dispatch]);
|
|
227
|
+
}, [api, comment.detail, comment.id, dispatch]);
|
|
228
228
|
const updateReply = (0, _react.useCallback)(async (replyId, newReply) => {
|
|
229
229
|
const commentId = comment.id;
|
|
230
230
|
const elementId = (0, _helper.getPrimaryElementId)(comment.detail);
|
|
231
|
-
await
|
|
231
|
+
await api.updateReply(commentId, replyId, newReply);
|
|
232
232
|
dispatch({
|
|
233
233
|
type: 'UPDATE_REPLY',
|
|
234
234
|
payload: {
|
|
@@ -238,7 +238,7 @@ const CommentItemWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
238
238
|
reply: newReply
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
-
}, [comment.detail, comment.id, dispatch]);
|
|
241
|
+
}, [api, comment.detail, comment.id, dispatch]);
|
|
242
242
|
const onItemClick = (0, _react.useCallback)(event => {
|
|
243
243
|
if (event.target.className === _constants.COMMENT_URL_CLASSNAME) return;
|
|
244
244
|
onCommentClick && onCommentClick(comment);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _reactI18next = require("react-i18next");
|
|
11
10
|
var _basicSdk = require("../basic-sdk");
|
|
12
11
|
var _errorBoundary = _interopRequireDefault(require("../components/error-boundary"));
|