aleman 1.1.39 → 1.1.41

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.08.30, v1.1.41
2
+
3
+ fix:
4
+ - 48a8b59 menu: stopPropagation
5
+
6
+ 2025.08.30, v1.1.40
7
+
8
+ feature:
9
+ - 55cd365 aleman: menu: f9: get rid of
10
+
1
11
  2025.08.30, v1.1.39
2
12
 
3
13
  fix:
@@ -66,12 +66,10 @@ const createListener = ({options, addon, readState, writeState}) => (event) => {
66
66
  key,
67
67
  listener,
68
68
  preventDefault,
69
+ stopPropagation,
69
70
  filter,
70
71
  } = addon;
71
72
 
72
- if (preventDefault)
73
- event.preventDefault();
74
-
75
73
  if (key && event.key !== key)
76
74
  return;
77
75
 
@@ -86,6 +84,12 @@ const createListener = ({options, addon, readState, writeState}) => (event) => {
86
84
  if (filter && !is)
87
85
  return false;
88
86
 
87
+ if (preventDefault)
88
+ event.preventDefault();
89
+
90
+ if (stopPropagation)
91
+ event.stopPropagation();
92
+
89
93
  const newState = listener({
90
94
  event,
91
95
  state,
@@ -3,8 +3,7 @@ export const events = ['click'];
3
3
  export const filter = ({state}) => state.command === 'show';
4
4
 
5
5
  export const listener = ({options, state}) => {
6
- options.beforeClick?.(state);
7
- options.beforeClose?.(state);
6
+ options.beforeHide?.(state);
8
7
 
9
8
  return {
10
9
  command: 'hide',
@@ -11,7 +11,7 @@ export const listener = ({event, state, options}) => {
11
11
  ...state,
12
12
  position: {
13
13
  x: event.clientX,
14
- y: event.clientY - 10,
14
+ y: event.clientY,
15
15
  },
16
16
  });
17
17
 
@@ -21,7 +21,7 @@ export const listener = ({event, state, options}) => {
21
21
  command,
22
22
  position: {
23
23
  x: event.clientX,
24
- y: event.clientY - 14,
24
+ y: event.clientY - 10,
25
25
  },
26
26
  };
27
27
  };
@@ -4,12 +4,15 @@ export const key = 'Enter';
4
4
 
5
5
  export const filter = ({state}) => state.command === 'show';
6
6
 
7
+ export const stopPropagation = true;
8
+
7
9
  export const listener = ({options, state}) => {
8
10
  const {index} = state;
9
11
  const {menu} = options;
10
12
 
11
13
  const fn = values(menu)[index];
12
14
  setTimeout(fn);
15
+ options.beforeHide?.(state);
13
16
 
14
17
  return {
15
18
  command: 'hide',
@@ -1,7 +1,7 @@
1
1
  export const key = 'Escape';
2
2
 
3
- export const listener = ({options}) => {
4
- options.beforeHide?.();
3
+ export const listener = ({state, options}) => {
4
+ options.beforeHide?.(state);
5
5
  return {
6
6
  command: 'hide',
7
7
  index: -1,
@@ -3,7 +3,6 @@ import * as click from './click.js';
3
3
  import * as escape from './escape.js';
4
4
  import * as down from './down.js';
5
5
  import * as up from './up.js';
6
- import * as f9 from './f9.js';
7
6
  import * as enter from './enter.js';
8
7
 
9
8
  export const addons = [
@@ -12,6 +11,5 @@ export const addons = [
12
11
  escape,
13
12
  down,
14
13
  up,
15
- f9,
16
14
  enter,
17
15
  ];
@@ -11,7 +11,7 @@ const listener = ({event, options}) => {
11
11
  const fn = menu[name];
12
12
 
13
13
  setTimeout(fn);
14
- options.beforeClose?.();
14
+ options.beforeHide?.();
15
15
 
16
16
  return {
17
17
  index: -1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",
package/menu/addons/f9.js DELETED
@@ -1,14 +0,0 @@
1
- export const key = 'F9';
2
-
3
- export const filter = ({state, options}) => {
4
- const {beforeShow} = options;
5
-
6
- if (!beforeShow)
7
- return true;
8
-
9
- return options.beforeShow?.(state);
10
- };
11
-
12
- export const listener = () => ({
13
- command: 'show',
14
- });