Add plugin actions menu

Summary: See D32311662 for details

Reviewed By: mweststrate

Differential Revision: D32329804

fbshipit-source-id: 26670353fdf8580643afcb8bc3493384146f5574
This commit is contained in:
Andrey Goncharov
2021-11-12 07:12:18 -08:00
committed by Facebook GitHub Bot
parent 2591d1629e
commit ed5c2bd39f
14 changed files with 180 additions and 113 deletions

View File

@@ -7,15 +7,12 @@
* @format
*/
export type TopLevelMenu = 'Edit' | 'View' | 'Window' | 'Help';
export type MenuEntry = BuiltInMenuEntry | CustomMenuEntry;
export type DefaultKeyboardAction = keyof typeof buildInMenuEntries;
export type NormalizedMenuEntry = {
label: string;
accelerator?: string;
topLevelMenu: TopLevelMenu;
handler: () => void;
action: string;
};
@@ -23,7 +20,6 @@ export type NormalizedMenuEntry = {
export type CustomMenuEntry = {
label: string;
accelerator?: string;
topLevelMenu: TopLevelMenu;
handler: () => void;
};
@@ -36,18 +32,15 @@ export const buildInMenuEntries = {
clear: {
label: 'Clear',
accelerator: 'CmdOrCtrl+K',
topLevelMenu: 'View',
action: 'clear',
},
goToBottom: {
label: 'Go To Bottom',
accelerator: 'CmdOrCtrl+B',
topLevelMenu: 'View',
action: 'goToBottom',
},
createPaste: {
label: 'Create Paste',
topLevelMenu: 'Edit',
action: 'createPaste',
},
} as const;