-
Notifications
You must be signed in to change notification settings - Fork 496
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
Related to #866
- Loading branch information
1 parent
cf1e2a2
commit 8024acc
Showing
14 changed files
with
565 additions
and
608 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
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
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,19 @@ | ||
import { | ||
getCanvasEntries, | ||
getDiagramFindEntries, | ||
getSelectionEntries, | ||
getToolEntries, | ||
getUndoRedoEntries | ||
} from '../getEditMenu'; | ||
|
||
export function getCmmnEditMenu(state) { | ||
return [ | ||
getUndoRedoEntries(state), | ||
getToolEntries(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.