@seafile/seafile-editor 1.0.33-1 → 1.0.33

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,27 +54,9 @@ function LongTextEditorDialog(_ref) {
54
54
  setValueChanged(false);
55
55
  }, [isValueChanged, onSaveEditorValue, readOnly]);
56
56
  const onCloseToggle = (0, _react.useCallback)(() => {
57
- let value = null;
58
- if (!readOnly && isValueChanged) {
59
- var _editorRef$current3, _editorRef$current4;
60
- const markdownString = (_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.getValue();
61
- const slateNodes = (_editorRef$current4 = editorRef.current) === null || _editorRef$current4 === void 0 ? void 0 : _editorRef$current4.getSlateValue();
62
- const {
63
- previewText,
64
- images,
65
- links,
66
- checklist
67
- } = (0, _getPreviewContent.default)(slateNodes, false);
68
- value = {
69
- text: markdownString,
70
- preview: previewText,
71
- images: images,
72
- links: links,
73
- checklist
74
- };
75
- }
76
- onCloseEditorDialog(value);
77
- }, [isValueChanged, onCloseEditorDialog, readOnly]);
57
+ onUpdateEditorValue();
58
+ onCloseEditorDialog();
59
+ }, [onCloseEditorDialog, onUpdateEditorValue]);
78
60
  const onHotKey = (0, _react.useCallback)(event => {
79
61
  if (event.keyCode === 27) {
80
62
  event.stopPropagation();
@@ -119,9 +101,9 @@ function LongTextEditorDialog(_ref) {
119
101
  setTimeout(() => {
120
102
  // update parent's component cache value
121
103
  if (onEditorValueChanged && typeof onEditorValueChanged === 'function') {
122
- var _editorRef$current5, _editorRef$current6;
123
- const markdownString = (_editorRef$current5 = editorRef.current) === null || _editorRef$current5 === void 0 ? void 0 : _editorRef$current5.getValue();
124
- const slateNodes = (_editorRef$current6 = editorRef.current) === null || _editorRef$current6 === void 0 ? void 0 : _editorRef$current6.getSlateValue();
104
+ var _editorRef$current3, _editorRef$current4;
105
+ const markdownString = (_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.getValue();
106
+ const slateNodes = (_editorRef$current4 = editorRef.current) === null || _editorRef$current4 === void 0 ? void 0 : _editorRef$current4.getSlateValue();
125
107
  const {
126
108
  previewText,
127
109
  images,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.33-1",
3
+ "version": "1.0.33",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {