generate-atomic-css
Advanced tools
Comparing version 2.2.7 to 3.0.0
@@ -6,2 +6,12 @@ # Change Log | ||
# 3.0.0 (2022-12-01) | ||
### Features | ||
- drop Node v12 support; minimum version requirement now is v14.18 and above ([c8049e8](https://github.com/codsen/codsen/commit/c8049e82a5844d3f72587740f1cc74e3c9020d22)) | ||
### BREAKING CHANGES | ||
- Minimum supported Node version is v14.18; we're dropping v12 support | ||
# 2.2.0 (2022-08-12) | ||
@@ -8,0 +18,0 @@ |
/** | ||
* @name generate-atomic-css | ||
* @fileoverview Generate Atomic CSS | ||
* @version 2.2.7 | ||
* @version 3.0.0 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,3 +10,3 @@ * @license MIT | ||
import{left as S,right as m}from"string-left-right";var J="2.2.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:A,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(A)){if(e.indexOf(A)!==-1&&e.indexOf(E)!==-1&&e.indexOf(A)>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(A);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(A)&&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(A)&&(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 S,right as m}from"string-left-right";var J="3.0.0";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:A,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(A)){if(e.indexOf(A)!==-1&&e.indexOf(E)!==-1&&e.indexOf(A)>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(A);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(A)&&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(A)&&(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 2.2.7 | ||
* @version 3.0.0 | ||
* @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 Er({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Et(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,c,g,u=0;for(;u<o.length;){if(!pr(o[u])||!o[u].length){u+=1;continue}let{value:p,optional:d,hungry:$}=hr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===p.toLowerCase()||!r.i&&t[b]===p){let a=e==="right"?f(t,b):y(t,b);$&&(r.i&&t[a].toLowerCase()===p.toLowerCase()||!r.i&&t[a]===p)?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),c=b):(c===void 0&&(c=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||c===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:c}}var z={i:!1};function M(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(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("left",e,t,r,Array.from(n).reverse())}function pe(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(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("right",e,t,r,n)}var Ot="2.2.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:V,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:O}=ne,wr=[":"];function wt(e){let t=e,n="",r="";if(e.includes(V)&&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(V)+V.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(V)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(V)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(V)+V.length,e.indexOf(E))}else if(!e.includes(V)&&!e.includes(R)&&(e.includes(E)||e.includes(O))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);M(e,l,"/","*")&&(l=M(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;pe(t,o-1,"*","/")&&(o=pe(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(O)){i=e.indexOf(O),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(O)+O.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(O)){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 Er({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Et(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,c,g,u=0;for(;u<o.length;){if(!pr(o[u])||!o[u].length){u+=1;continue}let{value:p,optional:d,hungry:$}=hr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===p.toLowerCase()||!r.i&&t[b]===p){let a=e==="right"?f(t,b):y(t,b);$&&(r.i&&t[a].toLowerCase()===p.toLowerCase()||!r.i&&t[a]===p)?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),c=b):(c===void 0&&(c=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||c===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:c}}var z={i:!1};function M(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(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("left",e,t,r,Array.from(n).reverse())}function pe(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(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("right",e,t,r,n)}var Ot="3.0.0";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:V,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:O}=ne,wr=[":"];function wt(e){let t=e,n="",r="";if(e.includes(V)&&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(V)+V.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(V)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(V)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(V)+V.length,e.indexOf(E))}else if(!e.includes(V)&&!e.includes(R)&&(e.includes(E)||e.includes(O))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);M(e,l,"/","*")&&(l=M(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;pe(t,o-1,"*","/")&&(o=pe(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(O)){i=e.indexOf(O),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(O)+O.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(O)){let o=[],i=!1;t=t.split(` | ||
`).filter(c=>!c.includes("$$$")&&!i?(i||o.push(c),!1):(i||(i=!0),!0)).join(` | ||
@@ -39,3 +39,3 @@ `);let l=t.indexOf(O);M(t,l,"/","*")&&(l=M(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 5.1.7 | ||
* @version 6.0.0 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -42,0 +42,0 @@ * @license MIT |
{ | ||
"name": "generate-atomic-css", | ||
"version": "2.2.7", | ||
"version": "3.0.0", | ||
"description": "Generate Atomic CSS", | ||
@@ -56,3 +56,3 @@ "keywords": [ | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": ">=14.18.0" | ||
}, | ||
@@ -74,4 +74,4 @@ "c8": { | ||
"dependencies": { | ||
"string-left-right": "^5.1.7" | ||
"string-left-right": "^6.0.0" | ||
} | ||
} |
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
42075
+ Addedcodsen-utils@1.6.4(transitive)
+ Addedrfdc@1.4.1(transitive)
+ Addedstring-left-right@6.0.17(transitive)
- Removedlodash.clonedeep@4.5.0(transitive)
- Removedlodash.isplainobject@4.0.6(transitive)
- Removedstring-left-right@5.1.7(transitive)
Updatedstring-left-right@^6.0.0