handsontable 0.0.0-next-28e0541-20231128 → 0.0.0-next-1aba9db-20231128

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-28e0541-20231128";
137
+ const hotVersion = "0.0.0-next-1aba9db-20231128";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-28e0541-20231128";
127
+ const hotVersion = "0.0.0-next-1aba9db-20231128";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.0.0-next-28e0541-20231128",
13
+ "version": "0.0.0-next-1aba9db-20231128",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -192,7 +192,7 @@ class ContextMenu extends _base.BasePlugin {
192
192
  */
193
193
  registerShortcuts() {
194
194
  this.hot.getShortcutManager().getContext('grid').addShortcut({
195
- keys: [['Control/Meta', 'Shift', '\\'], ['Shift', 'F10']],
195
+ keys: [['Control/Meta', 'Shift', 'Backslash'], ['Shift', 'F10']],
196
196
  callback: () => {
197
197
  const {
198
198
  highlight
@@ -186,7 +186,7 @@ export class ContextMenu extends BasePlugin {
186
186
  */
187
187
  registerShortcuts() {
188
188
  this.hot.getShortcutManager().getContext('grid').addShortcut({
189
- keys: [['Control/Meta', 'Shift', '\\'], ['Shift', 'F10']],
189
+ keys: [['Control/Meta', 'Shift', 'Backslash'], ['Shift', 'F10']],
190
190
  callback: () => {
191
191
  const {
192
192
  highlight
@@ -42,6 +42,7 @@ const getKeysList = normalizedKeys => {
42
42
  */
43
43
  exports.getKeysList = getKeysList;
44
44
  const codeToKeyRegExp = new RegExp('^(?:Key|Digit)([A-Z0-9])$');
45
+ const keyCodeNames = new Set(['Backquote', 'Minus', 'Equal', 'BracketLeft', 'BracketRight', 'Backslash', 'Semicolon', 'Quote', 'Comma', 'Period', 'Slash']);
45
46
 
46
47
  /**
47
48
  * Normalizes a keyboard event key value to a key before its modification. When the keyboard event
@@ -58,6 +59,12 @@ const normalizeEventKey = _ref => {
58
59
  key,
59
60
  code
60
61
  } = _ref;
61
- return (codeToKeyRegExp.test(code) ? code.replace(codeToKeyRegExp, '$1') : key).toLowerCase();
62
+ let normalizedKey = key;
63
+ if (codeToKeyRegExp.test(code)) {
64
+ normalizedKey = code.replace(codeToKeyRegExp, '$1');
65
+ } else if (keyCodeNames.has(code)) {
66
+ normalizedKey = code;
67
+ }
68
+ return normalizedKey.toLowerCase();
62
69
  };
63
70
  exports.normalizeEventKey = normalizeEventKey;
@@ -37,6 +37,7 @@ export const getKeysList = normalizedKeys => {
37
37
  * the string.
38
38
  */
39
39
  const codeToKeyRegExp = new RegExp('^(?:Key|Digit)([A-Z0-9])$');
40
+ const keyCodeNames = new Set(['Backquote', 'Minus', 'Equal', 'BracketLeft', 'BracketRight', 'Backslash', 'Semicolon', 'Quote', 'Comma', 'Period', 'Slash']);
40
41
 
41
42
  /**
42
43
  * Normalizes a keyboard event key value to a key before its modification. When the keyboard event
@@ -53,5 +54,11 @@ export const normalizeEventKey = _ref => {
53
54
  key,
54
55
  code
55
56
  } = _ref;
56
- return (codeToKeyRegExp.test(code) ? code.replace(codeToKeyRegExp, '$1') : key).toLowerCase();
57
+ let normalizedKey = key;
58
+ if (codeToKeyRegExp.test(code)) {
59
+ normalizedKey = code.replace(codeToKeyRegExp, '$1');
60
+ } else if (keyCodeNames.has(code)) {
61
+ normalizedKey = code;
62
+ }
63
+ return normalizedKey.toLowerCase();
57
64
  };