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 1.1.1 to 1.1.2

6

CHANGELOG.md

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

## [1.1.2] 2017-10-31
### Added
Exporting `Styler` type.
## [1.1.1] 2017-10-31

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

9

css/index.d.ts

@@ -0,10 +1,5 @@

import { Styler } from '../styler/types';
declare const _default: (element: HTMLElement, props?: {
enableHardwareAcceleration?: boolean;
}) => {
get(unmappedKey: string): any;
set(values: string | {
[key: string]: string | number;
}, value?: any): any;
render(forceRender?: boolean): any;
};
}) => Styler;
export default _default;

@@ -12,6 +12,6 @@ "use strict";

var styler_1 = require("../styler");
var prefixer_1 = require("./prefixer");
var render_1 = require("./render");
var transform_props_1 = require("./transform-props");
var value_types_1 = require("./value-types");
var transform_props_1 = require("./transform-props");
var prefixer_1 = require("./prefixer");
var cssStyler = styler_1.default({

@@ -18,0 +18,0 @@ onRead: function (key, _a) {

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

!function(e){function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}var t={};r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=6)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(9),a=function(e){var r=e.onRead,t=e.onRender,a=e.aliasMap,o=void 0===a?{}:a,u=e.useCache,s=void 0===u||u;return function(e){var a={},u=[],i=!1,c=function(e,r){var t=o[e]||e,n=a[t];a[t]=r,a[t]!==n&&(i=!0,u.push(t))},l=function(){t(a,e,u),i=!1,u.length=0};return{get:function(t){var n=o[t]||t;return n?s&&void 0!==a[n]?a[n]:r(n,e):a},set:function(e,r){if("string"==typeof e){if(void 0===r)return function(r){c(e,r),i&&n.onFrameRender(l)};c(e,r)}else for(var t in e)e.hasOwnProperty(t)&&c(t,e[t]);return i&&n.onFrameRender(l),this},render:function(e){return void 0===e&&(e=!1),(e||i)&&l(),this}}}};r.default=a},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["","X","Y","Z"],a=["translate","scale","rotate","skew","transformPerspective"],o=a.reduce(function(e,r){return n.reduce(function(e,t){return e.push(r+t),e},e)},["x","y","z"]),u=o.reduce(function(e,r){return e[r]=!0,e},{});r.isTransformProp=function(e){return!0===u[e]},r.sortTransformProps=function(e,r){return o.indexOf(e)-o.indexOf(r)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=/([a-z])([A-Z])/g;r.camelToDash=function(e){return e.replace(n,"$1-$2").toLowerCase()},r.setDomAttrs=function(e,r){for(var t in r)r.hasOwnProperty(t)&&e.setAttribute(t,r[t])}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=t(2),o={},u={},s=["Webkit","Moz","O","ms",""],i=s.length,c=function(e){n=n||document.createElement("div");for(var r=0;r<i;r++){var t=s[r],c=""===t,l=c?e:t+e.charAt(0).toUpperCase()+e.slice(1);l in n.style&&(o[e]=l,u[e]=(c?"":"-")+a.camelToDash(l))}};r.default=function(e,r){void 0===r&&(r=!1);var t=r?u:o;return t[e]||c(e),t[e]}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(5),a={color:n.color,backgroundColor:n.color,outlineColor:n.color,fill:n.color,stroke:n.color,borderColor:n.color,borderTopColor:n.color,borderRightColor:n.color,borderBottomColor:n.color,borderLeftColor:n.color,borderRadius:n.px,width:n.px,height:n.px,top:n.px,left:n.px,bottom:n.px,right:n.px,rotate:n.degrees,rotateX:n.degrees,rotateY:n.degrees,rotateZ:n.degrees,scale:n.scale,scaleX:n.scale,scaleY:n.scale,scaleZ:n.scale,skewX:n.degrees,skewY:n.degrees,distance:n.px,translateX:n.px,translateY:n.px,translateZ:n.px,perspective:n.px,opacity:n.alpha};r.default=function(e){return a[e]}},function(e,r,t){"use strict";function n(e){var t=e.length;return function(n){for(var a={},o=r.splitCommaDelimited(r.getValueFromFunctionString(n)),u=0;u<t;u++)a[e[u]]=void 0!==o[u]?parseFloat(o[u]):1;return a}}var a=this&&this.__assign||Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e};Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,r){return function(t){return Math.max(Math.min(t,r),e)}},u=function(e){return function(r){return"string"==typeof e&&-1!==r.indexOf(e)}},s=function(e){return{test:u(e),parse:parseFloat,transform:function(r){return""+r+e}}},i=function(e){return function(r){return"string"==typeof e&&0===r.indexOf(e)}};r.getValueFromFunctionString=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},r.splitCommaDelimited=function(e){return"string"==typeof e?e.split(/,\s*/):[e]},r.splitColorValues=n,r.number={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},r.alpha=a({},r.number,{transform:o(0,1)}),r.degrees=s("deg"),r.percent=s("%"),r.px=s("px"),r.scale=a({},r.number,{default:1});var c=/(-)?(\d[\d\.]*)/g,l=function(e){return"${"+e+"}"};r.complex={test:function(e){var r=e.match&&e.match(c);return void 0!==r&&r.constructor===Array&&r.length>1},parse:function(e){var r={};return e.match(c).forEach(function(e,t){return r[t]=parseFloat(e)}),r},createTransformer:function(e){var r=0,t=e.replace(c,function(){return l(""+r++)});return function(e){var r=t;for(var n in e)e.hasOwnProperty(n)&&(r=r.replace(l(n),e[n].toString()));return r}}};var f=o(0,255);r.rgbUnit=a({},r.number,{transform:function(e){return Math.round(f(e))}});var d=function(e){var r=e.red,t=e.green,n=e.blue,a=e.alpha;return"rgba("+r+", "+t+", "+n+", "+(void 0===a?1:a)+")"};r.rgba={test:i("rgb"),parse:n(["red","green","blue","alpha"]),transform:function(e){var t=e.red,n=e.green,a=e.blue,o=e.alpha;return d({red:r.rgbUnit.transform(t),green:r.rgbUnit.transform(n),blue:r.rgbUnit.transform(a),alpha:o})}};var p=function(e){var r=e.hue,t=e.saturation,n=e.lightness,a=e.alpha;return"hsla("+r+", "+t+", "+n+", "+(void 0===a?1:a)+")"};r.hsla={test:i("hsl"),parse:n(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,n=e.saturation,a=e.lightness,o=e.alpha;return p({hue:Math.round(t),saturation:r.percent.transform(n),lightness:r.percent.transform(a),alpha:o})}},r.hex=a({},r.rgba,{test:i("#"),parse:function(e){var r,t,n;return e.length>4?(r=e.substr(1,2),t=e.substr(3,2),n=e.substr(5,2)):(r=e.substr(1,1),t=e.substr(2,1),n=e.substr(3,1),r+=r,t+=t,n+=n),{red:parseInt(r,16),green:parseInt(t,16),blue:parseInt(n,16),alpha:1}}});var h=function(e){return void 0!==e.red},v=function(e){return void 0!==e.hue};r.color={test:function(e){return r.rgba.test(e)||r.hsla.test(e)||r.hex.test(e)},parse:function(e){return r.rgba.test(e)?r.rgba.parse(e):r.hsla.test(e)?r.hsla.parse(e):r.hex.test(e)?r.hex.parse(e):e},transform:function(e){return h(e)?r.rgba.transform(e):v(e)?r.hsla.transform(e):e}}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(7),a=t(16);window.styler=n.default,window.createStyler=n.createStyler,window.scrollStyler=a.default},function(e,r,t){"use strict";function n(e){return e instanceof SVGGraphicsElement?o.default(e):a.default(e)}Object.defineProperty(r,"__esModule",{value:!0});var a=t(8),o=t(13),u=t(0);r.default=n,r.createStyler=u.default},function(e,r,t){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e};Object.defineProperty(r,"__esModule",{value:!0});var a=t(0),o=t(12),u=t(4),s=t(1),i=t(3),c=a.default({onRead:function(e,r){var t=r.element,n=u.default(e);if(s.isTransformProp(e))return n?n.default||0:0;var a=window.getComputedStyle(t,null).getPropertyValue(i.default(e))||0;return n&&n.parse?n.parse(a):a},onRender:function(e,r,t){var n=r.element,a=r.enableHardwareAcceleration;o.default(n,e,t,a)},aliasMap:{x:"translateX",y:"translateY",z:"translateZ",originX:"transform-origin-x",originY:"transform-origin-y"}});r.default=function(e,r){return c(n({element:e,enableHardwareAcceleration:!0},r))}},function(e,r,t){"use strict";function n(){i||(i=!0,o.default(a))}function a(e){i=!1,f=Math.max(Math.min(e-l,c),1)*d,l=e,p.process(),h.process(),v.process(),m.process()}Object.defineProperty(r,"__esModule",{value:!0});var o=t(10),u=t(11),s="undefined"!=typeof performance&&performance.now;r.currentTime=s?function(){return performance.now()}:function(){return(new Date).getTime()};var i=!1,c=20,l=r.currentTime(),f=0,d=1,p=u.default(n),h=u.default(n),v=u.default(n),m=u.default(n);r.onFrameStart=p.schedule,r.onFrameUpdate=h.schedule,r.onFrameRender=v.schedule,r.onFrameEnd=m.schedule,r.cancelOnFrameStart=p.cancel,r.cancelOnFrameUpdate=h.cancel,r.cancelOnFrameRender=v.cancel,r.cancelOnFrameEnd=m.cancel,r.timeSinceLastFrame=function(){return f},r.currentFrameTime=function(){return l}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=!("undefined"==typeof window||!window.requestAnimationFrame);if(a)n=function(e){return window.requestAnimationFrame(e)};else{var o=0;n=function(e){var r=(new Date).getTime(),t=Math.max(0,16.7-(r-o));o=r+t,setTimeout(function(){return e(o)},t)}}r.default=n},function(e,r,t){"use strict";function n(e){var r=[],t=[];return{schedule:function(r){e(),-1===t.indexOf(r)&&t.push(r)},cancel:function(e){var r=t.indexOf(e);-1!==r&&t.splice(r,1)},process:function(){a=[t,r],r=a[0],t=a[1],t.length=0;for(var e=r.length,n=0;n<e;n++)r[n]();var a}}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},function(e,r,t){"use strict";function n(e,r,t,n){for(var s="",i="",c=!1,l=!1,f=t.length,d=0;d<f;d++){var p=t[d];if(a.isTransformProp(p)){c=!0;for(var h in r)a.isTransformProp(h)&&-1===t.indexOf(h)&&t.push(h);break}}t.sort(a.sortTransformProps);for(var v=t.length,d=0;d<v;d++){var p=t[d],m=r[p],g=u.default(p);g&&("number"==typeof m||"object"==typeof m)&&g.transform&&(m=g.transform(m)),a.isTransformProp(p)?(i+=p+"("+m+") ",l="translateZ"===p||l):s+=";"+o.default(p,!0)+":"+m}c&&(!l&&n&&(i+="translateZ(0)"),s+=";"+o.default("transform",!0)+":"+i),e.style.cssText+=s}Object.defineProperty(r,"__esModule",{value:!0});var a=t(1),o=t(3),u=t(4);r.default=n},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=t(2),o=t(1),u=t(14),s=t(15),i=n.default({onRead:function(e,r){var t=r.element;if(o.isTransformProp(e)){var n=u.default(e);return n?n.default:0}return t.getAttribute(e)},onRender:function(e,r,t){var n=r.dimensions,o=r.element,u=r.isPath,i=r.pathLength;a.setDomAttrs(o,s.default(e,n,u,i))},aliasMap:{x:"translateX",y:"translateY",background:"fill"}});r.default=function(e){var r=e.getBBox(),t=r.x,n=r.y,a=r.width,o=r.height,u={element:e,dimensions:{x:t,y:n,width:a,height:o},isPath:!1};return"path"===e.tagName&&(u.isPath=!0,u.pathLength=e.getTotalLength()),i(u)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(5),a={fill:n.color,stroke:n.color,scale:n.scale,scaleX:n.scale,scaleY:n.scale,opacity:n.alpha,fillOpacity:n.alpha,strokeOpacity:n.alpha};r.default=function(e){return a[e]}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(2),a=t(1),o=function(e,r){return e/100*r+"px"},u=function(e,r,t,u){var s=!1,i=!1,c={},l=t?{pathLength:"0",pathSpacing:""+u}:void 0,f=void 0!==e.scale?e.scale||1e-7:e.scaleX||1,d=void 0!==e.scaleY?e.scaleY||1e-7:f||1,p=r.width*((e.originX||50)/100)+r.x,h=r.height*((e.originY||50)/100)+r.y,v=1*f*-p,m=1*d*-h,g=p/f,b=h/d,y={translate:"translate("+e.translateX+", "+e.translateY+") ",scale:"translate("+v+", "+m+") scale("+f+", "+d+") translate("+g+", "+b+") ",rotate:"rotate("+e.rotate+", "+p+", "+h+") ",skewX:"skewX("+e.skewX+") ",skewY:"skewY("+e.skewY+") "};for(var w in e)if(e.hasOwnProperty(w)){var O=e[w];a.isTransformProp(w)?s=!0:!t||"pathLength"!==w&&"pathSpacing"!==w||"number"!=typeof O?t&&"pathOffset"===w?c["stroke-dashoffset"]=o(-O,u):c[n.camelToDash(w)]=O:(i=!0,l[w]=o(O,u))}if(i&&(c["stroke-dasharray"]=l.pathLength+" "+l.pathSpacing),s){c.transform="";for(var w in y)if(y.hasOwnProperty(w)){var x="scale"===w?"1":"0";c.transform+=y[w].replace(/undefined/g,x)}}return c};r.default=u},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=n.default({useCache:!1,onRead:function(e,r){var t=r.element;return"top"===e?t.scrollTop:t.scrollLeft},onRender:function(e,r){var t=e.top,n=e.left,a=r.element;a.scrollLeft=n,a.scrollTop=t}}),o=n.default({useCache:!1,onRead:function(e){return"undefined"==typeof window?0:window.pageXOffset},onRender:function(e){var r=e.top,t=void 0===r?0:r,n=e.left,a=void 0===n?0:n;"undefined"!=typeof window&&"number"==typeof t&&"number"==typeof a&&window.scrollTo(a,t)}});r.default=function(e){return e?a({element:e}):o()}}]);
!function(e){function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}var t={};r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=6)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(9),a=function(e){var r=e.onRead,t=e.onRender,a=e.aliasMap,o=void 0===a?{}:a,u=e.useCache,s=void 0===u||u;return function(e){var a={},u=[],i=!1,c=function(e,r){var t=o[e]||e,n=a[t];a[t]=r,a[t]!==n&&(i=!0,u.push(t))},l=function(){t(a,e,u),i=!1,u.length=0};return{get:function(t){var n=o[t]||t;return n?s&&void 0!==a[n]?a[n]:r(n,e):a},set:function(e,r){if("string"==typeof e){if(void 0===r)return function(r){c(e,r),i&&n.onFrameRender(l)};c(e,r)}else for(var t in e)e.hasOwnProperty(t)&&c(t,e[t]);return i&&n.onFrameRender(l),this},render:function(e){return void 0===e&&(e=!1),(e||i)&&l(),this}}}};r.default=a},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["","X","Y","Z"],a=["translate","scale","rotate","skew","transformPerspective"],o=a.reduce(function(e,r){return n.reduce(function(e,t){return e.push(r+t),e},e)},["x","y","z"]),u=o.reduce(function(e,r){return e[r]=!0,e},{});r.isTransformProp=function(e){return!0===u[e]},r.sortTransformProps=function(e,r){return o.indexOf(e)-o.indexOf(r)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=/([a-z])([A-Z])/g;r.camelToDash=function(e){return e.replace(n,"$1-$2").toLowerCase()},r.setDomAttrs=function(e,r){for(var t in r)r.hasOwnProperty(t)&&e.setAttribute(t,r[t])}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=t(2),o={},u={},s=["Webkit","Moz","O","ms",""],i=s.length,c=function(e){n=n||document.createElement("div");for(var r=0;r<i;r++){var t=s[r],c=""===t,l=c?e:t+e.charAt(0).toUpperCase()+e.slice(1);l in n.style&&(o[e]=l,u[e]=(c?"":"-")+a.camelToDash(l))}};r.default=function(e,r){void 0===r&&(r=!1);var t=r?u:o;return t[e]||c(e),t[e]}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(5),a={color:n.color,backgroundColor:n.color,outlineColor:n.color,fill:n.color,stroke:n.color,borderColor:n.color,borderTopColor:n.color,borderRightColor:n.color,borderBottomColor:n.color,borderLeftColor:n.color,borderRadius:n.px,width:n.px,height:n.px,top:n.px,left:n.px,bottom:n.px,right:n.px,rotate:n.degrees,rotateX:n.degrees,rotateY:n.degrees,rotateZ:n.degrees,scale:n.scale,scaleX:n.scale,scaleY:n.scale,scaleZ:n.scale,skewX:n.degrees,skewY:n.degrees,distance:n.px,translateX:n.px,translateY:n.px,translateZ:n.px,perspective:n.px,opacity:n.alpha};r.default=function(e){return a[e]}},function(e,r,t){"use strict";function n(e){var t=e.length;return function(n){for(var a={},o=r.splitCommaDelimited(r.getValueFromFunctionString(n)),u=0;u<t;u++)a[e[u]]=void 0!==o[u]?parseFloat(o[u]):1;return a}}var a=this&&this.__assign||Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e};Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,r){return function(t){return Math.max(Math.min(t,r),e)}},u=function(e){return function(r){return"string"==typeof e&&-1!==r.indexOf(e)}},s=function(e){return{test:u(e),parse:parseFloat,transform:function(r){return""+r+e}}},i=function(e){return function(r){return"string"==typeof e&&0===r.indexOf(e)}};r.getValueFromFunctionString=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},r.splitCommaDelimited=function(e){return"string"==typeof e?e.split(/,\s*/):[e]},r.splitColorValues=n,r.number={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},r.alpha=a({},r.number,{transform:o(0,1)}),r.degrees=s("deg"),r.percent=s("%"),r.px=s("px"),r.scale=a({},r.number,{default:1});var c=/(-)?(\d[\d\.]*)/g,l=function(e){return"${"+e+"}"};r.complex={test:function(e){var r=e.match&&e.match(c);return void 0!==r&&r.constructor===Array&&r.length>1},parse:function(e){var r={};return e.match(c).forEach(function(e,t){return r[t]=parseFloat(e)}),r},createTransformer:function(e){var r=0,t=e.replace(c,function(){return l(""+r++)});return function(e){var r=t;for(var n in e)e.hasOwnProperty(n)&&(r=r.replace(l(n),e[n].toString()));return r}}};var f=o(0,255);r.rgbUnit=a({},r.number,{transform:function(e){return Math.round(f(e))}});var d=function(e){var r=e.red,t=e.green,n=e.blue,a=e.alpha;return"rgba("+r+", "+t+", "+n+", "+(void 0===a?1:a)+")"};r.rgba={test:i("rgb"),parse:n(["red","green","blue","alpha"]),transform:function(e){var t=e.red,n=e.green,a=e.blue,o=e.alpha;return d({red:r.rgbUnit.transform(t),green:r.rgbUnit.transform(n),blue:r.rgbUnit.transform(a),alpha:o})}};var p=function(e){var r=e.hue,t=e.saturation,n=e.lightness,a=e.alpha;return"hsla("+r+", "+t+", "+n+", "+(void 0===a?1:a)+")"};r.hsla={test:i("hsl"),parse:n(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,n=e.saturation,a=e.lightness,o=e.alpha;return p({hue:Math.round(t),saturation:r.percent.transform(n),lightness:r.percent.transform(a),alpha:o})}},r.hex=a({},r.rgba,{test:i("#"),parse:function(e){var r,t,n;return e.length>4?(r=e.substr(1,2),t=e.substr(3,2),n=e.substr(5,2)):(r=e.substr(1,1),t=e.substr(2,1),n=e.substr(3,1),r+=r,t+=t,n+=n),{red:parseInt(r,16),green:parseInt(t,16),blue:parseInt(n,16),alpha:1}}});var h=function(e){return void 0!==e.red},v=function(e){return void 0!==e.hue};r.color={test:function(e){return r.rgba.test(e)||r.hsla.test(e)||r.hex.test(e)},parse:function(e){return r.rgba.test(e)?r.rgba.parse(e):r.hsla.test(e)?r.hsla.parse(e):r.hex.test(e)?r.hex.parse(e):e},transform:function(e){return h(e)?r.rgba.transform(e):v(e)?r.hsla.transform(e):e}}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(7),a=t(16);window.styler=n.default,window.createStyler=n.createStyler,window.scrollStyler=a.default},function(e,r,t){"use strict";function n(e){return e instanceof SVGGraphicsElement?u.default(e):a.default(e)}Object.defineProperty(r,"__esModule",{value:!0});var a=t(8),o=t(0);r.createStyler=o.default;var u=t(13);r.default=n},function(e,r,t){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e};Object.defineProperty(r,"__esModule",{value:!0});var a=t(0),o=t(3),u=t(12),s=t(1),i=t(4),c=a.default({onRead:function(e,r){var t=r.element,n=i.default(e);if(s.isTransformProp(e))return n?n.default||0:0;var a=window.getComputedStyle(t,null).getPropertyValue(o.default(e))||0;return n&&n.parse?n.parse(a):a},onRender:function(e,r,t){var n=r.element,a=r.enableHardwareAcceleration;u.default(n,e,t,a)},aliasMap:{x:"translateX",y:"translateY",z:"translateZ",originX:"transform-origin-x",originY:"transform-origin-y"}});r.default=function(e,r){return c(n({element:e,enableHardwareAcceleration:!0},r))}},function(e,r,t){"use strict";function n(){i||(i=!0,o.default(a))}function a(e){i=!1,f=Math.max(Math.min(e-l,c),1)*d,l=e,p.process(),h.process(),v.process(),m.process()}Object.defineProperty(r,"__esModule",{value:!0});var o=t(10),u=t(11),s="undefined"!=typeof performance&&performance.now;r.currentTime=s?function(){return performance.now()}:function(){return(new Date).getTime()};var i=!1,c=20,l=r.currentTime(),f=0,d=1,p=u.default(n),h=u.default(n),v=u.default(n),m=u.default(n);r.onFrameStart=p.schedule,r.onFrameUpdate=h.schedule,r.onFrameRender=v.schedule,r.onFrameEnd=m.schedule,r.cancelOnFrameStart=p.cancel,r.cancelOnFrameUpdate=h.cancel,r.cancelOnFrameRender=v.cancel,r.cancelOnFrameEnd=m.cancel,r.timeSinceLastFrame=function(){return f},r.currentFrameTime=function(){return l}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=!("undefined"==typeof window||!window.requestAnimationFrame);if(a)n=function(e){return window.requestAnimationFrame(e)};else{var o=0;n=function(e){var r=(new Date).getTime(),t=Math.max(0,16.7-(r-o));o=r+t,setTimeout(function(){return e(o)},t)}}r.default=n},function(e,r,t){"use strict";function n(e){var r=[],t=[];return{schedule:function(r){e(),-1===t.indexOf(r)&&t.push(r)},cancel:function(e){var r=t.indexOf(e);-1!==r&&t.splice(r,1)},process:function(){a=[t,r],r=a[0],t=a[1],t.length=0;for(var e=r.length,n=0;n<e;n++)r[n]();var a}}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},function(e,r,t){"use strict";function n(e,r,t,n){for(var s="",i="",c=!1,l=!1,f=t.length,d=0;d<f;d++){var p=t[d];if(a.isTransformProp(p)){c=!0;for(var h in r)a.isTransformProp(h)&&-1===t.indexOf(h)&&t.push(h);break}}t.sort(a.sortTransformProps);for(var v=t.length,d=0;d<v;d++){var p=t[d],m=r[p],g=u.default(p);g&&("number"==typeof m||"object"==typeof m)&&g.transform&&(m=g.transform(m)),a.isTransformProp(p)?(i+=p+"("+m+") ",l="translateZ"===p||l):s+=";"+o.default(p,!0)+":"+m}c&&(!l&&n&&(i+="translateZ(0)"),s+=";"+o.default("transform",!0)+":"+i),e.style.cssText+=s}Object.defineProperty(r,"__esModule",{value:!0});var a=t(1),o=t(3),u=t(4);r.default=n},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=t(0),o=t(2),u=t(14),s=t(15),i=a.default({onRead:function(e,r){var t=r.element;if(n.isTransformProp(e)){var a=s.default(e);return a?a.default:0}return t.getAttribute(e)},onRender:function(e,r,t){var n=r.dimensions,a=r.element,s=r.isPath,i=r.pathLength;o.setDomAttrs(a,u.default(e,n,s,i))},aliasMap:{x:"translateX",y:"translateY",background:"fill"}});r.default=function(e){var r=e.getBBox(),t=r.x,n=r.y,a=r.width,o=r.height,u={element:e,dimensions:{x:t,y:n,width:a,height:o},isPath:!1};return"path"===e.tagName&&(u.isPath=!0,u.pathLength=e.getTotalLength()),i(u)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(2),a=t(1),o=function(e,r){return e/100*r+"px"},u=function(e,r,t,u){var s=!1,i=!1,c={},l=t?{pathLength:"0",pathSpacing:""+u}:void 0,f=void 0!==e.scale?e.scale||1e-7:e.scaleX||1,d=void 0!==e.scaleY?e.scaleY||1e-7:f||1,p=r.width*((e.originX||50)/100)+r.x,h=r.height*((e.originY||50)/100)+r.y,v=1*f*-p,m=1*d*-h,g=p/f,b=h/d,y={translate:"translate("+e.translateX+", "+e.translateY+") ",scale:"translate("+v+", "+m+") scale("+f+", "+d+") translate("+g+", "+b+") ",rotate:"rotate("+e.rotate+", "+p+", "+h+") ",skewX:"skewX("+e.skewX+") ",skewY:"skewY("+e.skewY+") "};for(var w in e)if(e.hasOwnProperty(w)){var O=e[w];a.isTransformProp(w)?s=!0:!t||"pathLength"!==w&&"pathSpacing"!==w||"number"!=typeof O?t&&"pathOffset"===w?c["stroke-dashoffset"]=o(-O,u):c[n.camelToDash(w)]=O:(i=!0,l[w]=o(O,u))}if(i&&(c["stroke-dasharray"]=l.pathLength+" "+l.pathSpacing),s){c.transform="";for(var w in y)if(y.hasOwnProperty(w)){var x="scale"===w?"1":"0";c.transform+=y[w].replace(/undefined/g,x)}}return c};r.default=u},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(5),a={fill:n.color,stroke:n.color,scale:n.scale,scaleX:n.scale,scaleY:n.scale,opacity:n.alpha,fillOpacity:n.alpha,strokeOpacity:n.alpha};r.default=function(e){return a[e]}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=n.default({useCache:!1,onRead:function(e,r){var t=r.element;return"top"===e?t.scrollTop:t.scrollLeft},onRender:function(e,r){var t=e.top,n=e.left,a=r.element;a.scrollLeft=n,a.scrollTop=t}}),o=n.default({useCache:!1,onRead:function(e){return"undefined"==typeof window?0:window.pageXOffset},onRender:function(e){var r=e.top,t=void 0===r?0:r,n=e.left,a=void 0===n?0:n;"undefined"!=typeof window&&"number"==typeof t&&"number"==typeof a&&window.scrollTo(a,t)}});r.default=function(e){return e?a({element:e}):o()}}]);

@@ -1,29 +0,4 @@

export default function (node: (SVGGraphicsElement & SVGPathElement) | HTMLElement): {
get(unmappedKey: string): any;
set(values: string | {
[key: string]: string | number;
}, value?: any): any;
render(forceRender?: boolean): any;
};
export declare const createStyler: ({onRead, onRender, aliasMap, useCache}: {
onRead: (key: string, props: {
[key: string]: any;
}) => any;
onRender: (state: {
[key: string]: string | number;
}, props: {
[key: string]: any;
}, changedValues: string[]) => void;
aliasMap?: {
[key: string]: string;
};
useCache?: boolean;
}) => (props?: {
[key: string]: any;
}) => {
get(unmappedKey: string): any;
set(values: string | {
[key: string]: string | number;
}, value?: any): any;
render(forceRender?: boolean): any;
};
import createStyler from './styler';
import { Styler } from './styler/types';
export default function (node: (SVGGraphicsElement & SVGPathElement) | HTMLElement): Styler;
export { createStyler };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var css_1 = require("./css");
var styler_1 = require("./styler");
exports.createStyler = styler_1.default;
var svg_1 = require("./svg");
var styler_1 = require("./styler");
function default_1(node) {

@@ -10,4 +11,2 @@ return (node instanceof SVGGraphicsElement) ? svg_1.default(node) : css_1.default(node);

exports.default = default_1;
;
exports.createStyler = styler_1.default;
//# sourceMappingURL=index.js.map
{
"name": "stylefire",
"version": "1.1.1",
"version": "1.1.2",
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.",

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

@@ -1,8 +0,3 @@

declare const _default: (element?: HTMLElement) => {
get(unmappedKey: string): any;
set(values: string | {
[key: string]: string | number;
}, value?: any): any;
render(forceRender?: boolean): any;
};
import { Styler } from '../styler/types';
declare const _default: (element?: HTMLElement) => Styler;
export default _default;

@@ -1,7 +0,3 @@

import { Config, Props, State } from './types';
declare const createStyler: ({onRead, onRender, aliasMap, useCache}: Config) => (props?: Props) => {
get(unmappedKey: string): any;
set(values: string | State, value?: any): any;
render(forceRender?: boolean): any;
};
import { Config, Props, Styler } from './types';
declare const createStyler: ({onRead, onRender, aliasMap, useCache}: Config) => (props?: Props) => Styler;
export default createStyler;

@@ -34,3 +34,3 @@ "use strict";

set: function (values, value) {
if (typeof values === "string") {
if (typeof values === 'string') {
if (value !== undefined) {

@@ -37,0 +37,0 @@ setValue(values, value);

@@ -16,1 +16,7 @@ export declare type State = {

};
export declare type Setter = (value: any) => void;
export declare type Styler = {
get: (key: string) => any;
set: (values: string | State, value?: any) => Styler | Setter;
render: (forceRender?: boolean) => Styler;
};

@@ -1,8 +0,3 @@

declare const _default: (element: SVGGraphicsElement & SVGPathElement) => {
get(unmappedKey: string): any;
set(values: string | {
[key: string]: string | number;
}, value?: any): any;
render(forceRender?: boolean): any;
};
import { Styler } from '../styler/types';
declare const _default: (element: SVGGraphicsElement & SVGPathElement) => Styler;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var transform_props_1 = require("../css/transform-props");
var styler_1 = require("../styler");
var utils_1 = require("../styler/utils");
var transform_props_1 = require("../css/transform-props");
var build_1 = require("./build");
var value_types_1 = require("./value-types");
var build_1 = require("./build");
var svgStyler = styler_1.default({

@@ -9,0 +9,0 @@ onRead: function (key, _a) {

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

Sorry, the diff of this file is not supported yet

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