mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-18 01:01:42 +08:00
refactor(server): typed keyboard action names
This commit is contained in:
parent
728037075f
commit
a9ea3c8b63
@ -462,6 +462,7 @@ function getDefaultKeyboardActions() {
|
|||||||
description: t("keyboard_actions.toggle-inherited-attributes"),
|
description: t("keyboard_actions.toggle-inherited-attributes"),
|
||||||
scope: "window"
|
scope: "window"
|
||||||
},
|
},
|
||||||
|
// TODO: Remove or change since promoted attributes have been changed.
|
||||||
{
|
{
|
||||||
actionName: "toggleRibbonTabPromotedAttributes",
|
actionName: "toggleRibbonTabPromotedAttributes",
|
||||||
defaultShortcuts: [],
|
defaultShortcuts: [],
|
||||||
|
@ -1,6 +1,102 @@
|
|||||||
|
const enum KeyboardActionNamesEnum {
|
||||||
|
backInNoteHistory,
|
||||||
|
forwardInNoteHistory,
|
||||||
|
jumpToNote,
|
||||||
|
scrollToActiveNote,
|
||||||
|
quickSearch,
|
||||||
|
searchInSubtree,
|
||||||
|
expandSubtree,
|
||||||
|
collapseTree,
|
||||||
|
collapseSubtree,
|
||||||
|
sortChildNotes,
|
||||||
|
createNoteAfter,
|
||||||
|
createNoteInto,
|
||||||
|
createNoteIntoInbox,
|
||||||
|
deleteNotes,
|
||||||
|
moveNoteUp,
|
||||||
|
moveNoteDown,
|
||||||
|
moveNoteUpInHierarchy,
|
||||||
|
moveNoteDownInHierarchy,
|
||||||
|
editNoteTitle,
|
||||||
|
editBranchPrefix,
|
||||||
|
cloneNotesTo,
|
||||||
|
moveNotesTo,
|
||||||
|
copyNotesToClipboard,
|
||||||
|
pasteNotesFromClipboard,
|
||||||
|
cutNotesToClipboard,
|
||||||
|
selectAllNotesInParent,
|
||||||
|
addNoteAboveToSelection,
|
||||||
|
addNoteBelowToSelection,
|
||||||
|
duplicateSubtree,
|
||||||
|
openNewTab,
|
||||||
|
closeActiveTab,
|
||||||
|
reopenLastTab,
|
||||||
|
activateNextTab,
|
||||||
|
activatePreviousTab,
|
||||||
|
openNewWindow,
|
||||||
|
toggleTray,
|
||||||
|
firstTab,
|
||||||
|
secondTab,
|
||||||
|
thirdTab,
|
||||||
|
fourthTab,
|
||||||
|
fifthTab,
|
||||||
|
sixthTab,
|
||||||
|
seventhTab,
|
||||||
|
eigthTab,
|
||||||
|
ninthTab,
|
||||||
|
lastTab,
|
||||||
|
showNoteSource,
|
||||||
|
showOptions,
|
||||||
|
showRevisions,
|
||||||
|
showRecentChanges,
|
||||||
|
showSQLConsole,
|
||||||
|
showBackendLog,
|
||||||
|
showHelp,
|
||||||
|
addLinkToText,
|
||||||
|
followLinkUnderCursor,
|
||||||
|
insertDateTimeToText,
|
||||||
|
pasteMarkdownIntoText,
|
||||||
|
cutIntoNote,
|
||||||
|
addIncludeNoteToText,
|
||||||
|
editReadOnlyNote,
|
||||||
|
addNewLabel,
|
||||||
|
addNewRelation,
|
||||||
|
toggleRibbonTabClassicEditor,
|
||||||
|
toggleRibbonTabBasicProperties,
|
||||||
|
toggleRibbonTabBookProperties,
|
||||||
|
toggleRibbonTabFileProperties,
|
||||||
|
toggleRibbonTabImageProperties,
|
||||||
|
toggleRibbonTabOwnedAttributes,
|
||||||
|
toggleRibbonTabInheritedAttributes,
|
||||||
|
toggleRibbonTabPromotedAttributes,
|
||||||
|
toggleRibbonTabNoteMap,
|
||||||
|
toggleRibbonTabNoteInfo,
|
||||||
|
toggleRibbonTabNotePaths,
|
||||||
|
toggleRibbonTabSimilarNotes,
|
||||||
|
toggleRightPane,
|
||||||
|
printActiveNote,
|
||||||
|
openNoteExternally,
|
||||||
|
renderActiveNote,
|
||||||
|
runActiveNote,
|
||||||
|
toggleNoteHoisting,
|
||||||
|
unhoist,
|
||||||
|
reloadFrontendApp,
|
||||||
|
openDevTools,
|
||||||
|
findInText,
|
||||||
|
toggleLeftPane,
|
||||||
|
toggleFullscreen,
|
||||||
|
zoomOut,
|
||||||
|
zoomIn,
|
||||||
|
zoomReset,
|
||||||
|
copyWithoutFormatting,
|
||||||
|
forceSaveRevision
|
||||||
|
}
|
||||||
|
|
||||||
|
type KeyboardActionNames = keyof typeof KeyboardActionNamesEnum;
|
||||||
|
|
||||||
export interface KeyboardShortcut {
|
export interface KeyboardShortcut {
|
||||||
separator?: string;
|
separator?: string;
|
||||||
actionName?: string;
|
actionName?: KeyboardActionNames;
|
||||||
description?: string;
|
description?: string;
|
||||||
defaultShortcuts?: string[];
|
defaultShortcuts?: string[];
|
||||||
effectiveShortcuts?: string[];
|
effectiveShortcuts?: string[];
|
||||||
@ -16,5 +112,5 @@ export interface KeyboardShortcut {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut {
|
export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut {
|
||||||
actionName: string;
|
actionName: KeyboardActionNames;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user