aleman 1.4.10 → 1.5.0

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.10, v1.5.0
2
+
3
+ feature:
4
+ - dd17f0a aleman: menu: get rid of jsx-operator
5
+
6
+ 2025.09.10, v1.4.11
7
+
8
+ feature:
9
+ - d13066c aleman: setAttributeValue
10
+
1
11
  2025.09.10, v1.4.10
2
12
 
3
13
  feature:
package/menu/importmap.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const importmap = {
2
2
  imports: {
3
- 'putout': 'https://esm.sh/@putout/bundle@4.6.8',
3
+ 'putout': 'https://esm.sh/@putout/bundle@4.6.10',
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',
@@ -1,10 +1,10 @@
1
- import {template} from 'putout';
2
- import {
3
- addClassName,
4
- hasDataName,
5
- setAttributeValue,
6
- } from '../jsx-operator.js';
1
+ import {template, operator} from 'putout';
7
2
 
3
+ const {
4
+ setAttributeValue,
5
+ hasDataName,
6
+ addClassName,
7
+ } = operator;
8
8
  const {entries} = Object;
9
9
 
10
10
  const noop = () => {};
@@ -99,3 +99,4 @@ function getIconName(name) {
99
99
  .replace(/\s/g, '-')
100
100
  .toLowerCase();
101
101
  }
102
+
@@ -1,11 +1,12 @@
1
1
  import {operator} from 'putout';
2
- import {
3
- containsClassName,
2
+
3
+ const {
4
+ hasTagName,
4
5
  removeClassName,
5
6
  hasDataName,
6
- } from '../jsx-operator.js';
7
+ containsClassName,
8
+ } = operator;
7
9
 
8
- const {hasTagName} = operator;
9
10
  const CLASS = 'menu-submenu-show';
10
11
 
11
12
  export const report = () => `Hide submenu`;
@@ -32,3 +33,4 @@ export const traverse = ({push, options}) => ({
32
33
  push(path);
33
34
  },
34
35
  });
36
+
@@ -1,9 +1,11 @@
1
- import {
2
- addClassName,
1
+ import {operator} from 'putout';
2
+
3
+ const {
3
4
  containsClassName,
4
5
  hasDataName,
6
+ addClassName,
5
7
  removeClassName,
6
- } from '../jsx-operator.js';
8
+ } = operator;
7
9
 
8
10
  export const report = ({command}) => {
9
11
  const [first, ...rest] = command;
@@ -36,3 +38,4 @@ export const traverse = ({push, options}) => ({
36
38
  });
37
39
  },
38
40
  });
41
+
@@ -1,12 +1,13 @@
1
1
  import {operator, types} from 'putout';
2
- import {
2
+
3
+ const {isJSXElement} = types;
4
+ const {
5
+ hasTagName,
3
6
  addClassName,
4
7
  hasDataName,
5
8
  removeClassName,
6
- } from '../jsx-operator.js';
9
+ } = operator;
7
10
 
8
- const {hasTagName} = operator;
9
- const {isJSXElement} = types;
10
11
  const SELECTED = 'menu-item-selected';
11
12
  const SHOW = 'menu-submenu-show';
12
13
 
@@ -72,3 +73,4 @@ function addShowSubmenu(path, {showSubmenu}) {
72
73
  function removeShowSubmenu(path) {
73
74
  removeClassName(path, SHOW);
74
75
  }
76
+
@@ -1,12 +1,10 @@
1
1
  import {types, operator} from 'putout';
2
- import {
3
- hasDataName,
4
- setAttributeValue,
5
- } from '../jsx-operator.js';
6
2
 
7
3
  const {
4
+ setAttributeValue,
8
5
  getAttributeValue,
9
6
  getAttributePath,
7
+ hasDataName,
10
8
  } = operator;
11
9
 
12
10
  const {
@@ -76,3 +74,4 @@ function parsePosition(str) {
76
74
  Number(y),
77
75
  ];
78
76
  }
77
+
@@ -1,12 +1,12 @@
1
1
  import {operator, types} from 'putout';
2
- import {
2
+
3
+ const {
4
+ hasTagName,
5
+ removeClassName,
3
6
  addClassName,
4
- containsClassName,
5
7
  hasDataName,
6
- removeClassName,
7
- } from '../jsx-operator.js';
8
-
9
- const {hasTagName} = operator;
8
+ containsClassName,
9
+ } = operator;
10
10
 
11
11
  const {isJSXElement} = types;
12
12
 
@@ -74,3 +74,4 @@ function unselect(path) {
74
74
 
75
75
  removeClassName(path, 'menu-item-selected');
76
76
  }
77
+
@@ -1,11 +1,12 @@
1
1
  import {operator, types} from 'putout';
2
- import {
3
- containsClassName,
4
- hasDataName,
2
+
3
+ const {
4
+ hasTagName,
5
5
  removeClassName,
6
- } from '../jsx-operator.js';
6
+ hasDataName,
7
+ containsClassName,
8
+ } = operator;
7
9
 
8
- const {hasTagName} = operator;
9
10
  const {isJSXElement} = types;
10
11
  const SELECTED = 'menu-item-selected';
11
12
 
@@ -43,3 +44,4 @@ export const traverse = ({push, options}) => ({
43
44
  }
44
45
  },
45
46
  });
47
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.4.10",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",
@@ -1,41 +0,0 @@
1
- import {operator} from 'putout';
2
-
3
- const {
4
- setLiteralValue,
5
- getAttributeNode,
6
- addAttributeValue,
7
- getAttributeValue,
8
- removeAttributeValue,
9
- } = operator;
10
-
11
- export function setAttributeValue(node, name, value) {
12
- node = node.node || node;
13
-
14
- const attributeNode = getAttributeNode(node, name);
15
-
16
- if (attributeNode)
17
- setLiteralValue(attributeNode.value, value);
18
- }
19
-
20
- export function addClassName(path, name) {
21
- addAttributeValue(path, 'className', name);
22
- }
23
-
24
- export function getClassName(path) {
25
- return getAttributeValue(path, 'className');
26
- }
27
-
28
- export function removeClassName(path, name) {
29
- removeAttributeValue(path, 'className', name);
30
- }
31
-
32
- export function containsClassName(path, className) {
33
- const classNameValue = getClassName(path);
34
- return classNameValue.includes(className);
35
- }
36
-
37
- export function hasDataName(path, value = '') {
38
- const attribute = getAttributeValue(path, 'data-name');
39
- return attribute === value;
40
- }
41
-