Socket
Socket
Sign inDemoInstall

stylefire

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylefire - npm Package Compare versions

Comparing version 2.3.5 to 2.3.6

8

CHANGELOG.md

@@ -5,4 +5,10 @@ # Changelog

## [2.3.5] 2018-01-07
## [2.3.6] 2019-01-16
### Added
- Exporting `isTransformProp`
## [2.3.5] 2019-01-07
### Fixed

@@ -9,0 +15,0 @@

2

dist/stylefire.es.js

@@ -510,2 +510,2 @@ import sync from 'framesync';

export default index;
export { createStyler as createStylerFactory, buildStyleProperty };
export { createStyler as createStylerFactory, buildStyleProperty, isTransformProp };

@@ -828,2 +828,3 @@ (function (global, factory) {

exports.buildStyleProperty = buildStyleProperty;
exports.isTransformProp = isTransformProp;

@@ -830,0 +831,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -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)};var r=function(){};"production"!==process.env.NODE_ENV&&(r=function(t,e){if(!t)throw new Error("Hey, listen! ".toUpperCase()+e)});var n,o=0,a="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-o));o=e+r,setTimeout(function(){return t(o)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(n||(n={}));var i,s=1/60*1e3,u=!0,f=!1,c=!1,d={delta:0,timestamp:0},l=[n.Read,n.Update,n.Render,n.PostRender],p=function(t){return f=t},h=l.reduce(function(t,e){var n,o,a,i,s,u,c,d,l,h=(n=p,o=[],a=[],i=0,s=!1,u=0,c=new WeakSet,d=new WeakSet,l={cancel:function(t){var e=a.indexOf(t);c.add(t),-1!==e&&a.splice(e,1)},process:function(t){var e,r;if(s=!0,o=(e=[a,o])[0],(a=e[1]).length=0,i=o.length)for(u=0;u<i;u++)(r=o[u])(t),!0!==d.has(r)||c.has(r)||(l.schedule(r),n(!0));s=!1},schedule:function(t,e,n){r("function"==typeof t,"Argument must be a function");var u=n&&s,f=u?o:a;e&&d.add(t),-1===f.indexOf(t)&&(f.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),f||b(),h.schedule(t,e,r),t},t.cancelSync[e]=function(t){return h.cancel(t)},t.steps[e]=h,t},{steps:{},sync:{},cancelSync:{}}),g=h.steps,v=h.sync,m=(h.cancelSync,function(t){return g[t].process(d)}),y=function(t){f=!1,d.delta=u?s:Math.max(Math.min(t-d.timestamp,40),1),u||(s=d.delta),d.timestamp=t,c=!0,l.forEach(m),c=!1,f&&(u=!1,a(y))},b=function(){f=!0,u=!0,c||a(y)},w=function(t){var e=t.onRead,r=t.onRender,n=t.uncachedValues,o=void 0===n?new Set:n,a=t.useCache,i=void 0===a||a;return function(t){var n={},a=[],s=!1,u=function(t,e){var r=n[t];n[t]=e,n[t]!==r&&(-1===a.indexOf(t)&&a.push(t),s||(s=!0,v.render(f)))};function f(e){return void 0===e&&(e=!1),(!0===e||s)&&(r(n,t,a),s=!1,a.length=0),this}return{get:function(r){return r?i&&!o.has(r)&&void 0!==n[r]?n[r]:e(r,t):n},set:function(t,e){if("string"==typeof t){if(void 0===e)return function(e){return u(t,e)};u(t,e)}else for(var r in t)t.hasOwnProperty(r)&&u(r,t[r]);return this},render:f}}},O=/([a-z])([A-Z])/g,x=function(t){return t.replace(O,"$1-$2").toLowerCase()},R=new Map,L=new Map,S=["Webkit","Moz","O","ms",""],k=S.length,P="undefined"!=typeof document,T=function(t,e){return L.set(t,x(e))},Y=function(t,e){void 0===e&&(e=!1);var r=e?L:R;return r.has(t)||(P?function(t){i=i||document.createElement("div");for(var e=0;e<k;e++){var r=S[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);(o in i.style||n)&&(R.set(t,o),T(t,(n?"":"-")+x(o)))}}(t):function(t){T(t,t)}(t)),r.get(t)||t},X=["","X","Y","Z"],C=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return X.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),M=C.reduce(function(t,e){return t[e]=!0,t},{}),B=function(t){return!0===M[t]},W=function(t,e){return C.indexOf(t)-C.indexOf(e)},j=function(t){return"originX"===t||"originY"===t},A=function(){return(A=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)},E=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},F=function(t){return function(e){return"string"==typeof e&&0===e.indexOf(t)}},Z=function(t){return t%1?Number(t.toFixed(5)):t},z={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},H=A({},z,{transform:E(0,1)}),N=A({},z,{default:1}),U=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}}},V=U("deg"),I=U("%"),q=U("px"),$=E(0,255),_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,D=function(t){return void 0!==t.red},G=function(t){return void 0!==t.hue},J=function(t){var e=t.length;return function(r){if("string"!=typeof r)return r;for(var n,o={},a=function(t){return"string"==typeof t?t.split(/,\s*/):[t]}((n=r).substring(n.indexOf("(")+1,n.lastIndexOf(")"))),i=0;i<e;i++)o[t[i]]=void 0!==a[i]?parseFloat(a[i]):1;return o}},K=A({},z,{transform:function(t){return Math.round($(t))}}),Q=F("rgb"),tt={test:function(t){return"string"==typeof t?Q(t):D(t)},parse:J(["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:K.transform(e),green:K.transform(r),blue:K.transform(n),alpha:Z(o)})}},et=F("hsl"),rt={test:function(t){return"string"==typeof t?et(t):G(t)},parse:J(["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)})}},nt=A({},tt,{test:F("#"),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}}}),ot={test:function(t){return"string"==typeof t&&_.test(t)||tt.test(t)||rt.test(t)||nt.test(t)},parse:function(t){return tt.test(t)?tt.parse(t):rt.test(t)?rt.parse(t):nt.test(t)?nt.parse(t):t},transform:function(t){return D(t)?tt.transform(t):G(t)?rt.transform(t):t}},at={color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,rotate:V,rotateX:V,rotateY:V,rotateZ:V,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:V,skewX:V,skewY:V,distance:q,x:q,y:q,z:q,perspective:q,opacity:H,originX:I,originY:I,originZ:q},it=function(t){return at[t]},st=new Set(["scrollLeft","scrollTop"]),ut=new Set(["scrollLeft","scrollTop","transform"]),ft={x:"translateX",y:"translateY",z:"translateZ"},ct=function(t){return"function"==typeof t},dt=function(t,e,r,n,o,a){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a=[]);var i=!0,s=!1,u=!1;for(var f in t){var c=t[f],d=it(f),l="number"==typeof c&&d?d.transform(c):c;B(f)?(s=!0,n[f]=l,a.push(f),i&&(d.default&&c!==d.default||!d.default&&0!==c)&&(i=!1)):j(f)?(o[f]=l,u=!0):ut.has(f)&&ct(l)||(r[Y(f,!0)]=l)}if(i)s&&(r.transform="none");else{var p="";if(ct(t.transform))p=t.transform(n);else{var h=!1;a.sort(W);for(var g=a.length,v=0;v<g;v++){f=a[v];p+=(ft[f]||f)+"("+n[f]+") ",h="z"===f||h}!h&&e?p+="translateZ(0)":p=p.trim()}r.transform=p}return u&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r},lt=w({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=it(t);if(B(t))return o&&o.default||0;if(st.has(t))return r[t];var a=window.getComputedStyle(r,null).getPropertyValue(Y(t,!0))||0;return n&&o&&o.parse?o.parse(a):a},onRender:function(t,e,r){var n=e.element,o=e.buildStyles;Object.assign(n.style,o(t)),-1!==r.indexOf("scrollLeft")&&(n.scrollLeft=t.scrollLeft),-1!==r.indexOf("scrollTop")&&(n.scrollTop=t.scrollTop)},uncachedValues:st}),pt=function(t,r){void 0===r&&(r={});var n=r.enableHardwareAcceleration,o=function(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}(r,["enableHardwareAcceleration"]);return lt(e({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},r={},n={},o=[];return function(a){return o.length=0,dt(a,t,e,r,n,o),e}}(n),preparseOutput:!0},o))},ht=function(t,e){return t/100*e+"px"},gt={fill:ot,stroke:ot,scale:N,scaleX:N,scaleY:N,opacity:H,fillOpacity:H,strokeOpacity:H},vt=w({onRead:function(t,e){var r=e.element;if(B(t)){var n=function(t){return gt[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)/100)+e.x,d=e.height*((t.originY||50)/100)+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];B(m)?o=!0:!r||"pathLength"!==m&&"pathSpacing"!==m||"number"!=typeof y?r&&"pathOffset"===m?i["stroke-dashoffset"]=ht(-y,n):i[x(m)]=y:(a=!0,s[m]=ht(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))}}),mt=w({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)}}),yt=new WeakMap,bt=function(t,e){var n;return t instanceof HTMLElement?n=pt(t,e):t instanceof SVGElement?n=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()),vt(e)}(t):t===window&&(n=mt(t)),r(void 0!==n,"No valid node provided. Node must be HTMLElement, SVGElement or window."),yt.set(t,n),n},wt=function(t,e){return yt.has(t)?yt.get(t):bt(t,e)};t.default=function(t,e){var r="string"==typeof t?document.querySelector(t):t;return wt(r,e)},t.createStylerFactory=w,t.buildStyleProperty=dt,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)};var r=function(){};"production"!==process.env.NODE_ENV&&(r=function(t,e){if(!t)throw new Error("Hey, listen! ".toUpperCase()+e)});var n,o=0,a="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-o));o=e+r,setTimeout(function(){return t(o)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(n||(n={}));var i,s=1/60*1e3,u=!0,f=!1,c=!1,d={delta:0,timestamp:0},l=[n.Read,n.Update,n.Render,n.PostRender],p=function(t){return f=t},h=l.reduce(function(t,e){var n,o,a,i,s,u,c,d,l,h=(n=p,o=[],a=[],i=0,s=!1,u=0,c=new WeakSet,d=new WeakSet,l={cancel:function(t){var e=a.indexOf(t);c.add(t),-1!==e&&a.splice(e,1)},process:function(t){var e,r;if(s=!0,o=(e=[a,o])[0],(a=e[1]).length=0,i=o.length)for(u=0;u<i;u++)(r=o[u])(t),!0!==d.has(r)||c.has(r)||(l.schedule(r),n(!0));s=!1},schedule:function(t,e,n){r("function"==typeof t,"Argument must be a function");var u=n&&s,f=u?o:a;e&&d.add(t),-1===f.indexOf(t)&&(f.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),f||b(),h.schedule(t,e,r),t},t.cancelSync[e]=function(t){return h.cancel(t)},t.steps[e]=h,t},{steps:{},sync:{},cancelSync:{}}),g=h.steps,v=h.sync,m=(h.cancelSync,function(t){return g[t].process(d)}),y=function(t){f=!1,d.delta=u?s:Math.max(Math.min(t-d.timestamp,40),1),u||(s=d.delta),d.timestamp=t,c=!0,l.forEach(m),c=!1,f&&(u=!1,a(y))},b=function(){f=!0,u=!0,c||a(y)},w=function(t){var e=t.onRead,r=t.onRender,n=t.uncachedValues,o=void 0===n?new Set:n,a=t.useCache,i=void 0===a||a;return function(t){var n={},a=[],s=!1,u=function(t,e){var r=n[t];n[t]=e,n[t]!==r&&(-1===a.indexOf(t)&&a.push(t),s||(s=!0,v.render(f)))};function f(e){return void 0===e&&(e=!1),(!0===e||s)&&(r(n,t,a),s=!1,a.length=0),this}return{get:function(r){return r?i&&!o.has(r)&&void 0!==n[r]?n[r]:e(r,t):n},set:function(t,e){if("string"==typeof t){if(void 0===e)return function(e){return u(t,e)};u(t,e)}else for(var r in t)t.hasOwnProperty(r)&&u(r,t[r]);return this},render:f}}},O=/([a-z])([A-Z])/g,x=function(t){return t.replace(O,"$1-$2").toLowerCase()},R=new Map,L=new Map,S=["Webkit","Moz","O","ms",""],k=S.length,P="undefined"!=typeof document,T=function(t,e){return L.set(t,x(e))},Y=function(t,e){void 0===e&&(e=!1);var r=e?L:R;return r.has(t)||(P?function(t){i=i||document.createElement("div");for(var e=0;e<k;e++){var r=S[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);(o in i.style||n)&&(R.set(t,o),T(t,(n?"":"-")+x(o)))}}(t):function(t){T(t,t)}(t)),r.get(t)||t},X=["","X","Y","Z"],C=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return X.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),M=C.reduce(function(t,e){return t[e]=!0,t},{}),B=function(t){return!0===M[t]},W=function(t,e){return C.indexOf(t)-C.indexOf(e)},j=function(t){return"originX"===t||"originY"===t},A=function(){return(A=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)},E=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},F=function(t){return function(e){return"string"==typeof e&&0===e.indexOf(t)}},Z=function(t){return t%1?Number(t.toFixed(5)):t},z={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},H=A({},z,{transform:E(0,1)}),N=A({},z,{default:1}),U=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}}},V=U("deg"),I=U("%"),q=U("px"),$=E(0,255),_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,D=function(t){return void 0!==t.red},G=function(t){return void 0!==t.hue},J=function(t){var e=t.length;return function(r){if("string"!=typeof r)return r;for(var n,o={},a=function(t){return"string"==typeof t?t.split(/,\s*/):[t]}((n=r).substring(n.indexOf("(")+1,n.lastIndexOf(")"))),i=0;i<e;i++)o[t[i]]=void 0!==a[i]?parseFloat(a[i]):1;return o}},K=A({},z,{transform:function(t){return Math.round($(t))}}),Q=F("rgb"),tt={test:function(t){return"string"==typeof t?Q(t):D(t)},parse:J(["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:K.transform(e),green:K.transform(r),blue:K.transform(n),alpha:Z(o)})}},et=F("hsl"),rt={test:function(t){return"string"==typeof t?et(t):G(t)},parse:J(["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)})}},nt=A({},tt,{test:F("#"),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}}}),ot={test:function(t){return"string"==typeof t&&_.test(t)||tt.test(t)||rt.test(t)||nt.test(t)},parse:function(t){return tt.test(t)?tt.parse(t):rt.test(t)?rt.parse(t):nt.test(t)?nt.parse(t):t},transform:function(t){return D(t)?tt.transform(t):G(t)?rt.transform(t):t}},at={color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,rotate:V,rotateX:V,rotateY:V,rotateZ:V,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:V,skewX:V,skewY:V,distance:q,x:q,y:q,z:q,perspective:q,opacity:H,originX:I,originY:I,originZ:q},it=function(t){return at[t]},st=new Set(["scrollLeft","scrollTop"]),ut=new Set(["scrollLeft","scrollTop","transform"]),ft={x:"translateX",y:"translateY",z:"translateZ"},ct=function(t){return"function"==typeof t},dt=function(t,e,r,n,o,a){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a=[]);var i=!0,s=!1,u=!1;for(var f in t){var c=t[f],d=it(f),l="number"==typeof c&&d?d.transform(c):c;B(f)?(s=!0,n[f]=l,a.push(f),i&&(d.default&&c!==d.default||!d.default&&0!==c)&&(i=!1)):j(f)?(o[f]=l,u=!0):ut.has(f)&&ct(l)||(r[Y(f,!0)]=l)}if(i)s&&(r.transform="none");else{var p="";if(ct(t.transform))p=t.transform(n);else{var h=!1;a.sort(W);for(var g=a.length,v=0;v<g;v++){f=a[v];p+=(ft[f]||f)+"("+n[f]+") ",h="z"===f||h}!h&&e?p+="translateZ(0)":p=p.trim()}r.transform=p}return u&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r},lt=w({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=it(t);if(B(t))return o&&o.default||0;if(st.has(t))return r[t];var a=window.getComputedStyle(r,null).getPropertyValue(Y(t,!0))||0;return n&&o&&o.parse?o.parse(a):a},onRender:function(t,e,r){var n=e.element,o=e.buildStyles;Object.assign(n.style,o(t)),-1!==r.indexOf("scrollLeft")&&(n.scrollLeft=t.scrollLeft),-1!==r.indexOf("scrollTop")&&(n.scrollTop=t.scrollTop)},uncachedValues:st}),pt=function(t,r){void 0===r&&(r={});var n=r.enableHardwareAcceleration,o=function(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}(r,["enableHardwareAcceleration"]);return lt(e({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},r={},n={},o=[];return function(a){return o.length=0,dt(a,t,e,r,n,o),e}}(n),preparseOutput:!0},o))},ht=function(t,e){return t/100*e+"px"},gt={fill:ot,stroke:ot,scale:N,scaleX:N,scaleY:N,opacity:H,fillOpacity:H,strokeOpacity:H},vt=w({onRead:function(t,e){var r=e.element;if(B(t)){var n=function(t){return gt[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)/100)+e.x,d=e.height*((t.originY||50)/100)+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];B(m)?o=!0:!r||"pathLength"!==m&&"pathSpacing"!==m||"number"!=typeof y?r&&"pathOffset"===m?i["stroke-dashoffset"]=ht(-y,n):i[x(m)]=y:(a=!0,s[m]=ht(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))}}),mt=w({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)}}),yt=new WeakMap,bt=function(t,e){var n;return t instanceof HTMLElement?n=pt(t,e):t instanceof SVGElement?n=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()),vt(e)}(t):t===window&&(n=mt(t)),r(void 0!==n,"No valid node provided. Node must be HTMLElement, SVGElement or window."),yt.set(t,n),n},wt=function(t,e){return yt.has(t)?yt.get(t):bt(t,e)};t.default=function(t,e){var r="string"==typeof t?document.querySelector(t):t;return wt(r,e)},t.createStylerFactory=w,t.buildStyleProperty=dt,t.isTransformProp=B,Object.defineProperty(t,"__esModule",{value:!0})});
import createStylerFactory from './styler';
import { buildStyleProperty } from './css/build-styles';
import { isTransformProp } from './css/transform-props';
import { Styler, Props } from './styler/types';
export default function (nodeOrSelector: Element | string | Window, props?: Props): Styler;
export { createStylerFactory, Styler, buildStyleProperty };
export { createStylerFactory, Styler, buildStyleProperty, isTransformProp };

@@ -523,1 +523,2 @@ 'use strict';

exports.buildStyleProperty = buildStyleProperty;
exports.isTransformProp = isTransformProp;
{
"name": "stylefire",
"version": "2.3.5",
"version": "2.3.6",
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc