1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-07 21:47:02 +09:00

JS-6291: Move to Bin

This commit is contained in:
Andrew Simachev 2025-06-05 16:03:03 +02:00
parent 03a8c8e02b
commit fd359df39d
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF
3 changed files with 19 additions and 11 deletions

View file

@ -35,6 +35,7 @@ const getSections = () => {
{ id: 'redo', name: translate('popupShortcutMainBasics7'), keys: [ cmdKey, 'shift', 'z' ] },
{ id: 'createWidget', name: translate('menuObjectCreateWidget'), keys: [] },
{ id: 'copyPageLink', name: translate('commonCopyLink'), keys: [] },
{ id: 'moveToBin', name: translate('popupShortcutMainBasics25'), keys: [] },
]
},

View file

@ -1303,6 +1303,7 @@
"popupShortcutMainBasics22": "Lock Anytype",
"popupShortcutMainBasics23": "Previous Space",
"popupShortcutMainBasics24": "Lock / Unlock Object",
"popupShortcutMainBasics25": "Move to Bin / Restore from Bin",
"popupShortcutMainTextStyle": "Text style",
"popupShortcutMainTextStyle1": "Bold",

View file

@ -147,12 +147,12 @@ class Keyboard {
onKeyDown (e: any) {
const { theme, pin } = S.Common;
const isPopup = this.isPopup();
const key = e.key.toLowerCase();
const cmd = this.cmdKey();
const isMain = this.isMain();
const canWrite = U.Space.canMyParticipantWrite();
const selection = S.Common.getRef('selectionProvider');
const rootId = this.getRootId();
const object = S.Detail.get(rootId, rootId);
this.shortcut('toggleSidebar', e, () => {
e.preventDefault();
@ -298,6 +298,22 @@ class Keyboard {
});
});
// Copy page link
this.shortcut('copyPageLink', e, () => {
e.preventDefault();
const space = U.Space.getSpaceview();
U.Object.copyLink(object, space, 'web', analytics.route.shortcut);
});
// Move to bin
this.shortcut('moveToBin', e, () => {
e.preventDefault();
Action[object.isArchived ? 'restore' : 'archive']([ rootId ], analytics.route.shortcut);
});
if (canWrite) {
// Create new page
if (!S.Popup.isOpen('search') && !this.isMainSet()) {
@ -316,16 +332,6 @@ class Keyboard {
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());
};