@seafile/seafile-editor 2.0.48 → 2.0.49
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.
|
@@ -20,9 +20,11 @@ var _useAttachments = _interopRequireDefault(require("../../hooks/use-attachment
|
|
|
20
20
|
var _common = require("../../utils/common");
|
|
21
21
|
var _outline = _interopRequireDefault(require("../../containers/outline"));
|
|
22
22
|
var _useContainerStyle = _interopRequireDefault(require("../../hooks/use-container-style"));
|
|
23
|
+
var _userLinkClick = _interopRequireDefault(require("../../hooks/user-link-click"));
|
|
23
24
|
require("./style.css");
|
|
24
25
|
const isMacOS = (0, _common.isMac)();
|
|
25
26
|
function SlateEditor(_ref) {
|
|
27
|
+
var _editor$api;
|
|
26
28
|
let {
|
|
27
29
|
value,
|
|
28
30
|
editorApi,
|
|
@@ -31,6 +33,7 @@ function SlateEditor(_ref) {
|
|
|
31
33
|
isReadonly,
|
|
32
34
|
isSupportFormula,
|
|
33
35
|
isSupportInsertSeafileImage,
|
|
36
|
+
onLinkClick,
|
|
34
37
|
children
|
|
35
38
|
} = _ref;
|
|
36
39
|
const scrollRef = (0, _react.useRef)(null);
|
|
@@ -49,6 +52,7 @@ function SlateEditor(_ref) {
|
|
|
49
52
|
return new _eventHandler.default(editor);
|
|
50
53
|
}, [editor]);
|
|
51
54
|
(0, _useAttachments.default)(editor);
|
|
55
|
+
(0, _userLinkClick.default)(editor._id, editor === null || editor === void 0 ? void 0 : (_editor$api = editor.api) === null || _editor$api === void 0 ? void 0 : _editor$api.server, onLinkClick);
|
|
52
56
|
const decorate = (0, _extension.useHighlight)(editor);
|
|
53
57
|
const onChange = (0, _react.useCallback)(value => {
|
|
54
58
|
setSlateValue(value);
|
|
@@ -23,6 +23,7 @@ const SimpleEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
23
23
|
isSupportInsertSeafileImage,
|
|
24
24
|
onSave: propsOnSave,
|
|
25
25
|
onContentChanged: propsOnContentChanged,
|
|
26
|
+
onLinkClick,
|
|
26
27
|
children
|
|
27
28
|
} = _ref;
|
|
28
29
|
const [richValue, setRichValue] = (0, _react.useState)([]);
|
|
@@ -61,6 +62,7 @@ const SimpleEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
61
62
|
editorApi: editorApi,
|
|
62
63
|
onSave: propsOnSave,
|
|
63
64
|
onContentChanged: onContentChanged,
|
|
65
|
+
onLinkClick,
|
|
64
66
|
children: children
|
|
65
67
|
};
|
|
66
68
|
if (isFetching || isLoading || isLoadingMathJax) {
|