aleman 1.1.14 → 1.1.16

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.
Files changed (2) hide show
  1. package/menu/menu.js +6 -4
  2. package/package.json +1 -1
package/menu/menu.js CHANGED
@@ -1,7 +1,9 @@
1
1
  const {stringify} = JSON;
2
2
 
3
3
  export const createMenu = async (element, options, menuData) => {
4
- const {name = 'menu'} = options;
4
+ options.name = options.name || 'menu';
5
+ const {name} = options;
6
+
5
7
  const hydrateElement = createHydrate();
6
8
 
7
9
  await createMap();
@@ -35,8 +37,8 @@ async function createLink() {
35
37
  document.head.appendChild(style);
36
38
  }
37
39
 
38
- function createHydrate() {
39
- const name = 'aleman-hydrate-menu';
40
+ function createHydrate(name) {
41
+ const elementName = `aleman-hydrate-${name}`;
40
42
  const hydrateElement = findByName(name);
41
43
 
42
44
  if (hydrateElement)
@@ -44,7 +46,7 @@ function createHydrate() {
44
46
 
45
47
  const section = document.createElement('section');
46
48
 
47
- section.dataset.name = name;
49
+ section.dataset.name = elementName;
48
50
  section.innerHTML = `<ul data-name="menu" class="menu menu-hidden"></ul>`;
49
51
  document.body.append(section);
50
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aleman",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout-based framework for web",