@seafile/seafile-editor 2.0.4 → 2.0.6
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.
|
@@ -42,7 +42,7 @@ const InsertElementDialog = _ref => {
|
|
|
42
42
|
linkTitle: selectedText
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
}, [editor,
|
|
45
|
+
}, [editor, linkInfo]);
|
|
46
46
|
const onCloseModal = (0, _react.useCallback)(() => {
|
|
47
47
|
setIsOpenLinkModal(false);
|
|
48
48
|
setLinkInfo({
|
|
@@ -41,7 +41,7 @@ const RenderTableContainer = (_ref, editor) => {
|
|
|
41
41
|
});
|
|
42
42
|
const isReadonly = (0, _slateReact.useReadOnly)();
|
|
43
43
|
(0, _react.useEffect)(() => {
|
|
44
|
-
if (isReadonly) return
|
|
44
|
+
if (isReadonly) return;
|
|
45
45
|
clearSelectedCells();
|
|
46
46
|
document.addEventListener('contextmenu', handleContextMenu, true);
|
|
47
47
|
document.addEventListener('mousedown', handleOutsideMouseDown);
|
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _simpleEditor = _interopRequireDefault(require("../simple-editor"));
|
|
11
12
|
var _getPreviewContent = _interopRequireDefault(require("../../utils/get-preview-content"));
|
|
12
13
|
var _markdownPreview = _interopRequireDefault(require("../markdown-preview"));
|
|
13
14
|
var _longtextEditorDialog = _interopRequireDefault(require("../longtext-editor-dialog"));
|
|
14
|
-
var
|
|
15
|
+
var _slateConvert = require("../../slate-convert");
|
|
15
16
|
const NormalEditor = _ref => {
|
|
16
17
|
let {
|
|
17
18
|
enableEdit,
|
|
@@ -46,28 +47,21 @@ const NormalEditor = _ref => {
|
|
|
46
47
|
if (!valueChangedRef.current) return;
|
|
47
48
|
saveValue(valueRef.current, true);
|
|
48
49
|
}, [saveValue]);
|
|
49
|
-
const onContentChanged = (0, _react.useCallback)(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
preview: previewText,
|
|
65
|
-
images: images,
|
|
66
|
-
links: links,
|
|
67
|
-
checklist
|
|
68
|
-
};
|
|
69
|
-
saveValue(valueRef.current);
|
|
70
|
-
}, 0);
|
|
50
|
+
const onContentChanged = (0, _react.useCallback)(content => {
|
|
51
|
+
const {
|
|
52
|
+
previewText: preview,
|
|
53
|
+
images,
|
|
54
|
+
links,
|
|
55
|
+
checklist
|
|
56
|
+
} = (0, _getPreviewContent.default)(content, false);
|
|
57
|
+
valueRef.current = {
|
|
58
|
+
text: (0, _slateConvert.slateToMdString)(content),
|
|
59
|
+
preview,
|
|
60
|
+
images,
|
|
61
|
+
links,
|
|
62
|
+
checklist
|
|
63
|
+
};
|
|
64
|
+
saveValue(valueRef.current);
|
|
71
65
|
}, [saveValue]);
|
|
72
66
|
const openEditorDialog = (0, _react.useCallback)(() => {
|
|
73
67
|
const {
|