aleman 1.4.7 → 1.4.9

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.09, v1.4.9
2
+
3
+ feature:
4
+ - fc96832 menu: simplify
5
+
6
+ 2025.09.09, v1.4.8
7
+
8
+ feature:
9
+ - d52cb43 aleman: menu: addClassMenu
10
+
1
11
  2025.09.09, v1.4.7
2
12
 
3
13
  feature:
@@ -1,11 +1,10 @@
1
- import {template, operator} from 'putout';
1
+ import {template} from 'putout';
2
2
  import {
3
+ addClassName,
3
4
  hasDataName,
4
5
  setAttributeValue,
5
6
  } from '../jsx-operator.js';
6
7
 
7
- const {addAttributeValue} = operator;
8
-
9
8
  const {entries} = Object;
10
9
 
11
10
  const noop = () => {};
@@ -82,7 +81,7 @@ export const traverse = ({options, push}) => ({
82
81
  });
83
82
 
84
83
  function setSubmenu(menuItem) {
85
- addAttributeValue(menuItem, 'className', 'menu-submenu');
84
+ addClassName(menuItem, 'menu-submenu');
86
85
  }
87
86
 
88
87
  function setDataMenuPath(key, name, menuItem) {
@@ -91,7 +90,7 @@ function setDataMenuPath(key, name, menuItem) {
91
90
  }
92
91
 
93
92
  function setIcon(name, menuItem) {
94
- addAttributeValue(menuItem, 'className', `icon ${getIconName(name)}`);
93
+ addClassName(menuItem, `icon ${getIconName(name)}`);
95
94
  }
96
95
 
97
96
  function getIconName(name) {
@@ -100,4 +99,3 @@ function getIconName(name) {
100
99
  .replace(/\s/g, '-')
101
100
  .toLowerCase();
102
101
  }
103
-
@@ -50,4 +50,3 @@ export function hasDataName(path, value = '') {
50
50
  const attribute = getAttributeValue(path, 'data-name');
51
51
  return attribute === value;
52
52
  }
53
-
@@ -76,4 +76,3 @@ function parsePosition(str) {
76
76
  Number(y),
77
77
  ];
78
78
  }
79
-
@@ -1,15 +1,12 @@
1
1
  import {operator, types} from 'putout';
2
2
  import {
3
3
  addClassName,
4
+ containsClassName,
4
5
  hasDataName,
5
- removeAttributeValue,
6
6
  removeClassName,
7
7
  } from '../jsx-operator.js';
8
8
 
9
- const {
10
- getAttributeValue,
11
- hasTagName,
12
- } = operator;
9
+ const {hasTagName} = operator;
13
10
 
14
11
  const {isJSXElement} = types;
15
12
 
@@ -68,14 +65,12 @@ export const traverse = ({options, push}) => ({
68
65
  });
69
66
 
70
67
  function isParentSelected(path) {
71
- const classAttributeValue = getAttributeValue(path, 'className');
72
- return classAttributeValue.includes('menu-item-selected');
68
+ return containsClassName(path, 'menu-item-selected');
73
69
  }
74
70
 
75
71
  function unselect(path) {
76
72
  if (!path)
77
73
  return;
78
74
 
79
- removeAttributeValue(path, 'className', 'menu-item-selected');
75
+ removeClassName(path, 'menu-item-selected');
80
76
  }
81
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",