@seafile/sdoc-editor 0.1.69-beta → 0.1.69-beta2

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.
@@ -54,11 +54,12 @@ var SeafileAPI = /*#__PURE__*/function () {
54
54
  }
55
55
  }, {
56
56
  key: "startRevise",
57
- value: function startRevise(repoID, path) {
57
+ value: function startRevise(repoID, fileUuid, path) {
58
58
  var url = '/api/v2.1/seadoc/revisions/';
59
59
  var form = new FormData();
60
60
  form.append('p', path);
61
61
  form.append('repo_id', repoID);
62
+ form.append('file_uuid', fileUuid);
62
63
  return this._sendPostRequest(url, form);
63
64
  }
64
65
  }]);
@@ -39,13 +39,17 @@ var RevisionOperations = function RevisionOperations(_ref) {
39
39
 
40
40
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
41
  }, []);
42
- var startReviseBtn = /*#__PURE__*/React.createElement(Button, {
43
- color: "success",
44
- className: "mr-4",
45
- onClick: startRevise
46
- }, t('View_changes'));
47
- if (!isSdocRevision) return startReviseBtn;
48
- return /*#__PURE__*/React.createElement(React.Fragment, null, startReviseBtn, !isPublished && revisionURL && /*#__PURE__*/React.createElement(Button, {
42
+ var startReviseBtn = useCallback(function (className) {
43
+ return /*#__PURE__*/React.createElement(Button, {
44
+ color: "success",
45
+ className: className,
46
+ onClick: startRevise
47
+ }, t('Start_revise'));
48
+
49
+ // eslint-disable-next-line react-hooks/exhaustive-deps
50
+ }, []);
51
+ if (!isSdocRevision) return startReviseBtn();
52
+ return /*#__PURE__*/React.createElement(React.Fragment, null, startReviseBtn('mr-4'), !isPublished && revisionURL && /*#__PURE__*/React.createElement(Button, {
49
53
  color: "success",
50
54
  className: "mr-4",
51
55
  onClick: viewChanges
package/dist/context.js CHANGED
@@ -130,7 +130,8 @@ var Context = /*#__PURE__*/function () {
130
130
  value: function startRevise() {
131
131
  var repoID = this.getSetting('repoID');
132
132
  var filePath = this.getSetting('docPath');
133
- return this.api.startRevise(repoID, filePath);
133
+ var fileUuid = this.getSetting('docUuid');
134
+ return this.api.startRevise(repoID, fileUuid, filePath);
134
135
  }
135
136
  }, {
136
137
  key: "publishSdocRevision",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.1.69beta",
3
+ "version": "0.1.69beta2",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -254,5 +254,6 @@
254
254
  "Confirm": "Confirm",
255
255
  "View_changes": "View changes",
256
256
  "Revision": "Revision",
257
- "Error": "Error"
257
+ "Error": "Error",
258
+ "Start_revise": "Start revise"
258
259
  }
@@ -254,5 +254,6 @@
254
254
  "Confirm": "确定",
255
255
  "View_changes": "查看改动",
256
256
  "Revision": "修订",
257
- "Error": "错误"
257
+ "Error": "错误",
258
+ "Start_revise": "开始修订"
258
259
  }