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

Add dedicated undo/redo keyboard utilities #665

Merged
merged 1 commit into from
Aug 17, 2022
Merged

Add dedicated undo/redo keyboard utilities #665

merged 1 commit into from
Aug 17, 2022

Conversation

nikku
Copy link
Member

@nikku nikku commented Aug 16, 2022

The way folks in the bpmn-io sphere may now test keyboard events against common behaviors is now greatly simplified:

import {
  isUndo,
  isRedo,
  isPaste
} from 'diagram-js/lib/features/keyboard/KeyboardUtil';

document.addEventListener('keydown', function(event) {
  if (isUndo(event)) {
    // event is regarded as an UNDO event by bpmn-io tools.
  }
});

As a breaking change we stop exporting some basic utilities in KeyboardBindings (exporting from actual feature modules is an anti-pattern anyway) with more to be removed in future major upgrades. The remaining ones are continued to be used in downstream libraries (mainly form-js).


Non-breaking changes backported to:

BREAKING CHANGES:

* Key binding exports exposed by `KeyboardBindings` removed in
  favor of `KeyboardUtil` utilities
@nikku nikku merged commit 7c23e07 into develop Aug 17, 2022
@nikku nikku deleted the undo-redo-util branch August 17, 2022 12:13
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant