aleman 1.1.17 → 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
@@ -4,7 +4,7 @@ export const createMenu = async (element, options, menuData) => {
4
4
  options.name = options.name || 'menu';
5
5
  const {name} = options;
6
6
 
7
- const hydrateElement = createHydrate();
7
+ const hydrateElement = createHydrate(name);
8
8
 
9
9
  await createMap();
10
10
  await createLink();
@@ -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.17",
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",