@seafile/seafile-editor 2.0.33 → 2.0.34

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.
@@ -24,6 +24,7 @@ const isMacOS = (0, _common.isMac)();
24
24
  const InlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
25
25
  let {
26
26
  enableEdit,
27
+ autoFocus,
27
28
  value,
28
29
  editorApi,
29
30
  onSave,
@@ -101,6 +102,7 @@ const InlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
101
102
  const timer = setTimeout(() => {
102
103
  editor.forceNormalize = false;
103
104
  if (!enableEdit) return;
105
+ if (!autoFocus) return;
104
106
  focusNode(editor);
105
107
  }, 300);
106
108
  return () => {
@@ -114,6 +116,7 @@ const InlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
114
116
  editor.hasMovedSelection = false;
115
117
  return;
116
118
  }
119
+ if (!autoFocus) return;
117
120
  focusNode(editor, focusRangeRef.current);
118
121
  // eslint-disable-next-line react-hooks/exhaustive-deps
119
122
  }, [enableEdit]);
@@ -17,6 +17,7 @@ require("./index.css");
17
17
  const LongTextInlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
18
18
  let {
19
19
  isAlwaysEnableEdit = false,
20
+ autoFocus = true,
20
21
  autoSave,
21
22
  isCheckBrowser,
22
23
  saveDelay,
@@ -106,6 +107,7 @@ const LongTextInlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
106
107
  isCheckBrowser: isCheckBrowser,
107
108
  isImageUploadOnly: isImageUploadOnly,
108
109
  isSupportMultipleFiles: isSupportMultipleFiles,
110
+ autoFocus: autoFocus,
109
111
  editorApi: editorApi,
110
112
  onSaveEditorValue: onSaveEditorValue,
111
113
  onEditorValueChanged: onEditorValueChanged
@@ -25,6 +25,7 @@ const NormalEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
25
25
  isCheckBrowser = false,
26
26
  isImageUploadOnly = true,
27
27
  isSupportMultipleFiles = false,
28
+ autoFocus,
28
29
  editorApi,
29
30
  onSaveEditorValue,
30
31
  onEditorValueChanged
@@ -121,6 +122,7 @@ const NormalEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
121
122
  ref: editorRef,
122
123
  enableEdit: enableEdit,
123
124
  isInline: true,
125
+ autoFocus: autoFocus,
124
126
  isImageUploadOnly: isImageUploadOnly,
125
127
  isSupportMultipleFiles: isSupportMultipleFiles,
126
128
  value: valueRef.current.text,
@@ -16,6 +16,7 @@ const SimpleEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
16
16
  let {
17
17
  isInline,
18
18
  isFetching,
19
+ autoFocus,
19
20
  value,
20
21
  focusEnd = false,
21
22
  editorApi,
@@ -59,6 +60,7 @@ const SimpleEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
59
60
  isSupportFormula: !!mathJaxSource,
60
61
  value: richValue,
61
62
  focusEnd,
63
+ autoFocus,
62
64
  editorApi: editorApi,
63
65
  onSave: propsOnSave,
64
66
  onContentChanged: onContentChanged,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.33",
3
+ "version": "2.0.34",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {