menupro 2.1.0 → 2.1.1

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 (4) hide show
  1. package/index.cjs +80 -2
  2. package/index.css +111 -1
  3. package/index.js +79 -1
  4. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1,3 +1,81 @@
1
- ;(()=>{const s=document.createElement("style");s.textContent="@layer menupro {.menupro{position:relative;margin:0;padding:0}.menupro ul,.menupro li{background-color:#000;list-style:none;margin:0;padding:0}.menupro img,.menupro svg{max-width:20px}.menupro li:hover{transition:0s;transition-delay:0s}.menupro ul,.menupro ul:hover{transition:0s;transition-delay:.5s}.menupro hr{border:1px solid!important;height:0!important;color:#333!important;background-color:#333!important;margin:0;padding:0}.menupro a{padding:4px 10px;display:block;text-align:left;white-space:nowrap}.menupro:hover{background-color:#0b86bf}.menupro li{float:left;position:relative}.menupro li:hover,.menupro li:active{background-color:#0b86bf}.menupro li:hover>ul,.menupro li:focus-within>ul{opacity:1;visibility:visible;transition-delay:visibility 0s}.menupro li>span.icon{position:absolute;left:5px;top:8px;width:13px;height:auto;filter:invert(.5)}.menupro li>span.arrow:before{content:\"\\203a\";position:absolute;right:5px;top:0;font-size:1.5em;line-height:1em}.menupro li>ul{position:absolute;width:auto;float:left;opacity:0;visibility:hidden;transition-delay:visibility 0s;box-shadow:0 10px 12px -8px #000;padding:0}.menupro li>ul li{float:left;position:relative;width:100%;padding:0}.menupro li>ul li:hover>ul,.menupro li>ul li:focus-within>ul{opacity:1;pointer-events:auto}.menupro li>ul li:not(:visible){pointer-events:none}.menupro li>ul li>ul{position:absolute;margin:0 auto;top:0;left:99%}.menupro li>ul li a{padding:4px 20px 4px 30px}}";document.head.appendChild(s)})();'use strict';
1
+ ;(()=>{const s=document.createElement("style");s.textContent="@layer menupro {.menupro{position:relative;margin:0;padding:0;}.menupro ul,.menupro li,.menupro ul{background-color:#000;list-style:none;margin:0;padding:0;}.menupro img,.menupro svg{max-width:20px;}.menupro li:hover{transition:0s;transition-delay:0s;}.menupro ul,.menupro ul,.menupro ul:hover,.menupro ul:hover{transition:0s;transition-delay:0.5s;}.menupro hr{border:1px solid !important;height:0 !important;color:#333 !important;background-color:#333 !important;margin:0;padding:0;}.menupro a{padding:4px 10px;display:block;text-align:left;white-space:nowrap;}.menupro:hover{background-color:#0b86bf;}.menupro li{float:left;position:relative;}.menupro li:hover,.menupro li:active{background-color:#0b86bf;}.menupro li:hover > ul,.menupro li:focus-within > ul{opacity:1;visibility:visible;transition-delay:visibility 0s;}.menupro li > span.icon{position:absolute;left:5px;top:8px;width:13px;height:auto;filter:invert(0.5);}.menupro li > span.arrow:before{content:\u0022\\203a\u0022;position:absolute;right:5px;top:0;font-size:1.5em;line-height:1em;}.menupro li > ul{position:absolute;width:auto;float:left;opacity:0;visibility:hidden;transition-delay:visibility 0s;box-shadow:0 10px 12px -8px black;padding:0;}.menupro li > ul li{float:left;position:relative;width:100%;padding:0;}.menupro li > ul li:hover > ul,.menupro li > ul li:focus-within > ul{opacity:1;pointer-events:auto;}.menupro li > ul li:not(:visible){pointer-events:none;}.menupro li > ul li > ul{position:absolute;margin:0 auto;top:0px;left:99%;}.menupro li > ul li a{padding:4px 20px 4px 30px;}}";document.head.appendChild(s)})();"use strict";
2
2
 
3
- Object.defineProperty(window,"menupro",{value:{start:{}},writable:false,configurable:false,enumerable:false});var N=new Set(["eval","Function","exec","spawn","execSync","fetch","XMLHttpRequest","WebSocket","importScripts","setTimeout","setInterval","setImmediate","document.write","document.writeln","innerHTML","outerHTML","location","location.href","location.assign","location.replace","history.pushState","history.replaceState","localStorage","sessionStorage","cookie","postMessage","import","require"]),S=a=>/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(a)&&!N.has(a)&&!a.includes("__");menupro.start=a=>{let{element:d,name:h=a.name||"menupro",nav:T=a.nav||[]}=a,o,g,s=u=>document.createElement(u),k=(u,c="."+h)=>{let b=typeof c=="string"?document.querySelector(c):c;b&&u?.map(t=>{if(t.name){o=s("li");let e=s("a");e.textContent=t.name,o.appendChild(e),b.appendChild(o);}if(t.onclick&&t.sub?.length===0){let e;if(typeof t.onclick=="function")e=t.onclick;else if(typeof t.onclick=="string"){let r=t.onclick.trim();if(r.includes("(")&&r.endsWith(")")){let m=r.match(/^(\w+)\((.*)\)$/);if(m){let[,f,x]=m;if(!S(f))e=()=>{console.warn("menupro: blocked dangerous function:",f);};else {let w=window[f];if(w&&typeof w=="function"){let M=i=>{let n=i.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);if(!isNaN(Number(n)))return Number(n);if(n==="true")return true;if(n==="false")return false;if(n==="null")return null;n!=="undefined"&&console.warn("menupro: variable reference blocked:",n);},y=[];if(x.trim()){let i="",n=0,p=false,v="";for(let l of x)(l==='"'||l==="'")&&i.slice(-1)!=="\\"&&(p?l===v&&(p=false,v=""):(p=true,v=l)),!p&&l==="("&&n++,!p&&l===")"&&n--,!p&&n===0&&l===","?(y.push(M(i)),i=""):i+=l;i.trim()&&y.push(M(i));}e=()=>{try{w(...y);}catch(i){console.warn("menupro: onclick error:",i);}};}else e=()=>{console.warn("menupro: function not found:",f);};}}else e=()=>{console.warn("menupro: invalid function call:",r);};}else if(!S(r))e=()=>{console.warn("menupro: blocked dangerous function:",r);};else {let m=window[r];e=m||(()=>{console.warn("menupro: function not found:",r);});}}else e=()=>{};o.addEventListener("click",e);}if(t.name===""&&(o=s("hr"),b.appendChild(o)),c!="."+h){if(t.icon){let e=s("span");e.className="icon",e.innerHTML=t.icon,o.appendChild(e);}if(t.sub?.length>0){let e=s("span");e.className="arrow",o.appendChild(e);}}t.sub?.length>0&&(g=s("ul"),o.appendChild(g),k(t.sub,g));});};setTimeout(()=>{let u=s("ul");u.className=h;let c=typeof d=="string"?document.querySelector(d):d;c&&(c.appendChild(u),k(T,u));},0);};
3
+ Object.defineProperty(window, "menupro", {
4
+ value: {
5
+ start: {}
6
+ },
7
+ writable: !1,
8
+ configurable: !1,
9
+ enumerable: !1
10
+ });
11
+
12
+ var e = new Set([ "eval", "Function", "exec", "spawn", "execSync", "fetch", "XMLHttpRequest", "WebSocket", "importScripts", "setTimeout", "setInterval", "setImmediate", "document.write", "document.writeln", "innerHTML", "outerHTML", "location", "location.href", "location.assign", "location.replace", "history.pushState", "history.replaceState", "localStorage", "sessionStorage", "cookie", "postMessage", "import", "require" ]), t = t => /^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(t) && !e.has(t) && !t.includes("__");
13
+
14
+ menupro.start = e => {
15
+ const {element: n, name: i = e.name || "menupro", nav: s = e.nav || []} = e;
16
+ let o, c;
17
+ const a = e => document.createElement(e), l = (e, n = "." + i) => {
18
+ const s = "string" == typeof n ? document.querySelector(n) : n;
19
+ s && e?.map(e => {
20
+ if (e.name) {
21
+ o = a("li");
22
+ const t = a("a");
23
+ t.textContent = e.name, o.appendChild(t), s.appendChild(o);
24
+ }
25
+ if (e.onclick && 0 === e.sub?.length) {
26
+ let n;
27
+ if ("function" == typeof e.onclick) n = e.onclick; else if ("string" == typeof e.onclick) {
28
+ const i = e.onclick.trim();
29
+ if (i.includes("(") && i.endsWith(")")) {
30
+ const e = i.match(/^(\w+)\((.*)\)$/);
31
+ if (e) {
32
+ const [, i, s] = e;
33
+ if (t(i)) {
34
+ const e = window[i];
35
+ if (e && "function" == typeof e) {
36
+ const t = e => {
37
+ const t = e.trim();
38
+ return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : isNaN(Number(t)) ? "true" === t || "false" !== t && ("null" === t ? null : void 0) : Number(t);
39
+ }, i = [];
40
+ if (s.trim()) {
41
+ let e = "", n = 0, o = !1, c = "";
42
+ for (const a of s) '"' !== a && "'" !== a || "\\" === e.slice(-1) || (o ? a === c && (o = !1,
43
+ c = "") : (o = !0, c = a)), o || "(" !== a || n++, o || ")" !== a || n--, o || 0 !== n || "," !== a ? e += a : (i.push(t(e)),
44
+ e = "");
45
+ e.trim() && i.push(t(e));
46
+ }
47
+ n = () => {
48
+ try {
49
+ e(...i);
50
+ } catch (e) {}
51
+ };
52
+ } else n = () => {};
53
+ } else n = () => {};
54
+ } else n = () => {};
55
+ } else if (t(i)) {
56
+ const e = window[i];
57
+ n = e || (() => {});
58
+ } else n = () => {};
59
+ } else n = () => {};
60
+ o.addEventListener("click", n);
61
+ }
62
+ if ("" === e.name && (o = a("hr"), s.appendChild(o)), n != "." + i) {
63
+ if (e.icon) {
64
+ const t = a("span");
65
+ t.className = "icon", t.innerHTML = e.icon, o.appendChild(t);
66
+ }
67
+ if (e.sub?.length > 0) {
68
+ const e = a("span");
69
+ e.className = "arrow", o.appendChild(e);
70
+ }
71
+ }
72
+ e.sub?.length > 0 && (c = a("ul"), o.appendChild(c), l(e.sub, c));
73
+ });
74
+ };
75
+ setTimeout(() => {
76
+ const e = a("ul");
77
+ e.className = i;
78
+ const t = "string" == typeof n ? document.querySelector(n) : n;
79
+ t && (t.appendChild(e), l(s, e));
80
+ }, 0);
81
+ };
package/index.css CHANGED
@@ -1 +1,111 @@
1
- @charset "UTF-8";.menupro{position:relative;margin:0;padding:0}.menupro ul,.menupro li{background-color:#000;list-style:none;margin:0;padding:0}.menupro img,.menupro svg{max-width:20px}.menupro li:hover{transition:0s;transition-delay:0s}.menupro ul,.menupro ul:hover{transition:0s;transition-delay:.5s}.menupro hr{border:1px solid!important;height:0!important;color:#333!important;background-color:#333!important;margin:0;padding:0}.menupro a{padding:4px 10px;display:block;text-align:left;white-space:nowrap}.menupro :hover{background-color:#0b86bf}.menupro li{float:left;position:relative}.menupro li :hover,.menupro li :active{background-color:#0b86bf}.menupro li:hover>ul,.menupro li:focus-within>ul{opacity:1;visibility:visible;transition-delay:visibility 0s}.menupro li>span.icon{position:absolute;left:5px;top:8px;width:13px;height:auto;filter:invert(.5)}.menupro li>span.arrow:before{content:"\203a";position:absolute;right:5px;top:0;font-size:1.5em;line-height:1em}.menupro li>ul{position:absolute;width:auto;float:left;opacity:0;visibility:hidden;transition-delay:visibility 0s;box-shadow:0 10px 12px -8px #000;padding:0}.menupro li>ul li{float:left;position:relative;width:100%;padding:0}.menupro li>ul li:hover>ul,.menupro li>ul li:focus-within>ul{opacity:1;pointer-events:auto}.menupro li>ul li:not(:visible){pointer-events:none}.menupro li>ul li>ul{position:absolute;margin:0 auto;top:0;left:99%}.menupro li>ul li a{padding:4px 20px 4px 30px}
1
+ @charset "UTF-8";
2
+
3
+ /* scss/menupro.scss */
4
+ .menupro {
5
+ position: relative;
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+ .menupro ul,
10
+ .menupro li,
11
+ .menupro ul {
12
+ background-color: #000;
13
+ list-style: none;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+ .menupro img,
18
+ .menupro svg {
19
+ max-width: 20px;
20
+ }
21
+ .menupro li:hover {
22
+ transition: 0s;
23
+ transition-delay: 0s;
24
+ }
25
+ .menupro ul,
26
+ .menupro ul,
27
+ .menupro ul:hover,
28
+ .menupro ul:hover {
29
+ transition: 0s;
30
+ transition-delay: 0.5s;
31
+ }
32
+ .menupro hr {
33
+ border: 1px solid !important;
34
+ height: 0 !important;
35
+ color: #333 !important;
36
+ background-color: #333 !important;
37
+ margin: 0;
38
+ padding: 0;
39
+ }
40
+ .menupro a {
41
+ padding: 4px 10px;
42
+ display: block;
43
+ text-align: left;
44
+ white-space: nowrap;
45
+ }
46
+ .menupro :hover {
47
+ background-color: #0b86bf;
48
+ }
49
+ .menupro li {
50
+ float: left;
51
+ position: relative;
52
+ }
53
+ .menupro li :hover,
54
+ .menupro li :active {
55
+ background-color: #0b86bf;
56
+ }
57
+ .menupro li:hover > ul,
58
+ .menupro li:focus-within > ul {
59
+ opacity: 1;
60
+ visibility: visible;
61
+ transition-delay: visibility 0s;
62
+ }
63
+ .menupro li > span.icon {
64
+ position: absolute;
65
+ left: 5px;
66
+ top: 8px;
67
+ width: 13px;
68
+ height: auto;
69
+ filter: invert(0.5);
70
+ }
71
+ .menupro li > span.arrow:before {
72
+ content: "\203a";
73
+ position: absolute;
74
+ right: 5px;
75
+ top: 0;
76
+ font-size: 1.5em;
77
+ line-height: 1em;
78
+ }
79
+ .menupro li > ul {
80
+ position: absolute;
81
+ width: auto;
82
+ float: left;
83
+ opacity: 0;
84
+ visibility: hidden;
85
+ transition-delay: visibility 0s;
86
+ box-shadow: 0 10px 12px -8px black;
87
+ padding: 0;
88
+ }
89
+ .menupro li > ul li {
90
+ float: left;
91
+ position: relative;
92
+ width: 100%;
93
+ padding: 0;
94
+ }
95
+ .menupro li > ul li:hover > ul,
96
+ .menupro li > ul li:focus-within > ul {
97
+ opacity: 1;
98
+ pointer-events: auto;
99
+ }
100
+ .menupro li > ul li:not(:visible) {
101
+ pointer-events: none;
102
+ }
103
+ .menupro li > ul li > ul {
104
+ position: absolute;
105
+ margin: 0 auto;
106
+ top: 0px;
107
+ left: 99%;
108
+ }
109
+ .menupro li > ul li a {
110
+ padding: 4px 20px 4px 30px;
111
+ }
package/index.js CHANGED
@@ -1 +1,79 @@
1
- ;(()=>{const s=document.createElement("style");s.textContent="@layer menupro {.menupro{position:relative;margin:0;padding:0}.menupro ul,.menupro li{background-color:#000;list-style:none;margin:0;padding:0}.menupro img,.menupro svg{max-width:20px}.menupro li:hover{transition:0s;transition-delay:0s}.menupro ul,.menupro ul:hover{transition:0s;transition-delay:.5s}.menupro hr{border:1px solid!important;height:0!important;color:#333!important;background-color:#333!important;margin:0;padding:0}.menupro a{padding:4px 10px;display:block;text-align:left;white-space:nowrap}.menupro:hover{background-color:#0b86bf}.menupro li{float:left;position:relative}.menupro li:hover,.menupro li:active{background-color:#0b86bf}.menupro li:hover>ul,.menupro li:focus-within>ul{opacity:1;visibility:visible;transition-delay:visibility 0s}.menupro li>span.icon{position:absolute;left:5px;top:8px;width:13px;height:auto;filter:invert(.5)}.menupro li>span.arrow:before{content:\"\\203a\";position:absolute;right:5px;top:0;font-size:1.5em;line-height:1em}.menupro li>ul{position:absolute;width:auto;float:left;opacity:0;visibility:hidden;transition-delay:visibility 0s;box-shadow:0 10px 12px -8px #000;padding:0}.menupro li>ul li{float:left;position:relative;width:100%;padding:0}.menupro li>ul li:hover>ul,.menupro li>ul li:focus-within>ul{opacity:1;pointer-events:auto}.menupro li>ul li:not(:visible){pointer-events:none}.menupro li>ul li>ul{position:absolute;margin:0 auto;top:0;left:99%}.menupro li>ul li a{padding:4px 20px 4px 30px}}";document.head.appendChild(s)})();Object.defineProperty(window,"menupro",{value:{start:{}},writable:false,configurable:false,enumerable:false});var N=new Set(["eval","Function","exec","spawn","execSync","fetch","XMLHttpRequest","WebSocket","importScripts","setTimeout","setInterval","setImmediate","document.write","document.writeln","innerHTML","outerHTML","location","location.href","location.assign","location.replace","history.pushState","history.replaceState","localStorage","sessionStorage","cookie","postMessage","import","require"]),S=a=>/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(a)&&!N.has(a)&&!a.includes("__");menupro.start=a=>{let{element:d,name:h=a.name||"menupro",nav:T=a.nav||[]}=a,o,g,s=u=>document.createElement(u),k=(u,c="."+h)=>{let b=typeof c=="string"?document.querySelector(c):c;b&&u?.map(t=>{if(t.name){o=s("li");let e=s("a");e.textContent=t.name,o.appendChild(e),b.appendChild(o);}if(t.onclick&&t.sub?.length===0){let e;if(typeof t.onclick=="function")e=t.onclick;else if(typeof t.onclick=="string"){let r=t.onclick.trim();if(r.includes("(")&&r.endsWith(")")){let m=r.match(/^(\w+)\((.*)\)$/);if(m){let[,f,x]=m;if(!S(f))e=()=>{console.warn("menupro: blocked dangerous function:",f);};else {let w=window[f];if(w&&typeof w=="function"){let M=i=>{let n=i.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);if(!isNaN(Number(n)))return Number(n);if(n==="true")return true;if(n==="false")return false;if(n==="null")return null;n!=="undefined"&&console.warn("menupro: variable reference blocked:",n);},y=[];if(x.trim()){let i="",n=0,p=false,v="";for(let l of x)(l==='"'||l==="'")&&i.slice(-1)!=="\\"&&(p?l===v&&(p=false,v=""):(p=true,v=l)),!p&&l==="("&&n++,!p&&l===")"&&n--,!p&&n===0&&l===","?(y.push(M(i)),i=""):i+=l;i.trim()&&y.push(M(i));}e=()=>{try{w(...y);}catch(i){console.warn("menupro: onclick error:",i);}};}else e=()=>{console.warn("menupro: function not found:",f);};}}else e=()=>{console.warn("menupro: invalid function call:",r);};}else if(!S(r))e=()=>{console.warn("menupro: blocked dangerous function:",r);};else {let m=window[r];e=m||(()=>{console.warn("menupro: function not found:",r);});}}else e=()=>{};o.addEventListener("click",e);}if(t.name===""&&(o=s("hr"),b.appendChild(o)),c!="."+h){if(t.icon){let e=s("span");e.className="icon",e.innerHTML=t.icon,o.appendChild(e);}if(t.sub?.length>0){let e=s("span");e.className="arrow",o.appendChild(e);}}t.sub?.length>0&&(g=s("ul"),o.appendChild(g),k(t.sub,g));});};setTimeout(()=>{let u=s("ul");u.className=h;let c=typeof d=="string"?document.querySelector(d):d;c&&(c.appendChild(u),k(T,u));},0);};
1
+ ;(()=>{const s=document.createElement("style");s.textContent="@layer menupro {.menupro{position:relative;margin:0;padding:0;}.menupro ul,.menupro li,.menupro ul{background-color:#000;list-style:none;margin:0;padding:0;}.menupro img,.menupro svg{max-width:20px;}.menupro li:hover{transition:0s;transition-delay:0s;}.menupro ul,.menupro ul,.menupro ul:hover,.menupro ul:hover{transition:0s;transition-delay:0.5s;}.menupro hr{border:1px solid !important;height:0 !important;color:#333 !important;background-color:#333 !important;margin:0;padding:0;}.menupro a{padding:4px 10px;display:block;text-align:left;white-space:nowrap;}.menupro:hover{background-color:#0b86bf;}.menupro li{float:left;position:relative;}.menupro li:hover,.menupro li:active{background-color:#0b86bf;}.menupro li:hover > ul,.menupro li:focus-within > ul{opacity:1;visibility:visible;transition-delay:visibility 0s;}.menupro li > span.icon{position:absolute;left:5px;top:8px;width:13px;height:auto;filter:invert(0.5);}.menupro li > span.arrow:before{content:\u0022\\203a\u0022;position:absolute;right:5px;top:0;font-size:1.5em;line-height:1em;}.menupro li > ul{position:absolute;width:auto;float:left;opacity:0;visibility:hidden;transition-delay:visibility 0s;box-shadow:0 10px 12px -8px black;padding:0;}.menupro li > ul li{float:left;position:relative;width:100%;padding:0;}.menupro li > ul li:hover > ul,.menupro li > ul li:focus-within > ul{opacity:1;pointer-events:auto;}.menupro li > ul li:not(:visible){pointer-events:none;}.menupro li > ul li > ul{position:absolute;margin:0 auto;top:0px;left:99%;}.menupro li > ul li a{padding:4px 20px 4px 30px;}}";document.head.appendChild(s)})();Object.defineProperty(window, "menupro", {
2
+ value: {
3
+ start: {}
4
+ },
5
+ writable: !1,
6
+ configurable: !1,
7
+ enumerable: !1
8
+ });
9
+
10
+ var e = new Set([ "eval", "Function", "exec", "spawn", "execSync", "fetch", "XMLHttpRequest", "WebSocket", "importScripts", "setTimeout", "setInterval", "setImmediate", "document.write", "document.writeln", "innerHTML", "outerHTML", "location", "location.href", "location.assign", "location.replace", "history.pushState", "history.replaceState", "localStorage", "sessionStorage", "cookie", "postMessage", "import", "require" ]), t = t => /^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(t) && !e.has(t) && !t.includes("__");
11
+
12
+ menupro.start = e => {
13
+ const {element: n, name: i = e.name || "menupro", nav: s = e.nav || []} = e;
14
+ let o, c;
15
+ const a = e => document.createElement(e), l = (e, n = "." + i) => {
16
+ const s = "string" == typeof n ? document.querySelector(n) : n;
17
+ s && e?.map(e => {
18
+ if (e.name) {
19
+ o = a("li");
20
+ const t = a("a");
21
+ t.textContent = e.name, o.appendChild(t), s.appendChild(o);
22
+ }
23
+ if (e.onclick && 0 === e.sub?.length) {
24
+ let n;
25
+ if ("function" == typeof e.onclick) n = e.onclick; else if ("string" == typeof e.onclick) {
26
+ const i = e.onclick.trim();
27
+ if (i.includes("(") && i.endsWith(")")) {
28
+ const e = i.match(/^(\w+)\((.*)\)$/);
29
+ if (e) {
30
+ const [, i, s] = e;
31
+ if (t(i)) {
32
+ const e = window[i];
33
+ if (e && "function" == typeof e) {
34
+ const t = e => {
35
+ const t = e.trim();
36
+ return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : isNaN(Number(t)) ? "true" === t || "false" !== t && ("null" === t ? null : void 0) : Number(t);
37
+ }, i = [];
38
+ if (s.trim()) {
39
+ let e = "", n = 0, o = !1, c = "";
40
+ for (const a of s) '"' !== a && "'" !== a || "\\" === e.slice(-1) || (o ? a === c && (o = !1,
41
+ c = "") : (o = !0, c = a)), o || "(" !== a || n++, o || ")" !== a || n--, o || 0 !== n || "," !== a ? e += a : (i.push(t(e)),
42
+ e = "");
43
+ e.trim() && i.push(t(e));
44
+ }
45
+ n = () => {
46
+ try {
47
+ e(...i);
48
+ } catch (e) {}
49
+ };
50
+ } else n = () => {};
51
+ } else n = () => {};
52
+ } else n = () => {};
53
+ } else if (t(i)) {
54
+ const e = window[i];
55
+ n = e || (() => {});
56
+ } else n = () => {};
57
+ } else n = () => {};
58
+ o.addEventListener("click", n);
59
+ }
60
+ if ("" === e.name && (o = a("hr"), s.appendChild(o)), n != "." + i) {
61
+ if (e.icon) {
62
+ const t = a("span");
63
+ t.className = "icon", t.innerHTML = e.icon, o.appendChild(t);
64
+ }
65
+ if (e.sub?.length > 0) {
66
+ const e = a("span");
67
+ e.className = "arrow", o.appendChild(e);
68
+ }
69
+ }
70
+ e.sub?.length > 0 && (c = a("ul"), o.appendChild(c), l(e.sub, c));
71
+ });
72
+ };
73
+ setTimeout(() => {
74
+ const e = a("ul");
75
+ e.className = i;
76
+ const t = "string" == typeof n ? document.querySelector(n) : n;
77
+ t && (t.appendChild(e), l(s, e));
78
+ }, 0);
79
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "menupro",
3
3
  "code": "menupro",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "description": "Custom menu like OS but better",
6
6
  "main": "./index.cjs",
7
7
  "browser": "./index.cjs",