aleman 1.16.5 → 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 +26 -0
- package/aleman/render.js +2 -2
- package/aleman/state.js +2 -2
- package/aleman/vim.js +1 -0
- package/example/{index.js → menu/index.js} +1 -1
- package/example/nemo/index.html +1 -0
- package/example/nemo/index.js +8 -0
- package/menu/addons/click/click.js +1 -1
- package/menu/addons/item-click/item-click.js +1 -1
- package/menu/addons/left.js +2 -0
- package/menu/addons/set-position/set-position.js +1 -1
- 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/click/click.js +1 -1
- package/nemo/addons/down/down.js +2 -40
- package/nemo/addons/item-click/item-click.js +1 -1
- package/nemo/addons/set-position/set-position.js +1 -1
- package/nemo/addons/up.js +2 -37
- package/nemo/importmap.js +1 -1
- 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 +13 -14
- /package/example/{index.html → menu/index.html} +0 -0
package/ChangeLog
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
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
|
+
|
|
14
|
+
2026.01.25, v2.0.0
|
|
15
|
+
|
|
16
|
+
feature:
|
|
17
|
+
- dc0b6f3 aleman: drop support of node < 22
|
|
18
|
+
- 714ae25 aleman: try-to-catch v4.0.3
|
|
19
|
+
- bbbd53e aleman: try-catch v4.0.7
|
|
20
|
+
- 862c712 aleman: supertape v12.0.12
|
|
21
|
+
- bb0c78a aleman: putout v41.12.0
|
|
22
|
+
- 0c27906 aleman: madrun v12.1.0
|
|
23
|
+
- 3572de6 aleman: fullstore v4.0.0
|
|
24
|
+
- bb793a0 aleman: eslint-plugin-putout v30.0.1
|
|
25
|
+
- 6be993f aleman: @putout/test v15.1.0
|
|
26
|
+
|
|
1
27
|
2025.11.28, v1.16.5
|
|
2
28
|
|
|
3
29
|
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/state.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fullstore from 'fullstore';
|
|
1
|
+
import {fullstore} from 'fullstore';
|
|
2
2
|
|
|
3
3
|
const {assign} = Object;
|
|
4
4
|
const {stringify, parse} = JSON;
|
|
@@ -39,7 +39,7 @@ export const createState = (state, {options, listener, stateName = 'aleman-state
|
|
|
39
39
|
|
|
40
40
|
history[str] = true;
|
|
41
41
|
stateElement.textContent = str;
|
|
42
|
-
|
|
42
|
+
globalThis.alemanSync = fn;
|
|
43
43
|
|
|
44
44
|
document.addEventListener('keydown', ({key}) => {
|
|
45
45
|
if (key === '`')
|
package/aleman/vim.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<script src="index.js" type="module"></script>
|
package/menu/addons/left.js
CHANGED
|
@@ -4,7 +4,7 @@ export const setPosition = (name, event) => {
|
|
|
4
4
|
const element = document.querySelector(`[data-name="${name}"]`);
|
|
5
5
|
const heightMenu = getMenuHeight(element);
|
|
6
6
|
const widthMenu = getMenuWidth(element);
|
|
7
|
-
const {innerHeight, innerWidth} =
|
|
7
|
+
const {innerHeight, innerWidth} = globalThis;
|
|
8
8
|
|
|
9
9
|
const {x, y} = calculate(event, {
|
|
10
10
|
heightMenu,
|
package/menu/importmap.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const importmap = {
|
|
2
2
|
imports: {
|
|
3
|
-
'putout': 'https://esm.sh/@putout/bundle@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
|
+
};
|
|
@@ -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);
|
|
@@ -4,7 +4,7 @@ export const setPosition = (name, event) => {
|
|
|
4
4
|
const element = document.querySelector(`[data-name="${name}"]`);
|
|
5
5
|
const heightMenu = getMenuHeight(element);
|
|
6
6
|
const widthMenu = getMenuWidth(element);
|
|
7
|
-
const {innerHeight, innerWidth} =
|
|
7
|
+
const {innerHeight, innerWidth} = globalThis;
|
|
8
8
|
|
|
9
9
|
const {x, y} = calculate(event, {
|
|
10
10
|
heightMenu,
|
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);
|
package/nemo/importmap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const importmap = {
|
|
2
2
|
imports: {
|
|
3
|
-
'putout': 'https://esm.sh/@putout/bundle@
|
|
3
|
+
'putout': 'https://esm.sh/@putout/bundle@5.2.4',
|
|
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',
|
|
@@ -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": "
|
|
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",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@putout/processor-html": "^14.0.2",
|
|
32
|
-
"fullstore": "^
|
|
32
|
+
"fullstore": "^4.0.0",
|
|
33
33
|
"html-escaper": "^3.0.3",
|
|
34
|
-
"jessy": "^
|
|
34
|
+
"jessy": "^5.0.0",
|
|
35
35
|
"once": "^1.4.0",
|
|
36
|
-
"putout": "^
|
|
37
|
-
"try-to-catch": "^
|
|
36
|
+
"putout": "^42.4.2",
|
|
37
|
+
"try-to-catch": "^4.0.3"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"putout",
|
|
@@ -44,21 +44,20 @@
|
|
|
44
44
|
"debugger"
|
|
45
45
|
],
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@putout/test": "^
|
|
48
|
-
"
|
|
49
|
-
"eslint": "^
|
|
50
|
-
"eslint-plugin-n": "^17.0.0",
|
|
51
|
-
"eslint-plugin-putout": "^28.0.0",
|
|
47
|
+
"@putout/test": "^15.1.0",
|
|
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",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
54
|
+
"superc8": "^12.3.1",
|
|
55
|
+
"supertape": "^12.0.12",
|
|
56
|
+
"try-catch": "^4.0.7"
|
|
58
57
|
},
|
|
59
58
|
"license": "MIT",
|
|
60
59
|
"engines": {
|
|
61
|
-
"node": ">=
|
|
60
|
+
"node": ">=22"
|
|
62
61
|
},
|
|
63
62
|
"publishConfig": {
|
|
64
63
|
"access": "public"
|
|
File without changes
|