Skip to content
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 5 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,33 @@ ___Note:__ Yet to be released changes appear here._

* `FEAT`: show update button if update available ([#4606](https://github.com/camunda/camunda-modeler/pull/4606))
* `FEAT`: make bottom panel toggleable via keyboard ([#4516](https://github.com/camunda/camunda-modeler/issues/4516))
* `FEAT`: trigger core editor keyboard shortcuts on canvas focus only ([#4620](https://github.com/camunda/camunda-modeler/pull/4620))
* `FEAT`: integrate implicit keyboard binding into BPMN and DMN editors ([#4620](https://github.com/camunda/camunda-modeler/pull/4620))
* `FEAT`: expose `canvasFocus` state to menu actions ([#4620](https://github.com/camunda/camunda-modeler/pull/4620))
* `CHORE`: remove reset properties panel menu item ([#4516](https://github.com/camunda/camunda-modeler/issues/4516))
* `DEPS`: update to `electron@33.0.0` ([#4609](https://github.com/camunda/camunda-modeler/pull/4609))
* `DEPS`: update to `@bpmn-io/variable-outline@1.0.3`
* `DEPS`: update to `@bpmn-io/form-js@1.12.0`
* `DEPS`: update to `diagram-js@15.2.2`
* `DEPS`: update to `bpmn-js@18.0.0`
* `DEPS`: update to `dmn-js@17.0.3`
* `DEPS`: update to `camunda-bpmn-js@5.0.0`
* `DEPS`: update to `camunda-dmn-js@3.0.0`
* `DEPS`: update to `@bpmn-io/properties-panel@3.25.0`
* `DEPS`: update to `bpmn-js-properties-panel@5.28.0`
* `DEPS`: update to `dmn-js-properties-panel@3.7.0`

### BPMN

* `FEAT`: make variables tab accessible via the application footer ([#4516](https://github.com/camunda/camunda-modeler/issues/4516))
* `FEAT`: support task listeners ([bpmn-io/bpmn-js-properties-panel#1088](https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1088))
* `FIX`: prevent long element name from shrinking icon ([#4505](https://github.com/camunda/camunda-modeler/issues/4505))
* `FIX`: correct default extension used when saving Camunda 8 BPMN diagrams ([#4661](https://github.com/camunda/camunda-modeler/issues/4661))

### DMN

* `FIX`: correct changing literal expression name from properties panel ([#4684](https://github.com/camunda/camunda-modeler/issues/4684))

## 5.29.0

### General
Expand Down
22 changes: 11 additions & 11 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@bpmn-io/dmn-migrate": "^0.5.0",
"@bpmn-io/extract-process-variables": "^1.0.0",
"@bpmn-io/form-js": "^1.12.0",
"@bpmn-io/properties-panel": "^3.24.1",
"@bpmn-io/properties-panel": "^3.25.0",
"@bpmn-io/replace-ids": "^0.2.0",
"@bpmn-io/variable-outline": "^1.0.3",
"@camunda/execution-platform": "^0.3.2",
Expand All @@ -28,28 +28,28 @@
"@ibm/plex": "^6.4.1",
"@sentry/browser": "^8.0.0",
"@sentry/integrations": "^7.108.0",
"bpmn-js": "^17.11.1",
"bpmn-js-element-templates": "^2.3.0",
"bpmn-js-properties-panel": "^5.25.0",
"bpmn-js": "^18.0.0",
"bpmn-js-element-templates": "^2.2.1",
"bpmn-js-properties-panel": "^5.28.0",
"bpmn-js-tracking": "^0.6.0",
"bpmn-moddle": "^9.0.1",
"camunda-bpmn-js": "^4.20.2",
"camunda-bpmn-js": "^5.0.0",
"camunda-bpmn-moddle": "^7.0.1",
"camunda-cmmn-moddle": "^1.0.0",
"camunda-dmn-js": "^2.10.1",
"camunda-dmn-js": "^3.0.0",
"camunda-dmn-moddle": "^1.3.0",
"canvg": "^4.0.2",
"classnames": "^2.5.1",
"cmmn-js": "^0.20.0",
"cmmn-js-properties-panel": "^0.9.0",
"codemirror": "^6.0.1",
"debug": "^4.1.1",
"diagram-js": "^14.11.3",
"diagram-js-direct-editing": "^3.0.1",
"diagram-js": "^15.2.2",
"diagram-js-direct-editing": "^3.2.0",
"diagram-js-origin": "^1.4.0",
"dmn-js": "^16.8.1",
"dmn-js-properties-panel": "^3.5.2",
"dmn-js-shared": "^16.8.0",
"dmn-js": "^17.0.3",
"dmn-js-properties-panel": "^3.7.0",
"dmn-js-shared": "^17.0.1",
"drag-tabs": "^2.3.1",
"events": "^3.0.0",
"formik": "2.0.4",
Expand Down
58 changes: 33 additions & 25 deletions client/src/app/tabs/bpmn/BpmnEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ export class BpmnEditor extends CachedComponent {
listen(fn) {
const modeler = this.getModeler();

modeler[fn]('attach', this.handleAttach);

[
'import.done',
'saveXML.done',
Expand All @@ -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);
});
Expand Down Expand Up @@ -309,6 +305,12 @@ export class BpmnEditor extends CachedComponent {
});
};

handleAttach = (event) => {
const modeler = this.getModeler();

modeler.get('canvas').focus();
};

handleError = (event) => {
const {
error
Expand Down Expand Up @@ -434,38 +436,41 @@ export class BpmnEditor extends CachedComponent {

const inputActive = isInputActive();
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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)


const canvasFocused = modeler.get('canvas').isFocused();

const newState = {
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,
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
};

Expand Down Expand Up @@ -871,6 +876,9 @@ export class BpmnEditor extends CachedComponent {
},
propertiesPanel: {
layout: layout.propertiesPanel
},
keyboard: {
bind: false
}
});

Expand Down
20 changes: 1 addition & 19 deletions client/src/app/tabs/bpmn/__tests__/BpmnEditorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,25 +372,6 @@ describe('<BpmnEditor>', function() {
it('propertiesPanel.focusout', expectHandleChanged('propertiesPanel.focusout'));


it('directEditing.activate', expectHandleChanged('directEditing.activate'));


it('directEditing.deactivate', expectHandleChanged('directEditing.deactivate'));


it('searchPad.opened', expectHandleChanged('searchPad.opened'));


it('searchPad.closed', expectHandleChanged('searchPad.closed'));


it('popupMenu.opened', expectHandleChanged('popupMenu.opened'));


it('popupMenu.closed', expectHandleChanged('popupMenu.closed'));


it('elementTemplates.select', expectHandleChanged('elementTemplates.select'));
});


Expand Down Expand Up @@ -626,6 +607,7 @@ describe('<BpmnEditor>', function() {
// then
expect(state).to.include({
align: false,
canvasFocused: true,
copy: false,
defaultCopyCutPaste: false,
defaultUndoRedo: false,
Expand Down
64 changes: 34 additions & 30 deletions client/src/app/tabs/cloud-bpmn/BpmnEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export class BpmnEditor extends CachedComponent {
listen(fn) {
const modeler = this.getModeler();

modeler[fn]('attach', this.handleAttach);

[
'import.done',
'saveXML.done',
Expand All @@ -217,17 +219,7 @@ export class BpmnEditor extends CachedComponent {
'elements.copied',
'propertiesPanel.focusin',
'propertiesPanel.focusout',
'directEditing.activate',
'directEditing.deactivate',
'searchPad.closed',
'searchPad.opened',
'popupMenu.opened',
'popupMenu.closed',
'feelPopup.opened',
'feelPopup.closed',
'feelPopup.focusin',
'feelPopup.focusout',
'elementTemplates.select'
'canvas.focus.changed'
].forEach((event) => {
modeler[fn](event, this.handleChanged);
});
Expand Down Expand Up @@ -305,6 +297,12 @@ export class BpmnEditor extends CachedComponent {
});
};

handleAttach = (event) => {
const modeler = this.getModeler();

modeler.get('canvas').focus();
};

handleError = (event) => {
const {
error
Expand Down Expand Up @@ -400,38 +398,41 @@ export class BpmnEditor extends CachedComponent {

const inputActive = isInputActive();

const canvasFocused = modeler.get('canvas').isFocused();

const newState = {
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,
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: 'cloud',
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
};

Expand Down Expand Up @@ -845,7 +846,10 @@ export class BpmnEditor extends CachedComponent {
feelPopupContainer: '.bjs-container',
layout: layout.propertiesPanel
},
elementTemplateChooser: false
elementTemplateChooser: false,
keyboard: {
bind: false
}
});

const commandStack = modeler.get('commandStack');
Expand Down
20 changes: 1 addition & 19 deletions client/src/app/tabs/cloud-bpmn/__tests__/BpmnEditorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,25 +371,6 @@ describe('cloud-bpmn - <BpmnEditor>', function() {
it('propertiesPanel.focusout', expectHandleChanged('propertiesPanel.focusout'));


it('directEditing.activate', expectHandleChanged('directEditing.activate'));


it('directEditing.deactivate', expectHandleChanged('directEditing.deactivate'));


it('searchPad.opened', expectHandleChanged('searchPad.opened'));


it('searchPad.closed', expectHandleChanged('searchPad.closed'));


it('popupMenu.opened', expectHandleChanged('popupMenu.opened'));


it('popupMenu.closed', expectHandleChanged('popupMenu.closed'));


it('elementTemplates.select', expectHandleChanged('elementTemplates.select'));
});


Expand Down Expand Up @@ -625,6 +606,7 @@ describe('cloud-bpmn - <BpmnEditor>', function() {
// then
expect(state).to.include({
align: false,
canvasFocused: true,
copy: false,
defaultCopyCutPaste: false,
defaultUndoRedo: false,
Expand Down
Loading