feat: add Substitutions menu roles on macOS (#32024)

This commit is contained in:
Mitchell Cohen 2022-01-06 13:41:28 -05:00 committed by GitHub
parent d44a187d0b
commit 5af6b898d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 5 deletions

View file

@ -5,7 +5,8 @@ const isWindows = process.platform === 'win32';
const isLinux = process.platform === 'linux';
type RoleId = 'about' | 'close' | 'copy' | 'cut' | 'delete' | 'forcereload' | 'front' | 'help' | 'hide' | 'hideothers' | 'minimize' |
'paste' | 'pasteandmatchstyle' | 'quit' | 'redo' | 'reload' | 'resetzoom' | 'selectall' | 'services' | 'recentdocuments' | 'clearrecentdocuments' | 'startspeaking' | 'stopspeaking' |
'paste' | 'pasteandmatchstyle' | 'quit' | 'redo' | 'reload' | 'resetzoom' | 'selectall' | 'services' | 'recentdocuments' | 'clearrecentdocuments' |
'showsubstitutions' | 'togglesmartquotes' | 'togglesmartdashes' | 'toggletextreplacement' | 'startspeaking' | 'stopspeaking' |
'toggledevtools' | 'togglefullscreen' | 'undo' | 'unhide' | 'window' | 'zoom' | 'zoomin' | 'zoomout' | 'togglespellchecker' |
'appmenu' | 'filemenu' | 'editmenu' | 'viewmenu' | 'windowmenu' | 'sharemenu'
interface Role {
@ -133,6 +134,18 @@ export const roleList: Record<RoleId, Role> = {
clearrecentdocuments: {
label: 'Clear Menu'
},
showsubstitutions: {
label: 'Show Substitutions'
},
togglesmartquotes: {
label: 'Smart Quotes'
},
togglesmartdashes: {
label: 'Smart Dashes'
},
toggletextreplacement: {
label: 'Text Replacement'
},
startspeaking: {
label: 'Start Speaking'
},
@ -237,6 +250,16 @@ export const roleList: Record<RoleId, Role> = {
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Substitutions',
submenu: [
{ role: 'showSubstitutions' },
{ type: 'separator' },
{ role: 'toggleSmartQuotes' },
{ role: 'toggleSmartDashes' },
{ role: 'toggleTextReplacement' }
]
},
{
label: 'Speech',
submenu: [