Skip to content

Commit

Permalink
chore(keyboard): remove legacy key binding exports
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

* Key binding exports exposed by `KeyboardBindings` removed in
  favor of `KeyboardUtil` utilities
  • Loading branch information
nikku committed Aug 17, 2022
1 parent 4dd8a42 commit 383dae3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/features/keyboard/KeyboardBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {

var LOW_PRIORITY = 500;

export var KEYCODE_C = 67;
export var KEYCODE_V = 86;
export var KEYCODE_Y = 89;
export var KEYCODE_Z = 90;
var KEYCODE_C = 67;
var KEYCODE_V = 86;
var KEYCODE_Y = 89;
var KEYCODE_Z = 90;

// TODO(nikku): remove in future diagram-js version
export var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
export var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
export var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
Expand Down
18 changes: 18 additions & 0 deletions test/spec/features/keyboard/KeyboardBindingsSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {
KEYS_UNDO,
KEYS_REDO,
KEYS_COPY,
KEYS_PASTE
} from 'lib/features/keyboard/KeyboardBindings';


describe('features/keyboard - KeyboardBindings', function() {

it('should provide legacy KEYS_* exports', function() {
expect(KEYS_UNDO).to.exist;
expect(KEYS_REDO).to.exist;
expect(KEYS_COPY).to.exist;
expect(KEYS_PASTE).to.exist;
});

});

0 comments on commit 383dae3

Please sign in to comment.