@seafile/seafile-editor 3.0.30-aps.2 → 3.0.30-aps.8

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,14 +91,25 @@ const getImagesUrlList = nodes => {
91
91
  return list;
92
92
  };
93
93
  exports.getImagesUrlList = getImagesUrlList;
94
- const getNewImagesUrlList = lists => {
94
+ const getNewImagesUrlList = function () {
95
+ let lists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
96
+ if (!Array.isArray(lists)) {
97
+ return [];
98
+ }
95
99
  return lists.map(src => {
100
+ if (!src) {
101
+ return {
102
+ name: '',
103
+ thumbnail: ''
104
+ };
105
+ }
96
106
  let name = '';
97
107
  try {
98
- name = src ? decodeURIComponent(src.slice(src.lastIndexOf('/') + 1)) : '';
108
+ name = decodeURIComponent(src.slice(src.lastIndexOf('/') + 1));
99
109
  } catch (error) {
100
110
  // eslint-disable-next-line no-console
101
111
  console.log(error);
112
+ name = src.slice(src.lastIndexOf('/') + 1) || src;
102
113
  }
103
114
  return {
104
115
  name: name || '',
@@ -21,7 +21,9 @@ 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);
24
25
  const images = (0, _helper.getNewImagesUrlList)(defaultImages);
26
+ console.log('images', images);
25
27
  const {
26
28
  t
27
29
  } = (0, _reactI18next.useTranslation)(_constants.TRANSLATE_NAMESPACE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "3.0.30aps.2",
3
+ "version": "3.0.30aps.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {