@seafile/sdoc-editor 0.1.34 → 0.1.36
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
CHANGED
|
@@ -12,10 +12,20 @@ var SeafileAPI = /*#__PURE__*/function () {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
_createClass(SeafileAPI, [{
|
|
15
|
+
key: "getImageFileNameWithTimestamp",
|
|
16
|
+
value: function getImageFileNameWithTimestamp(file) {
|
|
17
|
+
var d = Date.now();
|
|
18
|
+
return 'image-' + d.toString() + file.name.slice(file.name.lastIndexOf('.'));
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
15
21
|
key: "uploadSdocImage",
|
|
16
|
-
value: function uploadSdocImage(docUuid,
|
|
22
|
+
value: function uploadSdocImage(docUuid, imageFile) {
|
|
17
23
|
var url = '/api/v2.1/seadoc/upload-image/' + docUuid + '/';
|
|
18
24
|
var form = new FormData();
|
|
25
|
+
var fileName = this.getImageFileNameWithTimestamp(imageFile);
|
|
26
|
+
var file = new File([imageFile], fileName, {
|
|
27
|
+
type: imageFile.type
|
|
28
|
+
});
|
|
19
29
|
form.append('file', file);
|
|
20
30
|
return this.req.post(url, form);
|
|
21
31
|
}
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import { SDocViewer, EventBus } from './basic-sdk';
|
|
|
2
2
|
import { EXTERNAL_EVENT } from './constants';
|
|
3
3
|
import SimpleEditor from './pages/simple-editor';
|
|
4
4
|
import SimpleViewer from './pages/simple-viewer';
|
|
5
|
-
|
|
5
|
+
import DiffViewer from './pages/diff-viewer';
|
|
6
|
+
export { SDocViewer, SimpleEditor, SimpleViewer, EventBus, EXTERNAL_EVENT, DiffViewer };
|