@seafile/seafile-editor 3.0.30-aik.12 → 3.0.30-aps.2
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.
|
@@ -91,25 +91,14 @@ const getImagesUrlList = nodes => {
|
|
|
91
91
|
return list;
|
|
92
92
|
};
|
|
93
93
|
exports.getImagesUrlList = getImagesUrlList;
|
|
94
|
-
const getNewImagesUrlList =
|
|
95
|
-
let lists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
96
|
-
if (!Array.isArray(lists)) {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
94
|
+
const getNewImagesUrlList = lists => {
|
|
99
95
|
return lists.map(src => {
|
|
100
|
-
if (!src) {
|
|
101
|
-
return {
|
|
102
|
-
name: '',
|
|
103
|
-
thumbnail: ''
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
96
|
let name = '';
|
|
107
97
|
try {
|
|
108
|
-
name = decodeURIComponent(src.slice(src.lastIndexOf('/') + 1));
|
|
98
|
+
name = src ? decodeURIComponent(src.slice(src.lastIndexOf('/') + 1)) : '';
|
|
109
99
|
} catch (error) {
|
|
110
100
|
// eslint-disable-next-line no-console
|
|
111
101
|
console.log(error);
|
|
112
|
-
name = src.slice(src.lastIndexOf('/') + 1) || src;
|
|
113
102
|
}
|
|
114
103
|
return {
|
|
115
104
|
name: name || '',
|
|
@@ -21,9 +21,7 @@ const ImagePreviewer = _ref => {
|
|
|
21
21
|
} = _ref;
|
|
22
22
|
const editor = (0, _slateReact.useSlateStatic)();
|
|
23
23
|
let defaultImages = (0, _helper.getImagesUrlList)(editor.children);
|
|
24
|
-
console.log('defaultImages', defaultImages);
|
|
25
24
|
const images = (0, _helper.getNewImagesUrlList)(defaultImages);
|
|
26
|
-
console.log('images', images);
|
|
27
25
|
const {
|
|
28
26
|
t
|
|
29
27
|
} = (0, _reactI18next.useTranslation)(_constants.TRANSLATE_NAMESPACE);
|