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 6.0.3 to 6.0.4

6

CHANGELOG.md

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

## [6.0.4] 2019-07-04
### Changed
- Added `tslib`.
## [6.0.3] 2019-06-25

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

38

dist/stylefire.es.js

@@ -0,38 +1,6 @@

import { __rest, __assign } from 'tslib';
import sync from 'framesync';
import { alpha, color, degrees, scale, px, progressPercentage, number } from 'style-value-types';
import { number, color, px, degrees, scale, alpha, progressPercentage } from 'style-value-types';
import { invariant } from 'hey-listen';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
return t;
}
var createStyler = function (_a) {

@@ -544,2 +512,2 @@ var onRead = _a.onRead,

export default index;
export { createStyler as createStylerFactory, buildStyleProperty, buildSVGAttrs, isTransformProp };
export { buildSVGAttrs, buildStyleProperty, createStyler as createStylerFactory, isTransformProp };
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.stylefire = {})));
}(this, (function (exports) { 'use strict';
(global = global || self, factory(global.stylefire = {}));
}(this, function (exports) { 'use strict';

@@ -43,3 +43,2 @@ /*! *****************************************************************************

var HEY_LISTEN = 'Hey, listen! ';
var invariant = function () { };

@@ -49,3 +48,3 @@ if (process.env.NODE_ENV !== 'production') {

if (!check) {
throw new Error(HEY_LISTEN.toUpperCase() + message);
throw new Error(message);
}

@@ -380,8 +379,8 @@ };

var rgbaTemplate = function (_a) {
var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha$$1 = _b === void 0 ? 1 : _b;
return "rgba(" + red + ", " + green + ", " + blue + ", " + alpha$$1 + ")";
var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha = _b === void 0 ? 1 : _b;
return "rgba(" + red + ", " + green + ", " + blue + ", " + alpha + ")";
};
var hslaTemplate = function (_a) {
var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha$$1 = _b === void 0 ? 1 : _b;
return "hsla(" + hue + ", " + saturation + ", " + lightness + ", " + alpha$$1 + ")";
var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha = _b === void 0 ? 1 : _b;
return "hsla(" + hue + ", " + saturation + ", " + lightness + ", " + alpha + ")";
};

@@ -396,3 +395,3 @@ var rgbUnit = __assign$1({}, number, { transform: function (v) { return Math.round(clampRgbUnit(v)); } });

transform: function (_a) {
var red = _a.red, green = _a.green, blue = _a.blue, alpha$$1 = _a.alpha;
var red = _a.red, green = _a.green, blue = _a.blue, alpha = _a.alpha;
return rgbaTemplate({

@@ -402,3 +401,3 @@ red: rgbUnit.transform(red),

blue: rgbUnit.transform(blue),
alpha: sanitize(alpha$$1)
alpha: sanitize(alpha)
});

@@ -411,3 +410,3 @@ }

transform: function (_a) {
var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, alpha$$1 = _a.alpha;
var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, alpha = _a.alpha;
return hslaTemplate({

@@ -417,3 +416,3 @@ hue: Math.round(hue),

lightness: percent.transform(sanitize(lightness)),
alpha: sanitize(alpha$$1)
alpha: sanitize(alpha)
});

@@ -863,6 +862,6 @@ }

exports.buildSVGAttrs = buildSVGAttrs;
exports.buildStyleProperty = buildStyleProperty;
exports.createStylerFactory = createStyler;
exports.default = index;
exports.createStylerFactory = createStyler;
exports.buildStyleProperty = buildStyleProperty;
exports.buildSVGAttrs = buildSVGAttrs;
exports.isTransformProp = isTransformProp;

@@ -872,2 +871,2 @@

})));
}));

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

@@ -7,2 +7,3 @@ 'use strict';

var tslib_1 = require('tslib');
var sync = _interopDefault(require('framesync'));

@@ -12,38 +13,2 @@ var styleValueTypes = require('style-value-types');

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
}
var createStyler = function (_a) {

@@ -53,3 +18,3 @@ var onRead = _a.onRead, onRender = _a.onRender, _b = _a.uncachedValues, uncachedValues = _b === void 0 ? new Set() : _b, _c = _a.useCache, useCache = _c === void 0 ? true : _c;

if (_a === void 0) { _a = {}; }
var props = __rest(_a, []);
var props = tslib_1.__rest(_a, []);
var state = {};

@@ -169,3 +134,3 @@ var changedValues = [];

var int = __assign({}, styleValueTypes.number, { transform: Math.round });
var int = tslib_1.__assign({}, styleValueTypes.number, { transform: Math.round });
var valueTypes = {

@@ -386,4 +351,4 @@ color: styleValueTypes.color,

if (_a === void 0) { _a = {}; }
var enableHardwareAcceleration = _a.enableHardwareAcceleration, props = __rest(_a, ["enableHardwareAcceleration"]);
return cssStyler(__assign({ element: element, buildStyles: createStyleBuilder(enableHardwareAcceleration), preparseOutput: true }, props));
var enableHardwareAcceleration = _a.enableHardwareAcceleration, props = tslib_1.__rest(_a, ["enableHardwareAcceleration"]);
return cssStyler(tslib_1.__assign({ element: element, buildStyles: createStyleBuilder(enableHardwareAcceleration), preparseOutput: true }, props));
}

@@ -430,3 +395,3 @@

if (attrs === void 0) { attrs = svgAttrsTemplate(); }
var x = _a.x, y = _a.y, z = _a.z, _b = _a.originX, originX = _b === void 0 ? 0.5 : _b, _c = _a.originY, originY = _c === void 0 ? 0.5 : _c, pathLength = _a.pathLength, _d = _a.pathSpacing, pathSpacing = _d === void 0 ? 1 : _d, _e = _a.pathOffset, pathOffset = _e === void 0 ? 0 : _e, state = __rest(_a, ["x", "y", "z", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
var x = _a.x, y = _a.y, z = _a.z, _b = _a.originX, originX = _b === void 0 ? 0.5 : _b, _c = _a.originY, originY = _c === void 0 ? 0.5 : _c, pathLength = _a.pathLength, _d = _a.pathSpacing, pathSpacing = _d === void 0 ? 1 : _d, _e = _a.pathOffset, pathOffset = _e === void 0 ? 0 : _e, state = tslib_1.__rest(_a, ["x", "y", "z", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
var style = cssBuilder(state);

@@ -551,6 +516,6 @@ for (var key in style) {

exports.buildSVGAttrs = buildSVGAttrs;
exports.buildStyleProperty = buildStyleProperty;
exports.createStylerFactory = createStyler;
exports.default = index;
exports.createStylerFactory = createStyler;
exports.buildStyleProperty = buildStyleProperty;
exports.buildSVGAttrs = buildSVGAttrs;
exports.isTransformProp = isTransformProp;
import { Styler } from '../styler/types';
export { Styler };
declare const _default: ({ ...props }?: import("stylefire/src/styler/types").Props) => Styler;
declare const _default: ({ ...props }?: import("../styler/types").Props) => Styler;
export default _default;
{
"name": "stylefire",
"version": "6.0.3",
"version": "6.0.4",
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.",

@@ -49,7 +49,7 @@ "main": "lib/index.js",

"jest-dom": "^3.0.0",
"rollup": "^0.59.1",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-typescript2": "^0.14.0",
"rollup-plugin-uglify": "^3.0.0",
"typescript": "^2.9.2",
"rollup": "^1.16.5",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript2": "^0.21.2",
"rollup-plugin-uglify": "^6.0.2",
"typescript": "^3.5.2",
"uglify-js": "^3.3.25",

@@ -59,6 +59,7 @@ "webpack": "^3.0.0"

"dependencies": {
"@popmotion/popcorn": "^0.4.0",
"framesync": "^4.0.0",
"@popmotion/popcorn": "^0.4.1",
"framesync": "^4.0.4",
"hey-listen": "^1.0.8",
"style-value-types": "^3.1.4"
"style-value-types": "^3.1.5",
"tslib": "^1.10.0"
},

@@ -65,0 +66,0 @@ "unpkg": "./dist/stylefire.min.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