-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump BPMN and DMN modeling dependencies / integrate implicit keyboard binding #4620
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7b129b8
deps: bump to diagram-js@15.0.0 / dmn-js@17.0.0 / bpmn-js@18.0.0
nikku aab1fd0
feat: integrate implicit keyboard binding into BPMN and DMN editors
jarekdanielak 86ddafa
deps: update to `bpmn-js-properties-panel@5.28.0`
nikku 14d1a74
deps: update to `dmn-js-properties-panel@3.7.0`
nikku a84b093
chore(CHANGELOG): update
jarekdanielak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -216,6 +216,8 @@ export class BpmnEditor extends CachedComponent { | |
listen(fn) { | ||
const modeler = this.getModeler(); | ||
|
||
modeler[fn]('attach', this.handleAttach); | ||
|
||
[ | ||
'import.done', | ||
'saveXML.done', | ||
|
@@ -225,13 +227,7 @@ export class BpmnEditor extends CachedComponent { | |
'elements.copied', | ||
'propertiesPanel.focusin', | ||
'propertiesPanel.focusout', | ||
'directEditing.activate', | ||
'directEditing.deactivate', | ||
'searchPad.closed', | ||
'searchPad.opened', | ||
'popupMenu.opened', | ||
'popupMenu.closed', | ||
'elementTemplates.select' | ||
'canvas.focus.changed' | ||
].forEach((event) => { | ||
modeler[fn](event, this.handleChanged); | ||
}); | ||
|
@@ -309,6 +305,12 @@ export class BpmnEditor extends CachedComponent { | |
}); | ||
}; | ||
|
||
handleAttach = (event) => { | ||
const modeler = this.getModeler(); | ||
|
||
modeler.get('canvas').focus(); | ||
}; | ||
|
||
handleError = (event) => { | ||
const { | ||
error | ||
|
@@ -434,38 +436,41 @@ export class BpmnEditor extends CachedComponent { | |
|
||
const inputActive = isInputActive(); | ||
|
||
const canvasFocused = modeler.get('canvas').isFocused(); | ||
|
||
const newState = { | ||
jarekdanielak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
align: selectionLength > 1, | ||
appendElement: !inputActive, | ||
appendElement: canvasFocused, | ||
canvasFocused, | ||
close: true, | ||
copy: !!selectionLength, | ||
cut: false, | ||
createElement: !inputActive, | ||
defaultCopyCutPaste: inputActive, | ||
defaultUndoRedo: inputActive, | ||
createElement: canvasFocused, | ||
defaultCopyCutPaste: !canvasFocused, | ||
defaultUndoRedo: !canvasFocused, | ||
dirty, | ||
distribute: selectionLength > 2, | ||
editLabel: !inputActive && !!selectionLength, | ||
editLabel: canvasFocused && selectionLength === 1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good one! |
||
exportAs: EXPORT_AS, | ||
find: !inputActive, | ||
globalConnectTool: !inputActive, | ||
handTool: !inputActive, | ||
find: canvasFocused, | ||
globalConnectTool: canvasFocused, | ||
handTool: canvasFocused, | ||
inputActive, | ||
lassoTool: !inputActive, | ||
moveCanvas: !inputActive, | ||
moveToOrigin: !inputActive, | ||
moveSelection: !inputActive && !!selectionLength, | ||
lassoTool: canvasFocused, | ||
moveCanvas: canvasFocused, | ||
moveToOrigin: canvasFocused, | ||
moveSelection: canvasFocused && !!selectionLength, | ||
paste: !modeler.get('clipboard').isEmpty(), | ||
platform: 'platform', | ||
propertiesPanel: true, | ||
redo: commandStack.canRedo(), | ||
removeSelected: !!selectionLength || inputActive, | ||
replaceElement: !!selectionLength && selectionLength == 1 && !inputActive, | ||
redo: canvasFocused && commandStack.canRedo(), | ||
removeSelected: canvasFocused && !!selectionLength, | ||
replaceElement: canvasFocused && selectionLength == 1, | ||
save: true, | ||
selectAll: true, | ||
selectAll: canvasFocused || inputActive, | ||
setColor: !!selectionLength, | ||
spaceTool: !inputActive, | ||
undo: commandStack.canUndo(), | ||
spaceTool: canvasFocused, | ||
undo: canvasFocused && commandStack.canUndo(), | ||
zoom: true | ||
}; | ||
|
||
|
@@ -871,6 +876,9 @@ export class BpmnEditor extends CachedComponent { | |
}, | ||
propertiesPanel: { | ||
layout: layout.propertiesPanel | ||
}, | ||
keyboard: { | ||
bind: false | ||
} | ||
}); | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking for all plugins relying on inputActive. I'd say let's leave the state property as is, but the shortcuts don't need to rely on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, as just discovered with @jarekdanielak, the
getEditMenu
still depends on inputActive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't backwards compatibility covered via https://github.com/camunda/camunda-modeler/pull/4620/files/725723408e34c74c5ab7ccb2cefb2cf3b2f2d766#diff-8d663070a9293c2317ca1a7dff4fa8a7004cbd6855d29d128635aad4fa20d67cR475?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it had been, the properties panel select all wouldn't have broken #4620 (comment)