aleman 1.10.0 → 1.11.0

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.14, v1.11.0
2
+
3
+ feature:
4
+ - 8b5f665 aleman: enter: do not close menu on enter on submenu name
5
+
1
6
  2025.09.14, v1.10.0
2
7
 
3
8
  feature:
@@ -30,4 +30,3 @@ export const listener = ({options, state}) => {
30
30
  insideSubmenu: false,
31
31
  };
32
32
  };
33
-
@@ -1,16 +1,25 @@
1
1
  import {run} from './run/index.js';
2
+ import * as right from './right.js';
2
3
 
3
4
  export const keys = ['Enter'];
4
5
 
5
6
  export const filter = ({state}) => state.command === 'show';
6
7
 
7
8
  export const stopPropagation = true;
9
+ export const preventDefault = true;
8
10
 
9
11
  export const listener = ({options, state}) => {
10
- run({
12
+ const [result] = run({
11
13
  options,
12
14
  state,
13
15
  });
16
+
17
+ if (!result)
18
+ return right.listener({
19
+ options,
20
+ state,
21
+ });
22
+
14
23
  options.beforeHide?.(state);
15
24
 
16
25
  return {
@@ -32,4 +32,3 @@ const listener = ({event, options, getMenuPath = _getMenuPath}) => {
32
32
  showSubmenu: false,
33
33
  };
34
34
  };
35
-
@@ -10,4 +10,3 @@ export function getMenuPath(event) {
10
10
 
11
11
  return menuItemElement.dataset.menuPath;
12
12
  }
13
-
@@ -7,8 +7,11 @@ export const run = ({options, state}) => {
7
7
 
8
8
  const fn = values(menu)[index];
9
9
 
10
+ if (isObject(fn) && submenuIndex === -1)
11
+ return [false];
12
+
10
13
  if (isObject(fn))
11
- return setTimeout(values(fn)[submenuIndex]);
14
+ return [true, setTimeout(values(fn)[submenuIndex])];
12
15
 
13
- setTimeout(fn);
16
+ return [true, setTimeout(fn)];
14
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",