@seafile/sdoc-editor 2.0.145 → 2.0.146

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 @@ var CommentItemContent = function CommentItemContent(_ref) {
137
137
  insertContent: updateContent,
138
138
  hiddenComment: setIsEditing,
139
139
  api: {
140
- uploadLocalImage: _context2["default"].uploadLocalImage
140
+ uploadLocalImage: _context2["default"].uploadCommentImage
141
141
  }
142
142
  };
143
143
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -121,7 +121,7 @@ var CommentItemReply = function CommentItemReply(_ref) {
121
121
  insertContent: updateContent,
122
122
  hiddenComment: setIsEditing,
123
123
  api: {
124
- uploadLocalImage: _context2["default"].uploadLocalImage
124
+ uploadLocalImage: _context2["default"].uploadCommentImage
125
125
  }
126
126
  };
127
127
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -220,7 +220,7 @@ var CommentList = function CommentList(_ref) {
220
220
  hiddenComment: hiddenComment,
221
221
  closePanel: closeComment,
222
222
  api: {
223
- uploadLocalImage: _context2["default"].uploadLocalImage
223
+ uploadLocalImage: _context2["default"].uploadCommentImage
224
224
  }
225
225
  }), !isEmptyComment && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !isActiveEditor && /*#__PURE__*/_react["default"].createElement(_reactstrap.Input, {
226
226
  value: inputContent !== null && inputContent !== void 0 && inputContent.trim() ? '.....' : '',
@@ -247,7 +247,7 @@ var CommentList = function CommentList(_ref) {
247
247
  },
248
248
  hiddenComment: hiddenComment,
249
249
  api: {
250
- uploadLocalImage: _context2["default"].uploadLocalImage
250
+ uploadLocalImage: _context2["default"].uploadCommentImage
251
251
  }
252
252
  }))));
253
253
  }), Object.values(commentDetail).length === 0 && /*#__PURE__*/_react["default"].createElement("div", {
@@ -267,7 +267,7 @@ var CommentList = function CommentList(_ref) {
267
267
  hiddenComment: hiddenComment,
268
268
  closePanel: closeComment,
269
269
  api: {
270
- uploadLocalImage: _context2["default"].uploadLocalImage
270
+ uploadLocalImage: _context2["default"].uploadCommentImage
271
271
  }
272
272
  }), !isEmptyComment && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !showEditor && /*#__PURE__*/_react["default"].createElement(_reactstrap.Input, {
273
273
  value: inputContent !== null && inputContent !== void 0 && inputContent.trim() ? '.....' : '',
@@ -292,7 +292,7 @@ var CommentList = function CommentList(_ref) {
292
292
  },
293
293
  hiddenComment: hiddenComment,
294
294
  api: {
295
- uploadLocalImage: _context2["default"].uploadLocalImage
295
+ uploadLocalImage: _context2["default"].uploadCommentImage
296
296
  }
297
297
  }))));
298
298
  };
@@ -39,7 +39,7 @@ var GlobalCommentEditor = function GlobalCommentEditor(_ref) {
39
39
  collaborators: collaborators,
40
40
  participants: participants,
41
41
  api: {
42
- uploadLocalImage: _context["default"].uploadLocalImage
42
+ uploadLocalImage: _context["default"].uploadCommentImage
43
43
  }
44
44
  };
45
45
  return /*#__PURE__*/_react["default"].createElement("div", {
package/dist/context.js CHANGED
@@ -42,6 +42,16 @@ var Context = /*#__PURE__*/function () {
42
42
  return relative_path;
43
43
  });
44
44
  });
45
+ (0, _defineProperty2["default"])(this, "uploadCommentImage", function (imageFiles) {
46
+ var docUuid = _this.getSetting('docUuid');
47
+ var serviceUrl = context.getSetting('serviceUrl');
48
+ var assetsUrl = context.getSetting('assetsUrl');
49
+ return _this.api.uploadSdocImage(docUuid, imageFiles).then(function (res) {
50
+ var relative_path = res.data.relative_path;
51
+ var filePath = serviceUrl + assetsUrl + relative_path[0];
52
+ return [filePath];
53
+ });
54
+ });
45
55
  (0, _defineProperty2["default"])(this, "uploadLocalVideo", function (videoFiles) {
46
56
  var docUuid = _this.getSetting('docUuid');
47
57
  return _this.api.uploadSdocVideo(docUuid, videoFiles).then(function (res) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.145",
3
+ "version": "2.0.146",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -17,7 +17,7 @@
17
17
  "license": "ISC",
18
18
  "description": "",
19
19
  "dependencies": {
20
- "@seafile/comment-editor": "0.0.7",
20
+ "@seafile/comment-editor": "^0.0.12",
21
21
  "@seafile/print-js": "1.6.6",
22
22
  "@seafile/react-image-lightbox": "4.0.2",
23
23
  "@seafile/slate": "0.91.8",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "4282c45e1f08d62085784c803721b16afb2fb65f"
74
+ "gitHead": "36d479c2ff2fe3a49631050db892d01e74e67b7c"
75
75
  }