mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-07 21:47:02 +09:00
Merge pull request #1451 from anyproto/feat/shortcut-copy-page-link
Feat/JS-6300: Shortcut copy page link
This commit is contained in:
commit
12bdae76ca
3 changed files with 14 additions and 3 deletions
|
@ -33,7 +33,8 @@ const getSections = () => {
|
|||
{ id: 'lock', name: translate('popupShortcutMainBasics22'), keys: [ cmdKey, 'alt', 'l' ] },
|
||||
{ id: 'undo', name: translate('popupShortcutMainBasics6'), keys: [ cmdKey, 'z' ] },
|
||||
{ id: 'redo', name: translate('popupShortcutMainBasics7'), keys: [ cmdKey, 'shift', 'z' ] },
|
||||
{ id: 'createWidget', name: translate('popupShortcutMainBasics25'), keys: [ cmdKey, 'shift', 'w' ] },
|
||||
{ id: 'createWidget', name: translate('menuObjectCreateWidget'), keys: [] },
|
||||
{ id: 'copyPageLink', name: translate('commonCopyLink'), keys: [] },
|
||||
]
|
||||
},
|
||||
|
||||
|
|
|
@ -1303,7 +1303,6 @@
|
|||
"popupShortcutMainBasics22": "Lock Anytype",
|
||||
"popupShortcutMainBasics23": "Previous Space",
|
||||
"popupShortcutMainBasics24": "Lock / Unlock Object",
|
||||
"popupShortcutMainBasics25": "Create widget",
|
||||
|
||||
"popupShortcutMainTextStyle": "Text style",
|
||||
"popupShortcutMainTextStyle1": "Bold",
|
||||
|
|
|
@ -152,9 +152,11 @@ class Keyboard {
|
|||
const isMain = this.isMain();
|
||||
const canWrite = U.Space.canMyParticipantWrite();
|
||||
const selection = S.Common.getRef('selectionProvider');
|
||||
const rootId = this.getRootId();
|
||||
|
||||
this.shortcut('toggleSidebar', e, () => {
|
||||
e.preventDefault();
|
||||
|
||||
sidebar.toggleOpenClose();
|
||||
});
|
||||
|
||||
|
@ -309,12 +311,21 @@ class Keyboard {
|
|||
this.shortcut('createWidget', e, () => {
|
||||
e.preventDefault();
|
||||
|
||||
const rootId = this.getRootId();
|
||||
const first = S.Block.getFirstBlock(S.Block.widgets, 1, it => it.isWidget());
|
||||
|
||||
Action.createWidgetFromObject(rootId, rootId, first?.id, I.BlockPosition.Top, analytics.route.shortcut);
|
||||
});
|
||||
|
||||
// Copy page link
|
||||
this.shortcut('copyPageLink', e, () => {
|
||||
e.preventDefault();
|
||||
|
||||
const object = S.Detail.get(rootId, rootId);
|
||||
const space = U.Space.getSpaceview();
|
||||
|
||||
U.Object.copyLink(object, space, 'web', analytics.route.shortcut);
|
||||
});
|
||||
|
||||
// Lock/Unlock
|
||||
this.shortcut('pageLock', e, () => this.onToggleLock());
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue