22import {
33 FaSave , FaUndo , FaRedo , FaTrash , FaFileImport , FaPlus , FaDownload , FaEdit , FaRegTimesCircle , FaHistory ,
44 FaHammer , FaBug , FaBomb , FaToggleOn , FaThermometerEmpty , FaTrashRestore , FaCogs , FaPencilAlt , FaTerminal ,
5+ FaCopy , FaPaste ,
56} from 'react-icons/fa' ;
67
78import {
@@ -12,7 +13,7 @@ import {
1213import {
1314 createNode , editElement , deleteElem , downloadImg , saveAction , saveGraphMLFile ,
1415 createFile , readFile , clearAll , undo , redo , viewHistory , resetAfterClear ,
15- toggleServer , optionModalToggle , toggleLogs , contribute ,
16+ toggleServer , optionModalToggle , toggleLogs , contribute , copySelected , pasteClipboard ,
1617 // openSettingModal,
1718} from './toolbarFunctions' ;
1819
@@ -117,6 +118,25 @@ const toolbarList = (state, dispatcher) => [
117118 hotkey : 'Delete,Backspace,Del,Clear' ,
118119 } ,
119120 { type : 'vsep' } ,
121+ {
122+ type : 'action' ,
123+ text : 'Copy' ,
124+ icon : FaCopy ,
125+ action : copySelected ,
126+ active : state . curGraphInstance && state . eleSelected ,
127+ visibility : true ,
128+ hotkey : 'Ctrl+C' ,
129+ } ,
130+ {
131+ type : 'action' ,
132+ text : 'Paste' ,
133+ icon : FaPaste ,
134+ action : pasteClipboard ,
135+ active : state . curGraphInstance && state . clipboard . length > 0 ,
136+ visibility : true ,
137+ hotkey : 'Ctrl+V' ,
138+ } ,
139+ { type : 'vsep' } ,
120140 {
121141 type : 'action' ,
122142 text : 'History' ,
0 commit comments