aleman 1.4.9 → 1.4.11

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.4.11
2
+
3
+ feature:
4
+ - d13066c aleman: setAttributeValue
5
+
6
+ 2025.09.10, v1.4.10
7
+
8
+ feature:
9
+ - f189812 aleman: menu: jsx-operator: removeAttributeValue
10
+
1
11
  2025.09.09, v1.4.9
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.5',
3
+ 'putout': 'https://esm.sh/@putout/bundle@4.6.9',
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,7 @@
1
- import {template} from 'putout';
2
- import {
3
- addClassName,
4
- hasDataName,
5
- setAttributeValue,
6
- } from '../jsx-operator.js';
1
+ import {template, operator} from 'putout';
2
+ import {addClassName, hasDataName} from '../jsx-operator.js';
7
3
 
4
+ const {setAttributeValue} = operator;
8
5
  const {entries} = Object;
9
6
 
10
7
  const noop = () => {};
@@ -99,3 +96,4 @@ function getIconName(name) {
99
96
  .replace(/\s/g, '-')
100
97
  .toLowerCase();
101
98
  }
99
+
@@ -1,21 +1,11 @@
1
1
  import {operator} from 'putout';
2
2
 
3
3
  const {
4
- setLiteralValue,
5
- getAttributeNode,
6
4
  addAttributeValue,
7
5
  getAttributeValue,
6
+ removeAttributeValue,
8
7
  } = operator;
9
8
 
10
- export function setAttributeValue(node, name, value) {
11
- node = node.node || node;
12
-
13
- const attributeNode = getAttributeNode(node, name);
14
-
15
- if (attributeNode)
16
- setLiteralValue(attributeNode.value, value);
17
- }
18
-
19
9
  export function addClassName(path, name) {
20
10
  addAttributeValue(path, 'className', name);
21
11
  }
@@ -33,19 +23,6 @@ export function containsClassName(path, className) {
33
23
  return classNameValue.includes(className);
34
24
  }
35
25
 
36
- export function removeAttributeValue(path, name, attributeValue) {
37
- if (!path)
38
- return;
39
-
40
- const {node} = path;
41
- const classAttribute = getAttributeNode(node, name);
42
-
43
- const {value} = classAttribute.value;
44
-
45
- if (value.includes(attributeValue))
46
- setLiteralValue(classAttribute.value, value.replace(RegExp(`\\s?${attributeValue}`), ''));
47
- }
48
-
49
26
  export function hasDataName(path, value = '') {
50
27
  const attribute = getAttributeValue(path, 'data-name');
51
28
  return attribute === value;
@@ -1,10 +1,8 @@
1
1
  import {types, operator} from 'putout';
2
- import {
3
- hasDataName,
4
- setAttributeValue,
5
- } from '../jsx-operator.js';
2
+ import {hasDataName} from '../jsx-operator.js';
6
3
 
7
4
  const {
5
+ setAttributeValue,
8
6
  getAttributeValue,
9
7
  getAttributePath,
10
8
  } = operator;
@@ -76,3 +74,4 @@ function parsePosition(str) {
76
74
  Number(y),
77
75
  ];
78
76
  }
77
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",