@seafile/seafile-editor 1.0.91-beta → 1.0.91-beta1
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.
|
@@ -15,7 +15,6 @@ var _eventHandler = _interopRequireDefault(require("../../utils/event-handler"))
|
|
|
15
15
|
var _withPropsEditor = _interopRequireDefault(require("./with-props-editor"));
|
|
16
16
|
var _core = require("../../extension/core");
|
|
17
17
|
var _common = require("../../utils/common");
|
|
18
|
-
var _userLinkClick = _interopRequireDefault(require("../../hooks/user-link-click"));
|
|
19
18
|
require("./index.css");
|
|
20
19
|
const isMacOS = (0, _common.isMac)();
|
|
21
20
|
const InlineEditor = _ref => {
|
|
@@ -34,6 +33,7 @@ const InlineEditor = _ref => {
|
|
|
34
33
|
const focusRangeRef = (0, _react.useRef)(null);
|
|
35
34
|
const editor = (0, _react.useMemo)(() => {
|
|
36
35
|
const baseEditor = (0, _extension.inlineEditor)();
|
|
36
|
+
baseEditor.isInline = true;
|
|
37
37
|
return (0, _withPropsEditor.default)(baseEditor, {
|
|
38
38
|
editorApi,
|
|
39
39
|
onSave,
|
|
@@ -102,7 +102,6 @@ const InlineEditor = _ref => {
|
|
|
102
102
|
focusNode(editor, focusRangeRef.current);
|
|
103
103
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
104
|
}, [enableEdit]);
|
|
105
|
-
(0, _userLinkClick.default)();
|
|
106
105
|
|
|
107
106
|
// willUnmount
|
|
108
107
|
(0, _react.useEffect)(() => {
|
|
@@ -46,7 +46,10 @@ const renderLink = (_ref, editor) => {
|
|
|
46
46
|
e.stopPropagation();
|
|
47
47
|
const eventBus = _eventBus.default.getInstance();
|
|
48
48
|
if (isReadonly) {
|
|
49
|
-
|
|
49
|
+
if (editor.isInline) {
|
|
50
|
+
window.open(element.url);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
eventBus.dispatch(_eventTypes.EXTERNAL_EVENTS.ON_LINK_CLICK, e);
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
@@ -68,7 +71,7 @@ const renderLink = (_ref, editor) => {
|
|
|
68
71
|
});
|
|
69
72
|
setIsShowPopover(true);
|
|
70
73
|
registerClickEvent();
|
|
71
|
-
}, [editor, isReadonly, registerClickEvent]);
|
|
74
|
+
}, [editor, isReadonly, registerClickEvent, element]);
|
|
72
75
|
const onHrefClick = (0, _react.useCallback)(e => {
|
|
73
76
|
e.preventDefault();
|
|
74
77
|
}, []);
|