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

fela

Package Overview
Dependencies
Maintainers
2
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela - npm Package Compare versions

Comparing version 12.0.0-rc.1 to 12.0.0-rc.2

es/extractCustomClassName.js

7

es/combineRules.js

@@ -33,2 +33,9 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

// escape hatch to skip the object assignment for single rules
if (rules.length === 1) {
return function (props, renderer) {
return resolveRule(rules[0], props, renderer);
};
}
return function (props, renderer) {

@@ -35,0 +42,0 @@ return arrayReduce(rules, function (style, rule) {

16

es/createRenderer.js

@@ -1,3 +0,2 @@

var _excluded = ["localAlias"],
_excluded2 = ["_className"];
var _excluded = ["localAlias"];

@@ -31,2 +30,3 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

import sortMediaQuery from './sortMediaQuery';
import extractCustomClassName from './extractCustomClassName';
export default function createRenderer() {

@@ -154,13 +154,11 @@ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var customClassName = extractCustomClassName(style);
var processedStyle = processStyleWithPlugins(renderer, style, RULE_TYPE, props, renderer.unoptimizedPlugins || renderer.plugins);
return renderer._renderStyleToClassNames(processedStyle).slice(1);
return customClassName + renderer._renderStyleToClassNames(processedStyle).substr(1);
},
_renderStyleToClassNames: function _renderStyleToClassNames(_ref) {
var _className = _ref._className,
style = _objectWithoutProperties(_ref, _excluded2);
_renderStyleToClassNames: function _renderStyleToClassNames(style) {
var pseudo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var media = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var support = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
var classNames = _className ? " ".concat(_className) : '';
var classNames = '';

@@ -216,3 +214,3 @@ for (var property in style) {

if (cachedClassName) {
classNames += " ".concat(cachedClassName);
classNames += ' ' + cachedClassName;
}

@@ -219,0 +217,0 @@ }

export default function sortMediaQuery() {
var mediaQueryOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return function (a, b) {
return function sort(a, b) {
if (mediaQueryOrder.indexOf(b) === -1) {

@@ -5,0 +5,0 @@ if (mediaQueryOrder.indexOf(a) === -1) {

@@ -41,2 +41,9 @@ "use strict";

// escape hatch to skip the object assignment for single rules
if (rules.length === 1) {
return function (props, renderer) {
return resolveRule(rules[0], props, renderer);
};
}
return function (props, renderer) {

@@ -43,0 +50,0 @@ return (0, _fastLoops.arrayReduce)(rules, function (style, rule) {

@@ -42,5 +42,6 @@ "use strict";

var _excluded = ["localAlias"],
_excluded2 = ["_className"];
var _extractCustomClassName = _interopRequireDefault(require("./extractCustomClassName"));
var _excluded = ["localAlias"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -180,13 +181,11 @@

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var customClassName = (0, _extractCustomClassName["default"])(style);
var processedStyle = (0, _felaUtils.processStyleWithPlugins)(renderer, style, _felaUtils.RULE_TYPE, props, renderer.unoptimizedPlugins || renderer.plugins);
return renderer._renderStyleToClassNames(processedStyle).slice(1);
return customClassName + renderer._renderStyleToClassNames(processedStyle).substr(1);
},
_renderStyleToClassNames: function _renderStyleToClassNames(_ref) {
var _className = _ref._className,
style = _objectWithoutProperties(_ref, _excluded2);
_renderStyleToClassNames: function _renderStyleToClassNames(style) {
var pseudo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var media = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var support = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
var classNames = _className ? " ".concat(_className) : '';
var classNames = '';

@@ -242,3 +241,3 @@ for (var property in style) {

if (cachedClassName) {
classNames += " ".concat(cachedClassName);
classNames += ' ' + cachedClassName;
}

@@ -245,0 +244,0 @@ }

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

var mediaQueryOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return function (a, b) {
return function sort(a, b) {
if (mediaQueryOrder.indexOf(b) === -1) {

@@ -13,0 +13,0 @@ if (mediaQueryOrder.indexOf(a) === -1) {

{
"name": "fela",
"version": "12.0.0-rc.1",
"version": "12.0.0-rc.2",
"description": "State-Driven Styling in JavaScript",

@@ -52,3 +52,3 @@ "typings": "index.d.ts",

"fast-loops": "^1.0.0",
"fela-utils": "^12.0.0-rc.1",
"fela-utils": "^12.0.0-rc.2",
"isobject": "^3.0.1"

@@ -74,3 +74,3 @@ },

},
"gitHead": "20e073d04b1a97beb6a099e160b0813db845a5e9"
"gitHead": "0e5e638041a6a62e52128dbac21e9c5f21d80b66"
}

@@ -7,2 +7,2 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Fela",[],t):"object"==typeof exports?exports.Fela=t():e.Fela=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([,,function(e,t,n){"use strict";

* Released under the MIT License.
*/e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"createRenderer",(function(){return te})),n.d(t,"combineRules",(function(){return le})),n.d(t,"enhance",(function(){return se}));var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}var c=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t};function u(e,t){return function(e){return c(e)}(e)+":"+t}function f(e,t,n){for(var r=0,o=e.length;r<o;++r)n=t(n,e[r],r,o,e);return n}function l(e,t){for(var n=0,r=e.length;n<r;++n)t(e[n],n,r,e)}function s(e,t){for(var n=[],r=0,o=e.length;r<o;++r){var i=e[r];t(i,r,o,e)&&n.push(i)}return n}var p=n(2),y=n.n(p);function d(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.plugins;return o.length>0?f(o,(function(t,o){return o(t,n,e,r)}),t):t}var v=/^(:|\[|>|&)/;function m(e){return v.test(e)}function h(e){return"&"===e.charAt(0)?e.slice(1):e}function g(e){return"@media"===e.substr(0,6)}function b(e,t){return 0===e.length?t:"".concat(e," and ").concat(t)}function O(e){return"@supports"===e.substr(0,9)}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+r+n+e+t}var j=/undefined|null/,A=/url/;function x(e){return null==e||"string"==typeof e&&j.test(e)&&!A.test(e)}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=".".concat(e).repeat(r);return"".concat(n).concat(o).concat(t)}function S(e){var t="";for(var n in e){var r=e[n];"string"!=typeof r&&"number"!=typeof r||(t&&(t+=";"),t+=u(n,r))}return t}function _(e){return"@font-face{".concat(S(e),"}")}function N(e){return function(e,t,n){for(var r in e)n=t(n,e[r],r,e);return n}(e,(function(e,t,n){return"".concat(e).concat(n,"{").concat(S(t),"}")}),"")}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,o=r||N(e);return f(n,(function(e,n){return"".concat(e,"@").concat(n,"keyframes ").concat(t,"{").concat(o,"}")}),"")}function I(e,t){return"string"==typeof e?e.replace(/\s{2,}/g,""):S(d(t,e,"STATIC"))}function k(e){return"k"+e}var M="abcdefghijklmnopqrstuvwxyz",T=M.length;function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e<=T?M[e-1]+t:R(e/T|0,M[e%T]+t)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=e(),r=R(n);return t(r)?r:z(e,t)}function F(e){return"data:"===e.substr(0,5)}function E(e){return F(e)?e:"'".concat(e,"'")}var K={".woff":"woff",".woff2":"woff2",".eot":"embedded-opentype",".ttf":"truetype",".otf":"opentype",".svg":"svg",".svgz":"svg"},q={"image/svg+xml":"svg","application/x-font-woff":"woff","application/font-woff":"woff","application/x-font-woff2":"woff2","application/font-woff2":"woff2","font/woff2":"woff2","application/octet-stream":"truetype","application/x-font-ttf":"truetype","application/x-font-truetype":"truetype","application/x-font-opentype":"opentype","application/vnd.ms-fontobject":"embedded-opentype","application/font-sfnt":"sfnt"};function Q(e){if(F(e)){for(var t="",n=5;;n++){var r=e.charAt(n);if(";"===r||","===r)break;t+=r}var o=q[t];if(o)return o;console.warn("A invalid base64 font was used. Please use one of the following mime type: ".concat(Object.keys(q).join(", "),"."))}else{for(var i="",a=e.length-1;;a--){if("."===e.charAt(a)){var c=e.slice(a,e.length);i=c.includes("?")?c.split("?",1)[0]:c;break}}var u=K[i];if(u)return u;console.warn('A invalid font-format was used in "'.concat(e,'". Use one of these: ').concat(Object.keys(K).join(", "),"."))}return""}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=f(t,(function(e,t,n){var r=n>0?",":"",o=E(t);return"".concat(e).concat(r,"local(").concat(o,")")}),""),r=f(e,(function(e,t,n){var r=n>0?",":"",o=Q(t),i=E(t);return"".concat(e).concat(r,"url(").concat(i,") format('").concat(o,"')")}),""),o=n.length>0&&r.length>0?",":"";return"".concat(n).concat(o).concat(r)}function D(e,t){return"string"==typeof e?e:t?t+JSON.stringify(e):""}function L(e){return"string"==typeof e?[e]:Array.isArray(e)?e.slice():[]}function Z(e){return-1===e.indexOf("ad")}function $(e){return'"'===e.charAt(0)?e:'"'.concat(e,'"')}var J=/^[a-z_][a-z0-9-_]*$/gi;function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length>0&&null===e.match(J)&&console.error("An invalid selectorPrefix (".concat(e,") has been used to create a new Fela renderer.\nIt must only contain a-Z, 0-9, - and _ while it must start with either _ or a-Z.\nSee http://fela.js.org/docs/advanced/RendererConfiguration.html")),e}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(t,n){return-1===e.indexOf(n)?-1===e.indexOf(t)?0:-1:-1===e.indexOf(t)?1:e.indexOf(t)-e.indexOf(n)}}var G=["localAlias"],H=["_className"];function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],sortMediaQuery:e.sortMediaQuery||B(e.mediaQueryOrder),supportQueryOrder:e.supportQueryOrder||[],styleNodeAttributes:e.styleNodeAttributes||{},propertyPriority:e.propertyPriority||{},ruleOrder:[/^:link/,/^:visited/,/^:hover/,/^:focus-within/,/^:focus/,/^:active/],selectorPrefix:Y(e.selectorPrefix),specificityPrefix:e.specificityPrefix||"",filterClassName:e.filterClassName||Z,devMode:e.devMode||!1,uniqueRuleIdentifier:0,uniqueKeyframeIdentifier:0,nodes:{},scoreIndex:{},cache:{},getNextRuleIdentifier:function(){return++t.uniqueRuleIdentifier},getNextKeyframeIdentifier:function(){return++t.uniqueKeyframeIdentifier},renderRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t._renderStyle(e(n,t),n)},renderKeyframe:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e(n,t),o=d(t,r,"KEYFRAME",n),i=N(o);if(!t.cache.hasOwnProperty(i)){var a=t.selectorPrefix+t.generateAnimationName(n),c=C(o,a,t.keyframePrefixes,i),u={type:"KEYFRAME",keyframe:c,name:a};t.cache[i]=u,t._emitChange(u)}return t.cache[i].name},generateAnimationName:function(e){return k(t.getNextKeyframeIdentifier())},renderFont:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.localAlias,i=ee(r,G),a=e+JSON.stringify(r),c=L(o);if(!t.cache.hasOwnProperty(a)){var u=$(e),f=W(W({},i),{},{src:U(n,c),fontFamily:u}),l=_(f),s={type:"FONT",fontFace:l,fontFamily:u};t.cache[a]=s,t._emitChange(s)}return t.cache[a].fontFamily},renderStatic:function(e,n){var r=D(e,n);if(!t.cache.hasOwnProperty(r)){var o={type:"STATIC",css:I(e,t),selector:n};t.cache[r]=o,t._emitChange(o)}},subscribe:function(e){return t.listeners.push(e),{unsubscribe:function(){return t.listeners.splice(t.listeners.indexOf(e),1)}}},clear:function(){t.uniqueRuleIdentifier=0,t.uniqueKeyframeIdentifier=0,t.cache={},t._emitChange({type:"CLEAR"})},_renderStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=d(t,e,"RULE",n,t.unoptimizedPlugins||t.plugins);return t._renderStyleToClassNames(r).slice(1)},_renderStyleToClassNames:function(e){var n=e._className,r=ee(e,H),o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=n?" ".concat(n):"";for(var u in r){var l=r[u];if(y()(l))if(m(u))c+=t._renderStyleToClassNames(l,o+h(u),i,a);else if(g(u)){var s=b(i,u.slice(6).trim());c+=t._renderStyleToClassNames(l,o,s,a)}else if(O(u)){var p=b(a,u.slice(9).trim());c+=t._renderStyleToClassNames(l,o,i,p)}else console.warn('The object key "'.concat(u,'" is not a valid nested key in Fela.\nMaybe you forgot to add a plugin to resolve it?\nCheck http://fela.js.org/docs/basics/Rules.html#styleobject for more information.'));else{var d=w(u,l,o,i,a);if(t.cacheMap){if(!t.cacheMap.hasOwnProperty(d)){var v={property:u,value:l,pseudo:o,media:i,support:a},j=f(t.optimizedPlugins,(function(e,n){return n(e,t)}),v),A=w(j.property,j.value,j.pseudo,j.media,j.support);t.cache.hasOwnProperty(A)||t._renderStyleToCache(A,j.property,j.value,j.pseudo,j.media,j.support),t.cacheMap[d]=A}d=t.cacheMap[d]}t.cache.hasOwnProperty(d)||t._renderStyleToCache(d,u,l,o,i,a);var x=t.cache[d].className;x&&(c+=" ".concat(x))}}return c},_renderStyleToCache:function(n,r,o,i,a,c){if(x(o))t.cache[n]={className:""};else{var f=t.selectorPrefix+t.generateClassName(r,o,i,a,c),l=u(r,o),s={type:"RULE",className:f,selector:P(f,i,e.specificityPrefix,t.propertyPriority[r]),declaration:l,pseudo:i,media:a,support:c};t.cache[n]=s,t._emitChange(s)}},generateClassName:function(e,n,r,o,i){return z(t.getNextRuleIdentifier,t.filterClassName)},_emitChange:function(e){l(t.listeners,(function(t){return t(e)}))}};return t.keyframePrefixes.push(""),t.optimizedPlugins=f(t.plugins,(function(e,t){return t.optimized&&e.push(t.optimized),e}),[]),t.optimizedPlugins.length>0&&(t.cacheMap={},t.unoptimizedPlugins=s(t.plugins,(function(e){return!e.optimized}))),e.enhancers&&l(e.enhancers,(function(e){t=e(t)})),t}function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function re(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ie(e){return e.filter((function(t,n){return e.lastIndexOf(t)===n}))}function ae(e){for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;++t){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var o in r){var i=r[o],a=e[o];if(a&&i){if(Array.isArray(a)){e[o]=ie(a.concat(i));continue}if(Array.isArray(i)){e[o]=ie([a].concat(re(i)));continue}if("object"===ne(i)){e[o]=ae({},a,i);continue}}e[o]=i}}return e}function ce(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t,n){return Array.isArray(e)?fe(le.apply(void 0,ce(e)),t,n):"function"==typeof e?e(t,n):e}function le(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){return f(t,(function(t,r){var o=fe(r,e,n);return o&&t._className&&(o._className=t._className+(o._className?" "+o._className:"")),ae(t,o)}),{})}}function se(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n){return f(t,(function(e,t){return e=t(e)}),e(n))}}}}])}));
*/e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"createRenderer",(function(){return te})),n.d(t,"combineRules",(function(){return le})),n.d(t,"enhance",(function(){return se}));var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}var c=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t};function u(e,t){return function(e){return c(e)}(e)+":"+t}function f(e,t,n){for(var r=0,o=e.length;r<o;++r)n=t(n,e[r],r,o,e);return n}function l(e,t){for(var n=0,r=e.length;n<r;++n)t(e[n],n,r,e)}function s(e,t){for(var n=[],r=0,o=e.length;r<o;++r){var i=e[r];t(i,r,o,e)&&n.push(i)}return n}var p=n(2),y=n.n(p);function d(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.plugins;return o.length>0?f(o,(function(t,o){return o(t,n,e,r)}),t):t}var v=/^(:|\[|>|&)/;function m(e){return v.test(e)}function h(e){return"&"===e.charAt(0)?e.substr(1):e}function g(e){return"@media"===e.substr(0,6)}function b(e,t){return 0===e.length?t:"".concat(e," and ").concat(t)}function O(e){return"@supports"===e.substr(0,9)}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+r+n+e+t}var j=/undefined|null/,A=/url/;function x(e){return null==e||"string"==typeof e&&j.test(e)&&!A.test(e)}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=".".concat(e).repeat(r);return"".concat(n).concat(o).concat(t)}function S(e){var t="";for(var n in e){var r=e[n];"string"!=typeof r&&"number"!=typeof r||(t&&(t+=";"),t+=u(n,r))}return t}function _(e){return"@font-face{".concat(S(e),"}")}function N(e){return function(e,t,n){for(var r in e)n=t(n,e[r],r,e);return n}(e,(function(e,t,n){return"".concat(e).concat(n,"{").concat(S(t),"}")}),"")}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,o=r||N(e);return f(n,(function(e,n){return"".concat(e,"@").concat(n,"keyframes ").concat(t,"{").concat(o,"}")}),"")}function I(e,t){return"string"==typeof e?e.replace(/\s{2,}/g,""):S(d(t,e,"STATIC"))}function k(e){return"k"+e}var M="abcdefghijklmnopqrstuvwxyz",T=M.length;function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e<=T?M[e-1]+t:R(e/T|0,M[e%T]+t)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=e(),r=R(n);return t(r)?r:z(e,t)}function F(e){return"data:"===e.substr(0,5)}function E(e){return F(e)?e:"'".concat(e,"'")}var K={".woff":"woff",".woff2":"woff2",".eot":"embedded-opentype",".ttf":"truetype",".otf":"opentype",".svg":"svg",".svgz":"svg"},q={"image/svg+xml":"svg","application/x-font-woff":"woff","application/font-woff":"woff","application/x-font-woff2":"woff2","application/font-woff2":"woff2","font/woff2":"woff2","application/octet-stream":"truetype","application/x-font-ttf":"truetype","application/x-font-truetype":"truetype","application/x-font-opentype":"opentype","application/vnd.ms-fontobject":"embedded-opentype","application/font-sfnt":"sfnt"};function Q(e){if(F(e)){for(var t="",n=5;;n++){var r=e.charAt(n);if(";"===r||","===r)break;t+=r}var o=q[t];if(o)return o;console.warn("A invalid base64 font was used. Please use one of the following mime type: ".concat(Object.keys(q).join(", "),"."))}else{for(var i="",a=e.length-1;;a--){if("."===e.charAt(a)){var c=e.slice(a,e.length);i=c.includes("?")?c.split("?",1)[0]:c;break}}var u=K[i];if(u)return u;console.warn('A invalid font-format was used in "'.concat(e,'". Use one of these: ').concat(Object.keys(K).join(", "),"."))}return""}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=f(t,(function(e,t,n){var r=n>0?",":"",o=E(t);return"".concat(e).concat(r,"local(").concat(o,")")}),""),r=f(e,(function(e,t,n){var r=n>0?",":"",o=Q(t),i=E(t);return"".concat(e).concat(r,"url(").concat(i,") format('").concat(o,"')")}),""),o=n.length>0&&r.length>0?",":"";return"".concat(n).concat(o).concat(r)}function D(e,t){return"string"==typeof e?e:t?t+JSON.stringify(e):""}function L(e){return"string"==typeof e?[e]:Array.isArray(e)?e.slice():[]}function Z(e){return-1===e.indexOf("ad")}function $(e){return'"'===e.charAt(0)?e:'"'.concat(e,'"')}var J=/^[a-z_][a-z0-9-_]*$/gi;function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length>0&&null===e.match(J)&&console.error("An invalid selectorPrefix (".concat(e,") has been used to create a new Fela renderer.\nIt must only contain a-Z, 0-9, - and _ while it must start with either _ or a-Z.\nSee http://fela.js.org/docs/advanced/RendererConfiguration.html")),e}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(t,n){return-1===e.indexOf(n)?-1===e.indexOf(t)?0:-1:-1===e.indexOf(t)?1:e.indexOf(t)-e.indexOf(n)}}function G(e){if(e._className){var t=e._className+" ";return delete e._className,t}return""}var H=["localAlias"];function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],sortMediaQuery:e.sortMediaQuery||B(e.mediaQueryOrder),supportQueryOrder:e.supportQueryOrder||[],styleNodeAttributes:e.styleNodeAttributes||{},propertyPriority:e.propertyPriority||{},ruleOrder:[/^:link/,/^:visited/,/^:hover/,/^:focus-within/,/^:focus/,/^:active/],selectorPrefix:Y(e.selectorPrefix),specificityPrefix:e.specificityPrefix||"",filterClassName:e.filterClassName||Z,devMode:e.devMode||!1,uniqueRuleIdentifier:0,uniqueKeyframeIdentifier:0,nodes:{},scoreIndex:{},cache:{},getNextRuleIdentifier:function(){return++t.uniqueRuleIdentifier},getNextKeyframeIdentifier:function(){return++t.uniqueKeyframeIdentifier},renderRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t._renderStyle(e(n,t),n)},renderKeyframe:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e(n,t),o=d(t,r,"KEYFRAME",n),i=N(o);if(!t.cache.hasOwnProperty(i)){var a=t.selectorPrefix+t.generateAnimationName(n),c=C(o,a,t.keyframePrefixes,i),u={type:"KEYFRAME",keyframe:c,name:a};t.cache[i]=u,t._emitChange(u)}return t.cache[i].name},generateAnimationName:function(e){return k(t.getNextKeyframeIdentifier())},renderFont:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.localAlias,i=ee(r,H),a=e+JSON.stringify(r),c=L(o);if(!t.cache.hasOwnProperty(a)){var u=$(e),f=W(W({},i),{},{src:U(n,c),fontFamily:u}),l=_(f),s={type:"FONT",fontFace:l,fontFamily:u};t.cache[a]=s,t._emitChange(s)}return t.cache[a].fontFamily},renderStatic:function(e,n){var r=D(e,n);if(!t.cache.hasOwnProperty(r)){var o={type:"STATIC",css:I(e,t),selector:n};t.cache[r]=o,t._emitChange(o)}},subscribe:function(e){return t.listeners.push(e),{unsubscribe:function(){return t.listeners.splice(t.listeners.indexOf(e),1)}}},clear:function(){t.uniqueRuleIdentifier=0,t.uniqueKeyframeIdentifier=0,t.cache={},t._emitChange({type:"CLEAR"})},_renderStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=G(e),o=d(t,e,"RULE",n,t.unoptimizedPlugins||t.plugins);return r+t._renderStyleToClassNames(o).substr(1)},_renderStyleToClassNames:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i="";for(var a in e){var c=e[a];if(y()(c))if(m(a))i+=t._renderStyleToClassNames(c,n+h(a),r,o);else if(g(a)){var u=b(r,a.slice(6).trim());i+=t._renderStyleToClassNames(c,n,u,o)}else if(O(a)){var l=b(o,a.slice(9).trim());i+=t._renderStyleToClassNames(c,n,r,l)}else console.warn('The object key "'.concat(a,'" is not a valid nested key in Fela.\nMaybe you forgot to add a plugin to resolve it?\nCheck http://fela.js.org/docs/basics/Rules.html#styleobject for more information.'));else{var s=w(a,c,n,r,o);if(t.cacheMap){if(!t.cacheMap.hasOwnProperty(s)){var p={property:a,value:c,pseudo:n,media:r,support:o},d=f(t.optimizedPlugins,(function(e,n){return n(e,t)}),p),v=w(d.property,d.value,d.pseudo,d.media,d.support);t.cache.hasOwnProperty(v)||t._renderStyleToCache(v,d.property,d.value,d.pseudo,d.media,d.support),t.cacheMap[s]=v}s=t.cacheMap[s]}t.cache.hasOwnProperty(s)||t._renderStyleToCache(s,a,c,n,r,o);var j=t.cache[s].className;j&&(i+=" "+j)}}return i},_renderStyleToCache:function(n,r,o,i,a,c){if(x(o))t.cache[n]={className:""};else{var f=t.selectorPrefix+t.generateClassName(r,o,i,a,c),l=u(r,o),s={type:"RULE",className:f,selector:P(f,i,e.specificityPrefix,t.propertyPriority[r]),declaration:l,pseudo:i,media:a,support:c};t.cache[n]=s,t._emitChange(s)}},generateClassName:function(e,n,r,o,i){return z(t.getNextRuleIdentifier,t.filterClassName)},_emitChange:function(e){l(t.listeners,(function(t){return t(e)}))}};return t.keyframePrefixes.push(""),t.optimizedPlugins=f(t.plugins,(function(e,t){return t.optimized&&e.push(t.optimized),e}),[]),t.optimizedPlugins.length>0&&(t.cacheMap={},t.unoptimizedPlugins=s(t.plugins,(function(e){return!e.optimized}))),e.enhancers&&l(e.enhancers,(function(e){t=e(t)})),t}function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function re(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ie(e){return e.filter((function(t,n){return e.lastIndexOf(t)===n}))}function ae(e){for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;++t){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var o in r){var i=r[o],a=e[o];if(a&&i){if(Array.isArray(a)){e[o]=ie(a.concat(i));continue}if(Array.isArray(i)){e[o]=ie([a].concat(re(i)));continue}if("object"===ne(i)){e[o]=ae({},a,i);continue}}e[o]=i}}return e}function ce(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t,n){return Array.isArray(e)?fe(le.apply(void 0,ce(e)),t,n):"function"==typeof e?e(t,n):e}function le(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length?function(e,n){return fe(t[0],e,n)}:function(e,n){return f(t,(function(t,r){var o=fe(r,e,n);return o&&t._className&&(o._className=t._className+(o._className?" "+o._className:"")),ae(t,o)}),{})}}function se(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n){return f(t,(function(e,t){return e=t(e)}),e(n))}}}}])}));
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