@seafile/seafile-editor 2.0.48-beta1 → 2.0.48-beta2

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.
@@ -35,7 +35,8 @@ const InlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
35
35
  isImageUploadOnly,
36
36
  isSupportMultipleFiles,
37
37
  onExpandEditorToggle,
38
- handelEnableEdit
38
+ handelEnableEdit,
39
+ onLinkClick
39
40
  } = _ref;
40
41
  const [slateValue, setSlateValue] = (0, _react.useState)(value);
41
42
  const focusRangeRef = (0, _react.useRef)(null);
@@ -53,7 +54,7 @@ const InlineEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
53
54
  return new _eventHandler.default(editor);
54
55
  }, [editor]);
55
56
  (0, _useAttachments.default)(editor);
56
- (0, _userLinkClick.default)(editor._id);
57
+ (0, _userLinkClick.default)(editor._id, onLinkClick);
57
58
  const decorate = (0, _extension.useHighlight)(editor);
58
59
  const onChange = (0, _react.useCallback)(value => {
59
60
  setSlateValue(value);
@@ -28,7 +28,8 @@ const SimpleSlateEditor = _ref => {
28
28
  columns,
29
29
  onContentChanged,
30
30
  isSupportFormula,
31
- onExpandEditorToggle
31
+ onExpandEditorToggle,
32
+ onLinkClick
32
33
  } = _ref;
33
34
  const [slateValue, setSlateValue] = (0, _react.useState)(value);
34
35
  const editor = (0, _react.useMemo)(() => {
@@ -43,7 +44,7 @@ const SimpleSlateEditor = _ref => {
43
44
  return new _eventHandler.default(editor);
44
45
  }, [editor]);
45
46
  (0, _useAttachments.default)(editor);
46
- (0, _userLinkClick.default)(editor._id);
47
+ (0, _userLinkClick.default)(editor._id, onLinkClick);
47
48
  const decorate = (0, _extension.useHighlight)(editor);
48
49
  const onChange = (0, _react.useCallback)(value => {
49
50
  setSlateValue(value);
@@ -33,8 +33,10 @@ const LinkPopover = _ref => {
33
33
  const onLinkClick = (0, _react.useCallback)(e => {
34
34
  if (!(0, _common.isUrl)(linkUrl)) {
35
35
  e.preventDefault();
36
+ const eventBus = _eventBus.default.getInstance();
37
+ eventBus.dispatch(_eventTypes.EXTERNAL_EVENTS.ON_LINK_CLICK, e, editor._id);
36
38
  }
37
- }, [linkUrl]);
39
+ }, [linkUrl, editor]);
38
40
  const onUnwrapLink = (0, _react.useCallback)(e => {
39
41
  e.stopPropagation();
40
42
  (0, _helper.unWrapLinkNode)(editor);
@@ -63,6 +65,7 @@ const LinkPopover = _ref => {
63
65
  style: popoverPosition
64
66
  }, /*#__PURE__*/_react.default.createElement("a", {
65
67
  href: linkUrl,
68
+ "data-url": linkUrl,
66
69
  onClick: onLinkClick,
67
70
  target: "_blank",
68
71
  rel: "noopener noreferrer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.48-beta1",
3
+ "version": "2.0.48-beta2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {