aleman 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2025.09.03, v1.2.3
2
+
3
+ feature:
4
+ - ae911f9 aleman: menu: key -> keys
5
+
1
6
  2025.09.02, v1.2.2
2
7
 
3
8
  fix:
@@ -63,7 +63,7 @@ export const addGlobalListeners = ({globalAddons, options, readState, writeState
63
63
 
64
64
  const createListener = ({options, addon, readState, writeState}) => (event) => {
65
65
  const {
66
- key,
66
+ keys,
67
67
  listener,
68
68
  preventDefault,
69
69
  stopPropagation,
@@ -72,7 +72,7 @@ const createListener = ({options, addon, readState, writeState}) => (event) => {
72
72
  afterIf,
73
73
  } = addon;
74
74
 
75
- if (key && event.key !== key)
75
+ if (keys && !keys.includes(event.key))
76
76
  return;
77
77
 
78
78
  const state = readState();
@@ -1,12 +1,13 @@
1
- const {keys} = Object;
2
-
3
- export const key = 'ArrowDown';
1
+ export const keys = [
2
+ 'ArrowDown',
3
+ 'j',
4
+ ];
4
5
  export const preventDefault = true;
5
6
 
6
7
  export const listener = ({state, options}) => {
7
8
  let {index} = state;
8
9
  const {menu} = options;
9
- const n = keys(menu).length - 1;
10
+ const n = Object.keys(menu).length - 1;
10
11
 
11
12
  if (index < n)
12
13
  ++index;
@@ -1,6 +1,6 @@
1
1
  const {values} = Object;
2
2
 
3
- export const key = 'Enter';
3
+ export const keys = ['Enter'];
4
4
 
5
5
  export const filter = ({state}) => state.command === 'show';
6
6
 
@@ -1,4 +1,4 @@
1
- export const key = 'Escape';
1
+ export const keys = ['Escape'];
2
2
 
3
3
  export const listener = ({state, options}) => {
4
4
  options.beforeHide?.(state);
package/menu/addons/up.js CHANGED
@@ -1,4 +1,7 @@
1
- export const key = 'ArrowUp';
1
+ export const keys = [
2
+ 'ArrowUp',
3
+ 'k',
4
+ ];
2
5
 
3
6
  export const preventDefault = true;
4
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",