aleman 1.1.18 → 1.1.19

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/menu/menu.js CHANGED
@@ -46,7 +46,7 @@ function createHydrate(name) {
46
46
  const section = document.createElement('section');
47
47
 
48
48
  section.dataset.name = `aleman-hydrate-${name}`;
49
- section.innerHTML = `<ul data-name="${name}" class="menu menu-hidden"></ul>`;
49
+ section.innerHTML = `<ul data-name="menu" class="menu menu-hidden"></ul>`;
50
50
  document.body.append(section);
51
51
 
52
52
  return section;
@@ -1 +1,3 @@
1
- <ul data-name="menu" className='menu menu-hidden'><li></li><li></li></ul>;
1
+ <sction data-name="aleman-hydrate-hello">
2
+ <ul data-name="menu" className='menu menu-hidden'><li></li><li></li></ul>;
3
+ </sction>;
@@ -1 +1,3 @@
1
- <ul data-name="menu" className="menu"><li></li><li></li></ul>;
1
+ <sction data-name="aleman-hydrate-hello">
2
+ <ul data-name="menu" className="menu"><li></li><li></li></ul>;
3
+ </sction>;
@@ -1,4 +1,7 @@
1
- import {operator} from 'putout';
1
+ import {operator, types} from 'putout';
2
+ import {checkDataName} from '../check-data-name.js';
3
+
4
+ const {isJSXElement} = types;
2
5
 
3
6
  const {setLiteralValue} = operator;
4
7
 
@@ -22,20 +25,11 @@ export const fix = ({path, command}) => {
22
25
 
23
26
  export const traverse = ({push, options}) => ({
24
27
  JSXOpeningElement(path) {
25
- const {name: menuName, command} = options;
28
+ const {name, command} = options;
26
29
  const attributes = path.get('attributes');
27
30
 
28
- for (const attr of attributes) {
29
- const {name, value} = attr.node;
30
-
31
- if (name.name !== 'data-name')
32
- continue;
33
-
34
- if (value.value !== menuName)
35
- return;
36
-
37
- break;
38
- }
31
+ if (!checkDataName(path.parentPath, name))
32
+ return false;
39
33
 
40
34
  for (const attr of attributes) {
41
35
  const {name, value} = attr.node;
@@ -57,3 +51,4 @@ export const traverse = ({push, options}) => ({
57
51
  }
58
52
  },
59
53
  });
54
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",