@seafile/seafile-editor 2.0.28 → 2.0.30

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.
@@ -30,7 +30,7 @@ const InlineEditor = _ref => {
30
30
  columns,
31
31
  onContentChanged,
32
32
  isSupportFormula,
33
- isSupportFileToLink,
33
+ isImageUploadOnly,
34
34
  isSupportMultipleFiles,
35
35
  onExpandEditorToggle,
36
36
  handelEnableEdit
@@ -44,9 +44,9 @@ const InlineEditor = _ref => {
44
44
  onSave,
45
45
  columns,
46
46
  isSupportMultipleFiles,
47
- isSupportFileToLink
47
+ isImageUploadOnly
48
48
  });
49
- }, [columns, isSupportFileToLink, isSupportMultipleFiles, editorApi, onSave]);
49
+ }, [columns, isImageUploadOnly, isSupportMultipleFiles, editorApi, onSave]);
50
50
  const eventProxy = (0, _react.useMemo)(() => {
51
51
  return new _eventHandler.default(editor);
52
52
  }, [editor]);
@@ -16,9 +16,8 @@ const withPropsEditor = function (editor) {
16
16
  if (props.columns) {
17
17
  newEditor.columns = props.columns;
18
18
  }
19
- newEditor.isSupportFileToLink = Boolean(props.isSupportFileToLink);
19
+ newEditor.isImageUploadOnly = props.isImageUploadOnly === undefined ? true : Boolean(props.isImageUploadOnly);
20
20
  newEditor.isSupportMultipleFiles = Boolean(props.isSupportMultipleFiles);
21
- newEditor.isInlineEditor = true;
22
21
  return newEditor;
23
22
  };
24
23
  var _default = exports.default = withPropsEditor;
@@ -16,6 +16,8 @@ const withPropsEditor = function (editor) {
16
16
  if (props.columns) {
17
17
  newEditor.columns = props.columns;
18
18
  }
19
+ newEditor.isImageUploadOnly = props.isImageUploadOnly === undefined ? true : Boolean(props.isImageUploadOnly);
20
+ newEditor.isSupportMultipleFiles = Boolean(props.isSupportMultipleFiles);
19
21
  return newEditor;
20
22
  };
21
23
  var _default = exports.default = withPropsEditor;
@@ -13,6 +13,8 @@ const withPropsEditor = function (editor) {
13
13
  if (props.onSave) {
14
14
  newEditor.onSave = props.onSave;
15
15
  }
16
+ newEditor.isImageUploadOnly = props.isImageUploadOnly === undefined ? true : Boolean(props.isImageUploadOnly);
17
+ newEditor.isSupportMultipleFiles = Boolean(props.isSupportMultipleFiles);
16
18
  return newEditor;
17
19
  };
18
20
  var _default = exports.default = withPropsEditor;
@@ -32,14 +32,14 @@ const withImages = editor => {
32
32
  if (data.types && data.types.includes('Files') && data.files) {
33
33
  if (!newEditor.isSupportMultipleFiles) {
34
34
  const file = data.files[0];
35
- if (!file.type.includes(_elementTypes.IMAGE) && !newEditor.isSupportFileToLink) return;
35
+ if (!file.type.includes(_elementTypes.IMAGE) && newEditor.isImageUploadOnly) return;
36
36
  (0, _helper.handleUpdateFile)(newEditor, file);
37
37
  return;
38
38
  }
39
39
  let files = [];
40
40
  for (let i = 0; i < data.files.length; i++) {
41
41
  const file = data.files[i];
42
- if (!newEditor.isSupportFileToLink && !file.type.includes(_elementTypes.IMAGE)) continue;
42
+ if (newEditor.isImageUploadOnly && !file.type.includes(_elementTypes.IMAGE)) continue;
43
43
  files.push(file);
44
44
  }
45
45
  const hasImage = files.some(file => file.type.includes(_elementTypes.IMAGE));
@@ -23,7 +23,7 @@ const LongTextInlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
23
23
  value,
24
24
  lang,
25
25
  headerName,
26
- isSupportFileToLink = false,
26
+ isImageUploadOnly = true,
27
27
  isSupportMultipleFiles = false,
28
28
  onClick,
29
29
  onSaveEditorValue,
@@ -99,7 +99,7 @@ const LongTextInlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
99
99
  autoSave: autoSave,
100
100
  saveDelay: saveDelay,
101
101
  isCheckBrowser: isCheckBrowser,
102
- isSupportFileToLink: isSupportFileToLink,
102
+ isImageUploadOnly: isImageUploadOnly,
103
103
  isSupportMultipleFiles: isSupportMultipleFiles,
104
104
  editorApi: editorApi,
105
105
  onSaveEditorValue: onSaveEditorValue,
@@ -23,7 +23,7 @@ const NormalEditor = _ref => {
23
23
  autoSave = true,
24
24
  saveDelay = 60000,
25
25
  isCheckBrowser = false,
26
- isSupportFileToLink = false,
26
+ isImageUploadOnly = true,
27
27
  isSupportMultipleFiles = false,
28
28
  editorApi,
29
29
  onSaveEditorValue,
@@ -112,7 +112,7 @@ const NormalEditor = _ref => {
112
112
  ref: editorRef,
113
113
  enableEdit: enableEdit,
114
114
  isInline: true,
115
- isSupportFileToLink: isSupportFileToLink,
115
+ isImageUploadOnly: isImageUploadOnly,
116
116
  isSupportMultipleFiles: isSupportMultipleFiles,
117
117
  value: valueRef.current.text,
118
118
  handelEnableEdit: handelEnableEdit,
@@ -132,7 +132,7 @@ const NormalEditor = _ref => {
132
132
  })))), showExpandEditor && /*#__PURE__*/_react.default.createElement(_longtextEditorDialog.default, {
133
133
  lang: lang,
134
134
  readOnly: false,
135
- isSupportFileToLink: isSupportFileToLink,
135
+ isImageUploadOnly: isImageUploadOnly,
136
136
  isSupportMultipleFiles: isSupportMultipleFiles,
137
137
  headerName: headerName,
138
138
  value: valueRef.current.text,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.28",
3
+ "version": "2.0.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {