Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.0.3 to 2.0.4

lib/css/index.js

6

CHANGELOG.md

@@ -5,8 +5,2 @@ # Changelog

## [2.0.3] 2018-06-21
### Updated
- `style-value-types@2.0.1`
## [2.0.2] 2018-05-16

@@ -13,0 +7,0 @@

20

dist/stylefire.es.js

@@ -101,3 +101,3 @@ import { onFrameRender } from 'framesync';

};
var prefixer = function (key, asDashCase) {
function prefixer(key, asDashCase) {
if (asDashCase === void 0) {

@@ -109,3 +109,3 @@ asDashCase = false;

return cache.get(key) || key;
};
}

@@ -176,5 +176,5 @@ var axes = ['', 'X', 'Y', 'Z'];

};
var getValueType = function (key) {
function getValueType(key) {
return valueTypes[key];
};
}

@@ -292,5 +292,5 @@ var aliasMap = {

});
var css = function (element, props) {
function css(element, props) {
return cssStyler(__assign({ element: element, enableHardwareAcceleration: true, preparseOutput: true }, props));
};
}

@@ -364,5 +364,5 @@ var ZERO_NOT_ZERO = 0.0000001;

};
var getValueType$1 = function (key) {
function getValueType$1(key) {
return valueTypes$1[key];
};
}

@@ -392,3 +392,3 @@ var svgStyler = /*#__PURE__*/createStyler({

});
var svg = function (element) {
function svg(element) {
var _a = element.getBBox(),

@@ -409,3 +409,3 @@ x = _a.x,

return svgStyler(props);
};
}

@@ -412,0 +412,0 @@ var viewport = /*#__PURE__*/createStyler({

@@ -192,3 +192,3 @@ (function (global, factory) {

};
var prefixer = (function (key, asDashCase) {
function prefixer (key, asDashCase) {
if (asDashCase === void 0) { asDashCase = false; }

@@ -199,3 +199,3 @@ var cache = asDashCase ? dashCache : camelCache;

return cache.get(key) || key;
});
}

@@ -381,3 +381,3 @@ var axes = ['', 'X', 'Y', 'Z'];

};
var getValueType$1 = (function (key) { return valueTypes[key]; });
function getValueType (key) { return valueTypes[key]; }

@@ -435,3 +435,3 @@ var aliasMap = {

var value = state[key];
var valueType = getValueType$1(key);
var valueType = getValueType(key);
if (isTransformKey) {

@@ -479,3 +479,3 @@ if ((valueType.default && value !== valueType.default) ||

var element = _a.element, preparseOutput = _a.preparseOutput;
var valueType = getValueType$1(key);
var valueType = getValueType(key);
if (isTransformProp(key)) {

@@ -507,5 +507,5 @@ return valueType ? valueType.default || 0 : 0;

});
var css = (function (element, props) {
function css (element, props) {
return cssStyler(__assign({ element: element, enableHardwareAcceleration: true, preparseOutput: true }, props));
});
}

@@ -582,3 +582,3 @@ var ZERO_NOT_ZERO = 0.0000001;

};
var getValueType$2 = (function (key) { return valueTypes$1[key]; });
function getValueType$1 (key) { return valueTypes$1[key]; }

@@ -592,3 +592,3 @@ var svgStyler = createStyler({

else {
var valueType = getValueType$2(key);
var valueType = getValueType$1(key);
return valueType ? valueType.default : 0;

@@ -607,3 +607,3 @@ }

});
var svg = (function (element) {
function svg (element) {
var _a = element.getBBox(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;

@@ -620,3 +620,3 @@ var props = {

return svgStyler(props);
});
}

@@ -623,0 +623,0 @@ var viewport = createStyler({

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.stylefire={})}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r=0,n="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-r));r=t+n,setTimeout(function(){return e(r)},n)};function a(e){var t=[],r=[],n=0,a=!1,o=0;return{cancel:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)},process:function(){for(a=!0,t=(e=[r,t])[0],(r=e[1]).length=0,n=t.length,o=0;o<n;o++)t[o]();var e;a=!1},schedule:function(o,s){void 0===s&&(s=!1),e();var i=s&&a,f=i?t:r;-1===f.indexOf(o)&&(f.push(o),i&&(n=t.length))}}}"undefined"!=typeof performance&&performance.now;var o=!1;function s(){o||(o=!0,n(c))}var i=a(s),f=a(s),u=a(s),l=a(s);function c(e){o=!1,i.process(),f.process(),u.process(),l.process()}var p,d=u.schedule,h=function(e){var t=e.onRead,r=e.onRender,n=e.aliasMap,a=void 0===n?{}:n,o=e.useCache,s=void 0===o||o;return function(e){var n={},o=[],i=!1,f=function(e,t){var r=a[e]||e,s=n[r];n[r]=t,n[r]!==s&&(-1===o.indexOf(r)&&o.push(r),i||(i=!0,d(u)))};function u(t){return void 0===t&&(t=!1),(t||i)&&(r(n,e,o),i=!1,o.length=0),this}return{get:function(r){var o=a[r]||r;return o?s&&void 0!==n[o]?n[o]:t(o,e):n},set:function(e,t){if("string"==typeof e){if(void 0===t)return function(t){return f(e,t)};f(e,t)}else for(var r in e)e.hasOwnProperty(r)&&f(r,e[r]);return this},render:u}}},g=/([a-z])([A-Z])/g,m=function(e){return e.replace(g,"$1-$2").toLowerCase()},v=new Map,y=new Map,w=["Webkit","Moz","O","ms",""],b=w.length,O=function(e,t){void 0===t&&(t=!1);var r=t?y:v;return r.has(e)||function(e){if("undefined"!=typeof document){p=p||document.createElement("div");for(var t=0;t<b;t++){var r=w[t],n=""===r,a=n?e:r+e.charAt(0).toUpperCase()+e.slice(1);a in p.style&&(v.set(e,a),y.set(e,(n?"":"-")+m(a)))}}}(e),r.get(e)||e},x=["","X","Y","Z"],Y=["translate","scale","rotate","skew","transformPerspective"].reduce(function(e,t){return x.reduce(function(e,r){return e.push(t+r),e},e)},["x","y","z"]),k=Y.reduce(function(e,t){return e[t]=!0,e},{}),X=function(e){return!0===k[e]},$=function(e,t){return Y.indexOf(e)-Y.indexOf(t)},L=function(e){return"transformOriginX"===e||"transformOriginY"===e};const M=(e,t)=>r=>Math.max(Math.min(r,t),e),C=e=>t=>"string"==typeof t&&0===t.indexOf(e),T={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},P=Object.assign({},T,{transform:M(0,1)}),Z=Object.assign({},T,{default:1}),j=e=>{const t=(e=>t=>"string"==typeof t&&-1!==t.indexOf(e))(e);return{test:e=>"string"==typeof e&&t(e)&&1===e.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}},R=j("deg"),S=j("%"),A=j("px"),E=M(0,255),F=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,H=e=>void 0!==e.red,N=e=>void 0!==e.hue,V=e=>{const t=e.length;return r=>{if("string"!=typeof r)return r;const n={},a=(e=>"string"==typeof e?e.split(/,\s*/):[e])((e=>e.substring(e.indexOf("(")+1,e.lastIndexOf(")")))(r));for(let r=0;r<t;r++)n[e[r]]=void 0!==a[r]?parseFloat(a[r]):1;return n}},z=Object.assign({},T,{transform:e=>Math.round(E(e))}),I=C("rgb"),q={test:e=>"string"==typeof e?I(e):H(e),parse:V(["red","green","blue","alpha"]),transform:({red:e,green:t,blue:r,alpha:n})=>(({red:e,green:t,blue:r,alpha$$1:n=1})=>`rgba(${e}, ${t}, ${r}, ${n})`)({red:z.transform(e),green:z.transform(t),blue:z.transform(r),alpha:n})},B=C("hsl"),W={test:e=>"string"==typeof e?B(e):N(e),parse:V(["hue","saturation","lightness","alpha"]),transform:({hue:e,saturation:t,lightness:r,alpha:n})=>(({hue:e,saturation:t,lightness:r,alpha$$1:n=1})=>`hsla(${e}, ${t}, ${r}, ${n})`)({hue:Math.round(e),saturation:S.transform(t),lightness:S.transform(r),alpha:n})},_=Object.assign({},q,{test:C("#"),parse:e=>{let t="",r="",n="";return e.length>4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),D={test:e=>"string"==typeof e&&F.test(e)||q.test(e)||W.test(e)||_.test(e),parse:e=>q.test(e)?q.parse(e):W.test(e)?W.parse(e):_.test(e)?_.parse(e):e,transform:e=>H(e)?q.transform(e):N(e)?W.transform(e):e};var G={color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,borderRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,left:A,bottom:A,right:A,rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skewX:R,skewY:R,distance:A,translateX:A,translateY:A,translateZ:A,perspective:A,opacity:P,transformOriginX:S,transformOriginY:S,transformOriginZ:A},U=function(e){return G[e]},J="number",K="object",Q="transform-origin",ee="transform",te="translateZ",re=";transform: none",ne=function(e,t){return";"+e+":"+t};function ae(e,t,r,n){void 0===t&&(t=!0),void 0===r&&(r=!0);for(var a=!0===t?Object.keys(e):t,o="",s="",i=!1,f=!0,u=!1,l=!1,c=a.length,p=0;p<c;p++){var d=a[p];if(X(d)){for(var h in u=!0,e)X(h)&&-1===a.indexOf(h)&&a.push(h);break}}a.sort($);var g=a.length;for(p=0;p<g;p++){d=a[p];if(!n.has(d)){var m=X(d),v=e[d],y=U(d);m&&(y.default&&v!==y.default||!y.default&&0!==v)&&(f=!1),y&&(typeof v===J||typeof v===K)&&y.transform&&(v=y.transform(v)),m?(s+=d+"("+v+") ",l=d===te||l):L(d)?(e[d]=v,i=!0):o+=ne(O(d,!0),v)}}return i&&(o+=ne(Q,(e.transformOriginX||0)+" "+(e.transformOriginY||0)+" "+(e.transformOriginZ||0))),u&&(!l&&r&&(s+=te+"(0)"),o+=ne(ee,f?re:s)),o}var oe=new Set(["scrollLeft","scrollTop"]),se=h({onRead:function(e,t){var r=t.element,n=t.preparseOutput,a=U(e);if(X(e))return a&&a.default||0;if(oe.has(e))return r[e];var o=window.getComputedStyle(r,null).getPropertyValue(O(e,!0))||0;return n&&a&&a.parse?a.parse(o):o},onRender:function(e,t,r){var n=t.element,a=t.enableHardwareAcceleration;n.style.cssText+=ae(e,r,a,oe),-1!==r.indexOf("scrollLeft")&&(n.scrollLeft=e.scrollLeft),-1!==r.indexOf("scrollTop")&&(n.scrollTop=e.scrollTop)},aliasMap:{x:"translateX",y:"translateY",z:"translateZ",originX:"transformOriginX",originY:"transformOriginY",originZ:"transformOriginZ"},uncachedValues:oe}),ie=function(e,t){return e/100*t+"px"},fe={fill:D,stroke:D,scale:Z,scaleX:Z,scaleY:Z,opacity:P,fillOpacity:P,strokeOpacity:P},ue=h({onRead:function(e,t){var r=t.element;if(X(e)){var n=function(e){return fe[e]}(e);return n?n.default:0}return r.getAttribute(e)},onRender:function(e,t,r){var n=t.dimensions;!function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setAttribute(r,t[r])}(t.element,function(e,t,r,n){var a=!1,o=!1,s={},i=r?{pathLength:"0",pathSpacing:""+n}:void 0,f=void 0!==e.scale?e.scale||1e-7:e.scaleX||1,u=void 0!==e.scaleY?e.scaleY||1e-7:f||1,l=t.width*((e.originX||50)/100)+t.x,c=t.height*((e.originY||50)/100)+t.y,p=1*f*-l,d=1*u*-c,h=l/f,g=c/u,v={translate:"translate("+e.translateX+", "+e.translateY+") ",scale:"translate("+p+", "+d+") scale("+f+", "+u+") translate("+h+", "+g+") ",rotate:"rotate("+e.rotate+", "+l+", "+c+") ",skewX:"skewX("+e.skewX+") ",skewY:"skewY("+e.skewY+") "};for(var y in e)if(e.hasOwnProperty(y)){var w=e[y];X(y)?a=!0:!r||"pathLength"!==y&&"pathSpacing"!==y||"number"!=typeof w?r&&"pathOffset"===y?s["stroke-dashoffset"]=ie(-w,n):s[m(y)]=w:(o=!0,i[y]=ie(w,n))}if(o&&(s["stroke-dasharray"]=i.pathLength+" "+i.pathSpacing),a)for(var y in s.transform="",v)if(v.hasOwnProperty(y)){var b="scale"===y?"1":"0";s.transform+=v[y].replace(/undefined/g,b)}return s}(e,n,t.isPath,t.pathLength))},aliasMap:{x:"translateX",y:"translateY",background:"fill"}}),le=h({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,r=void 0===t?0:t,n=e.scrollLeft,a=void 0===n?0:n;return window.scrollTo(a,r)}}),ce=function(){};"production"!==process.env.NODE_ENV&&(ce=function(e,t){if(!e)throw new Error("Hey, listen! ".toUpperCase()+t)});var pe=new WeakMap,de=function(e,r){var n;return e instanceof HTMLElement?n=function(e,r){return se(t({element:e,enableHardwareAcceleration:!0,preparseOutput:!0},r))}(e,r):e instanceof SVGElement?n=function(e){var t=e.getBBox(),r={element:e,dimensions:{x:t.x,y:t.y,width:t.width,height:t.height},isPath:!1};return"path"===e.tagName&&(r.isPath=!0,r.pathLength=e.getTotalLength()),ue(r)}(e):"undefined"!=typeof window&&e===window&&(n=le(e)),ce(void 0!==n,"No valid node provided. Node must be HTMLElement, SVGElement or window."),pe.set(e,n),n},he=function(e,t){return pe.has(e)?pe.get(e):de(e,t)};e.default=function(e,t){var r="string"==typeof e?document.querySelector(e):e;return he(r,t)},e.createStylerFactory=h,e.buildStyles=ae,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.stylefire={})}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r=0,n="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-r));r=t+n,setTimeout(function(){return e(r)},n)};function a(e){var t=[],r=[],n=0,a=!1,o=0;return{cancel:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)},process:function(){for(a=!0,t=(e=[r,t])[0],(r=e[1]).length=0,n=t.length,o=0;o<n;o++)t[o]();var e;a=!1},schedule:function(o,s){void 0===s&&(s=!1),e();var i=s&&a,f=i?t:r;-1===f.indexOf(o)&&(f.push(o),i&&(n=t.length))}}}"undefined"!=typeof performance&&performance.now;var o=!1;function s(){o||(o=!0,n(c))}var i=a(s),f=a(s),u=a(s),l=a(s);function c(e){o=!1,i.process(),f.process(),u.process(),l.process()}var p,d=u.schedule,h=function(e){var t=e.onRead,r=e.onRender,n=e.aliasMap,a=void 0===n?{}:n,o=e.useCache,s=void 0===o||o;return function(e){var n={},o=[],i=!1,f=function(e,t){var r=a[e]||e,s=n[r];n[r]=t,n[r]!==s&&(-1===o.indexOf(r)&&o.push(r),i||(i=!0,d(u)))};function u(t){return void 0===t&&(t=!1),(t||i)&&(r(n,e,o),i=!1,o.length=0),this}return{get:function(r){var o=a[r]||r;return o?s&&void 0!==n[o]?n[o]:t(o,e):n},set:function(e,t){if("string"==typeof e){if(void 0===t)return function(t){return f(e,t)};f(e,t)}else for(var r in e)e.hasOwnProperty(r)&&f(r,e[r]);return this},render:u}}},g=/([a-z])([A-Z])/g,v=function(e){return e.replace(g,"$1-$2").toLowerCase()},m=new Map,y=new Map,w=["Webkit","Moz","O","ms",""],b=w.length,O=function(e){if("undefined"!=typeof document){p=p||document.createElement("div");for(var t=0;t<b;t++){var r=w[t],n=""===r,a=n?e:r+e.charAt(0).toUpperCase()+e.slice(1);a in p.style&&(m.set(e,a),y.set(e,(n?"":"-")+v(a)))}}};function x(e,t){void 0===t&&(t=!1);var r=t?y:m;return r.has(e)||O(e),r.get(e)||e}var Y=["","X","Y","Z"],k=["translate","scale","rotate","skew","transformPerspective"].reduce(function(e,t){return Y.reduce(function(e,r){return e.push(t+r),e},e)},["x","y","z"]),X=k.reduce(function(e,t){return e[t]=!0,e},{}),$=function(e){return!0===X[e]},L=function(e,t){return k.indexOf(e)-k.indexOf(t)},M=function(e){return"transformOriginX"===e||"transformOriginY"===e};const C=(e,t)=>r=>Math.max(Math.min(r,t),e),T=e=>t=>"string"==typeof t&&0===t.indexOf(e),P={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Z=Object.assign({},P,{transform:C(0,1)}),j=Object.assign({},P,{default:1}),R=e=>{const t=(e=>t=>"string"==typeof t&&-1!==t.indexOf(e))(e);return{test:e=>"string"==typeof e&&t(e)&&1===e.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}},S=R("deg"),A=R("%"),E=R("px"),F=C(0,255),H=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,N=e=>void 0!==e.red,V=e=>void 0!==e.hue,z=e=>{const t=e.length;return r=>{if("string"!=typeof r)return r;const n={},a=(e=>"string"==typeof e?e.split(/,\s*/):[e])((e=>e.substring(e.indexOf("(")+1,e.lastIndexOf(")")))(r));for(let r=0;r<t;r++)n[e[r]]=void 0!==a[r]?parseFloat(a[r]):1;return n}},I=Object.assign({},P,{transform:e=>Math.round(F(e))}),q=T("rgb"),B={test:e=>"string"==typeof e?q(e):N(e),parse:z(["red","green","blue","alpha"]),transform:({red:e,green:t,blue:r,alpha:n})=>(({red:e,green:t,blue:r,alpha$$1:n=1})=>`rgba(${e}, ${t}, ${r}, ${n})`)({red:I.transform(e),green:I.transform(t),blue:I.transform(r),alpha:n})},W=T("hsl"),_={test:e=>"string"==typeof e?W(e):V(e),parse:z(["hue","saturation","lightness","alpha"]),transform:({hue:e,saturation:t,lightness:r,alpha:n})=>(({hue:e,saturation:t,lightness:r,alpha$$1:n=1})=>`hsla(${e}, ${t}, ${r}, ${n})`)({hue:Math.round(e),saturation:A.transform(t),lightness:A.transform(r),alpha:n})},D=Object.assign({},B,{test:T("#"),parse:e=>{let t="",r="",n="";return e.length>4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),G={test:e=>"string"==typeof e&&H.test(e)||B.test(e)||_.test(e)||D.test(e),parse:e=>B.test(e)?B.parse(e):_.test(e)?_.parse(e):D.test(e)?D.parse(e):e,transform:e=>N(e)?B.transform(e):V(e)?_.transform(e):e};var U={color:G,backgroundColor:G,outlineColor:G,fill:G,stroke:G,borderColor:G,borderTopColor:G,borderRightColor:G,borderBottomColor:G,borderLeftColor:G,borderRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,left:E,bottom:E,right:E,rotate:S,rotateX:S,rotateY:S,rotateZ:S,scale:j,scaleX:j,scaleY:j,scaleZ:j,skewX:S,skewY:S,distance:E,translateX:E,translateY:E,translateZ:E,perspective:E,opacity:Z,transformOriginX:A,transformOriginY:A,transformOriginZ:E};function J(e){return U[e]}var K="number",Q="object",ee="transform-origin",te="transform",re="translateZ",ne=";transform: none",ae=function(e,t){return";"+e+":"+t};function oe(e,t,r,n){void 0===t&&(t=!0),void 0===r&&(r=!0);for(var a=!0===t?Object.keys(e):t,o="",s="",i=!1,f=!0,u=!1,l=!1,c=a.length,p=0;p<c;p++){var d=a[p];if($(d)){for(var h in u=!0,e)$(h)&&-1===a.indexOf(h)&&a.push(h);break}}a.sort(L);var g=a.length;for(p=0;p<g;p++){d=a[p];if(!n.has(d)){var v=$(d),m=e[d],y=J(d);v&&(y.default&&m!==y.default||!y.default&&0!==m)&&(f=!1),y&&(typeof m===K||typeof m===Q)&&y.transform&&(m=y.transform(m)),v?(s+=d+"("+m+") ",l=d===re||l):M(d)?(e[d]=m,i=!0):o+=ae(x(d,!0),m)}}return i&&(o+=ae(ee,(e.transformOriginX||0)+" "+(e.transformOriginY||0)+" "+(e.transformOriginZ||0))),u&&(!l&&r&&(s+=re+"(0)"),o+=ae(te,f?ne:s)),o}var se=new Set(["scrollLeft","scrollTop"]),ie=h({onRead:function(e,t){var r=t.element,n=t.preparseOutput,a=J(e);if($(e))return a&&a.default||0;if(se.has(e))return r[e];var o=window.getComputedStyle(r,null).getPropertyValue(x(e,!0))||0;return n&&a&&a.parse?a.parse(o):o},onRender:function(e,t,r){var n=t.element,a=t.enableHardwareAcceleration;n.style.cssText+=oe(e,r,a,se),-1!==r.indexOf("scrollLeft")&&(n.scrollLeft=e.scrollLeft),-1!==r.indexOf("scrollTop")&&(n.scrollTop=e.scrollTop)},aliasMap:{x:"translateX",y:"translateY",z:"translateZ",originX:"transformOriginX",originY:"transformOriginY",originZ:"transformOriginZ"},uncachedValues:se});var fe=function(e,t){return e/100*t+"px"},ue={fill:G,stroke:G,scale:j,scaleX:j,scaleY:j,opacity:Z,fillOpacity:Z,strokeOpacity:Z};var le=h({onRead:function(e,t){var r=t.element;if($(e)){var n=function(e){return ue[e]}(e);return n?n.default:0}return r.getAttribute(e)},onRender:function(e,t,r){var n=t.dimensions;!function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setAttribute(r,t[r])}(t.element,function(e,t,r,n){var a=!1,o=!1,s={},i=r?{pathLength:"0",pathSpacing:""+n}:void 0,f=void 0!==e.scale?e.scale||1e-7:e.scaleX||1,u=void 0!==e.scaleY?e.scaleY||1e-7:f||1,l=t.width*((e.originX||50)/100)+t.x,c=t.height*((e.originY||50)/100)+t.y,p=1*f*-l,d=1*u*-c,h=l/f,g=c/u,m={translate:"translate("+e.translateX+", "+e.translateY+") ",scale:"translate("+p+", "+d+") scale("+f+", "+u+") translate("+h+", "+g+") ",rotate:"rotate("+e.rotate+", "+l+", "+c+") ",skewX:"skewX("+e.skewX+") ",skewY:"skewY("+e.skewY+") "};for(var y in e)if(e.hasOwnProperty(y)){var w=e[y];$(y)?a=!0:!r||"pathLength"!==y&&"pathSpacing"!==y||"number"!=typeof w?r&&"pathOffset"===y?s["stroke-dashoffset"]=fe(-w,n):s[v(y)]=w:(o=!0,i[y]=fe(w,n))}if(o&&(s["stroke-dasharray"]=i.pathLength+" "+i.pathSpacing),a)for(var y in s.transform="",m)if(m.hasOwnProperty(y)){var b="scale"===y?"1":"0";s.transform+=m[y].replace(/undefined/g,b)}return s}(e,n,t.isPath,t.pathLength))},aliasMap:{x:"translateX",y:"translateY",background:"fill"}});var ce=h({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,r=void 0===t?0:t,n=e.scrollLeft,a=void 0===n?0:n;return window.scrollTo(a,r)}}),pe=function(){};"production"!==process.env.NODE_ENV&&(pe=function(e,t){if(!e)throw new Error("Hey, listen! ".toUpperCase()+t)});var de=new WeakMap,he=function(e,r){var n;return e instanceof HTMLElement?n=function(e,r){return ie(t({element:e,enableHardwareAcceleration:!0,preparseOutput:!0},r))}(e,r):e instanceof SVGElement?n=function(e){var t=e.getBBox(),r={element:e,dimensions:{x:t.x,y:t.y,width:t.width,height:t.height},isPath:!1};return"path"===e.tagName&&(r.isPath=!0,r.pathLength=e.getTotalLength()),le(r)}(e):"undefined"!=typeof window&&e===window&&(n=ce(e)),pe(void 0!==n,"No valid node provided. Node must be HTMLElement, SVGElement or window."),de.set(e,n),n},ge=function(e,t){return de.has(e)?de.get(e):he(e,t)};e.default=function(e,t){var r="string"==typeof e?document.querySelector(e):e;return ge(r,t)},e.createStylerFactory=h,e.buildStyles=oe,Object.defineProperty(e,"__esModule",{value:!0})});
import { Styler } from '../styler/types';
declare type Props = {
declare const _default: (element: HTMLElement, props?: {
enableHardwareAcceleration?: boolean;
preparseOutput?: boolean;
};
declare const _default: (element: HTMLElement, props?: Props) => Styler;
}) => Styler;
export default _default;

@@ -101,3 +101,3 @@ 'use strict';

};
var prefixer = (function (key, asDashCase) {
function prefixer (key, asDashCase) {
if (asDashCase === void 0) { asDashCase = false; }

@@ -108,3 +108,3 @@ var cache = asDashCase ? dashCache : camelCache;

return cache.get(key) || key;
});
}

@@ -169,3 +169,3 @@ var axes = ['', 'X', 'Y', 'Z'];

};
var getValueType = (function (key) { return valueTypes[key]; });
function getValueType (key) { return valueTypes[key]; }

@@ -293,5 +293,5 @@ var aliasMap = {

});
var css = (function (element, props) {
function css (element, props) {
return cssStyler(tslib_1.__assign({ element: element, enableHardwareAcceleration: true, preparseOutput: true }, props));
});
}

@@ -368,3 +368,3 @@ var ZERO_NOT_ZERO = 0.0000001;

};
var getValueType$1 = (function (key) { return valueTypes$1[key]; });
function getValueType$1 (key) { return valueTypes$1[key]; }

@@ -392,3 +392,3 @@ var svgStyler = createStyler({

});
var svg = (function (element) {
function svg (element) {
var _a = element.getBBox(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;

@@ -405,3 +405,3 @@ var props = {

return svgStyler(props);
});
}

@@ -408,0 +408,0 @@ var viewport = createStyler({

import { Config, Props, Styler } from './types';
declare const createStyler: ({ onRead, onRender, aliasMap, useCache }: Config) => (props?: Props) => Styler;
declare const createStyler: ({onRead, onRender, aliasMap, useCache}: Config) => (props?: Props) => Styler;
export default createStyler;
import { Styler } from '../styler/types';
export { Styler };
declare const _default: (props?: import("styler/types").Props) => Styler;
declare const _default: (props?: {
[key: string]: any;
}) => Styler;
export default _default;
{
"name": "stylefire",
"version": "2.0.3",
"version": "2.0.4",
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.",

@@ -20,3 +20,3 @@ "main": "lib/index.js",

"measure": "gzip -c dist/stylefire.min.js | wc -c",
"prepublishOnly": "yarn build"
"prepublishOnly": "npm run lint && npm run build"
},

@@ -51,3 +51,3 @@ "repository": {

"ts-jest": "^20.0.10",
"typescript": "^2.9.2",
"typescript": "^2.4.2",
"uglify-js": "^3.3.25",

@@ -70,3 +70,3 @@ "webpack": "^3.0.0"

"hey-listen": "^1.0.4",
"style-value-types": "2.0.1",
"style-value-types": "3.0.1",
"tslib": "^1.9.1"

@@ -79,2 +79,2 @@ },

}
}
}
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