@fower/parser
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -371,2 +371,11 @@ 'use strict'; | ||
_proto.mutateAtom = function mutateAtom(atom) { | ||
for (var _iterator3 = _createForOfIteratorHelperLoose(this.plugins), _step3; !(_step3 = _iterator3()).done;) { | ||
var plugin = _step3.value; | ||
if (!(plugin.isMatch != null && plugin.isMatch(atom.key))) continue; | ||
if (plugin.beforeHandleAtom) { | ||
atom = plugin.beforeHandleAtom(atom, this); | ||
} | ||
} | ||
var cachedAtom = atomCache.get(atom.id); | ||
@@ -386,12 +395,12 @@ | ||
for (var _iterator3 = _createForOfIteratorHelperLoose(this.plugins), _step3; !(_step3 = _iterator3()).done;) { | ||
var plugin = _step3.value; | ||
if (!(plugin.isMatch != null && plugin.isMatch(atom.key))) continue; | ||
for (var _iterator4 = _createForOfIteratorHelperLoose(this.plugins), _step4; !(_step4 = _iterator4()).done;) { | ||
var _plugin = _step4.value; | ||
if (!(_plugin.isMatch != null && _plugin.isMatch(atom.key))) continue; | ||
if (plugin.beforeAtomStyleCreate) { | ||
atom = plugin.beforeAtomStyleCreate(atom, this); | ||
if (_plugin.beforeHandleAtom) { | ||
atom = _plugin.beforeHandleAtom(atom, this); | ||
} | ||
if (plugin.handleAtom) { | ||
atom = plugin.handleAtom == null ? void 0 : plugin.handleAtom(atom, this); | ||
if (_plugin.handleAtom) { | ||
atom = _plugin.handleAtom == null ? void 0 : _plugin.handleAtom(atom, this); | ||
} | ||
@@ -413,7 +422,7 @@ | ||
for (var _iterator4 = _createForOfIteratorHelperLoose(parsed), _step4; !(_step4 = _iterator4()).done;) { | ||
var _step4$value = _step4.value, | ||
selector = _step4$value.selector, | ||
selectorType = _step4$value.selectorType, | ||
style = _step4$value.style; | ||
for (var _iterator5 = _createForOfIteratorHelperLoose(parsed), _step5; !(_step5 = _iterator5()).done;) { | ||
var _step5$value = _step5.value, | ||
selector = _step5$value.selector, | ||
selectorType = _step5$value.selectorType, | ||
style = _step5$value.style; | ||
var entries = Object.entries(style); | ||
@@ -546,3 +555,3 @@ if (!entries.length) continue; | ||
var _loop = function _loop() { | ||
var atom = _step5.value; | ||
var atom = _step6.value; | ||
var rule = ''; | ||
@@ -583,3 +592,3 @@ var className = atom.className, | ||
for (var _iterator5 = _createForOfIteratorHelperLoose(this.atoms), _step5; !(_step5 = _iterator5()).done;) { | ||
for (var _iterator6 = _createForOfIteratorHelperLoose(this.atoms), _step6; !(_step6 = _iterator6()).done;) { | ||
var _ret = _loop(); | ||
@@ -586,0 +595,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@fower/atom"),t=require("@fower/store"),r=require("@fower/color-helper"),n=require("@fower/sheet"),o=require("@fower/css-object-processor"),s=require("@fower/utils");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}var c=new Map,l=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,d=["children","onClick","onChange","onBlur","className","placeholder"];exports.Parser=function(){function a(e){void 0===e&&(e={}),this.props=e,this.atoms=[],this.traverseProps(e)}var f,m=a.prototype;return m.traverseProps=function(r){if(!s.isEmptyObj(r)){var n=this.config,o=n.pseudos,a=void 0===o?[]:o,c=n.theme||{},l=c.breakpoints,f=c.modes,m=Object.keys(l),p=f||[],h=a,v=r.excludedProps,y=void 0===v?[]:v,b=Object.entries(r);if(r.className)for(var g,S=u(r.className.split(/\s+/));!(g=S()).done;)b.push([g.value,!0]);for(var j=0,C=b;j<C.length;j++){var k=C[j],A=k[0],O=k[1];if(!y.includes(A)&&!d.includes(A)&&this.isValidProp(A,O))if("css"!==A){if(A.startsWith("_")){var N=A.replace(/^_/,""),w=Array.isArray(O)?O.reduce((function(e,t){var r;return i({},e,((r={})[t]=!0,r))}),{}):O;if(p.includes(N)){this.parseCSSObject(w,{mode:N});continue}if(m.includes(N)){this.parseCSSObject(w,{breakpoint:l[N]});continue}if(h.includes(N)){this.parseCSSObject(w,{pseudo:":"+N});continue}}var P=t.store.compositions.get(A);if(P){this.parseCSSObject(P,{});var K=new e.Atom({propKey:A,propValue:O});K.handled=!0,K.style={},K.createClassName(t.store.config.prefix),this.addAtom(K)}else{var x=new e.Atom({propKey:A,propValue:O});try{this.mutateAtom(x),x.handled&&this.addAtom(x)}catch(e){continue}}}else this.parseCSSObject(O)}for(var V,T=u(this.plugins);!(V=T()).done;){var q=V.value;q.afterAtomStyleCreate&&q.afterAtomStyleCreate(this)}}},m.formatCssValue=function(e,r){if(!l.test(e))return r;var n;if(s.isPercentNumber(String(r)))return String(r).replace("p","%");if(!s.isNumber(r))return r;if((n=Number(r))<1&&n>0)return 100*n+"%";var o=t.store.config;return"none"!==o.unit?o.transformUnit?o.transformUnit(n):r+t.store.config.unit:n},m.styleToString=function(e,n){var o=this,i=n.important,a=n.colorPostfix;return Object.entries(e).reduce((function(e,n){var u=n[1],c=s.jsKeyToCssKey(n[0]),l=i?" !important":"",d=t.store.theme.colors;return e+(c+": ")+(u=a?r.formatColor(d[u]||u,a):o.formatCssValue(c,d[u]||u))+l+";"}),"")},m.addAtom=function(e){c.get(e.id)||c.set(e.id,e);for(var t=this.config.theme.colors.modes,r=0,n=Object.entries(void 0===t?{}:t);r<n.length;r++){var o=n[r],s=o[0],a=o[1];if(e.style){var u=Object.entries(e.style);if(u.length){var l=u[0],d=l[0],f=a[l[1]];if(f){var m="--"+s,p=JSON.parse(JSON.stringify(e));p.className=e.className+m,p.key=e.key+m,p.id=e.id+m,p.meta=i({mode:s},e.meta),p.style[d]=f,this.atoms.push(p)}}}}this.atoms.push(e)},m.isValidProp=function(e,t){return"css"===e||!!e.startsWith("_")||!!["string","boolean","number","undefined"].includes(typeof t)},m.mutateAtom=function(e){var r=c.get(e.id);if(r)throw this.addAtom(r),new Error("atom is cached, add to this.atoms derectly, no need to mutate");if((e=e.preprocessAtom(t.store.config)).handled)throw this.addAtom(e),new Error("atom is handled, add to this.atoms derectly ,no need to mutate");for(var n,o=u(this.plugins);!(n=o()).done;){var s=n.value;if(null!=s.isMatch&&s.isMatch(e.key)){s.beforeAtomStyleCreate&&(e=s.beforeAtomStyleCreate(e,this)),s.handleAtom&&(e=null==s.handleAtom?void 0:s.handleAtom(e,this)),e.createClassName(t.store.config.prefix),e.handled=!0;break}}},m.parseCSSObject=function(t,r){void 0===r&&(r={});for(var n,i=o.parse(t),a=s.objectToClassName(t),c=u(i);!(n=c()).done;){var l=n.value,d=l.selector,f=l.selectorType,m=l.style,p=Object.entries(m);if(p.length){var h=p[0],v={propKey:h[0],propValue:h[1],meta:r};"pseudo"===f&&v.meta&&(v.meta.pseudo=d),"child"===f&&v.meta&&(v.meta.childSelector=d);var y=new e.Atom(v),b="void"===f;try{this.mutateAtom(y)}catch(e){continue}y.style||(y.style=m,y.id=s.objectToClassName({style:m}),y.className=b?s.objectToClassName(m):a,y.handled=!0),this.addAtom(y)}}},m.makeResponsiveStyle=function(e,t){return"@media (min-width: "+e+") {"+t+"}"},m.getClassNames=function(){var e=[];this.atoms.reduce((function(t,r){var n=t.findIndex((function(e){return e.styleKeysHash===r.styleKeysHash}));return r.isValid?(-1===n?(e.push(r.className),t=[].concat(t,[r])):(t.splice(n,1,r),e.splice(n,1,r.className)),t):t}),[]);var t=this.props.className,r=(void 0===t?"":t).split(/\s+/).filter((function(t){return!e.includes(t)&&!!t}));return e=e.concat(r),this.hasResponsive&&e.unshift(this.uniqueClassName),e},m.toStyle=function(){var e=this;return this.atoms.reduce((function(t,r){if(!r.isValid)return t;var n=Object.entries(r.style).reduce((function(t,r){var n,o=r[0],a=r[1];return i({},t,((n={})[o]=e.formatCssValue(s.jsKeyToCssKey(o),a),n))}),{});return i({},t,n)}),{})},m.toRules=function(e){var t=this;void 0===e&&(e=!1);var r=this.config.theme.modePrefix,n=void 0===r?"":r,o=[];this.atoms=this.atoms.sort((function(e,t){return parseInt(t.meta.breakpoint||"0")-parseInt(e.meta.breakpoint||"0")}));for(var i,a=function(){var r=i.value,a="",u=r.className,c=r.style,l=void 0===c?{}:c;if(!r.isValid)return"continue";if(s.isEmptyObj(l))return"continue";if(!e&&r.inserted)return"continue";r.inserted=!0;var d=r.meta,f=d.pseudo,m=d.mode,p=d.breakpoint,h=void 0===p?"":p,v=d.childSelector,y=(t.atoms.find((function(e){return e.styleKeys===r.styleKeys&&(r.meta.breakpoint||e.meta.breakpoint)}))||r.meta.breakpoint?"."+t.uniqueClassName:"")+"."+u;f&&(y+=f),m&&(y="."+n+m+" "+y),v&&(y=y+" "+v),a=y+" { "+t.styleToString(l,r.meta)+" }",h&&(a=t.makeResponsiveStyle(h,a)),o.push(a)},c=u(this.atoms);!(i=c()).done;)a();return o},m.getParsedProps=function(){var e=this.props,t=this.atoms;return s.isEmptyObj(e)?{}:Object.entries(e).reduce((function(e,r){var n=r[0],o=r[1];return t.find((function(e){return[e.propKey,e.key,e.id,"css"].includes(n)}))||(e[n]=o),e}),{})},m.insertRule=function(){var e=this.toRules();n.styleSheet.insertStyles(e)},(f=[{key:"uniqueClassName",get:function(){return s.objectToClassName(Object.keys(this.props))}},{key:"hasResponsive",get:function(){return!!this.atoms.find((function(e){return!!e.meta.breakpoint}))}},{key:"config",get:function(){return t.store.config}},{key:"plugins",get:function(){return t.store.config.plugins}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(a.prototype,f),a}(),exports.atomCache=c; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@fower/atom"),t=require("@fower/store"),r=require("@fower/color-helper"),n=require("@fower/sheet"),o=require("@fower/css-object-processor"),s=require("@fower/utils");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}var l=new Map,c=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,d=["children","onClick","onChange","onBlur","className","placeholder"];exports.Parser=function(){function a(e){void 0===e&&(e={}),this.props=e,this.atoms=[],this.traverseProps(e)}var f,m=a.prototype;return m.traverseProps=function(r){if(!s.isEmptyObj(r)){var n=this.config,o=n.pseudos,a=void 0===o?[]:o,l=n.theme||{},c=l.breakpoints,f=l.modes,m=Object.keys(c),p=f||[],h=a,v=r.excludedProps,y=void 0===v?[]:v,b=Object.entries(r);if(r.className)for(var g,S=u(r.className.split(/\s+/));!(g=S()).done;)b.push([g.value,!0]);for(var j=0,k=b;j<k.length;j++){var A=k[j],C=A[0],O=A[1];if(!y.includes(C)&&!d.includes(C)&&this.isValidProp(C,O))if("css"!==C){if(C.startsWith("_")){var N=C.replace(/^_/,""),w=Array.isArray(O)?O.reduce((function(e,t){var r;return i({},e,((r={})[t]=!0,r))}),{}):O;if(p.includes(N)){this.parseCSSObject(w,{mode:N});continue}if(m.includes(N)){this.parseCSSObject(w,{breakpoint:c[N]});continue}if(h.includes(N)){this.parseCSSObject(w,{pseudo:":"+N});continue}}var P=t.store.compositions.get(C);if(P){this.parseCSSObject(P,{});var K=new e.Atom({propKey:C,propValue:O});K.handled=!0,K.style={},K.createClassName(t.store.config.prefix),this.addAtom(K)}else{var x=new e.Atom({propKey:C,propValue:O});try{this.mutateAtom(x),x.handled&&this.addAtom(x)}catch(e){continue}}}else this.parseCSSObject(O)}for(var V,T=u(this.plugins);!(V=T()).done;){var q=V.value;q.afterAtomStyleCreate&&q.afterAtomStyleCreate(this)}}},m.formatCssValue=function(e,r){if(!c.test(e))return r;var n;if(s.isPercentNumber(String(r)))return String(r).replace("p","%");if(!s.isNumber(r))return r;if((n=Number(r))<1&&n>0)return 100*n+"%";var o=t.store.config;return"none"!==o.unit?o.transformUnit?o.transformUnit(n):r+t.store.config.unit:n},m.styleToString=function(e,n){var o=this,i=n.important,a=n.colorPostfix;return Object.entries(e).reduce((function(e,n){var u=n[1],l=s.jsKeyToCssKey(n[0]),c=i?" !important":"",d=t.store.theme.colors;return e+(l+": ")+(u=a?r.formatColor(d[u]||u,a):o.formatCssValue(l,d[u]||u))+c+";"}),"")},m.addAtom=function(e){l.get(e.id)||l.set(e.id,e);for(var t=this.config.theme.colors.modes,r=0,n=Object.entries(void 0===t?{}:t);r<n.length;r++){var o=n[r],s=o[0],a=o[1];if(e.style){var u=Object.entries(e.style);if(u.length){var c=u[0],d=c[0],f=a[c[1]];if(f){var m="--"+s,p=JSON.parse(JSON.stringify(e));p.className=e.className+m,p.key=e.key+m,p.id=e.id+m,p.meta=i({mode:s},e.meta),p.style[d]=f,this.atoms.push(p)}}}}this.atoms.push(e)},m.isValidProp=function(e,t){return"css"===e||!!e.startsWith("_")||!!["string","boolean","number","undefined"].includes(typeof t)},m.mutateAtom=function(e){for(var r,n=u(this.plugins);!(r=n()).done;){var o=r.value;null!=o.isMatch&&o.isMatch(e.key)&&o.beforeHandleAtom&&(e=o.beforeHandleAtom(e,this))}var s=l.get(e.id);if(s)throw this.addAtom(s),new Error("atom is cached, add to this.atoms derectly, no need to mutate");if((e=e.preprocessAtom(t.store.config)).handled)throw this.addAtom(e),new Error("atom is handled, add to this.atoms derectly ,no need to mutate");for(var i,a=u(this.plugins);!(i=a()).done;){var c=i.value;if(null!=c.isMatch&&c.isMatch(e.key)){c.beforeHandleAtom&&(e=c.beforeHandleAtom(e,this)),c.handleAtom&&(e=null==c.handleAtom?void 0:c.handleAtom(e,this)),e.createClassName(t.store.config.prefix),e.handled=!0;break}}},m.parseCSSObject=function(t,r){void 0===r&&(r={});for(var n,i=o.parse(t),a=s.objectToClassName(t),l=u(i);!(n=l()).done;){var c=n.value,d=c.selector,f=c.selectorType,m=c.style,p=Object.entries(m);if(p.length){var h=p[0],v={propKey:h[0],propValue:h[1],meta:r};"pseudo"===f&&v.meta&&(v.meta.pseudo=d),"child"===f&&v.meta&&(v.meta.childSelector=d);var y=new e.Atom(v),b="void"===f;try{this.mutateAtom(y)}catch(e){continue}y.style||(y.style=m,y.id=s.objectToClassName({style:m}),y.className=b?s.objectToClassName(m):a,y.handled=!0),this.addAtom(y)}}},m.makeResponsiveStyle=function(e,t){return"@media (min-width: "+e+") {"+t+"}"},m.getClassNames=function(){var e=[];this.atoms.reduce((function(t,r){var n=t.findIndex((function(e){return e.styleKeysHash===r.styleKeysHash}));return r.isValid?(-1===n?(e.push(r.className),t=[].concat(t,[r])):(t.splice(n,1,r),e.splice(n,1,r.className)),t):t}),[]);var t=this.props.className,r=(void 0===t?"":t).split(/\s+/).filter((function(t){return!e.includes(t)&&!!t}));return e=e.concat(r),this.hasResponsive&&e.unshift(this.uniqueClassName),e},m.toStyle=function(){var e=this;return this.atoms.reduce((function(t,r){if(!r.isValid)return t;var n=Object.entries(r.style).reduce((function(t,r){var n,o=r[0],a=r[1];return i({},t,((n={})[o]=e.formatCssValue(s.jsKeyToCssKey(o),a),n))}),{});return i({},t,n)}),{})},m.toRules=function(e){var t=this;void 0===e&&(e=!1);var r=this.config.theme.modePrefix,n=void 0===r?"":r,o=[];this.atoms=this.atoms.sort((function(e,t){return parseInt(t.meta.breakpoint||"0")-parseInt(e.meta.breakpoint||"0")}));for(var i,a=function(){var r=i.value,a="",u=r.className,l=r.style,c=void 0===l?{}:l;if(!r.isValid)return"continue";if(s.isEmptyObj(c))return"continue";if(!e&&r.inserted)return"continue";r.inserted=!0;var d=r.meta,f=d.pseudo,m=d.mode,p=d.breakpoint,h=void 0===p?"":p,v=d.childSelector,y=(t.atoms.find((function(e){return e.styleKeys===r.styleKeys&&(r.meta.breakpoint||e.meta.breakpoint)}))||r.meta.breakpoint?"."+t.uniqueClassName:"")+"."+u;f&&(y+=f),m&&(y="."+n+m+" "+y),v&&(y=y+" "+v),a=y+" { "+t.styleToString(c,r.meta)+" }",h&&(a=t.makeResponsiveStyle(h,a)),o.push(a)},l=u(this.atoms);!(i=l()).done;)a();return o},m.getParsedProps=function(){var e=this.props,t=this.atoms;return s.isEmptyObj(e)?{}:Object.entries(e).reduce((function(e,r){var n=r[0],o=r[1];return t.find((function(e){return[e.propKey,e.key,e.id,"css"].includes(n)}))||(e[n]=o),e}),{})},m.insertRule=function(){var e=this.toRules();n.styleSheet.insertStyles(e)},(f=[{key:"uniqueClassName",get:function(){return s.objectToClassName(Object.keys(this.props))}},{key:"hasResponsive",get:function(){return!!this.atoms.find((function(e){return!!e.meta.breakpoint}))}},{key:"config",get:function(){return t.store.config}},{key:"plugins",get:function(){return t.store.config.plugins}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(a.prototype,f),a}(),exports.atomCache=l; | ||
//# sourceMappingURL=parser.cjs.production.min.js.map |
@@ -367,2 +367,11 @@ import { Atom } from '@fower/atom'; | ||
_proto.mutateAtom = function mutateAtom(atom) { | ||
for (var _iterator3 = _createForOfIteratorHelperLoose(this.plugins), _step3; !(_step3 = _iterator3()).done;) { | ||
var plugin = _step3.value; | ||
if (!(plugin.isMatch != null && plugin.isMatch(atom.key))) continue; | ||
if (plugin.beforeHandleAtom) { | ||
atom = plugin.beforeHandleAtom(atom, this); | ||
} | ||
} | ||
var cachedAtom = atomCache.get(atom.id); | ||
@@ -382,12 +391,12 @@ | ||
for (var _iterator3 = _createForOfIteratorHelperLoose(this.plugins), _step3; !(_step3 = _iterator3()).done;) { | ||
var plugin = _step3.value; | ||
if (!(plugin.isMatch != null && plugin.isMatch(atom.key))) continue; | ||
for (var _iterator4 = _createForOfIteratorHelperLoose(this.plugins), _step4; !(_step4 = _iterator4()).done;) { | ||
var _plugin = _step4.value; | ||
if (!(_plugin.isMatch != null && _plugin.isMatch(atom.key))) continue; | ||
if (plugin.beforeAtomStyleCreate) { | ||
atom = plugin.beforeAtomStyleCreate(atom, this); | ||
if (_plugin.beforeHandleAtom) { | ||
atom = _plugin.beforeHandleAtom(atom, this); | ||
} | ||
if (plugin.handleAtom) { | ||
atom = plugin.handleAtom == null ? void 0 : plugin.handleAtom(atom, this); | ||
if (_plugin.handleAtom) { | ||
atom = _plugin.handleAtom == null ? void 0 : _plugin.handleAtom(atom, this); | ||
} | ||
@@ -409,7 +418,7 @@ | ||
for (var _iterator4 = _createForOfIteratorHelperLoose(parsed), _step4; !(_step4 = _iterator4()).done;) { | ||
var _step4$value = _step4.value, | ||
selector = _step4$value.selector, | ||
selectorType = _step4$value.selectorType, | ||
style = _step4$value.style; | ||
for (var _iterator5 = _createForOfIteratorHelperLoose(parsed), _step5; !(_step5 = _iterator5()).done;) { | ||
var _step5$value = _step5.value, | ||
selector = _step5$value.selector, | ||
selectorType = _step5$value.selectorType, | ||
style = _step5$value.style; | ||
var entries = Object.entries(style); | ||
@@ -542,3 +551,3 @@ if (!entries.length) continue; | ||
var _loop = function _loop() { | ||
var atom = _step5.value; | ||
var atom = _step6.value; | ||
var rule = ''; | ||
@@ -579,3 +588,3 @@ var className = atom.className, | ||
for (var _iterator5 = _createForOfIteratorHelperLoose(this.atoms), _step5; !(_step5 = _iterator5()).done;) { | ||
for (var _iterator6 = _createForOfIteratorHelperLoose(this.atoms), _step6; !(_step6 = _iterator6()).done;) { | ||
var _ret = _loop(); | ||
@@ -582,0 +591,0 @@ |
{ | ||
"name": "@fower/parser", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
@@ -24,9 +24,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@fower/atom": "^1.1.0", | ||
"@fower/css-object-processor": "^1.1.0", | ||
"@fower/sheet": "^1.1.0", | ||
"@fower/store": "^1.1.0", | ||
"@fower/utils": "^1.1.0" | ||
"@fower/atom": "^1.2.0", | ||
"@fower/css-object-processor": "^1.2.0", | ||
"@fower/sheet": "^1.2.0", | ||
"@fower/store": "^1.2.0", | ||
"@fower/utils": "^1.2.0" | ||
}, | ||
"gitHead": "b9bdec67e9b200ac680d99351574e897dfcf9e6f" | ||
"gitHead": "a86822a8163a224c9ddc9ef991e348c085814a12" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
127880
1190
Updated@fower/atom@^1.2.0
Updated@fower/sheet@^1.2.0
Updated@fower/store@^1.2.0
Updated@fower/utils@^1.2.0