aleman 1.2.4 → 1.2.6

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,13 @@
1
+ 2025.09.04, v1.2.6
2
+
3
+ fix:
4
+ - b8eca4b aleman: menu: enter
5
+
6
+ 2025.09.04, v1.2.5
7
+
8
+ feature:
9
+ - 221ca50 aleman: menu: enter
10
+
1
11
  2025.09.03, v1.2.4
2
12
 
3
13
  feature:
@@ -1,3 +1,6 @@
1
+ import {run} from './run/index.js';
2
+
3
+ const isObject = (a) => a && typeof a === 'object';
1
4
  const {values} = Object;
2
5
 
3
6
  export const keys = ['Enter'];
@@ -7,15 +10,16 @@ export const filter = ({state}) => state.command === 'show';
7
10
  export const stopPropagation = true;
8
11
 
9
12
  export const listener = ({options, state}) => {
10
- const {index} = state;
11
- const {menu} = options;
12
-
13
- const fn = values(menu)[index];
14
- setTimeout(fn);
13
+ run({
14
+ options,
15
+ state,
16
+ });
15
17
  options.beforeHide?.(state);
16
18
 
17
19
  return {
18
20
  command: 'hide',
19
21
  index: -1,
22
+ insideSubmenu: false,
20
23
  };
21
24
  };
25
+
@@ -0,0 +1,14 @@
1
+ const isObject = (a) => a && typeof a === 'object';
2
+ const {values} = Object;
3
+
4
+ export const run = ({options, state}) => {
5
+ const {index, submenuIndex} = state;
6
+ const {menu} = options;
7
+
8
+ const fn = values(menu)[index];
9
+
10
+ if (isObject(fn))
11
+ return setTimeout(values(fn)[submenuIndex]);
12
+
13
+ setTimeout(fn);
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",