@seafile/sdoc-editor 0.5.68 → 0.5.69

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.
@@ -81,7 +81,7 @@ class HeaderMenu extends React.Component {
81
81
  this.menu = ref;
82
82
  });
83
83
  _defineProperty(this, "getToolTip", type => {
84
- return isMac ? MAC_HOTKEYS[type] : WIN_HOTKEYS[type];
84
+ return isMac() ? MAC_HOTKEYS[type] : WIN_HOTKEYS[type];
85
85
  });
86
86
  this.state = {
87
87
  isShowHeaderPopover: false
@@ -42,15 +42,15 @@ const LinkMenu = _ref => {
42
42
  }
43
43
 
44
44
  // eslint-disable-next-line react-hooks/rules-of-hooks
45
- const printShortCutTexts = useMemo(() => {
46
- const printTexts = isMac ? ['⌘', 'k'] : ['Ctrl', 'k'];
45
+ const linkShortCutTexts = useMemo(() => {
46
+ const printTexts = isMac() ? ['⌘', 'k'] : ['Ctrl', 'k'];
47
47
  return printTexts;
48
48
  }, []);
49
49
  return /*#__PURE__*/React.createElement(DropdownMenuItem, {
50
50
  disabled: disabled,
51
51
  menuConfig: menuConfig,
52
52
  onClick: openLinkDialog,
53
- shortcut: printShortCutTexts
53
+ shortcut: linkShortCutTexts
54
54
  });
55
55
  };
56
56
  export default LinkMenu;
@@ -73,6 +73,8 @@ const withLink = editor => {
73
73
  } = newEditor;
74
74
  const isCollapsed = Range.isCollapsed(selection);
75
75
  if (isHotkey('mod+k', e) && isCollapsed) {
76
+ // Prevent edge behavior
77
+ e.preventDefault();
76
78
  const eventBus = EventBus.getInstance();
77
79
  eventBus.dispatch(INTERNAL_EVENT.INSERT_ELEMENT, {
78
80
  type: ELEMENT_TYPE.LINK,
@@ -56,8 +56,8 @@ const MoreOperations = _ref => {
56
56
  event.nativeEvent.stopImmediatePropagation();
57
57
  window.location.href = historyURL;
58
58
  }, [docPerm, historyURL, isSdocRevision]);
59
- const printShortCutTexts = useMemo(() => {
60
- const printTexts = isMac ? ['⌘', 'P'] : ['Ctrl', 'P'];
59
+ const printShortcutTexts = useMemo(() => {
60
+ const printTexts = isMac() ? ['⌘', 'P'] : ['Ctrl', 'P'];
61
61
  return printTexts;
62
62
  }, []);
63
63
  return /*#__PURE__*/React.createElement(Dropdown, {
@@ -78,7 +78,7 @@ const MoreOperations = _ref => {
78
78
  }, /*#__PURE__*/React.createElement("div", {
79
79
  className: "sdoc-dropdown-print-container"
80
80
  }, /*#__PURE__*/React.createElement("div", null, t('Print')), /*#__PURE__*/React.createElement(MenuShortcutPrompt, {
81
- shortcuts: printShortCutTexts
81
+ shortcuts: printShortcutTexts
82
82
  }))), isPro && isFreezed && /*#__PURE__*/React.createElement(DropdownItem, {
83
83
  className: "sdoc-dropdown-menu-item",
84
84
  onClick: unFreeze
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.5.68",
3
+ "version": "0.5.69",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",