@seafile/sdoc-editor 2.0.153 → 2.0.154
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,8 +54,7 @@ var useCopyImage = function useCopyImage(_ref2) {
|
|
|
54
54
|
element = _ref2.element;
|
|
55
55
|
var data = element.data;
|
|
56
56
|
var _data$is_copy_error = data.is_copy_error,
|
|
57
|
-
is_copy_error = _data$is_copy_error === void 0 ? false : _data$is_copy_error
|
|
58
|
-
isComment = data.is_comment;
|
|
57
|
+
is_copy_error = _data$is_copy_error === void 0 ? false : _data$is_copy_error;
|
|
59
58
|
var _useState = (0, _react.useState)(),
|
|
60
59
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
61
60
|
isLoading = _useState2[0],
|
|
@@ -67,10 +66,14 @@ var useCopyImage = function useCopyImage(_ref2) {
|
|
|
67
66
|
(0, _react.useEffect)(function () {
|
|
68
67
|
var url = data.src;
|
|
69
68
|
if (isCopyError) return;
|
|
70
|
-
if (isComment) return;
|
|
71
69
|
if (!(0, _helpers.isImageUrlIsFromCopy)(url)) return;
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
|
|
71
|
+
// not md convert to sdoc
|
|
72
|
+
if (url.indexOf('/file/images/auto-upload/') < 0) {
|
|
73
|
+
var cacheContent = _localStorageUtils["default"].getItem(_font.RECENT_PASTE_HTML_CONTENT);
|
|
74
|
+
// sync content from another user's copy
|
|
75
|
+
if (!cacheContent || JSON.stringify(cacheContent).indexOf(url) === -1) return;
|
|
76
|
+
}
|
|
74
77
|
var downloadAndUploadImages = /*#__PURE__*/function () {
|
|
75
78
|
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee2(url) {
|
|
76
79
|
var response, blob, file, imageUrl, _t;
|
|
@@ -26,8 +26,7 @@ var updateImageNode = /*#__PURE__*/function () {
|
|
|
26
26
|
}, editor) : newUrl;
|
|
27
27
|
nodePath = _slateReact.ReactEditor.findPath(editor, element);
|
|
28
28
|
newData = {
|
|
29
|
-
src: url
|
|
30
|
-
is_comment: isComment
|
|
29
|
+
src: url
|
|
31
30
|
};
|
|
32
31
|
_slate.Transforms.setNodes(editor, {
|
|
33
32
|
data: newData
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.154",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "77ec29f6e2cfc839e2c48ce0ba2e74439e274372"
|
|
75
75
|
}
|