{"_id":"@anujdatar/electron-context-menu","_rev":"11-812a8f0651b21e57773259e47d821a54","name":"@anujdatar/electron-context-menu","dist-tags":{"latest":"1.1.1","next":"1.0.6-3"},"versions":{"1.0.1":{"name":"@anujdatar/electron-context-menu","version":"1.0.1","description":"Building simple context menus for Electron","main":"index.js","scripts":{"test":"echo \"No test specified\""},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"gitHead":"a9df2a4d61e4ae61f8c6b12a8bb5e39e5eb23834","_id":"@anujdatar/electron-context-menu@1.0.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ZSlGagaMQ3Othas12tasc50708/GO9OJIkj3DUB9BPADs1x6W4FD5O+lNb5OofAKnl/NNxpiJH7TZQsphiOTkw==","shasum":"a591f3e7ea7ec034424e68d1ca444b577400ae60","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.1.tgz","fileCount":4,"unpackedSize":4549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDNi+CRA9TVsSAnZWagAAb44QAIGTt0ZBY25YOh6eLlW3\nImwH8w2+xlZrmJQSTbLDz5xX+JvWXCfPEI/SMPxm3w6VIKZsAQj4Nnepbe/0\nbIIoDXtkf8twBU8xmhQTfMymyBvDlY8H7OxDAU6/NXh1X7pO2cByFQmPwzwb\nvF1pzN/gDf1cCAyP/q7ewelHyHW0/r2E19WYbdIX0i1g7apZwCH9hjia/Vjc\n2Ik4YENz04aphMyNITy1LtZtsDBEHHeWcfC3bbxYdpM8f0i6SxLnQh3UtGdH\n1X223QCDWdVHFhU1YEMgmSC+XEdatMEPBSsO2a21SI4FAaocMKim9rKT8W4g\nYc6mni4591m9UDe0qOh0zwouyrQVT59XkjqllOuHr89uvOrOsmRgunjpWuRp\nabxVHYNga48beXpxIkFJvSP6C8uD7MOHtsgIrGufKidFuE9/NK9qvWlM8bB4\n252vGGeGcXahywzvqx6t/Ji5ZKHBAOeCn6wA1SkvslfurCx5Ef7VcWgrnkPj\nm7pffU4Yql8323EX4fzkOQ71TX9KRMAZCNvYk7L7roRZ/okjrJG5I6r5DoaU\n6QEuK0GtkkXYKv/KC0sXoMHGZyyUBXw7PyvL54D2ZMyQaAzOMYXBhIiWD1sJ\n2HHwiKrWdjVmzqThVaCak5NvXVOsZ1+KAtWOQShPpNGoyCSI0zl3PUrkPJVW\nd+gO\r\n=konC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH13rvVteZfKVF6+cgKac3xdk9XnZIOwacpMjUXGnMi+AiEAnHDdfewbIsXhv3wwZwWT0zfI4fT4J61NJyo1CJeA/V0="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.1_1561123005974_0.6702459427224694"},"_hasShrinkwrap":false},"1.0.2":{"name":"@anujdatar/electron-context-menu","version":"1.0.2","description":"Building simple context menus for Electron","main":"src/index.js","scripts":{"test":"echo \"No test specified\""},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"gitHead":"a5a955d6bbe0f73963c46bd1ea0c9adedc313e83","_id":"@anujdatar/electron-context-menu@1.0.2","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HwQcgU3JC/xeZYpEGfYJx9HyiuzIfeUVzpFr2O8ZRZZDN7G1+dfq96bUfuWsKG5wz7JucCrthGMW8JHpIfV7Ag==","shasum":"eb2647372032a3363c02d60346e34d10d168fc3d","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.2.tgz","fileCount":4,"unpackedSize":4587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDUIjCRA9TVsSAnZWagAAEb0P/jeyi3Ttrk9jo9aPKhhc\nbxDVF+HRXpqvkk4nLTT39SF8JDk9a8rZnEdUm9HaBUEmxeZvcegn4HAwdGzV\noUAuw6RwC0bpdxMGbpNJafe07gZPyAHKoqzfoTqcybAsKFE4I0UyDU501grC\nwEF7WxZiW0IQdzttCawYpkF7+tC4+8JDOPDhmZtr7GdGCpGYkI5bemH8HcPf\nHXwZPfco0jN3H9Iz4Ao2urz1+3c0i2v1SKDlahE8R1EMqegBFdViN/ZjR+pY\nxpLlpQPwY1doCllUwsOmPSYpnXe6XdNydx2I3TTE5YuEbnuqAQ17CGJektVV\n61uhr/LO31mCC6bhvs4lKcWZ5j7NC2F3YrQbEIdmA1mVjJnrUA7DimY3VAEf\nxqCCLMqwm/HsXs5yz1+9Lk9vUeX0SAPN7g+NnJbJ/JLWv1oA5Eg34Lcrr7+P\n/ZsgVBcwBYmww9mFz9jCo3mgETfcQFJ9+snVJLbe5fNXtbqG417WQEmRjN46\noO+Oc0iIiBG2Iv1KTLw6QMAH4in/lMg11+CIKCs+oHhjCytEPzTxd3RPEGT/\nI8eCSX/GSVujzOKe92MjdDe0vjqV4WVyewD3ATdvq+3Oi4vkPTChcxEUVbaK\np05iibFgTldI5ClCTIeXP68yVw/zIgGTykfdWxTYSLDmvJDBJGopHBzmbHZF\nuYT+\r\n=eVkT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTmJc10fig/svm7mZwS4hU6JXCxGmKcQdUeGf5E/zReAiEAwtTMF+dZPQ1MMuiMWjmhh2wSK5rVBPTmsrwZg2NF6eQ="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.2_1561149986531_0.315433046006544"},"_hasShrinkwrap":false},"1.0.3":{"name":"@anujdatar/electron-context-menu","version":"1.0.3","description":"Building simple context menus for Electron","main":"src/index.js","scripts":{"test":"echo \"No test specified\""},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"gitHead":"111d32f74fc3544e34b1459a0f712ba3121d26ba","_id":"@anujdatar/electron-context-menu@1.0.3","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-WXTfiewK0OGvCNKNASLwZLX6Pj0Bvl1v+JKOLdWiklA6SSZD4eeg41P2HpgQgqXA9CpswgHWxv0EjDJqy1kxdg==","shasum":"6db703a4591ca8281a3866f78c5ffb93fc07758e","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.3.tgz","fileCount":6,"unpackedSize":36933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDVlJCRA9TVsSAnZWagAAjIoP/0gY/0v5KAG+32DoCEFW\nONNU+hMy4jldhGNR+AEFZocEPgUhT+ZF4rIERa/2cEtacD63DcGUY/NESs1K\nPvJ69MsF2MwIZfwmJBFin6lDKVxJLRjsx9ppTZx3KUnUUKwCveyX6CgH5AIe\n3E+s774rfcinofz8Kd0KM7V0nkTe0+2z0vNZ+NsjF5GgGfItqzjBjPqbt14b\nOStuN5VVPTGlDhXlprl7VyqkrLmpo8LI71s7vP//jN+wOrF1KdFF95vy/vHn\nNuo/6RH1i5oMGGWVAonl6RoTWUMxMa3ErE6yzar/eWpv2Rp+ZofvrbsgbElk\nhAiw3ojyhvEesjksY9Os4rYuzEtOzBtvqAdfZ5EIFLFtTwcN9zC5n5Ptl/2O\nM2eb7wLN81+4DD043WfXJ0eCy0MMXnC55ZBqPtjwenefQ1k/z1uIpSI8Dkqh\nyPANbyUUNAxHjWxp+Z72wbo3kuvpKZyVG2iZjtB7jyeaftHUCH/bODJ5DPQV\nNAUyGw/HDINXfdUa/cg1keuFRoYhrpv5+0KFxWhONbLH7JY58nwN/k1fXWjA\nqxY3bjTw8BrBL0DhDRHIjd6z5++RgiUMGHH5a3TWenDGYDGWyvvsnbpxUmJe\nB6jCHyLhrnPC4OMyGaeuHHYUwKFQXdsKTNDwKG/UVXMMydpS2v9oCuLdpfi6\ngzpu\r\n=mAeE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3A6waUbCxH8hNGcLVERXVgWQH16ijb+9hksgW2SgxCgIhAIUNbNFcHAkl4/3FylVuK6gmZDLPo0k0ZyOyBY4E7Eb3"}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.3_1561155913106_0.7651859481110577"},"_hasShrinkwrap":false},"1.0.4":{"name":"@anujdatar/electron-context-menu","version":"1.0.4","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"gitHead":"b7f468efd94931d7e6ed652222272e9b3f7203bd","_id":"@anujdatar/electron-context-menu@1.0.4","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-8FGaLtK4BagqgH4RO09t46KyXFzS7ow9dH9xXs0qWuPB+1Y40RxsUB+85y72FWUfbIwVEH+0AVYDwCMzq3GRCA==","shasum":"5e8e07c8480ba3abd41a8daa586adea4fa27773e","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.4.tgz","fileCount":9,"unpackedSize":41873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEfchCRA9TVsSAnZWagAASN4P/ihyoslDbdyldyWaO2ms\np1bQ/YjZ0RFTjxFzEB+p9Arn1YxwWJG9lDFJVqCnARRweks6Azx3BmEqWVpB\n97df8qPfE3cxMRpoMgs+c8xIngfCirhBKz2n9IUzeM0dbNAwHBUk8SPu3dY4\nXIjxstj1BaKChttub4DdKUHbFfqRlxJx4I971aR/lobuZVDxFw0I/IUbzXxm\nBSfk+2DkBWEpW7dEQSBRqwunNebaom2v0qeWrPLSgBySOfE7dKtgjp6zgFQT\n6udikH2relgMuBqoPPkHhfR/WQWDmqEo167un4VV7izIWgynVKQKSyJIcZii\nM4to5v2E71zix60fdjJbPmRJo0bE0nuf1cx3xi8RzWgbMt/MMOK7h4y8wVLj\ndkAp2CtqL0SrBgGDAFDFWq5g+Ye79ksaTifCnH/XdYdu4th4YHpyNOB0LQoD\nt1ZH5X6R/bhML99ANsKvzanea6J3RY6HWHSrhR+078gDsqh1fRAuWcL6IfGY\n31dSR3N7YVOLEkOdzX4SOh/D3w+OApxeefynnic3XmaC0p9IGF/a4MTxLUuy\nP+Ve9dXWY7UPjzl39pdnT/NjKBTISpBT2GHCHuEEDA8fkMAU6/SIdHrUQchJ\nFZVZz0SFpA4yPKHSjj1YI/MHJyTtspXTt/lIwlXefM/PgVKcuC7El0SDAUK6\noJ26\r\n=lZuN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfS4PezG5ZI5Z6MET9JxcfqJ8gqaTQz0sT/IjFLj/NrAiEAx+bn47oZkKb3QYqNpKWGa5vD8sCE0gZ88Cxg7bjjed0="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.4_1561458464914_0.3196280281110293"},"_hasShrinkwrap":false},"1.0.5":{"name":"@anujdatar/electron-context-menu","version":"1.0.5","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"gitHead":"d1f7a72659f8a9c0ad8b75743a1e5f99ccd9a019","_id":"@anujdatar/electron-context-menu@1.0.5","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-e3fpYM226SgrRpbatsL7XkDG4t6H5v+4oiPX7OtBGBFAT0X2lcwvAekkSn0UsKqqf25LB6VuTEFuycWqB8aWHQ==","shasum":"34d705e5af290d6c3b0ffa706d6760134efda786","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.5.tgz","fileCount":10,"unpackedSize":41807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEf5fCRA9TVsSAnZWagAA8LsP/jTPpOXPBOqDLbJCoUvr\n7spJ97xYnUr08nGG+Lph9ZbEZktzMHH5ikH6BVaBRI69OY+/RWH/hk1I5zLc\nhSjly5pBNt9MbNsWuMlhTC2pKNJEEjFja60kEGfUbdaGRjVw95boVB4njuSd\nGrLi7o6Vl2TuZ8bGYFCFwva2/AFbvIck/wLVv7KVSHZYuLdybOgnGGZ3NTjV\n6yMCVzrGEfsex2XH762HkPc8zB/Ew8F+iqWol+lqB6p8O2sCWmUyXPLgiexW\nT9LE9Suxose0b6SbzhDEnGElRF1w1glS9yVUH0L/710SmOv2Ehe96in96FAj\nxOYm0KMSibUDLID7ZVZ3rQU1pJdk5IPS5LkU4pxsAyHIq9aMNr42RrJVB7CD\nwOzXqywKYoMXrDPJ8S93Oyh6apj0sQvXdLUCJKWfTuZC2h/99r1yu66Mx+BK\nEcf9ppnOWiH27zyZDY/s7waXQ4sxXOylSRDb6Bg7UzSBEDtB1kUfro03elaF\nphd/vYb3IsC2ScWg8y/QW/PFgZFQ3+Pandh3z0dXr2BomeFgtZKM9hDJX4oW\n6A1EcyY3FO0J6Atk8oUi4sl4eAT0DBMn1UQ29ZjhItLbZ9U/rJVqSDLsnDxL\n9JQSN95mCyjyb6kvJGQyLiEHgLQjWFKe63ZPIvPFQo7Tih35jKc9/cTL9bjR\nYfo7\r\n=oryN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHp259Kpto4h9SeONQcL+Ufz4J26cw27J5l4N3QtJ+B6AiEAhBYhRIQzLDzNlFKWycf4BHq3yEAASfI7TpytOuc/9Xs="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.5_1561460318949_0.922156371463251"},"_hasShrinkwrap":false},"1.0.6-0":{"name":"@anujdatar/electron-context-menu","version":"1.0.6-0","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"readme":"# electron-context-menu\n\n![npm](https://img.shields.io/npm/v/@anujdatar/electron-context-menu.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu/badge)](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu)\n![Issues](https://img.shields.io/github/issues/anujdatar/electron-context-menu.svg)\n![GitHub](https://img.shields.io/github/license/anujdatar/electron-context-menu.svg)\n\nRight-click context menus for Electron.\nDetects context if click area is editable or not.\n\nBasic menu for uneditable areas:\n\n![copy_menu](/docs/copy_menu.png)\n\nMore complex menu for editable areas:\n\n![editor_menu](/docs/editor_menu.png)\n\nYou can also add prefixes and suffixes to either option.\nThree different menu options:\n\n  1. Simple menu with only \"copy\" option: copyContextMenu()\n  2. Simple menu with only \"page reload\" option: reloadContextMenu()\n  3. Customizable menus for editable text-areas: buildContextMenu()\n\n```js\nbuildContextMenu(prefix, suffix)\n  /*\n    function generates context menu inside a browserwindow of an electron app\n\n    Args:\n      prefix: Object - contains any prefix options required in the ctx menu\n      suffix: Object - contains and suffix options required in the ctx menu\n    Returns:\n      Menu: Electron Menu\n  */\n\n// Usage\n\nbuildContextMenu() // basic menu for editable areas\n// for menus with prefixs and or suffixes\nbuildContextMenu(prefix, suffix) // editor_menu - prefix and suffix\nbuildContextMenu({}, suffix) // editor_menu - no prefix, only suffix\n```\n\n## Installation\n\n```js\nnpm install @anujdatar/electron-context-menu\n```\n\n## Usage example\n\n```js\n// in renderer or preload script\nconst electron = require('electron')\nconst remote = electron.remote\nconst { buildContextMenu,\n  copyContextMenu,\n  reloadContextMenu } = remote.require('@anujdatar/electron-context-menu')\n\nwindow.addEventListener('contextmenu', (e) => {\n    e.preventDefault()\n\n    let ctxMenu\n\n    if (window.getSelection().toString() === '') {\n      // if no text is selected\n      ctxMenu = new reloadContextMenu()\n      ctxMenu.popup(remote.getCurrentWindow())\n    } else {\n      // if some text is selected\n      if (!e.target.closest('textarea, input, [contenteditable=\"true\"]')) {\n        // if selected text is in non-editable area\n        ctxMenu = new copyContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        // if selected text is in editable area\n        // you can add menu prefixes and suffixes here if needed (eg. spellchecking)\n        ctxMenu = new buildContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    }\n  })\n```\n\n### Menu Customization\n\n  adding *prefix* or *suffix* menu items to the context menu\n  prefix and suffix: objects\n    @param: exists - boolean - *true* when you need to add menu prefix\n    @param menuItems - array - containing objects\n      menuItem = {\n        label - string - displayed in the menu,\n        click -function - activated when label clicked in ctxMenu\n      }\n\n  ```js\n  // example\n  prefix = {\n    exists: true,\n    menuItems: []\n  }\n  ```\n\n## Thanks\n\n[Jeff Wear](https://github.com/wearhere) and MixMax's [electron-editor-context-menu](https://github.com/mixmaxhq/electron-editor-context-menu)\n\n## Copyright and License\n\nCopyright 2019 Anuj Datar, licensed under MIT License\n\n## TODO\n\n1. Add contexts for other type of elements, eg. images, etc.\n2. Any ideas?\n","readmeFilename":"README.md","gitHead":"9669153062d0f3a63a4790282b295abd3379c19d","_id":"@anujdatar/electron-context-menu@1.0.6-0","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-tyeNzKcskSEZjNdCwuWLVXvfF8jldxmzVN9Z6+/6ZCTXjBfZfAliZHjL67nFjWDKlQ5e6cujjuN8KWbF0X1cIA==","shasum":"37133fcaaea872af791f0d9efd380c2c885aabb6","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.6-0.tgz","fileCount":10,"unpackedSize":42440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEgvKCRA9TVsSAnZWagAAGNkP/AyhzmYAQj9q6C0jBPjB\n0/EE4Im/tQe1fb4IjdDqD/vLQx9zYfo+RnMUZfPTkkNKFdL8UtUWosUk4+I9\nxKw9vwd/FO/xOP7ukdGqBXl/3POhhibxcamhW7pHqyp4OjgLn4HYf7xsKIKE\nZ+PnUyVL70QhvpQDYV0hwL/h3bidfXjXCSVQAmeQK7r8fBE2JZcblqXeWnnY\nCCTGUkFdhR0BKfbaEPkbg+av50ZmgTYTRuSztGh/X/9N/1wkGCdGK71LGjwV\nBj+V46jSPfqsGld5gfa0NKq5lwTuOjcZV0Z37UndvwY1Xr1aC8XnYOHULoDu\nqgHSxPSiv5Y4bHiJTuRsQ6zlwSAEMxvJG45Y29/6VkRTz2nKkvLt0IYIMk35\n6SLNTFw/7v66yHYlfrVeCsrHDyKxS3c99OirpnzQB9FahnIVtSbcNmIVTkP0\nsgOdvr3nZ0tkHaBr49TXlPoFAzKsU3ihHPmtmmGxAAIFzkdmk1Ob0W08wQSF\nSTYDDvn6Jv5yLD0d1wIT0qU8p2inb+eQYvR9B5yVAC3nv3X1kDTokU1pqw/e\n5vfO3vlCc+XZY6q7Jk7fM6patxRyX7KtyP3B9kaswdTy3xn6kxLlChIY/sUl\nlaaKrFJtd35jEhxO6CdgQMkcqm/9ZqRKSQUR/ygoa920/LScbVtu3Zb97Kit\n04Uf\r\n=OLVM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXAi3xJO75pRLfQQFm2P0YYkZo0dZi7eSesvhkEVtfWQIgVvyDppeUx1X9cm939e0SdyCUcl8fex26A/LQsdQbwqo="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.6-0_1561463753699_0.8376807264858595"},"_hasShrinkwrap":false},"1.0.6-1":{"name":"@anujdatar/electron-context-menu","version":"1.0.6-1","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"readme":"# electron-context-menu\n\n![npm](https://img.shields.io/npm/v/@anujdatar/electron-context-menu.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu/badge)](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu)\n![Issues](https://img.shields.io/github/issues/anujdatar/electron-context-menu.svg)\n![GitHub](https://img.shields.io/github/license/anujdatar/electron-context-menu.svg)\n\nRight-click context menus for Electron.\nDetects context if click area is editable or not.\n\nBasic menu for uneditable areas:\n\n![copy_menu](/docs/copy_menu.png)\n\nMore complex menu for editable areas:\n\n![editor_menu](/docs/editor_menu.png)\n\nYou can also add prefixes and suffixes to either option.\nFour different menu options:\n\n  1. Simple menu with only \"copy\" option: copyContextMenu()\n  2. Simple menu with \"paste\" and \"selectall\" options: pasteContextMenu()\n  3. Simple menu with only \"page reload\" option: reloadContextMenu()\n  4. Customizable menus for editable text-areas: buildContextMenu()\n\n```js\nbuildContextMenu(prefix, suffix)\n  /*\n    function generates context menu inside a browserwindow of an electron app\n\n    Args:\n      prefix: Object - contains any prefix options required in the ctx menu\n      suffix: Object - contains and suffix options required in the ctx menu\n    Returns:\n      Menu: Electron Menu\n  */\n\n// Usage\n\nbuildContextMenu() // basic menu for editable areas\n// for menus with prefixs and or suffixes\nbuildContextMenu(prefix, suffix) // editor_menu - prefix and suffix\nbuildContextMenu({}, suffix) // editor_menu - no prefix, only suffix\n```\n\n## Installation\n\n```js\nnpm install @anujdatar/electron-context-menu\n```\n\n## Usage example\n\n```js\n// in renderer or preload script\nconst electron = require('electron')\nconst remote = electron.remote\nconst { buildContextMenu,\n  copyContextMenu,\n  pasteContextMenu,\n  reloadContextMenu } = remote.require('@anujdatar/electron-context-menu')\n\nwindow.addEventListener('contextmenu', (e) => {\n    e.preventDefault()\n\n    let ctxMenu\n    if (!e.target.closest('textarea, input, [contenteditable=\"true\"]')) {\n      // if click in uneditable area\n      if (window.getSelection().toString() === '') {\n        // if no text selected\n        ctxMenu = new reloadContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        // if text is selected\n        ctxMenu = new copyContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    } else {\n      // if click in editable text area\n      if (window.getSelection().toString() === '') {\n        // if no text is selected\n        ctxMenu = new pasteContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        ctxMenu = new buildContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    }\n  })\n```\n\n### Menu Customization\n\n  adding *prefix* or *suffix* menu items to the context menu\n  prefix and suffix: objects\n    @param: exists - boolean - *true* when you need to add menu prefix\n    @param menuItems - array - containing objects\n      menuItem = {\n        label - string - displayed in the menu,\n        click -function - activated when label clicked in ctxMenu\n      }\n\n  ```js\n  // example\n  prefix = {\n    exists: true,\n    menuItems: []\n  }\n  ```\n\n## Thanks\n\n[Jeff Wear](https://github.com/wearhere) and MixMax's [electron-editor-context-menu](https://github.com/mixmaxhq/electron-editor-context-menu)\n\n## Copyright and License\n\nCopyright 2019 Anuj Datar, licensed under MIT License\n\n## TODO\n\n1. Add contexts for other type of elements, eg. images, etc.\n2. Any ideas?\n","readmeFilename":"README.md","gitHead":"b6133d6f7af5a7a37ec2fc5219b110fa43dbe1df","_id":"@anujdatar/electron-context-menu@1.0.6-1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lBEbYxAiCLRxWqg0ATkUZyj5vFqiLZDiDWxC/OhX8RffOclgbWXa+qhZ8uZvFkCJukSR8xz9/gKWYPVk/hX5jw==","shasum":"677b6b4c5093ace0d31c6c5d96f68cf36e95d1cd","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.6-1.tgz","fileCount":10,"unpackedSize":43668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEhHwCRA9TVsSAnZWagAA6Q8P/3qSC2JvxBtSbyxnZ0hk\nc/O7V//nUFBv6trG7xV4vklURCHTplpgYs7uSuN9voUG3wJAGKWM2WygCVoj\nsHGuCDWTCTjLWn7HpuakMJicyG6OPhp/H2kG3prgDaN/3IgMkPXAbqpkpLb5\n3MSQVF1+y8lbzhPrxALlNxmt4wAcnRse+3cg5cbdR5j65R9qH+ecfX8f9/80\n0UYnNake1nJyky9dRvGhisk4kj837BrGo4syz/jp/K8j5Q7d86RbkbRINsGk\nRzcjccM1nwmqOmZfMqT1CJzSmFQtwRHvHD6ljv4c4KfJJX6JEHOGbhKWuO4e\njtyctI9h6eqfTQorkoT4/7BF8ejXAmz/pSjB1tTHys2p7A5PR7x0XFH/Fc7O\nHJqSWJbVFQSdcCIrC628QPV+eOlCLVsEYJFHpaUhJFGJRn+vU6T4YpCetivy\n+zbESHZcZc7ovqPj+xBuRF0vx8b9lxyH8sA1a0Pl99VE4pBU9BlHgx0NUAkR\nj56ZGz3KXpmJ3U/TGNrZzlsIEN/DJLJC7hMnEevPFeqg19nGlW8cn5hTxTVe\ncRsIt0fwTuFNI3PESfI7SJWpT1DxjVxMJrj61YVWPUjkLG8s2a0WNYU7H7a/\nZVfaA+G61Eh5vvgLT43PLwkOHmWpqKj+lzwCR8uwWtoCYQU8Vh2XXHV9ygmY\nPMk1\r\n=kW+n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC12yylxXDPPlKi/VzVq09/VDlbIz5Oa/p5W/ASGmi3PwIhAPqe8DLURwoNkSr0XJvuDX1wK9dZhi/uHU2KzTR29K3k"}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.6-1_1561465327814_0.24915821616768086"},"_hasShrinkwrap":false},"1.0.6-2":{"name":"@anujdatar/electron-context-menu","version":"1.0.6-2","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0","spellchecker":"^3.6.1"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"readme":"# electron-context-menu\n\n![npm](https://img.shields.io/npm/v/@anujdatar/electron-context-menu.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu/badge)](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu)\n![Issues](https://img.shields.io/github/issues/anujdatar/electron-context-menu.svg)\n![GitHub](https://img.shields.io/github/license/anujdatar/electron-context-menu.svg)\n\nRight-click context menus for Electron.\nDetects context if click area is editable or not.\n\nBasic menu for uneditable areas:\n\n![copy_menu](/docs/copy_menu.png)\n\nMore complex menu for editable areas:\n\n![editor_menu](/docs/editor_menu.png)\n\nYou can also add prefixes and suffixes to either option.\nDifferent menu options:\n\n- Simple menu with only \"copy\" option: **copyContextMenu()**\n- Simple menu with \"paste\" and \"selectall\" options: **pasteContextMenu()**\n- Simple menu with only \"page reload\" option: **reloadContextMenu()**\n- Menu when spell-check does not have suggestions: **noSuggestionsMenu()**\n- Customizable menus for editable text-areas: **buildContextMenu()**\n\n```js\nbuildContextMenu(prefix, suffix)\n  /*\n    function generates context menu inside a browserwindow of an electron app\n\n    Args:\n      prefix: Object - contains any prefix options required in the ctx menu\n      suffix: Object - contains and suffix options required in the ctx menu\n    Returns:\n      Menu: Electron Menu\n  */\n\n// Usage\n\nbuildContextMenu() // basic menu for editable areas\n// for menus with prefixs and or suffixes\nbuildContextMenu(prefix, suffix) // editor_menu - prefix and suffix\nbuildContextMenu({}, suffix) // editor_menu - no prefix, only suffix\n```\n\n## Installation\n\n```js\nnpm install @anujdatar/electron-context-menu\n```\n\n## Usage example\n\n```js\n// in renderer or preload script\nconst electron = require('electron')\nconst remote = electron.remote\nconst { buildContextMenu,\n  copyContextMenu,\n  pasteContextMenu,\n  reloadContextMenu } = remote.require('@anujdatar/electron-context-menu')\n\nwindow.addEventListener('contextmenu', (e) => {\n    e.preventDefault()\n\n    let ctxMenu\n    if (!e.target.closest('textarea, input, [contenteditable=\"true\"]')) {\n      // if click in uneditable area\n      if (window.getSelection().toString() === '') {\n        // if no text selected\n        ctxMenu = new reloadContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        // if text is selected\n        ctxMenu = new copyContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    } else {\n      // if click in editable text area\n      if (window.getSelection().toString() === '') {\n        // if no text is selected\n        ctxMenu = new pasteContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        ctxMenu = new buildContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    }\n  })\n```\n\n### Menu Customization\n\n  adding *prefix* or *suffix* menu items to the context menu\n  prefix and suffix: objects\n    @param: exists - boolean - *true* when you need to add menu prefix\n    @param menuItems - array - containing objects\n      menuItem = {\n        label - string - displayed in the menu,\n        click -function - activated when label clicked in ctxMenu\n      }\n\n  ```js\n  // example\n  prefix = {\n    exists: true,\n    menuItems: []\n  }\n  ```\n\n## Thanks\n\n[Jeff Wear](https://github.com/wearhere) and MixMax's [electron-editor-context-menu](https://github.com/mixmaxhq/electron-editor-context-menu)\n\n## Copyright and License\n\nCopyright 2019 Anuj Datar, licensed under MIT License\n\n## TODO\n\n1. Add contexts for other type of elements, eg. images, etc.\n2. Any ideas?\n","readmeFilename":"README.md","gitHead":"5037122aa239ac10fc9c97579b406cd3cec8b9b2","_id":"@anujdatar/electron-context-menu@1.0.6-2","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-NTF+EAcAyWKkCE0NoZ5MsE4WQCgh/v5FRd6GxmqNbF+yKzXBhXkzEljNG/oMecw3N1mBgM3UgSdI5er+jo6/2g==","shasum":"330d4a6a13262b61f912ed6a61f84d8686e939cd","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.6-2.tgz","fileCount":14,"unpackedSize":48824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE4JsCRA9TVsSAnZWagAAakoP+gLo0Eq6RmNw5akd7HJo\nJ9FjZ5hOdVN46pqRBIoiuA0wtKSS2Dia4tno+tHqgubnhY/hBfP6n/uU0qpD\nvb79HSjlPsoajMu2pzrdwPM2Xx1ArPtO6H1dofvUoJrxDM58zsFj4k/Phhll\nO90fSH7p0tmflxXWjjPiGVNV/rapcdl9oi9hFD//xaeyxZQX+XAZQigNaktf\nX8IXBqi8jj40QhCxW+Kq2t7Xa+9gmJo0UwgFiCST5ejsFch94BwgCblqPGJH\nlMQJ4g7oiXRiZ+OwARoFX9zxygh3l07VczY+RPRMtk3v54OvHt8pXu4w5lrs\nNRKc7Dd4UZfftrX+dC7yYUxuFa6lECTE/TnECLu2C2V/T43iWAelU+K4pqE5\nTYUMnc5tuXBVAiF2SlF45W3mCyxRL30nYKEAaloyH1uOIb5ZWupkUKxH6hrr\naONsK4mgzanps6mBuOkO2jMFSkNYUhLIib1MVsjet41qxjO/+dhCQOjqiaQV\nY5pyLSKDekOVqpcVSslx3rC+0NWJFPdT29oQd4q0Z2qfSwNduwBFsE89nurF\n6v6AaCx71uU6FZcnL56x7YsOKs8PquFV5pCqBRAD85f6NiNceW8KoIA9hIeO\nXLrydeH15kCZYwGpVpAopwUIK3/t/yycB4QmiJ/MSGOPLghgjHSAqCG6egxU\nfU3G\r\n=/DCS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFS3uIwbBcJ4FVEJBnu7cqVe7BAtbsWZBkaKHfzqxZMcAiEAxpq0NJu8Tdkpcd28BUlSONwD54xRmnGTqgckUgBuGpA="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.6-2_1561559660073_0.706653605320605"},"_hasShrinkwrap":false},"1.0.6-3":{"name":"@anujdatar/electron-context-menu","version":"1.0.6-3","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"build":"babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0"},"readme":"# electron-context-menu\n\n![npm](https://img.shields.io/npm/v/@anujdatar/electron-context-menu.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu/badge)](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu)\n![Issues](https://img.shields.io/github/issues/anujdatar/electron-context-menu.svg)\n![GitHub](https://img.shields.io/github/license/anujdatar/electron-context-menu.svg)\n\nRight-click context menus for Electron.\nDetects context if click area is editable or not.\n\nBasic menu for uneditable areas:\n\n![copy_menu](/docs/copy_menu.png)\n\nMore complex menu for editable areas:\n\n![editor_menu](/docs/editor_menu.png)\n\nYou can also add prefixes and suffixes to either option.\nDifferent menu options:\n\n- Simple menu with only \"copy\" option: **copyContextMenu()**\n- Simple menu with \"paste\" and \"selectall\" options: **pasteContextMenu()**\n- Simple menu with only \"page reload\" option: **reloadContextMenu()**\n- Menu when spell-check does not have suggestions: **noSuggestionsMenu()**\n- Customizable menus for editable text-areas: **buildContextMenu()**\n\n```js\nbuildContextMenu(prefix, suffix)\n  /*\n    function generates context menu inside a browserwindow of an electron app\n\n    Args:\n      prefix: Object - contains any prefix options required in the ctx menu\n      suffix: Object - contains and suffix options required in the ctx menu\n    Returns:\n      Menu: Electron Menu\n  */\n\n// Usage\n\nbuildContextMenu() // basic menu for editable areas\n// for menus with prefixs and or suffixes\nbuildContextMenu(prefix, suffix) // editor_menu - prefix and suffix\nbuildContextMenu({}, suffix) // editor_menu - no prefix, only suffix\n```\n\n## Installation\n\n```js\nnpm install @anujdatar/electron-context-menu\n```\n\n## Usage example\n\n```js\n// in renderer or preload script\nconst electron = require('electron')\nconst remote = electron.remote\nconst { buildContextMenu,\n  copyContextMenu,\n  pasteContextMenu,\n  reloadContextMenu } = remote.require('@anujdatar/electron-context-menu')\n\nwindow.addEventListener('contextmenu', (e) => {\n    e.preventDefault()\n\n    let ctxMenu\n    if (!e.target.closest('textarea, input, [contenteditable=\"true\"]')) {\n      // if click in uneditable area\n      if (window.getSelection().toString() === '') {\n        // if no text selected\n        ctxMenu = new reloadContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        // if text is selected\n        ctxMenu = new copyContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    } else {\n      // if click in editable text area\n      if (window.getSelection().toString() === '') {\n        // if no text is selected\n        ctxMenu = new pasteContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      } else {\n        ctxMenu = new buildContextMenu()\n        ctxMenu.popup(remote.getCurrentWindow())\n      }\n    }\n  })\n```\n\n### Menu Customization\n\n  adding *prefix* or *suffix* menu items to the context menu\n  prefix and suffix: objects\n    @param: exists - boolean - *true* when you need to add menu prefix\n    @param menuItems - array - containing objects\n      menuItem = {\n        label - string - displayed in the menu,\n        click -function - activated when label clicked in ctxMenu\n      }\n\n  ```js\n  // example\n  prefix = {\n    exists: true,\n    menuItems: []\n  }\n  ```\n\n## Thanks\n\n[Jeff Wear](https://github.com/wearhere) and MixMax's [electron-editor-context-menu](https://github.com/mixmaxhq/electron-editor-context-menu)\n\n## Copyright and License\n\nCopyright 2019 Anuj Datar, licensed under MIT License\n\n## TODO\n\n1. Add contexts for other type of elements, eg. images, etc.\n2. Any ideas?\n","readmeFilename":"README.md","gitHead":"22cbf0ad6324c4d963fac9434f3630aa61dfbe1a","_id":"@anujdatar/electron-context-menu@1.0.6-3","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-np9rywJiYUbLjKMeqnB6J+lMiA3+xN9niChi0JMTJhqb9uumFaBWnzsakFoV5/k4EUPv0f+ADRScWlEOFX4BBA==","shasum":"8990b5a263bf500abebf041d2ec0f518d44bd709","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.0.6-3.tgz","fileCount":14,"unpackedSize":48706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE4dGCRA9TVsSAnZWagAAf2QP/RhQxBc51VKBhAeJ7ukt\nXacz8KTuuujbDWy/6GjYy0wQ1BlIkiJ8boyOMwRmuHjUQ7pxSONbBtSB1Rf4\njz5PL8+pPwuSxiUN6ikkjT08uyTe6aWQ8Kdff/TYVWdhhT2bsA924TrAkF/u\nx84t0iTVwsI4vPky3GozgXH2nGlNvlxMU7r9NfCM6a+UZRWy4iOejMA8Xn/I\nFZhwOZmQPQqfznbooxsef/NtScwlavU/Q4wC7nR9/t70Gx0AmvOczft6TePS\n5Qe1SrNEZTirPP6WRixaKnhD87O9m3SXa0a1itXJEhqs0tcJAJQyxGYPdNzX\nDd0sSYkUHow7N0AIzTcEiCrpc4xH5cAjBFwHuq1ggbMroJaHCE2ffiAJKJhW\nlnfNmX0jRu6Qq0U6kxHphTVrxy7LnkfGnBCwk4SQe0NDFpaLVRZfeNy4dGK4\njOboyPywYDgep/TohLTxDeAstc/B3eYS83PWbYft13pqn9vw0c8CGOPzy7do\nMR/YwvovVmndjd9A/YI8SDFJXgy1Vzk47B+nLxr+5F4TN+e+Fgh28PuEhlgo\nkSMxMmDW9vHUnSh2BBkm3bSR0q5eh8iwXI49PCFT7Uk4icfMznlA1knNKBUT\n9yB37ULhjDE7OBcRD2z957mvs7e4AHUu+9lagqNqHlDUpQT5k7W48VSqsEyu\nGlCU\r\n=hyPs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAScgO+2N9mcBO060UAnsw9aP3STSLhkGH4SzMG7MyTeAiBA0sC/VShDZBHoI8U7nkGYn0WNd5C0cEpPfvMQmdvuvQ=="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.0.6-3_1561560902099_0.9099581311069187"},"_hasShrinkwrap":false},"1.1.0":{"name":"@anujdatar/electron-context-menu","version":"1.1.0","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"clean-slate":"rimraf lib/","build":"npm run clean-slate && babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**","install-example":"cd example && npm install","start-example":"cd example && npm start"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0","rimraf":"^2.6.3"},"gitHead":"857f5418ac7c90a44fa831eda6087834dc7e5939","_id":"@anujdatar/electron-context-menu@1.1.0","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-j0RiixtoxOATOoJ0AwghDXcN0A6+d0jVNESpONB3OAGxegyUXE5snEpfSmoRC9fYq2FCTVncnf22ldGhncYeVQ==","shasum":"e4b7172e3123f9f7b7e0079671be9946eecf16cb","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.1.0.tgz","fileCount":6252,"unpackedSize":195502459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHdKACRA9TVsSAnZWagAAvyMP/RKEXQ+GYMsy6LWQ27fn\nBBiv6S0y0EqPLxGKDt7VOY2/wMHwIn2z8fwqgOq956O6xAD9JH7MPOT8G4/X\nitpXCNEBTMvISlFaFIQGnDLgOKbFlKY5PD6wMlvb1JeK07C30zYwEdLf2zvn\nLM4D2zOhPwqo1D/3+NAGbVlQxeEBeaUPlq9YKMPjKqh7pzc/FCYg71xnYoEp\nACkfBVRskoQwhiqFzglhf4VKgeqkle5iYuzfzLr1rSdYbSKSMjV8kD+RpAND\nLKjAVBg97H9VBgiGJ3N0zEX3sp1ppMc/K+gParOZp6vF09rVEmi3OmlCL9Sm\ncGIKlbtdCg8onBP4oFR8UqvZW4YSHlfOea/chLQSq4ej1uyDa+ruNHfgn/s4\ncfKrvSrS489HSh2dxJmZvCM0PkYnMV9QUbZxU+oP0MFhOMJHq6WImfqVcSKu\nOHyuYI0Grh4Ub5QUPEOO89kwZgPTNCDfw8ixgHeOenWndoIpWsC1ZSP4KwLp\n9m4P+6H5ENQMvJUtiucoI9SIIBdPgtHb7dRwuuBtoZvBTbzZE17cbH2h/Rw+\nDIHbrUtzqXm7g3/updqrgG072TBDk6C0Uc25oLTkDLqukBPXmlTC9HSJ/E6T\nW5hKLCAv7dexSdHhok+S5/s8YDFDYB0t+K9Xxpgf/4LiWnAUelQlaqWAm6hi\n9Ybx\r\n=GOv0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj/CvJnkrif4BBHGxArvJyLjISVwDCYM7CtUOO+ZutKwIgUV/rQqTrruHI+DCo4yZPscgSQw9VMBTqEKRChPLp+tM="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.1.0_1562235516943_0.6181391304977228"},"_hasShrinkwrap":false},"1.1.1":{"name":"@anujdatar/electron-context-menu","version":"1.1.1","description":"Building simple context menus for Electron","main":"lib/index.js","scripts":{"clean-slate":"rimraf lib/","build":"npm run clean-slate && babel src --out-dir lib","test":"echo \"No test specified\"","lint":"eslint --config .eslintrc.js src/**"},"keywords":["Electron","ContextMenus"],"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"homepage":"https://github.com/anujdatar/electron-context-menu#readme","dependencies":{"@babel/polyfill":"^7.4.4","lodash.clonedeep":"^4.5.0","lodash.defaults":"^4.2.0","lodash.isempty":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","eslint":"^6.0.1","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-node":"^9.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0","rimraf":"^2.6.3"},"gitHead":"00ad90dca35dbe8a0033b53132521a33748dc7c3","_id":"@anujdatar/electron-context-menu@1.1.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-nCaGpp5dyQ7HZ11QihY1kNZ2GNN6m6j2S5zK6qF44Cdc4oftLXBaIK0VcREP6a7G/4T4f8JCYTlxGbM65TLccw==","shasum":"a3ab8f23c9d05c5d12d0d449f3c275d5a2024a98","tarball":"https://registry.npmjs.org/@anujdatar/electron-context-menu/-/electron-context-menu-1.1.1.tgz","fileCount":13,"unpackedSize":114520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHeYoCRA9TVsSAnZWagAAzv4P/jxjsWrEKXZbldM12x1s\naX8WWR5aac+Yk76lW4DVWnUWl9B9K2sM0+Tyw9MhqmlUqq6lqfefUXd1PRhn\nGwhFLeTVA09i6nNALM48faXtuEfvpl35XSP2f75elvvJNqGPtlm5bDEbwOYK\n195SQ9d1mmy2h0cE8d4yJt4EnTxVgug/D4GcreVOkVoYaG/zNB5ZYR9ffwaO\n9ZaoZlM2tCF5U0RdCpye/e4xrpjN+ZcSWkiio211vTEdrvzrY6DgmMvg1H9n\nfP7yJW+aDParFGCItMK9AnSp1QxQqiPijLJR61wXQRfyTYkSE1c+qy9gCuQx\nLFZuHbYUQqE4YPyX3SElXT9o9xOvH2e6EOMSK53Tmv2SzbYKSfM96aG3RKXh\n55bAh7BL+rRQb51KUFjjtIWMPVK9WWZEx+W+LxHRq1qJSJ88JdMAoRsjFpGm\nfHMYqwiTlAWPxrRefKMR5NXXeIblSK9Muh2kTsuaVOAY2HR4XjrvNlYPLiK1\nwPyNjbBol8fq6VuAZ7/PP59vnaAeY1oRXGkCfg6Ni0dIy1vlgmcK2P/SV8rQ\nTk4cPRW5Y5dJbuEMDfgR4KqNRBm+4G8kOmEYX1TNM7n00ASRU88SfQe8DZQG\nJveAs6e8NKi4aSbjHc3CfB72FFu1Le06lN7+VIf6VmJxnDs1wZi/+Wmm8/cM\nacp7\r\n=99H9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFDZC3oFfMUb1UMHNe5GaN4MjaRHtRyTYQ9JNO2LkmGAiEAp9NyK9DG7vCZfoHHgtd3spHrTCD1xPSPkinnzkmBD18="}]},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"_npmUser":{"name":"anujdatar","email":"anuj.datar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-context-menu_1.1.1_1562240552142_0.857468457599464"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-21T13:16:45.937Z","1.0.1":"2019-06-21T13:16:46.075Z","modified":"2022-04-04T14:25:46.867Z","1.0.2":"2019-06-21T20:46:26.654Z","1.0.3":"2019-06-21T22:25:13.227Z","1.0.4":"2019-06-25T10:27:45.070Z","1.0.5":"2019-06-25T10:58:39.129Z","1.0.6-0":"2019-06-25T11:55:53.832Z","1.0.6-1":"2019-06-25T12:22:08.073Z","1.0.6-2":"2019-06-26T14:34:20.224Z","1.0.6-3":"2019-06-26T14:55:02.315Z","1.1.0":"2019-07-04T10:18:39.656Z","1.1.1":"2019-07-04T11:42:32.267Z"},"maintainers":[{"name":"anujdatar","email":"anuj.datar@gmail.com"}],"description":"Building simple context menus for Electron","homepage":"https://github.com/anujdatar/electron-context-menu#readme","keywords":["Electron","ContextMenus"],"repository":{"type":"git","url":"git+https://github.com/anujdatar/electron-context-menu.git"},"author":{"name":"Anuj Datar","email":"anuj.datar@gmail.com"},"bugs":{"url":"https://github.com/anujdatar/electron-context-menu/issues"},"license":"MIT","readme":"# electron-context-menu\n\n![npm](https://img.shields.io/npm/v/@anujdatar/electron-context-menu.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu/badge)](https://www.codefactor.io/repository/github/anujdatar/electron-context-menu)\n![Issues](https://img.shields.io/github/issues/anujdatar/electron-context-menu.svg)\n![GitHub](https://img.shields.io/github/license/anujdatar/electron-context-menu.svg)\n\nRight-click context menus for Electron.\nDetects context if click area is editable or not.\n\nBasic menu for uneditable areas:\n\n![copy_menu](/docs/copy_menu.png)\n\nMore complex menu for editable areas with spellcheck options:\n\n![spellcheck_menu](/docs/spellcheck_menu.png)\n\nModule exports a function to build electron context menus and a set of templates and classes to help build/customize said menus. Module exports:\n\nMenu templates:\n\n- copy: just \"copy\" option in menu\n- paste: \"paste\" and \"selectAll\"\n- reload: just \"page reload\"\n- editor: \"cut/copy/paste\" and \"selectAll\"\n- noSuggest: disabled option for when spell checker cannot find any suggested corrections\n\nClasses:\n\n- SuggestionMenuItem: constructor for single menu item for one spelling correction at a time, accepts string\n- MenuTemplate: constructor for menu prefix or suffix object\n\nFunction:\n\n- BuildContextMenu(): builds context menus based on arguments\n\n```js\nBuildContextMenu(menuTemplate, prefix, suffix)\n  /*\n    function generates context menu inside a browserwindow of an electron app\n\n    Args:\n      menuTemplate (optional): Array - contains a list of menu objects. defaults to editor menu template if no argument is passed\n      prefix (optional): Object - contains any prefix options required in the ctx menu\n      suffix (optional): Object - contains and suffix options required in the ctx menu\n    Returns:\n      Menu: Electron Menu\n  */\n\n// Usage\n\nbuildContextMenu() or buildContextMenu(menuTemplates.editor) // editor_menu for editable textareas\nbuildContextMenu(menuTemplates.paste) // paste_menu\n// for menus with prefixs and or suffixes\nbuildContextMenu(menuTemplates.editor, prefix, suffix) // editor_menu - prefix and suffix\nbuildContextMenu(menuTemplates.copy, prefix) // copy_menu and prefix only\nbuildContextMenu(menuTemplates.editor, {}, suffix) // editor_menu w/ only suffix, no prefix\n```\n\n## Installation and testing\n\n### Installing and using package with your project\n\n```bash\nnpm install @anujdatar/electron-context-menu\n```\n\n### testing the included example electron app\n\n```bash\ngit clone https://github.com/anujdatar/electron-context-menu-example.git\ncd electron-context-menu-example\nnpm install\n\nnpm start\n```\n\ninstalling node modules for example also rebuilds node-spellchecker using electron-rebuild.\n\n## Usage example\n\nSee [example-repository](https://github.com/anujdatar/electron-context-menu-example.git) for more details\n\n```js\n// in renderer or preload script\nconst electron = require('electron')\nconst remote = electron.remote\nconst { BuildContextMenu, menuTemplates } = require('@anujdatar/electron-context-menu')\n\nwindow.addEventListener('contextmenu', (e) => {\n    e.preventDefault()\n\n    let ctxMenu\n    if (!e.target.closest('textarea, input, [contenteditable=\"true\"]')) {\n      // if click in uneditable area\n      if (window.getSelection().toString() === '') {\n        // if no text selected\n        ctxMenu = new BuildContextMenu(menuTemplates.reload)\n      } else {\n        // if text is selected\n        ctxMenu = new BuildContextMenu(menuTemplates.copy)\n      }\n    } else {\n      // if click in editable text area\n      if (window.getSelection().toString() === '') {\n        // if no text is selected\n        ctxMenu = new BuildContextMenu(menuTemplates.paste)\n      } else {\n        ctxMenu = new BuildContextMenu()\n      }\n    }\n    // popup menu\n    ctxMenu.popup(remote.getCurrentWindow())\n  })\n```\n\n### Menu Customization\n\n  passing custom template\n  menuTemplate: Array containing Electron.MenuItem(s)\n\n  adding *prefix* or *suffix* menu items to the context menu\n  prefix and suffix: objects\n    @param: exists - boolean - *true* when you need to add menu prefix\n    @param menuItems - array - containing objects\n      menuItem = {\n        label - string - displayed in the menu,\n        click -function - activated when label clicked in ctxMenu\n      }\n\n  ```js\n  // examples of function params for customization\n  menuTemplate = [\n    {\n      label: 'Copy',\n      role: 'copy'\n    },\n    {\n      role: 'paste'\n    },\n    {\n      label: 'Some function',\n      click: function () {\n        //do something\n        console.log('Did something')\n      }\n    }\n  ]\n\n  prefix = {\n    exists: true,\n    menuItems: []\n  }\n  ```\n\n## Thanks\n\n[Jeff Wear](https://github.com/wearhere) and MixMax's [electron-editor-context-menu](https://github.com/mixmaxhq/electron-editor-context-menu)\n\n## Copyright and License\n\nCopyright 2019 Anuj Datar, licensed under MIT License\n\n## TODO\n\n1. Add contexts for other type of elements, eg. images, etc.\n2. Any ideas?\n","readmeFilename":"README.md"}