generate-atomic-css
Advanced tools
Comparing version 3.0.6 to 3.0.7
/** | ||
* @name generate-atomic-css | ||
* @fileoverview Generate Atomic CSS | ||
* @version 3.0.6 | ||
* @version 3.0.7 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,3 +10,3 @@ * @license MIT | ||
import{left as y,right as g}from"string-left-right";var J="3.0.6";import{left as O,right as b,leftSeq as x,rightSeq as L}from"string-left-right";function P(e){return typeof e=="string"}var F={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},w=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:S,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(S)){if(e.indexOf(S)!==-1&&e.indexOf(E)!==-1&&e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let s=e.indexOf(T)+T.length,l=e.indexOf(S);if(e[b(e,s)]==="*"&&e[b(e,b(e,s))]==="/"&&(s=b(e,b(e,s))+1),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l))),u=e.slice(s,l).trim(),!P(u)||!u.trim().length)return[u,c,d]}else if(e.includes(T)&&!e.includes(S)&&e.includes(E)){if(e.indexOf(T)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");u=e.slice(e.indexOf(T)+T.length,e.indexOf(E))}else if(!e.includes(T)&&!e.includes(S)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);x(e,o,"/","*")&&(o=x(e,o,"/","*").leftmostChar),c=o===0?"":e.slice(0,o)}let s=u.indexOf(E)+E.length;L(u,s-1,"*","/")&&(s=L(u,s-1,"*","/").rightmostChar+1);let l=null;if(e.includes(h)){l=e.indexOf(h),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l)));let o=e.indexOf(h)+h.length;e[b(e,o-1)]==="*"&&e[b(e,b(e,o-1))]==="/"&&(o=b(e,b(e,o-1))+1),b(e,o)&&(d=e.slice(o))}l?u=u.slice(s,l).trim():u=u.slice(s).trim()}else if(u.includes(h)){let s=[],l=!1;u=u.split(` | ||
import{left as y,right as g}from"string-left-right";var J="3.0.7";import{left as O,right as b,leftSeq as x,rightSeq as L}from"string-left-right";function P(e){return typeof e=="string"}var F={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},w=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:S,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(S)){if(e.indexOf(S)!==-1&&e.indexOf(E)!==-1&&e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let s=e.indexOf(T)+T.length,l=e.indexOf(S);if(e[b(e,s)]==="*"&&e[b(e,b(e,s))]==="/"&&(s=b(e,b(e,s))+1),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l))),u=e.slice(s,l).trim(),!P(u)||!u.trim().length)return[u,c,d]}else if(e.includes(T)&&!e.includes(S)&&e.includes(E)){if(e.indexOf(T)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");u=e.slice(e.indexOf(T)+T.length,e.indexOf(E))}else if(!e.includes(T)&&!e.includes(S)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);x(e,o,"/","*")&&(o=x(e,o,"/","*").leftmostChar),c=o===0?"":e.slice(0,o)}let s=u.indexOf(E)+E.length;L(u,s-1,"*","/")&&(s=L(u,s-1,"*","/").rightmostChar+1);let l=null;if(e.includes(h)){l=e.indexOf(h),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l)));let o=e.indexOf(h)+h.length;e[b(e,o-1)]==="*"&&e[b(e,b(e,o-1))]==="/"&&(o=b(e,b(e,o-1))+1),b(e,o)&&(d=e.slice(o))}l?u=u.slice(s,l).trim():u=u.slice(s).trim()}else if(u.includes(h)){let s=[],l=!1;u=u.split(` | ||
`).filter(i=>!i.includes("$$$")&&!l?(l||s.push(i),!1):(l||(l=!0),!0)).join(` | ||
@@ -13,0 +13,0 @@ `);let o=u.indexOf(h);x(u,o,"/","*")&&(o=x(u,o,"/","*").leftmostChar),u=u.slice(0,o).trim(),s.length&&(c=`${s.join(` |
/** | ||
* @name generate-atomic-css | ||
* @fileoverview Generate Atomic CSS | ||
* @version 3.0.6 | ||
* @version 3.0.7 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -16,3 +16,3 @@ * @license MIT | ||
\r`.includes(e[t-2])||r&&e[t-2]===L))return t-2;for(let o=t;o--;)if(e[o]&&(e[o].trim()||n&&` | ||
\r`.includes(e[o])||r&&e[o]===L))return o;return null}function y(e,t=0){return lr({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function $t(e,t,n,r,o){if(typeof t!="string"||!t.length||(typeof n!="number"&&(n=0),e==="right"&&!t[n+1]||e==="left"&&!t[~-n]))return null;let i=n,l=[],s,a,g,u=0;for(;u<o.length;){if(!or(o[u])||!o[u].length){u+=1;continue}let{value:h,optional:d,hungry:m}=rr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===h.toLowerCase()||!r.i&&t[b]===h){let c=e==="right"?f(t,b):y(t,b);m&&(r.i&&t[c].toLowerCase()===h.toLowerCase()||!r.i&&t[c]===h)?g=!0:u+=1,typeof b=="number"&&e==="right"&&b>i+1?l.push([i+1,b]):e==="left"&&typeof b=="number"&&b<~-i&&l.unshift([b+1,i]),i=b,e==="right"?(s===void 0&&(s=b),a=b):(a===void 0&&(a=b),s=b)}else if(d){u+=1;continue}else if(g){u+=1,g=void 0;continue}else return null}return s===void 0||a===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:a}}var z={i:!1};function H(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let r;return re(n[0])?r=S(S({},z),n.shift()):r=z,$t("left",e,t,r,Array.from(n).reverse())}function he(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let r;return re(n[0])?r=S(S({},z),n.shift()):r=z,$t("right",e,t,r,n)}var dt="3.0.6";function te(e){return typeof e=="string"}var ne={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},ee=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:x,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:A}=ne,ur=[":"];function bt(e){let t=e,n="",r="";if(e.includes(x)&&e.includes(R)){if(e.indexOf(R)!==-1&&e.indexOf(E)!==-1&&e.indexOf(R)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let o=e.indexOf(x)+x.length,i=e.indexOf(R);if(e[f(e,o)]==="*"&&e[f(e,f(e,o))]==="/"&&(o=f(e,f(e,o))+1),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i))),t=e.slice(o,i).trim(),!te(t)||!t.trim().length)return[t,n,r]}else if(e.includes(x)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(x)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(x)+x.length,e.indexOf(E))}else if(!e.includes(x)&&!e.includes(R)&&(e.includes(E)||e.includes(A))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);H(e,l,"/","*")&&(l=H(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;he(t,o-1,"*","/")&&(o=he(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(A)){i=e.indexOf(A),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(A)+A.length;e[f(e,l-1)]==="*"&&e[f(e,f(e,l-1))]==="/"&&(l=f(e,f(e,l-1))+1),f(e,l)&&(r=e.slice(l))}i?t=t.slice(o,i).trim():t=t.slice(o).trim()}else if(t.includes(A)){let o=[],i=!1;t=t.split(` | ||
\r`.includes(e[o])||r&&e[o]===L))return o;return null}function y(e,t=0){return lr({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function $t(e,t,n,r,o){if(typeof t!="string"||!t.length||(typeof n!="number"&&(n=0),e==="right"&&!t[n+1]||e==="left"&&!t[~-n]))return null;let i=n,l=[],s,a,g,u=0;for(;u<o.length;){if(!or(o[u])||!o[u].length){u+=1;continue}let{value:h,optional:d,hungry:m}=rr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===h.toLowerCase()||!r.i&&t[b]===h){let c=e==="right"?f(t,b):y(t,b);m&&(r.i&&t[c].toLowerCase()===h.toLowerCase()||!r.i&&t[c]===h)?g=!0:u+=1,typeof b=="number"&&e==="right"&&b>i+1?l.push([i+1,b]):e==="left"&&typeof b=="number"&&b<~-i&&l.unshift([b+1,i]),i=b,e==="right"?(s===void 0&&(s=b),a=b):(a===void 0&&(a=b),s=b)}else if(d){u+=1;continue}else if(g){u+=1,g=void 0;continue}else return null}return s===void 0||a===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:a}}var z={i:!1};function H(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let r;return re(n[0])?r=S(S({},z),n.shift()):r=z,$t("left",e,t,r,Array.from(n).reverse())}function he(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let r;return re(n[0])?r=S(S({},z),n.shift()):r=z,$t("right",e,t,r,n)}var dt="3.0.7";function te(e){return typeof e=="string"}var ne={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},ee=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:x,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:A}=ne,ur=[":"];function bt(e){let t=e,n="",r="";if(e.includes(x)&&e.includes(R)){if(e.indexOf(R)!==-1&&e.indexOf(E)!==-1&&e.indexOf(R)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let o=e.indexOf(x)+x.length,i=e.indexOf(R);if(e[f(e,o)]==="*"&&e[f(e,f(e,o))]==="/"&&(o=f(e,f(e,o))+1),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i))),t=e.slice(o,i).trim(),!te(t)||!t.trim().length)return[t,n,r]}else if(e.includes(x)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(x)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(x)+x.length,e.indexOf(E))}else if(!e.includes(x)&&!e.includes(R)&&(e.includes(E)||e.includes(A))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);H(e,l,"/","*")&&(l=H(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;he(t,o-1,"*","/")&&(o=he(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(A)){i=e.indexOf(A),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(A)+A.length;e[f(e,l-1)]==="*"&&e[f(e,f(e,l-1))]==="/"&&(l=f(e,f(e,l-1))+1),f(e,l)&&(r=e.slice(l))}i?t=t.slice(o,i).trim():t=t.slice(o).trim()}else if(t.includes(A)){let o=[],i=!1;t=t.split(` | ||
`).filter(a=>!a.includes("$$$")&&!i?(i||o.push(a),!1):(i||(i=!0),!0)).join(` | ||
@@ -47,3 +47,3 @@ `);let l=t.indexOf(A);H(t,l,"/","*")&&(l=H(t,l,"/","*").leftmostChar),t=t.slice(0,l).trim(),o.length&&(n=`${o.join(` | ||
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index | ||
* @version 6.0.6 | ||
* @version 6.0.7 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -50,0 +50,0 @@ * @license MIT |
{ | ||
"name": "generate-atomic-css", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Generate Atomic CSS", | ||
@@ -73,4 +73,4 @@ "keywords": [ | ||
"dependencies": { | ||
"string-left-right": "^6.0.6" | ||
"string-left-right": "^6.0.7" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Updatedstring-left-right@^6.0.7