-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): editors are responsible for edit menu
- Loading branch information
1 parent
c5c5f1d
commit ce2c47f
Showing
16 changed files
with
646 additions
and
747 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { | ||
getCanvasEntries, | ||
getDiagramFindEntries, | ||
getSelectionEntries, | ||
getToolEntries, | ||
getUndoRedoEntries | ||
} from '../getEditMenu'; | ||
|
||
function getCopyPasteEntries({ | ||
canCopy, | ||
canPaste | ||
}) { | ||
return [{ | ||
label: 'Copy', | ||
accelerator: 'CommandOrControl+C', | ||
enabled: canCopy, | ||
action: 'copy' | ||
}, { | ||
label: 'Paste', | ||
accelerator: 'CommandOrControl+V', | ||
enabled: canPaste, | ||
action: 'paste' | ||
}]; | ||
} | ||
|
||
function getAlignDistributeEntries({ | ||
align, | ||
distribute | ||
}) { | ||
return [{ | ||
label: 'Align Elements', | ||
enabled: align, | ||
submenu: [ 'Left', 'Right', 'Center', 'Top', 'Bottom', 'Middle' ].map(direction => { | ||
return { | ||
label: `Align ${direction}`, | ||
enabled: align, | ||
action: 'alignElements', | ||
options: { | ||
type: direction.toLowerCase() | ||
} | ||
}; | ||
}) | ||
}, { | ||
label: 'Distribute Elements', | ||
enabled: distribute, | ||
submenu: [{ | ||
label: 'Distribute Horizontally', | ||
enabled: distribute, | ||
action: 'distributeHorizontally' | ||
}, { | ||
label: 'Distribute Vertically', | ||
enabled: distribute, | ||
action: 'distributeVertically' | ||
}] | ||
}]; | ||
} | ||
|
||
export function getBpmnEditMenu(state) { | ||
return [ | ||
getUndoRedoEntries(state), | ||
getCopyPasteEntries(state), | ||
getToolEntries(state), | ||
getAlignDistributeEntries(state), | ||
getDiagramFindEntries(state), | ||
[ | ||
...getCanvasEntries(state), | ||
...getSelectionEntries(state) | ||
] | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.