aleman 2.0.0 → 2.0.1

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,16 @@
1
+ 2026.04.04, v2.0.1
2
+
3
+ fix:
4
+ - 514ce5b aleman: left: filter
5
+
6
+ feature:
7
+ - 74339b8 aleman: putout v42.4.2
8
+ - 36c6aa4 aleman: madrun v13.0.1
9
+ - bb8206b aleman: eslint-plugin-putout v31.1.2
10
+ - 41dc50e aleman: eslint v10.2.0
11
+ - ac383b2 aleman: superc8 v12.3.1
12
+ - 3b703e8 nemo: up/down: use updateState
13
+
1
14
  2026.01.25, v2.0.0
2
15
 
3
16
  feature:
package/aleman/render.js CHANGED
@@ -25,7 +25,7 @@ export const createRender = (html, {options, rules, type}) => {
25
25
  }];
26
26
  }
27
27
 
28
- const places = findPlaces(ast, source, {
28
+ const places = findPlaces(ast, {
29
29
  rules: currentRules,
30
30
  plugins,
31
31
  });
@@ -37,7 +37,7 @@ export const createRender = (html, {options, rules, type}) => {
37
37
  places,
38
38
  ];
39
39
 
40
- transform(ast, source, {
40
+ transform(ast, {
41
41
  rules: currentRules,
42
42
  plugins,
43
43
  });
package/aleman/vim.js CHANGED
@@ -46,5 +46,6 @@ export const createVimParser = (buffer = []) => ({key}) => {
46
46
  }
47
47
 
48
48
  buffer = [];
49
+
49
50
  return [''];
50
51
  };
@@ -4,6 +4,8 @@ export const keys = [
4
4
  ];
5
5
  export const preventDefault = true;
6
6
 
7
+ export const filter = ({state}) => state.command === 'show';
8
+
7
9
  export const listener = () => ({
8
10
  submenuIndex: -1,
9
11
  insideSubmenu: false,
package/menu/importmap.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export const importmap = {
2
2
  imports: {
3
- 'putout': 'https://esm.sh/@putout/bundle@5.2.4',
3
+ 'putout': 'https://esm.sh/@putout/bundle@5.4.1',
4
4
  '@putout/processor-html': 'https://esm.sh/@putout/processor-html',
5
5
  'fullstore': 'https://esm.sh/fullstore',
6
6
  'jessy': 'https://esm.sh/jessy',
7
7
  },
8
- };
8
+ };
@@ -5,6 +5,7 @@ import {
5
5
  } from 'putout';
6
6
 
7
7
  const {jsxText} = types;
8
+
8
9
  const {
9
10
  setAttributeValue,
10
11
  hasDataName,
@@ -31,8 +31,14 @@ export const fix = ({path, attr, x, y}) => {
31
31
 
32
32
  export const traverse = ({options, push}) => ({
33
33
  JSXElement(path) {
34
- const {name = 'menu', position = {}} = options;
35
- const {x = 0, y = 20} = position;
34
+ const {
35
+ name = 'menu',
36
+ position = {},
37
+ } = options;
38
+ const {
39
+ x = 0,
40
+ y = 20,
41
+ } = position;
36
42
 
37
43
  if (!hasDataName(path, name))
38
44
  return;
@@ -32,7 +32,10 @@ export const traverse = ({options, push}) => ({
32
32
  if (!isJSXElement(path.parentPath))
33
33
  return;
34
34
 
35
- const {insideSubmenu = true, submenuIndex = 1} = options;
35
+ const {
36
+ insideSubmenu = true,
37
+ submenuIndex = 1,
38
+ } = options;
36
39
  const parentMenu = path.parentPath.parentPath.parentPath;
37
40
 
38
41
  if (!isJSXElement(parentMenu))
@@ -1,44 +1,6 @@
1
- import {getSubmenu} from '../submenu/index.js';
1
+ import {updateState} from '../../state/state.js';
2
2
 
3
3
  export const keys = ['ArrowDown'];
4
4
  export const preventDefault = true;
5
5
 
6
- export const filter = ({state}) => state.command === 'show';
7
-
8
- export const listener = ({state, options}) => {
9
- let {
10
- index,
11
- insideSubmenu,
12
- submenuIndex,
13
- } = state;
14
-
15
- const {menu, infiniteScroll} = options;
16
- const n = Object.keys(menu).length - 1;
17
-
18
- if (!insideSubmenu && (infiniteScroll && index === n || index < n))
19
- ++index;
20
-
21
- if (!insideSubmenu && infiniteScroll && index > n)
22
- index -= n + 1;
23
-
24
- const submenu = getSubmenu({
25
- index,
26
- options,
27
- });
28
-
29
- const submenuCount = Object.keys(submenu).length - 1;
30
-
31
- if (insideSubmenu)
32
- if (submenuIndex < submenuCount)
33
- ++submenuIndex;
34
- else if (infiniteScroll && submenuIndex === submenuCount)
35
- submenuIndex = 0;
36
-
37
- const showSubmenu = submenuCount > -1;
38
-
39
- return {
40
- index,
41
- submenuIndex,
42
- showSubmenu,
43
- };
44
- };
6
+ export const listener = ({state, options}) => updateState('down', state, options);
package/nemo/addons/up.js CHANGED
@@ -1,42 +1,7 @@
1
- import {getSubmenu} from './submenu/index.js';
1
+ import {updateState} from '../state/state.js';
2
2
 
3
3
  export const keys = ['ArrowUp'];
4
4
 
5
5
  export const preventDefault = true;
6
- export const filter = ({state}) => state.command === 'show';
7
6
 
8
- export const listener = ({state, options}) => {
9
- const {menu, infiniteScroll} = options;
10
- let {
11
- index,
12
- insideSubmenu,
13
- submenuIndex,
14
- } = state;
15
-
16
- const count = Object.keys(menu).length;
17
-
18
- if (insideSubmenu && submenuIndex > 0)
19
- --submenuIndex;
20
-
21
- if (infiniteScroll && !index)
22
- index = count - 1;
23
- else if (!insideSubmenu && index > 0)
24
- --index;
25
-
26
- if (index === -1)
27
- index = count - 1;
28
-
29
- const submenu = getSubmenu({
30
- index,
31
- options,
32
- });
33
-
34
- const submenuCount = Object.keys(submenu).length;
35
- const showSubmenu = submenuCount > 0;
36
-
37
- return {
38
- index,
39
- submenuIndex,
40
- showSubmenu,
41
- };
42
- };
7
+ export const listener = ({state, options}) => updateState('up', state, options);
@@ -80,10 +80,12 @@ function createMenu(menu) {
80
80
  export const fix = ({path, menu}) => {
81
81
  path.node.children = createMenu(menu);
82
82
 
83
- if (menu.show)
83
+ if (menu.show) {
84
84
  removeClassName(path, 'menu-hidden');
85
- else
86
- addClassName(path, 'menu-hidden');
85
+ return;
86
+ }
87
+
88
+ addClassName(path, 'menu-hidden');
87
89
  };
88
90
 
89
91
  export const traverse = ({options, push}) => ({
@@ -31,8 +31,14 @@ export const fix = ({path, attr, x, y}) => {
31
31
 
32
32
  export const traverse = ({options, push}) => ({
33
33
  JSXElement(path) {
34
- const {name = 'menu', position = {}} = options;
35
- const {x = 0, y = 20} = position;
34
+ const {
35
+ name = 'menu',
36
+ position = {},
37
+ } = options;
38
+ const {
39
+ x = 0,
40
+ y = 20,
41
+ } = position;
36
42
 
37
43
  if (!hasDataName(path, name))
38
44
  return;
@@ -32,7 +32,10 @@ export const traverse = ({options, push}) => ({
32
32
  if (!isJSXElement(path.parentPath))
33
33
  return;
34
34
 
35
- const {insideSubmenu = true, submenuIndex = 1} = options;
35
+ const {
36
+ insideSubmenu = true,
37
+ submenuIndex = 1,
38
+ } = options;
36
39
  const parentMenu = path.parentPath.parentPath.parentPath;
37
40
 
38
41
  if (!isJSXElement(parentMenu))
@@ -3,6 +3,7 @@ const {assign} = Object;
3
3
  export const parseState = (source) => {
4
4
  const lines = source.split('\n');
5
5
  const items = [];
6
+
6
7
  const state = {
7
8
  index: -1,
8
9
  submenuIndex: -1,
@@ -43,7 +43,10 @@ function createMenuItems(menu, path = '') {
43
43
  }
44
44
 
45
45
  export const updateState = (command, state, options = {}) => {
46
- const {count = 1, infiniteScroll = state.infiniteScroll} = options;
46
+ const {
47
+ count = 1,
48
+ infiniteScroll = state.infiniteScroll,
49
+ } = options;
47
50
 
48
51
  for (let i = 0; i < count; i++) {
49
52
  if (command === 'down') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",
@@ -33,7 +33,7 @@
33
33
  "html-escaper": "^3.0.3",
34
34
  "jessy": "^5.0.0",
35
35
  "once": "^1.4.0",
36
- "putout": "^41.12.0",
36
+ "putout": "^42.4.2",
37
37
  "try-to-catch": "^4.0.3"
38
38
  },
39
39
  "keywords": [
@@ -45,14 +45,13 @@
45
45
  ],
46
46
  "devDependencies": {
47
47
  "@putout/test": "^15.1.0",
48
- "c8": "^10.0.0",
49
- "eslint": "^9.0.0",
50
- "eslint-plugin-n": "^17.0.0",
51
- "eslint-plugin-putout": "^30.0.1",
48
+ "eslint": "^10.2.0",
49
+ "eslint-plugin-putout": "^31.1.2",
52
50
  "just-kebab-case": "^4.2.0",
53
- "madrun": "^12.1.0",
51
+ "madrun": "^13.0.1",
54
52
  "montag": "^1.2.1",
55
53
  "nodemon": "^3.0.1",
54
+ "superc8": "^12.3.1",
56
55
  "supertape": "^12.0.12",
57
56
  "try-catch": "^4.0.7"
58
57
  },