Comparing version 4.1.3 to 4.1.4
@@ -5,2 +5,8 @@ # Changelog | ||
## [4.1.4] 2019-05-07 | ||
### Fix | ||
- Adding rounding to `zIndex`. | ||
## [4.1.3] 2019-05-01 | ||
@@ -7,0 +13,0 @@ |
@@ -171,2 +171,3 @@ import sync from 'framesync'; | ||
var rounded = /*#__PURE__*/__assign({}, number, { transform: Math.round }); | ||
var valueTypes = { | ||
@@ -232,3 +233,4 @@ color: color, | ||
originY: progressPercentage, | ||
originZ: px | ||
originZ: px, | ||
zIndex: rounded | ||
}; | ||
@@ -235,0 +237,0 @@ var getValueType = function (key) { |
@@ -473,2 +473,3 @@ (function (global, factory) { | ||
var rounded = __assign({}, number, { transform: Math.round }); | ||
var valueTypes = { | ||
@@ -534,3 +535,4 @@ color: color, | ||
originY: progressPercentage, | ||
originZ: px | ||
originZ: px, | ||
zIndex: rounded | ||
}; | ||
@@ -537,0 +539,0 @@ var getValueType = function (key) { return valueTypes[key]; }; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.stylefire={})}(this,function(t){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r}var n=function(){};"production"!==process.env.NODE_ENV&&(n=function(t,e){if(!t)throw new Error("Hey, listen! ".toUpperCase()+e)});var o,a=0,i="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),r=Math.max(0,16.7-(e-a));a=e+r,setTimeout(function(){return t(a)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(o||(o={}));var s,u=1/60*1e3,f=!0,c=!1,d=!1,l={delta:0,timestamp:0},p=[o.Read,o.Update,o.Render,o.PostRender],h=function(t){return c=t},g=p.reduce(function(t,e){var r,o,a,i,s,u,f,d,l,p=(r=h,o=[],a=[],i=0,s=!1,u=0,f=new WeakSet,d=new WeakSet,l={cancel:function(t){var e=a.indexOf(t);f.add(t),-1!==e&&a.splice(e,1)},process:function(t){var e,n;if(s=!0,o=(e=[a,o])[0],(a=e[1]).length=0,i=o.length)for(u=0;u<i;u++)(n=o[u])(t),!0!==d.has(n)||f.has(n)||(l.schedule(n),r(!0));s=!1},schedule:function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1),n("function"==typeof t,"Argument must be a function");var u=r&&s,c=u?o:a;f.delete(t),e&&d.add(t),-1===c.indexOf(t)&&(c.push(t),u&&(i=o.length))}});return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),c||w(),p.schedule(t,e,r),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),v=g.steps,m=g.sync,y=(g.cancelSync,function(t){return v[t].process(l)}),b=function(t){c=!1,l.delta=f?u:Math.max(Math.min(t-l.timestamp,40),1),f||(u=l.delta),l.timestamp=t,d=!0,p.forEach(y),d=!1,c&&(f=!1,i(b))},w=function(){c=!0,f=!0,d||i(b)},O=function(t){var e=t.onRead,n=t.onRender,o=t.uncachedValues,a=void 0===o?new Set:o,i=t.useCache,s=void 0===i||i;return function(t){void 0===t&&(t={});var o=r(t,[]),i={},u=[],f=!1;function c(t,e){t.startsWith("--")&&(o.hasCSSVariable=!0);var r=i[t];i[t]=e,i[t]!==r&&(-1===u.indexOf(t)&&u.push(t),f||(f=!0,m.render(d.render)))}var d={get:function(t,r){return void 0===r&&(r=!1),!r&&s&&!a.has(t)&&void 0!==i[t]?i[t]:e(t,o)},set:function(t,e){if("string"==typeof t)c(t,e);else for(var r in t)c(r,t[r]);return this},render:function(t){return void 0===t&&(t=!1),(f||!0===t)&&(n(i,o,u),f=!1,u.length=0),this}};return d}},x=/([a-z])([A-Z])/g,S=function(t){return t.replace(x,"$1-$2").toLowerCase()},R=new Map,k=new Map,C=["Webkit","Moz","O","ms",""],P=C.length,L="undefined"!=typeof document,Y=function(t,e){return k.set(t,S(e))},M=function(t,e){void 0===e&&(e=!1);var r=e?k:R;return r.has(t)||(L?function(t){s=s||document.createElement("div");for(var e=0;e<P;e++){var r=C[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);(o in s.style||n)&&(R.set(t,o),Y(t,(n?"":"-")+S(o)))}}(t):function(t){Y(t,t)}(t)),r.get(t)||t},T=["","X","Y","Z"],X=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return T.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),W=X.reduce(function(t,e){return t[e]=!0,t},{});function E(t){return!0===W[t]}function B(t,e){return X.indexOf(t)-X.indexOf(e)}var j=new Set(["originX","originY","originZ"]);function A(t){return j.has(t)}var V=function(){return(V=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},F=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},Z=function(t){return t%1?Number(t.toFixed(5)):t},N=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,z={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},H=V({},z,{transform:F(0,1)}),U=V({},z,{default:1}),q=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},D=q("deg"),I=q("%"),_=q("px"),$=V({},I,{parse:function(t){return I.parse(t)/100},transform:function(t){return I.transform(100*t)}}),G=F(0,255),J=function(t){return void 0!==t.red},K=function(t){return void 0!==t.hue},Q=function(t){return function(e){if("string"!=typeof e)return e;for(var r,n={},o=(r=e,r.substring(r.indexOf("(")+1,r.lastIndexOf(")"))).split(/,\s*/),a=0;a<4;a++)n[t[a]]=void 0!==o[a]?parseFloat(o[a]):1;return n}},tt=V({},z,{transform:function(t){return Math.round(G(t))}});function et(t,e){return t.startsWith(e)&&N.test(t)}var rt={test:function(t){return"string"==typeof t?et(t,"rgb"):J(t)},parse:Q(["red","green","blue","alpha"]),transform:function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return"rgba("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({red:tt.transform(e),green:tt.transform(r),blue:tt.transform(n),alpha:Z(o)})}},nt={test:function(t){return"string"==typeof t?et(t,"hsl"):K(t)},parse:Q(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return"hsla("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:I.transform(Z(r)),lightness:I.transform(Z(n)),alpha:Z(o)})}},ot=V({},rt,{test:function(t){return"string"==typeof t&&et(t,"#")},parse:function(t){var e="",r="",n="";return t.length>4?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),e+=e,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),at={test:function(t){return"string"==typeof t&&N.test(t)||J(t)||K(t)},parse:function(t){return rt.test(t)?rt.parse(t):nt.test(t)?nt.parse(t):ot.test(t)?ot.parse(t):t},transform:function(t){return J(t)?rt.transform(t):K(t)?nt.transform(t):t}},it={color:at,backgroundColor:at,outlineColor:at,fill:at,stroke:at,borderColor:at,borderTopColor:at,borderRightColor:at,borderBottomColor:at,borderLeftColor:at,borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,radius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,size:_,top:_,right:_,bottom:_,left:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,rotate:D,rotateX:D,rotateY:D,rotateZ:D,scale:U,scaleX:U,scaleY:U,scaleZ:U,skew:D,skewX:D,skewY:D,distance:_,x:_,y:_,z:_,perspective:_,opacity:H,originX:$,originY:$,originZ:_},st=function(t){return it[t]},ut=function(t,e){return e&&"number"==typeof t?e.transform(t):t},ft="scrollLeft",ct="scrollTop",dt=new Set([ft,ct]),lt=new Set([ft,ct,"transform"]),pt={x:"translateX",y:"translateY",z:"translateZ"};function ht(t){return"function"==typeof t}function gt(t,e,r,n,o,a,i){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a=[]),void 0===i&&(i=!1);var s=!0,u=!1,f=!1;for(var c in t){var d=t[c],l=st(c),p=ut(d,l);E(c)?(u=!0,n[c]=p,a.push(c),s&&(l.default&&d!==l.default||!l.default&&0!==d)&&(s=!1)):A(c)?(o[c]=p,f=!0):lt.has(c)&&ht(p)||(r[M(c,i)]=p)}return(u||"function"==typeof t.transform)&&(r.transform=function(t,e,r,n,o){var a="",i=!1;r.sort(B);for(var s=r.length,u=0;u<s;u++){var f=r[u];a+=(pt[f]||f)+"("+e[f]+") ",i="z"===f||i}return!i&&o?a+="translateZ(0)":a=a.trim(),ht(t.transform)?a=t.transform(e,a):n&&(a="none"),a}(t,n,a,s,e)),f&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r}var vt=O({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=st(t);if(E(t))return o&&o.default||0;if(dt.has(t))return r[t];var a=window.getComputedStyle(r,null).getPropertyValue(M(t,!0))||0;return n&&o&&o.test(a)&&o.parse?o.parse(a):a},onRender:function(t,e,r){var n=e.element,o=e.buildStyles,a=e.hasCSSVariable;if(Object.assign(n.style,o(t)),a)for(var i=r.length,s=0;s<i;s++){var u=r[s];u.startsWith("--")&&n.style.setProperty(u,t[u])}-1!==r.indexOf(ft)&&(n[ft]=t[ft]),-1!==r.indexOf(ct)&&(n[ct]=t[ct])},uncachedValues:dt});function mt(t,n){void 0===n&&(n={});var o=n.enableHardwareAcceleration,a=r(n,["enableHardwareAcceleration"]);return vt(e({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},r={},n={},o=[];return function(a){return o.length=0,gt(a,t,e,r,n,o,!0),e}}(o),preparseOutput:!0},a))}var yt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),bt=function(t,e){return t*e+"px"},wt={fill:at,stroke:at,scale:U,scaleX:U,scaleY:U,opacity:H,fillOpacity:H,strokeOpacity:H,numOctaves:e({},z,{transform:Math.round})},Ot=O({onRead:function(t,e){var r=e.element;if(E(t)){var n=function(t){return wt[t]}(t);return n?n.default:0}return r.getAttribute(t)},onRender:function(t,e){var r=e.dimensions;!function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setAttribute(r,e[r])}(e.element,function(t,e,r,n){var o=!1,a=!1,i={},s=r?{pathLength:"0",pathSpacing:""+n}:void 0,u=void 0!==t.scale?t.scale||1e-7:t.scaleX||1,f=void 0!==t.scaleY?t.scaleY||1e-7:u||1,c=e.width*(t.originX||50)+e.x,d=e.height*(t.originY||50)+e.y,l=1*u*-c,p=1*f*-d,h=c/u,g=d/f,v={translate:"translate("+t.x+", "+t.y+") ",scale:"translate("+l+", "+p+") scale("+u+", "+f+") translate("+h+", "+g+") ",rotate:"rotate("+t.rotate+", "+c+", "+d+") ",skewX:"skewX("+t.skewX+") ",skewY:"skewY("+t.skewY+") "};for(var m in t)if(t.hasOwnProperty(m)){var y=t[m];E(m)?o=!0:!r||"pathLength"!==m&&"pathSpacing"!==m||"number"!=typeof y?r&&"pathOffset"===m?i["stroke-dashoffset"]=bt(-y,n):i[yt.has(m)?m:S(m)]=y:(a=!0,s[m]=bt(y,n))}if(a&&(i["stroke-dasharray"]=s.pathLength+" "+s.pathSpacing),o)for(var m in i.transform="",v)if(v.hasOwnProperty(m)){var b="scale"===m?"1":"0";i.transform+=v[m].replace(/undefined/g,b)}return i}(t,r,e.isPath,e.pathLength))}}),xt=O({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,r=void 0===e?0:e,n=t.scrollLeft,o=void 0===n?0:n;return window.scrollTo(o,r)}}),St=function(){};"production"!==process.env.NODE_ENV&&(St=function(t,e){if(!t)throw new Error(e)});var Rt=new WeakMap,kt=function(t,e){var r;return t instanceof HTMLElement?r=mt(t,e):t instanceof SVGElement?r=function(t){var e={element:t,dimensions:function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),isPath:!1};return"path"===t.tagName&&(e.isPath=!0,e.pathLength=t.getTotalLength()),Ot(e)}(t):t===window&&(r=xt(t)),St(void 0!==r,"No valid node provided. Node must be HTMLElement, SVGElement or window."),Rt.set(t,r),r},Ct=function(t,e){return Rt.has(t)?Rt.get(t):kt(t,e)};t.default=function(t,e){var r="string"==typeof t?document.querySelector(t):t;return Ct(r,e)},t.createStylerFactory=O,t.buildStyleProperty=gt,t.isTransformProp=E,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.stylefire={})}(this,function(t){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r}var n=function(){};"production"!==process.env.NODE_ENV&&(n=function(t,e){if(!t)throw new Error("Hey, listen! ".toUpperCase()+e)});var o,a=0,i="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),r=Math.max(0,16.7-(e-a));a=e+r,setTimeout(function(){return t(a)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(o||(o={}));var s,u=1/60*1e3,f=!0,c=!1,d=!1,l={delta:0,timestamp:0},p=[o.Read,o.Update,o.Render,o.PostRender],h=function(t){return c=t},g=p.reduce(function(t,e){var r,o,a,i,s,u,f,d,l,p=(r=h,o=[],a=[],i=0,s=!1,u=0,f=new WeakSet,d=new WeakSet,l={cancel:function(t){var e=a.indexOf(t);f.add(t),-1!==e&&a.splice(e,1)},process:function(t){var e,n;if(s=!0,o=(e=[a,o])[0],(a=e[1]).length=0,i=o.length)for(u=0;u<i;u++)(n=o[u])(t),!0!==d.has(n)||f.has(n)||(l.schedule(n),r(!0));s=!1},schedule:function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1),n("function"==typeof t,"Argument must be a function");var u=r&&s,c=u?o:a;f.delete(t),e&&d.add(t),-1===c.indexOf(t)&&(c.push(t),u&&(i=o.length))}});return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),c||w(),p.schedule(t,e,r),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),v=g.steps,m=g.sync,y=(g.cancelSync,function(t){return v[t].process(l)}),b=function(t){c=!1,l.delta=f?u:Math.max(Math.min(t-l.timestamp,40),1),f||(u=l.delta),l.timestamp=t,d=!0,p.forEach(y),d=!1,c&&(f=!1,i(b))},w=function(){c=!0,f=!0,d||i(b)},O=function(t){var e=t.onRead,n=t.onRender,o=t.uncachedValues,a=void 0===o?new Set:o,i=t.useCache,s=void 0===i||i;return function(t){void 0===t&&(t={});var o=r(t,[]),i={},u=[],f=!1;function c(t,e){t.startsWith("--")&&(o.hasCSSVariable=!0);var r=i[t];i[t]=e,i[t]!==r&&(-1===u.indexOf(t)&&u.push(t),f||(f=!0,m.render(d.render)))}var d={get:function(t,r){return void 0===r&&(r=!1),!r&&s&&!a.has(t)&&void 0!==i[t]?i[t]:e(t,o)},set:function(t,e){if("string"==typeof t)c(t,e);else for(var r in t)c(r,t[r]);return this},render:function(t){return void 0===t&&(t=!1),(f||!0===t)&&(n(i,o,u),f=!1,u.length=0),this}};return d}},x=/([a-z])([A-Z])/g,S=function(t){return t.replace(x,"$1-$2").toLowerCase()},R=new Map,k=new Map,C=["Webkit","Moz","O","ms",""],P=C.length,L="undefined"!=typeof document,M=function(t,e){return k.set(t,S(e))},Y=function(t,e){void 0===e&&(e=!1);var r=e?k:R;return r.has(t)||(L?function(t){s=s||document.createElement("div");for(var e=0;e<P;e++){var r=C[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);(o in s.style||n)&&(R.set(t,o),M(t,(n?"":"-")+S(o)))}}(t):function(t){M(t,t)}(t)),r.get(t)||t},T=["","X","Y","Z"],X=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return T.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),W=X.reduce(function(t,e){return t[e]=!0,t},{});function E(t){return!0===W[t]}function B(t,e){return X.indexOf(t)-X.indexOf(e)}var j=new Set(["originX","originY","originZ"]);function A(t){return j.has(t)}var V=function(){return(V=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},F=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},Z=function(t){return t%1?Number(t.toFixed(5)):t},z=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,N={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},H=V({},N,{transform:F(0,1)}),U=V({},N,{default:1}),I=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},q=I("deg"),D=I("%"),_=I("px"),$=V({},D,{parse:function(t){return D.parse(t)/100},transform:function(t){return D.transform(100*t)}}),G=F(0,255),J=function(t){return void 0!==t.red},K=function(t){return void 0!==t.hue},Q=function(t){return function(e){if("string"!=typeof e)return e;for(var r,n={},o=(r=e,r.substring(r.indexOf("(")+1,r.lastIndexOf(")"))).split(/,\s*/),a=0;a<4;a++)n[t[a]]=void 0!==o[a]?parseFloat(o[a]):1;return n}},tt=V({},N,{transform:function(t){return Math.round(G(t))}});function et(t,e){return t.startsWith(e)&&z.test(t)}var rt={test:function(t){return"string"==typeof t?et(t,"rgb"):J(t)},parse:Q(["red","green","blue","alpha"]),transform:function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return"rgba("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({red:tt.transform(e),green:tt.transform(r),blue:tt.transform(n),alpha:Z(o)})}},nt={test:function(t){return"string"==typeof t?et(t,"hsl"):K(t)},parse:Q(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return"hsla("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:D.transform(Z(r)),lightness:D.transform(Z(n)),alpha:Z(o)})}},ot=V({},rt,{test:function(t){return"string"==typeof t&&et(t,"#")},parse:function(t){var e="",r="",n="";return t.length>4?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),e+=e,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),at={test:function(t){return"string"==typeof t&&z.test(t)||J(t)||K(t)},parse:function(t){return rt.test(t)?rt.parse(t):nt.test(t)?nt.parse(t):ot.test(t)?ot.parse(t):t},transform:function(t){return J(t)?rt.transform(t):K(t)?nt.transform(t):t}},it={color:at,backgroundColor:at,outlineColor:at,fill:at,stroke:at,borderColor:at,borderTopColor:at,borderRightColor:at,borderBottomColor:at,borderLeftColor:at,borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,radius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,size:_,top:_,right:_,bottom:_,left:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,rotate:q,rotateX:q,rotateY:q,rotateZ:q,scale:U,scaleX:U,scaleY:U,scaleZ:U,skew:q,skewX:q,skewY:q,distance:_,x:_,y:_,z:_,perspective:_,opacity:H,originX:$,originY:$,originZ:_,zIndex:e({},N,{transform:Math.round})},st=function(t){return it[t]},ut=function(t,e){return e&&"number"==typeof t?e.transform(t):t},ft="scrollLeft",ct="scrollTop",dt=new Set([ft,ct]),lt=new Set([ft,ct,"transform"]),pt={x:"translateX",y:"translateY",z:"translateZ"};function ht(t){return"function"==typeof t}function gt(t,e,r,n,o,a,i){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a=[]),void 0===i&&(i=!1);var s=!0,u=!1,f=!1;for(var c in t){var d=t[c],l=st(c),p=ut(d,l);E(c)?(u=!0,n[c]=p,a.push(c),s&&(l.default&&d!==l.default||!l.default&&0!==d)&&(s=!1)):A(c)?(o[c]=p,f=!0):lt.has(c)&&ht(p)||(r[Y(c,i)]=p)}return(u||"function"==typeof t.transform)&&(r.transform=function(t,e,r,n,o){var a="",i=!1;r.sort(B);for(var s=r.length,u=0;u<s;u++){var f=r[u];a+=(pt[f]||f)+"("+e[f]+") ",i="z"===f||i}return!i&&o?a+="translateZ(0)":a=a.trim(),ht(t.transform)?a=t.transform(e,a):n&&(a="none"),a}(t,n,a,s,e)),f&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r}var vt=O({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=st(t);if(E(t))return o&&o.default||0;if(dt.has(t))return r[t];var a=window.getComputedStyle(r,null).getPropertyValue(Y(t,!0))||0;return n&&o&&o.test(a)&&o.parse?o.parse(a):a},onRender:function(t,e,r){var n=e.element,o=e.buildStyles,a=e.hasCSSVariable;if(Object.assign(n.style,o(t)),a)for(var i=r.length,s=0;s<i;s++){var u=r[s];u.startsWith("--")&&n.style.setProperty(u,t[u])}-1!==r.indexOf(ft)&&(n[ft]=t[ft]),-1!==r.indexOf(ct)&&(n[ct]=t[ct])},uncachedValues:dt});function mt(t,n){void 0===n&&(n={});var o=n.enableHardwareAcceleration,a=r(n,["enableHardwareAcceleration"]);return vt(e({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},r={},n={},o=[];return function(a){return o.length=0,gt(a,t,e,r,n,o,!0),e}}(o),preparseOutput:!0},a))}var yt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),bt=function(t,e){return t*e+"px"},wt={fill:at,stroke:at,scale:U,scaleX:U,scaleY:U,opacity:H,fillOpacity:H,strokeOpacity:H,numOctaves:e({},N,{transform:Math.round})},Ot=O({onRead:function(t,e){var r=e.element;if(E(t)){var n=function(t){return wt[t]}(t);return n?n.default:0}return r.getAttribute(t)},onRender:function(t,e){var r=e.dimensions;!function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setAttribute(r,e[r])}(e.element,function(t,e,r,n){var o=!1,a=!1,i={},s=r?{pathLength:"0",pathSpacing:""+n}:void 0,u=void 0!==t.scale?t.scale||1e-7:t.scaleX||1,f=void 0!==t.scaleY?t.scaleY||1e-7:u||1,c=e.width*(t.originX||50)+e.x,d=e.height*(t.originY||50)+e.y,l=1*u*-c,p=1*f*-d,h=c/u,g=d/f,v={translate:"translate("+t.x+", "+t.y+") ",scale:"translate("+l+", "+p+") scale("+u+", "+f+") translate("+h+", "+g+") ",rotate:"rotate("+t.rotate+", "+c+", "+d+") ",skewX:"skewX("+t.skewX+") ",skewY:"skewY("+t.skewY+") "};for(var m in t)if(t.hasOwnProperty(m)){var y=t[m];E(m)?o=!0:!r||"pathLength"!==m&&"pathSpacing"!==m||"number"!=typeof y?r&&"pathOffset"===m?i["stroke-dashoffset"]=bt(-y,n):i[yt.has(m)?m:S(m)]=y:(a=!0,s[m]=bt(y,n))}if(a&&(i["stroke-dasharray"]=s.pathLength+" "+s.pathSpacing),o)for(var m in i.transform="",v)if(v.hasOwnProperty(m)){var b="scale"===m?"1":"0";i.transform+=v[m].replace(/undefined/g,b)}return i}(t,r,e.isPath,e.pathLength))}}),xt=O({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,r=void 0===e?0:e,n=t.scrollLeft,o=void 0===n?0:n;return window.scrollTo(o,r)}}),St=function(){};"production"!==process.env.NODE_ENV&&(St=function(t,e){if(!t)throw new Error(e)});var Rt=new WeakMap,kt=function(t,e){var r;return t instanceof HTMLElement?r=mt(t,e):t instanceof SVGElement?r=function(t){var e={element:t,dimensions:function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),isPath:!1};return"path"===t.tagName&&(e.isPath=!0,e.pathLength=t.getTotalLength()),Ot(e)}(t):t===window&&(r=xt(t)),St(void 0!==r,"No valid node provided. Node must be HTMLElement, SVGElement or window."),Rt.set(t,r),r},Ct=function(t,e){return Rt.has(t)?Rt.get(t):kt(t,e)};t.default=function(t,e){var r="string"==typeof t?document.querySelector(t):t;return Ct(r,e)},t.createStylerFactory=O,t.buildStyleProperty=gt,t.isTransformProp=E,Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -171,2 +171,3 @@ 'use strict'; | ||
var rounded = __assign({}, styleValueTypes.number, { transform: Math.round }); | ||
var valueTypes = { | ||
@@ -232,3 +233,4 @@ color: styleValueTypes.color, | ||
originY: styleValueTypes.progressPercentage, | ||
originZ: styleValueTypes.px | ||
originZ: styleValueTypes.px, | ||
zIndex: rounded | ||
}; | ||
@@ -235,0 +237,0 @@ var getValueType = function (key) { return valueTypes[key]; }; |
{ | ||
"name": "stylefire", | ||
"version": "4.1.3", | ||
"version": "4.1.4", | ||
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
101215
2094