Socket
Socket
Sign inDemoInstall

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 11.3.3 to 11.4.0

3

es/createRenderer.js

@@ -54,2 +54,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

selectorPrefix: validateSelectorPrefix(config.selectorPrefix),
specificityPrefix: config.specificityPrefix || '',
filterClassName: config.filterClassName || isSafeClassName,

@@ -222,3 +223,3 @@ devMode: config.devMode || false,

var declaration = cssifyDeclaration(property, value);
var selector = generateCSSSelector(className, pseudo);
var selector = generateCSSSelector(className, pseudo, config.specificityPrefix);

@@ -225,0 +226,0 @@ var change = {

@@ -47,2 +47,3 @@ declare module "fela" {

selectorPrefix?: string;
specificityPrefix?: string;
filterClassName?: (className: string) => boolean;

@@ -298,2 +299,20 @@ devMode?: boolean;

declare module "fela-plugin-fullscreen-prefixer" {
import { TPlugin } from "fela";
export default function(): TPlugin;
}
declare module "fela-plugin-pseudo-prefixer" {
import { TPlugin } from "fela";
export default function(): TPlugin;
}
declare module "fela-plugin-theme-value" {
import { TPlugin } from "fela";
export default function(): TPlugin;
}
declare module "fela-plugin-prefixer" {

@@ -300,0 +319,0 @@ import { TPlugin } from "fela";

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

selectorPrefix: (0, _validateSelectorPrefix2.default)(config.selectorPrefix),
specificityPrefix: config.specificityPrefix || '',
filterClassName: config.filterClassName || _isSafeClassName2.default,

@@ -275,3 +276,3 @@ devMode: config.devMode || false,

var declaration = (0, _cssifyDeclaration2.default)(property, value);
var selector = (0, _felaUtils.generateCSSSelector)(className, pseudo);
var selector = (0, _felaUtils.generateCSSSelector)(className, pseudo, config.specificityPrefix);

@@ -278,0 +279,0 @@ var change = {

{
"name": "fela",
"version": "11.3.3",
"version": "11.4.0",
"description": "State-Driven Styling in JavaScript",

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

],
"author": "Robin Frischmann",
"author": "Robin Weser",
"license": "MIT",

@@ -43,6 +43,6 @@ "dependencies": {

"fast-loops": "^1.0.0",
"fela-utils": "^11.3.3",
"fela-utils": "^11.4.0",
"isobject": "^3.0.1"
},
"gitHead": "4cc4686d9e16877251ac5c73e161076ec7c113a1"
"gitHead": "94e23ad2fda221aea52ccb939d90f81eb400b5fb"
}

@@ -153,15 +153,15 @@ <h1><img alt="Fela" src="docs/res/logo.png" width="203"/></h1>

## Talks
* [**CSS in JS: The Good & Bad Parts**](https://www.youtube.com/watch?v=95M-2YzyTno) ([Slides](https://speakerdeck.com/robinweser/css-in-js-the-good-and-bad-parts))<br> - *by [Robin Frischmann](https://twitter.com/robinweser)*
* [**CSS in JS: The Good & Bad Parts**](https://www.youtube.com/watch?v=95M-2YzyTno) ([Slides](https://speakerdeck.com/robinweser/css-in-js-the-good-and-bad-parts))<br> - *by [Robin Weser](https://twitter.com/robinweser)*
* [**CSS in JS: Patterns**](https://www.webexpo.net/prague2018/talk?id=css-in-js-patterns)<br> - *by [Vojtech Miksu](https://twitter.com/vmiksu)*
## Posts
* [**Style as a Function of State**](https://medium.com/@robinweser/styles-as-functions-of-state-1885627a63f7#.6k6i4kdch)<br> - *by [Robin Frischmann](https://twitter.com/robinweser)*
* [**Style as a Function of State**](https://medium.com/@robinweser/styles-as-functions-of-state-1885627a63f7#.6k6i4kdch)<br> - *by [Robin Weser](https://twitter.com/robinweser)*
* [**CSS in JS: The Argument Refined**](https://medium.com/@steida/css-in-js-the-argument-refined-471c7eb83955#.3otvkubq4)<br> - *by [Daniel Steigerwald](https://twitter.com/steida)*
* [**What is Fela?**](https://davidsinclair.io/thoughts/what-is-fela)<br> - *by [David Sinclair](https://davidsinclair.io)*
* [**Choosing a CSS in JS library**](https://gist.github.com/troch/c27c6a8cc47b76755d848c6d1204fdaf#file-choosing-a-css-in-js-library-md)<br> - *by [Thomas Roch](https://twitter.com/tcroch)*
* [**Introducing Fela 6.0**](https://medium.com/felajs/the-future-of-fela-d4dad2efad00)<br> - *by [Robin Frischmann](https://twitter.com/robinweser)*
* [**Introducing Fela 6.0**](https://medium.com/felajs/the-future-of-fela-d4dad2efad00)<br> - *by [Robin Weser](https://twitter.com/robinweser)*
* [**A journey into CSS and then into CSS-in-JS**](https://www.zeolearn.com/magazine/a-journey-into-css-and-then-into-css-in-js)<br> - *by [Prithvi Raju](https://twitter.com/aga5tya)*
* [**CSS In JS — Future of styling components**](https://we-are.bookmyshow.com/css-in-js-future-of-styling-components-ad315eb5448b)<br> - *by [Manjula Dube](https://twitter.com/manjula_dube)*
* [**Styling Components with React Fela**](https://alligator.io/react/styling-with-react-fela/)<br> - *by [Josh Sherman](https://twitter.com/joshtronic)*
* [**The Future of Fela**](https://medium.com/@robinweser/introducing-fela-6-0-289c84b52dd5)<br> - *by [Robin Frischmann](https://twitter.com/robinweser)*
* [**The Future of Fela**](https://medium.com/@robinweser/introducing-fela-6-0-289c84b52dd5)<br> - *by [Robin Weser](https://twitter.com/robinweser)*

@@ -168,0 +168,0 @@ ## Ecosystem

@@ -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=11)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){for(var r=0,o=e.length;r<o;++r)n=t(n,e[r],r,o,e);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="";for(var n in e){var r=e[n];"string"!=typeof r&&"number"!=typeof r||(t&&(t+=";"),t+=(0,i.default)(n,r))}return t};var r,o=n(2),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e)+":"+t};var r,o=n(9),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=0,r=e.length;n<r;++n)t(e[n],n,r,e)}},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";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){for(var r in e)n=t(n,e[r],r,e);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,(function(e){return e[1].toUpperCase()})).replace(o,"ms")};var r=/-([a-z])/g,o=/^Ms/g;e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){return e.filter((function(t,n){return e.lastIndexOf(t)===n}))}t.default=function e(t){for(var n=arguments.length,u=Array(n>1?n-1:0),a=1;a<n;a++)u[a-1]=arguments[a];for(var f=0,s=u.length;f<s;++f){var c=u[f];for(var l in c){var d=c[l],p=t[l];if(p&&d){if(Array.isArray(p)){t[l]=i(p.concat(d));continue}if(Array.isArray(d)){t[l]=i([p].concat(o(d)));continue}if("object"===(void 0===d?"undefined":r(d))){t[l]=e({},p,d);continue}}t[l]=d}}return t},e.exports=t.default},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)};var r,o=n(10),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){"use strict";var r=/[A-Z]/g,o=/^ms-/,i={};e.exports=function(e){return e in i?i[e]:i[e]=e.replace(r,"-$&").toLowerCase().replace(o,"-ms-")}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(3),u=n.n(i),a=n(4),f=n.n(a),s=n(0),c=n.n(s);function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.plugins.length>0?c()(e.plugins,(function(t,o){return o(t,n,e,r)}),t):t}var d=/^(:|\[|>|&)/;function p(e){return d.test(e)}function y(e){return"@media"===e.substr(0,6)}function m(e,t){return 0===e.length?t:e+" and "+t}function h(e){return"@supports"===e.substr(0,9)}var v=n(6),g=n.n(v);function b(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+g()(e)+t}function _(e){return null==e||"string"==typeof e&&null!==e.match(/(undefined|null)/)&&null===e.match(/url/)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."+e+t}var O=n(1),w=n.n(O);var A=n(5),j=n.n(A);function N(e){return j()(e,(e,t,n)=>`${e}${n}{${w()(t)}}`,"")}const $="abcdefghijklmnopqrstuvwxyz",P=$.length;function C(e,t=(()=>!0)){const n=function e(t,n=""){return t<=P?$[t-1]+n:e(t/P|0,$[t%P]+n)}(e());return t(n)?n:C(e,t)}function M(e){return"data:"===e.substr(0,5)}function S(e){return M(e)?e:`'${e}'`}const k={".woff":"woff",".woff2":"woff2",".eot":"embedded-opentype",".ttf":"truetype",".otf":"opentype",".svg":"svg",".svgz":"svg"},I={"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 R(e=[],t=[]){const n=c()(t,(e,t,n)=>`${e}${n>0?",":""}local(${S(t)})`,""),r=c()(e,(e,t,n)=>{const r=n>0?",":"",o=function(e){if(M(e)){let t="";for(let n=5;;n++){const r=e.charAt(n);if(";"===r||","===r)break;t+=r}const n=I[t];if(n)return n;console.warn(`A invalid base64 font was used. Please use one of the following mime type: ${Object.keys(I).join(", ")}.`)}else{let t="";for(let n=e.length-1;;n--){if("."===e.charAt(n)){const r=e.slice(n,e.length);t=r.includes("?")?r.split("?",1)[0]:r;break}}const n=k[t];if(n)return n;console.warn(`A invalid font-format was used in "${e}". Use one of these: ${Object.keys(k).join(", ")}.`)}return""}(t);return`${e}${r}url(${S(t)}) format('${o}')`},"");return`${n}${n.length>0&&r.length>0?",":""}${r}`}function F(e){return-1===e.indexOf("ad")}const T=/^[a-z_][a-z0-9-_]*$/gi;function K(e=""){return e.length>0&&null===e.match(T)&&console.error(`An invalid selectorPrefix (${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}const q=(e=[])=>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 E(e={}){let t={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],sortMediaQuery:e.sortMediaQuery||q(e.mediaQueryOrder),supportQueryOrder:e.supportQueryOrder||[],styleNodeAttributes:e.styleNodeAttributes||{},ruleOrder:[/^:link/,/^:visited/,/^:hover/,/^:focus-within/,/^:focus/,/^:active/],selectorPrefix:K(e.selectorPrefix),filterClassName:e.filterClassName||F,devMode:e.devMode||!1,uniqueRuleIdentifier:0,uniqueKeyframeIdentifier:0,nodes:{},scoreIndex:{},cache:{},getNextRuleIdentifier:()=>++t.uniqueRuleIdentifier,getNextKeyframeIdentifier:()=>++t.uniqueKeyframeIdentifier,renderRule:(e,n={})=>t._renderStyle(e(n,t),n),renderKeyframe(e,n={}){const r=e(n,t),o=l(t,r,"KEYFRAME",n),i=N(o);if(!t.cache.hasOwnProperty(i)){const e=t.selectorPrefix+t.generateAnimationName(n),r={type:"KEYFRAME",keyframe:function(e,t,n=[""],r){const o=r||N(e);return c()(n,(e,n)=>`${e}@${n}keyframes ${t}{${o}}`,"")}(o,e,t.keyframePrefixes,i),name:e};t.cache[i]=r,t._emitChange(r)}return t.cache[i].name},generateAnimationName:e=>"k"+t.getNextKeyframeIdentifier(),renderFont(e,n,r={}){const{localAlias:o,...i}=r,u=e+JSON.stringify(r),a=function(e){return"string"==typeof e?[e]:Array.isArray(e)?e.slice():[]}(o);if(!t.cache.hasOwnProperty(u)){const r='"'===(f=e).charAt(0)?f:`"${f}"`,o={type:"FONT",fontFace:function(e){return`@font-face{${w()(e)}}`}({...i,src:R(n,a),fontFamily:r}),fontFamily:r};t.cache[u]=o,t._emitChange(o)}var f;return t.cache[u].fontFamily},renderStatic(e,n){const r=function(e,t){return"string"==typeof e?e:t?t+JSON.stringify(e):""}(e,n);if(!t.cache.hasOwnProperty(r)){const o={type:"STATIC",css:function(e,t){if("string"==typeof e)return e.replace(/\s{2,}/g,"");const n=l(t,e,"STATIC");return w()(n)}(e,t),selector:n};t.cache[r]=o,t._emitChange(o)}},subscribe:e=>(t.listeners.push(e),{unsubscribe:()=>t.listeners.splice(t.listeners.indexOf(e),1)}),clear(){t.uniqueRuleIdentifier=0,t.uniqueKeyframeIdentifier=0,t.cache={},t._emitChange({type:"CLEAR"})},_renderStyle(e={},n={}){const r=l(t,e,"RULE",n);return t._renderStyleToClassNames(r).slice(1)},_renderStyleToClassNames({_className:e,...n},r="",i="",u=""){let a=e?` ${e}`:"";for(const e in n){const c=n[e];if(f()(c))if(p(e))a+=t._renderStyleToClassNames(c,r+("&"===(s=e).charAt(0)?s.slice(1):s),i,u);else if(y(e)){const n=m(i,e.slice(6).trim());a+=t._renderStyleToClassNames(c,r,n,u)}else if(h(e)){const n=m(u,e.slice(9).trim());a+=t._renderStyleToClassNames(c,r,i,n)}else console.warn(`The object key "${e}" 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{const n=b(e,c,r,i,u);if(!t.cache.hasOwnProperty(n)){if(_(c)){t.cache[n]={className:""};continue}const a=t.selectorPrefix+t.generateClassName(e,c,r,i,u),f=o()(e,c),s={type:"RULE",className:a,selector:x(a,r),declaration:f,pseudo:r,media:i,support:u};t.cache[n]=s,t._emitChange(s)}const f=t.cache[n].className;f&&(a+=` ${f}`)}}var s;return a},generateClassName:(e,n,r,o,i)=>C(t.getNextRuleIdentifier,t.filterClassName),_emitChange(e){u()(t.listeners,t=>t(e))}};return t.keyframePrefixes.push(""),e.enhancers&&u()(e.enhancers,e=>{t=e(t)}),t}var z=n(7),Q=n.n(z);function L(...e){return(t,n)=>c()(e,(e,r)=>{const o=function e(t,n,r){return Array.isArray(t)?e(L(...t),n,r):"function"==typeof t?t(n,r):t}(r,t,n);return o&&e._className&&(o._className=e._className+(o._className?" "+o._className:"")),Q()(e,o)},{})}function U(...e){return t=>n=>c()(e,(e,t)=>e=t(e),t(n))}n.d(t,"createRenderer",(function(){return E})),n.d(t,"combineRules",(function(){return L})),n.d(t,"enhance",(function(){return U}))}])}));
*/e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){for(var r in e)n=t(n,e[r],r,e);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,(function(e){return e[1].toUpperCase()})).replace(o,"ms")};var r=/-([a-z])/g,o=/^Ms/g;e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){return e.filter((function(t,n){return e.lastIndexOf(t)===n}))}t.default=function e(t){for(var n=arguments.length,f=Array(n>1?n-1:0),u=1;u<n;u++)f[u-1]=arguments[u];for(var a=0,s=f.length;a<s;++a){var c=f[a];for(var l in c){var d=c[l],p=t[l];if(p&&d){if(Array.isArray(p)){t[l]=i(p.concat(d));continue}if(Array.isArray(d)){t[l]=i([p].concat(o(d)));continue}if("object"===(void 0===d?"undefined":r(d))){t[l]=e({},p,d);continue}}t[l]=d}}return t},e.exports=t.default},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)};var r,o=n(10),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){"use strict";var r=/[A-Z]/g,o=/^ms-/,i={};e.exports=function(e){return e in i?i[e]:i[e]=e.replace(r,"-$&").toLowerCase().replace(o,"-ms-")}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(3),f=n.n(i),u=n(4),a=n.n(u),s=n(0),c=n.n(s);function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.plugins.length>0?c()(e.plugins,(function(t,o){return o(t,n,e,r)}),t):t}var d=/^(:|\[|>|&)/;function p(e){return d.test(e)}function y(e){return"@media"===e.substr(0,6)}function m(e,t){return 0===e.length?t:e+" and "+t}function h(e){return"@supports"===e.substr(0,9)}var v=n(6),g=n.n(v);function b(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+g()(e)+t}function _(e){return null==e||"string"==typeof e&&null!==e.match(/(undefined|null)/)&&null===e.match(/url/)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return n+"."+e+t}var O=n(1),w=n.n(O);var A=n(5),j=n.n(A);function N(e){return j()(e,(e,t,n)=>`${e}${n}{${w()(t)}}`,"")}const P="abcdefghijklmnopqrstuvwxyz",$=P.length;function C(e,t=(()=>!0)){const n=function e(t,n=""){return t<=$?P[t-1]+n:e(t/$|0,P[t%$]+n)}(e());return t(n)?n:C(e,t)}function M(e){return"data:"===e.substr(0,5)}function S(e){return M(e)?e:`'${e}'`}const k={".woff":"woff",".woff2":"woff2",".eot":"embedded-opentype",".ttf":"truetype",".otf":"opentype",".svg":"svg",".svgz":"svg"},I={"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 R(e=[],t=[]){const n=c()(t,(e,t,n)=>`${e}${n>0?",":""}local(${S(t)})`,""),r=c()(e,(e,t,n)=>{const r=n>0?",":"",o=function(e){if(M(e)){let t="";for(let n=5;;n++){const r=e.charAt(n);if(";"===r||","===r)break;t+=r}const n=I[t];if(n)return n;console.warn(`A invalid base64 font was used. Please use one of the following mime type: ${Object.keys(I).join(", ")}.`)}else{let t="";for(let n=e.length-1;;n--){if("."===e.charAt(n)){const r=e.slice(n,e.length);t=r.includes("?")?r.split("?",1)[0]:r;break}}const n=k[t];if(n)return n;console.warn(`A invalid font-format was used in "${e}". Use one of these: ${Object.keys(k).join(", ")}.`)}return""}(t);return`${e}${r}url(${S(t)}) format('${o}')`},"");return`${n}${n.length>0&&r.length>0?",":""}${r}`}function F(e){return-1===e.indexOf("ad")}const T=/^[a-z_][a-z0-9-_]*$/gi;function K(e=""){return e.length>0&&null===e.match(T)&&console.error(`An invalid selectorPrefix (${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}const q=(e=[])=>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 E(e={}){let t={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],sortMediaQuery:e.sortMediaQuery||q(e.mediaQueryOrder),supportQueryOrder:e.supportQueryOrder||[],styleNodeAttributes:e.styleNodeAttributes||{},ruleOrder:[/^:link/,/^:visited/,/^:hover/,/^:focus-within/,/^:focus/,/^:active/],selectorPrefix:K(e.selectorPrefix),specificityPrefix:e.specificityPrefix||"",filterClassName:e.filterClassName||F,devMode:e.devMode||!1,uniqueRuleIdentifier:0,uniqueKeyframeIdentifier:0,nodes:{},scoreIndex:{},cache:{},getNextRuleIdentifier:()=>++t.uniqueRuleIdentifier,getNextKeyframeIdentifier:()=>++t.uniqueKeyframeIdentifier,renderRule:(e,n={})=>t._renderStyle(e(n,t),n),renderKeyframe(e,n={}){const r=e(n,t),o=l(t,r,"KEYFRAME",n),i=N(o);if(!t.cache.hasOwnProperty(i)){const e=t.selectorPrefix+t.generateAnimationName(n),r={type:"KEYFRAME",keyframe:function(e,t,n=[""],r){const o=r||N(e);return c()(n,(e,n)=>`${e}@${n}keyframes ${t}{${o}}`,"")}(o,e,t.keyframePrefixes,i),name:e};t.cache[i]=r,t._emitChange(r)}return t.cache[i].name},generateAnimationName:e=>"k"+t.getNextKeyframeIdentifier(),renderFont(e,n,r={}){const{localAlias:o,...i}=r,f=e+JSON.stringify(r),u=function(e){return"string"==typeof e?[e]:Array.isArray(e)?e.slice():[]}(o);if(!t.cache.hasOwnProperty(f)){const r='"'===(a=e).charAt(0)?a:`"${a}"`,o={type:"FONT",fontFace:function(e){return`@font-face{${w()(e)}}`}({...i,src:R(n,u),fontFamily:r}),fontFamily:r};t.cache[f]=o,t._emitChange(o)}var a;return t.cache[f].fontFamily},renderStatic(e,n){const r=function(e,t){return"string"==typeof e?e:t?t+JSON.stringify(e):""}(e,n);if(!t.cache.hasOwnProperty(r)){const o={type:"STATIC",css:function(e,t){if("string"==typeof e)return e.replace(/\s{2,}/g,"");const n=l(t,e,"STATIC");return w()(n)}(e,t),selector:n};t.cache[r]=o,t._emitChange(o)}},subscribe:e=>(t.listeners.push(e),{unsubscribe:()=>t.listeners.splice(t.listeners.indexOf(e),1)}),clear(){t.uniqueRuleIdentifier=0,t.uniqueKeyframeIdentifier=0,t.cache={},t._emitChange({type:"CLEAR"})},_renderStyle(e={},n={}){const r=l(t,e,"RULE",n);return t._renderStyleToClassNames(r).slice(1)},_renderStyleToClassNames({_className:n,...r},i="",f="",u=""){let s=n?` ${n}`:"";for(const n in r){const l=r[n];if(a()(l))if(p(n))s+=t._renderStyleToClassNames(l,i+("&"===(c=n).charAt(0)?c.slice(1):c),f,u);else if(y(n)){const e=m(f,n.slice(6).trim());s+=t._renderStyleToClassNames(l,i,e,u)}else if(h(n)){const e=m(u,n.slice(9).trim());s+=t._renderStyleToClassNames(l,i,f,e)}else console.warn(`The object key "${n}" 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{const r=b(n,l,i,f,u);if(!t.cache.hasOwnProperty(r)){if(_(l)){t.cache[r]={className:""};continue}const a=t.selectorPrefix+t.generateClassName(n,l,i,f,u),s=o()(n,l),c={type:"RULE",className:a,selector:x(a,i,e.specificityPrefix),declaration:s,pseudo:i,media:f,support:u};t.cache[r]=c,t._emitChange(c)}const a=t.cache[r].className;a&&(s+=` ${a}`)}}var c;return s},generateClassName:(e,n,r,o,i)=>C(t.getNextRuleIdentifier,t.filterClassName),_emitChange(e){f()(t.listeners,t=>t(e))}};return t.keyframePrefixes.push(""),e.enhancers&&f()(e.enhancers,e=>{t=e(t)}),t}var z=n(7),Q=n.n(z);function L(...e){return(t,n)=>c()(e,(e,r)=>{const o=function e(t,n,r){return Array.isArray(t)?e(L(...t),n,r):"function"==typeof t?t(n,r):t}(r,t,n);return o&&e._className&&(o._className=e._className+(o._className?" "+o._className:"")),Q()(e,o)},{})}function U(...e){return t=>n=>c()(e,(e,t)=>e=t(e),t(n))}n.d(t,"createRenderer",(function(){return E})),n.d(t,"combineRules",(function(){return L})),n.d(t,"enhance",(function(){return U}))}])}));
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