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 +13 -0
- package/aleman/render.js +2 -2
- package/aleman/vim.js +1 -0
- package/menu/addons/left.js +2 -0
- package/menu/importmap.js +2 -2
- package/menu/rules/build-menu/index.js +1 -0
- package/menu/rules/set-position/index.js +8 -2
- package/menu/rules/submenu/index.js +4 -1
- package/nemo/addons/down/down.js +2 -40
- package/nemo/addons/up.js +2 -37
- package/nemo/rules/build-menu/index.js +5 -3
- package/nemo/rules/set-position/index.js +8 -2
- package/nemo/rules/submenu/index.js +4 -1
- package/nemo/state/parse-state.js +1 -0
- package/nemo/state/state.js +4 -1
- package/package.json +6 -7
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,
|
|
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,
|
|
40
|
+
transform(ast, {
|
|
41
41
|
rules: currentRules,
|
|
42
42
|
plugins,
|
|
43
43
|
});
|
package/aleman/vim.js
CHANGED
package/menu/addons/left.js
CHANGED
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.
|
|
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
|
+
};
|
|
@@ -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 {
|
|
35
|
-
|
|
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 {
|
|
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))
|
package/nemo/addons/down/down.js
CHANGED
|
@@ -1,44 +1,6 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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 {
|
|
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
|
-
|
|
86
|
-
|
|
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 {
|
|
35
|
-
|
|
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 {
|
|
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))
|
package/nemo/state/state.js
CHANGED
|
@@ -43,7 +43,10 @@ function createMenuItems(menu, path = '') {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export const updateState = (command, state, options = {}) => {
|
|
46
|
-
const {
|
|
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.
|
|
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": "^
|
|
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
|
-
"
|
|
49
|
-
"eslint": "^
|
|
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": "^
|
|
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
|
},
|