aleman 1.4.8 → 1.4.10
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
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.
|
|
3
|
+
'putout': 'https://esm.sh/@putout/bundle@4.6.8',
|
|
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',
|
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
getAttributeNode,
|
|
6
6
|
addAttributeValue,
|
|
7
7
|
getAttributeValue,
|
|
8
|
+
removeAttributeValue,
|
|
8
9
|
} = operator;
|
|
9
10
|
|
|
10
11
|
export function setAttributeValue(node, name, value) {
|
|
@@ -33,19 +34,6 @@ export function containsClassName(path, className) {
|
|
|
33
34
|
return classNameValue.includes(className);
|
|
34
35
|
}
|
|
35
36
|
|
|
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
37
|
export function hasDataName(path, value = '') {
|
|
50
38
|
const attribute = getAttributeValue(path, 'data-name');
|
|
51
39
|
return attribute === value;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
75
|
+
removeClassName(path, 'menu-item-selected');
|
|
80
76
|
}
|
|
81
|
-
|