import { app , shell } from 'electron' ; export const appMenuTemplate = ( ) => { const template = [ { label : 'Edit' , submenu : [ { label : 'Undo' , accelerator : 'CmdOrCtrl+Z' , role : 'undo' , } , { label : 'Redo' , accelerator : 'Shift+CmdOrCtrl+Z' , role : 'redo' , } , { type : 'separator' , } , { label : 'Cut' , accelerator : 'CmdOrCtrl+X' , role : 'cut' , } , { label : 'Copy' , accelerator : 'CmdOrCtrl+C' , role : 'copy' , } , { label : 'Paste' , accelerator : 'CmdOrCtrl+V' , role : 'paste' , } , { label : 'Select All' , accelerator : 'CmdOrCtrl+A' , role : 'selectAll' , } , ] , } , { label : 'Window' , role : 'window' , submenu : [ { label : 'Minimize' , accelerator : 'CmdOrCtrl+M' , role : 'minimize' , } , { label : 'Close' , accelerator : 'CmdOrCtrl+W' , role : 'close' , } , ] , } , { label : 'Help' , role : 'help' , submenu : [ { label : 'Github Repo' , click : function ( ) { shell . openExternal ( 'https://github.com/jamaljsr/polar' ) ; } , } , ] , } , ] ; if ( process . platform === 'darwin' ) { const name = app . getName ( ) ; template . unshift ( { label : name , submenu : [ { label : 'About ' + name , accelerator : '' , role : 'about' , } , { type : 'separator' , } , { label : 'Hide ' + name , accelerator : 'Command+H' , role : 'hide' , } , { label : 'Hide Others' , accelerator : 'Command+Shift+H' , role : 'hideOthers' , } , { label : 'Show All' , accelerator : '' , role : 'unhide' , } , { type : 'separator' , } , { label : 'Quit' , accelerator : 'Command+Q' , role : 'quit' , } , ] , } ) ; } return template ; } ;