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 11.7.0 to 12.0.0-rc.0

23

es/combineRules.js

@@ -1,9 +0,19 @@

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
import assignStyle from 'css-in-js-utils/lib/assignStyle';
import arrayReduce from 'fast-loops/lib/arrayReduce';
function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
import { assignStyle } from 'css-in-js-utils';
import { arrayReduce } from 'fast-loops';
function resolveRule(rule, props, renderer) {
if (Array.isArray(rule)) {
return resolveRule(combineRules.apply(undefined, _toConsumableArray(rule)), props, renderer);
return resolveRule(combineRules.apply(void 0, _toConsumableArray(rule)), props, renderer);
}

@@ -19,3 +29,3 @@

export default function combineRules() {
for (var _len = arguments.length, rules = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, rules = new Array(_len), _key = 0; _key < _len; _key++) {
rules[_key] = arguments[_key];

@@ -26,5 +36,4 @@ }

return arrayReduce(rules, function (style, rule) {
var resolvedRule = resolveRule(rule, props, renderer);
var resolvedRule = resolveRule(rule, props, renderer); // special combination of our special _className key
// special combination of our special _className key
if (resolvedRule && style._className) {

@@ -31,0 +40,0 @@ resolvedRule._className = style._className + (resolvedRule._className ? ' ' + resolvedRule._className : '');

@@ -1,12 +0,18 @@

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; };
var _excluded = ["localAlias"],
_excluded2 = ["_className"];
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 cssifyDeclaration from 'css-in-js-utils/lib/cssifyDeclaration';
import arrayEach from 'fast-loops/lib/arrayEach';
import arrayReduce from 'fast-loops/lib/arrayReduce';
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { cssifyDeclaration } from 'css-in-js-utils';
import { arrayEach, arrayReduce, arrayFilter } from 'fast-loops';
import isPlainObject from 'isobject';
import { generateDeclarationReference, generateCombinedMediaQuery, generateCSSSelector, isMediaQuery, isNestedSelector, isUndefinedValue, isSupport, normalizeNestedProperty, processStyleWithPlugins, STATIC_TYPE, RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, CLEAR_TYPE } from 'fela-utils';
import cssifyFontFace from './cssifyFontFace';

@@ -25,6 +31,4 @@ import cssifyKeyframe from './cssifyKeyframe';

import sortMediaQuery from './sortMediaQuery';
export default function createRenderer() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var renderer = {

@@ -43,6 +47,4 @@ listeners: [],

devMode: config.devMode || false,
uniqueRuleIdentifier: 0,
uniqueKeyframeIdentifier: 0,
nodes: {},

@@ -53,3 +55,2 @@ scoreIndex: {},

cache: {},
getNextRuleIdentifier: function getNextRuleIdentifier() {

@@ -63,3 +64,2 @@ return ++renderer.uniqueRuleIdentifier;

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return renderer._renderStyle(rule(props, renderer), props);

@@ -69,6 +69,4 @@ },

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var resolvedKeyframe = keyframe(props, renderer);
var processedKeyframe = processStyleWithPlugins(renderer, resolvedKeyframe, KEYFRAME_TYPE, props);
var keyframeReference = cssifyKeyframeRule(processedKeyframe);

@@ -79,5 +77,3 @@

var animationName = renderer.selectorPrefix + renderer.generateAnimationName(props);
var cssKeyframe = cssifyKeyframe(processedKeyframe, animationName, renderer.keyframePrefixes, keyframeReference);
var change = {

@@ -88,4 +84,4 @@ type: KEYFRAME_TYPE,

};
renderer.cache[keyframeReference] = change;
renderer.cache[keyframeReference] = change;
renderer._emitChange(change);

@@ -103,3 +99,3 @@ }

var localAlias = properties.localAlias,
otherProperties = _objectWithoutProperties(properties, ['localAlias']);
otherProperties = _objectWithoutProperties(properties, _excluded);

@@ -112,3 +108,3 @@ var fontReference = family + JSON.stringify(properties);

var fontFace = _extends({}, otherProperties, {
var fontFace = _objectSpread(_objectSpread({}, otherProperties), {}, {
src: generateFontSource(files, fontLocals),

@@ -119,3 +115,2 @@ fontFamily: fontFamily

var cssFontFace = cssifyFontFace(fontFace);
var change = {

@@ -126,4 +121,4 @@ type: FONT_TYPE,

};
renderer.cache[fontReference] = change;
renderer.cache[fontReference] = change;
renderer._emitChange(change);

@@ -139,3 +134,2 @@ }

var cssDeclarations = cssifyStaticStyle(staticStyle, renderer);
var change = {

@@ -146,4 +140,4 @@ type: STATIC_TYPE,

};
renderer.cache[staticReference] = change;
renderer.cache[staticReference] = change;
renderer._emitChange(change);

@@ -154,3 +148,2 @@ }

renderer.listeners.push(callback);
return {

@@ -174,17 +167,14 @@ unsubscribe: function unsubscribe() {

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var processedStyle = processStyleWithPlugins(renderer, style, RULE_TYPE, props, renderer.unoptimizedPlugins || renderer.plugins);
return renderer._renderStyleToClassNames(processedStyle).slice(1);
},
_renderStyleToClassNames: function _renderStyleToClassNames(_ref) {
var _className = _ref._className,
style = _objectWithoutProperties(_ref, _excluded2);
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 _className = _ref._className,
style = _objectWithoutProperties(_ref, ['_className']);
var classNames = _className ? ' ' + _className : '';
for (var property in style) {

@@ -203,3 +193,3 @@ var value = style[property];

} else {
console.warn('The object key "' + property + '" 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.');
console.warn("The object key \"".concat(property, "\" 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."));
}

@@ -218,7 +208,5 @@ } else {

};
var processed = arrayReduce(renderer.optimizedPlugins, function (processed, plugin) {
return plugin(processed, renderer);
}, pluginInterface);
var cacheReference = generateDeclarationReference(processed.property, processed.value, processed.pseudo, processed.media, processed.support);

@@ -240,7 +228,6 @@

var cachedClassName = renderer.cache[declarationReference].className;
var cachedClassName = renderer.cache[declarationReference].className; // only append if we got a class cached
// only append if we got a class cached
if (cachedClassName) {
classNames += ' ' + cachedClassName;
classNames += " ".concat(cachedClassName);
}

@@ -259,3 +246,2 @@ }

};
return;

@@ -265,6 +251,4 @@ }

var className = renderer.selectorPrefix + renderer.generateClassName(property, value, pseudo, media, support);
var declaration = cssifyDeclaration(property, value);
var selector = generateCSSSelector(className, pseudo, config.specificityPrefix, renderer.propertyPriority[property]);
var change = {

@@ -279,4 +263,4 @@ type: RULE_TYPE,

};
renderer.cache[reference] = change;
renderer.cache[reference] = change;
renderer._emitChange(change);

@@ -292,21 +276,18 @@ },

}
};
}; // initial setup
// initial setup
renderer.keyframePrefixes.push('');
renderer.optimizedPlugins = arrayReduce(renderer.plugins, function (plugins, plugin) {
if (plugin.optimized) {
plugins.push(plugin.optimized);
}
if (config.optimizeCaching) {
renderer.optimizedPlugins = renderer.plugins.filter(function (plugin) {
return plugin.optimized;
}).map(function (plugin) {
return plugin.optimized;
return plugins;
}, []); // only enable the cache map if we have optimized plugins
if (renderer.optimizedPlugins.length > 0) {
renderer.cacheMap = {};
renderer.unoptimizedPlugins = arrayFilter(renderer.plugins, function (plugin) {
return !plugin.optimized;
});
// only enable the cache map if we have optimized plugins
if (renderer.optimizedPlugins.length > 0) {
renderer.cacheMap = {};
renderer.unoptimizedPlugins = renderer.plugins.filter(function (plugin) {
return !plugin.optimized;
});
}
}

@@ -313,0 +294,0 @@

@@ -1,5 +0,4 @@

import cssifyObject from 'css-in-js-utils/lib/cssifyObject';
import { cssifyObject } from 'css-in-js-utils';
export default function cssifyFontFace(fontFace) {
return '@font-face{' + cssifyObject(fontFace) + '}';
return "@font-face{".concat(cssifyObject(fontFace), "}");
}

@@ -1,14 +0,10 @@

import arrayReduce from 'fast-loops/lib/arrayReduce';
import { arrayReduce } from 'fast-loops';
import cssifyKeyframeRule from './cssifyKeyframeRule';
export default function cssifyKeyframe(frames, animationName) {
var prefixes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [''];
var prerendered = arguments[3];
var prerendered = arguments.length > 3 ? arguments[3] : undefined;
var keyframe = prerendered || cssifyKeyframeRule(frames);
return arrayReduce(prefixes, function (cssKeyframe, prefix) {
return cssKeyframe + '@' + prefix + 'keyframes ' + animationName + '{' + keyframe + '}';
return "".concat(cssKeyframe, "@").concat(prefix, "keyframes ").concat(animationName, "{").concat(keyframe, "}");
}, '');
}

@@ -1,8 +0,7 @@

import objectReduce from 'fast-loops/lib/objectReduce';
import cssifyObject from 'css-in-js-utils/lib/cssifyObject';
import { objectReduce } from 'fast-loops';
import { cssifyObject } from 'css-in-js-utils';
export default function cssifyKeyframeRule(frames) {
return objectReduce(frames, function (css, frame, percentage) {
return '' + css + percentage + '{' + cssifyObject(frame) + '}';
return "".concat(css).concat(percentage, "{").concat(cssifyObject(frame), "}");
}, '');
}

@@ -1,6 +0,4 @@

import cssifyObject from 'css-in-js-utils/lib/cssifyObject';
import { cssifyObject } from 'css-in-js-utils';
import { processStyleWithPlugins, STATIC_TYPE } from 'fela-utils';
import minifyCSSString from './minifyCSSString';
export default function cssifyStaticStyle(staticStyle, renderer) {

@@ -12,4 +10,3 @@ if (typeof staticStyle === 'string') {

var processedStaticStyle = processStyleWithPlugins(renderer, staticStyle, STATIC_TYPE);
return cssifyObject(processedStaticStyle);
}

@@ -1,5 +0,4 @@

import arrayReduce from 'fast-loops/lib/arrayReduce';
import { arrayReduce } from 'fast-loops';
export default function enhance() {
for (var _len = arguments.length, enhancers = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, enhancers = new Array(_len), _key = 0; _key < _len; _key++) {
enhancers[_key] = arguments[_key];

@@ -6,0 +5,0 @@ }

@@ -9,6 +9,6 @@ var chars = 'abcdefghijklmnopqrstuvwxyz';

return chars[id - 1] + className;
}
} // Bitwise floor as safari performs much faster
// https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
// Bitwise floor as safari performs much faster
// https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
return generateUniqueClassName(id / charLength | 0, chars[id % charLength] + className);

@@ -21,3 +21,2 @@ }

};
var startId = getId();

@@ -24,0 +23,0 @@ var generatedClassName = generateUniqueClassName(startId);

@@ -1,15 +0,11 @@

import arrayReduce from 'fast-loops/lib/arrayReduce';
import { arrayReduce } from 'fast-loops';
import getFontUrl from './getFontUrl';
import getFontFormat from './getFontFormat';
export default function generateFontSource() {
var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var fontLocals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var localSource = arrayReduce(fontLocals, function (src, local, index) {
var prefix = index > 0 ? ',' : '';
var localUrl = getFontUrl(local);
return '' + src + prefix + 'local(' + localUrl + ')';
return "".concat(src).concat(prefix, "local(").concat(localUrl, ")");
}, '');

@@ -20,8 +16,6 @@ var urlSource = arrayReduce(files, function (src, fileSource, index) {

var fileUrl = getFontUrl(fileSource);
return '' + src + prefix + 'url(' + fileUrl + ') format(\'' + fileFormat + '\')';
return "".concat(src).concat(prefix, "url(").concat(fileUrl, ") format('").concat(fileFormat, "')");
}, '');
var delimiter = localSource.length > 0 && urlSource.length > 0 ? ',' : '';
return '' + localSource + delimiter + urlSource;
return "".concat(localSource).concat(delimiter).concat(urlSource);
}
import isBase64 from './isBase64';
var formats = {

@@ -12,3 +11,2 @@ '.woff': 'woff',

};
var base64Formats = {

@@ -28,6 +26,6 @@ 'image/svg+xml': 'svg',

};
export default function getFontFormat(src) {
if (isBase64(src)) {
var mime = '';
for (var i = 5;; i++) {

@@ -45,2 +43,3 @@ // 'data:'.length === 5

var fmt = base64Formats[mime];
if (fmt) {

@@ -50,5 +49,6 @@ return fmt;

console.warn('A invalid base64 font was used. Please use one of the following mime type: ' + Object.keys(base64Formats).join(', ') + '.');
console.warn("A invalid base64 font was used. Please use one of the following mime type: ".concat(Object.keys(base64Formats).join(', '), "."));
} else {
var extension = '';
for (var _i = src.length - 1;; _i--) {

@@ -60,9 +60,7 @@ var _c = src.charAt(_i);

// of the string
var strippedSrc = src.slice(_i, src.length);
// removes all query string that are usually attached to the
var strippedSrc = src.slice(_i, src.length); // removes all query string that are usually attached to the
// font face strings e.g ./font-location/font.woff2?some-query
// Reference: https://github.com/robinweser/fela/issues/642
extension = strippedSrc.includes('?') ? strippedSrc.split('?', 1)[0] : strippedSrc;
break;

@@ -73,2 +71,3 @@ }

var _fmt = formats[extension];
if (_fmt) {

@@ -78,5 +77,6 @@ return _fmt;

console.warn('A invalid font-format was used in "' + src + '". Use one of these: ' + Object.keys(formats).join(', ') + '.');
console.warn("A invalid font-format was used in \"".concat(src, "\". Use one of these: ").concat(Object.keys(formats).join(', '), "."));
}
return '';
}
import isBase64 from './isBase64';
export default function getFontUrl(src) {

@@ -8,3 +7,3 @@ if (isBase64(src)) {

return '\'' + src + '\'';
return "'".concat(src, "'");
}
import createRenderer from './createRenderer';
import combineRules from './combineRules';
import enhance from './enhance';
export { createRenderer, combineRules, enhance };
export default function sortMediaQuery() {
var mediaQueryOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return function (a, b) {

@@ -12,2 +11,3 @@ if (mediaQueryOrder.indexOf(b) === -1) {

}
if (mediaQueryOrder.indexOf(a) === -1) {

@@ -14,0 +14,0 @@ return 1;

@@ -6,3 +6,3 @@ export default function toCSSString(value) {

return '"' + value + '"';
return "\"".concat(value, "\"");
}
var PREFIX_SYNTAX = /^[a-z_][a-z0-9-_]*$/gi;
export default function validateSelectorPrefix() {

@@ -7,3 +6,3 @@ var selectorPrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

if (selectorPrefix.length > 0 && selectorPrefix.match(PREFIX_SYNTAX) === null) {
console.error('An invalid selectorPrefix (' + selectorPrefix + ') 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');
console.error("An invalid selectorPrefix (".concat(selectorPrefix, ") 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"));
}

@@ -10,0 +9,0 @@

@@ -1,48 +0,83 @@

declare module "fela" {
import * as CSS from 'csstype';
import { TRuleType, TKeyframeType, TFontType, TStaticType, TClearType } from 'fela-utils';
declare module 'fela' {
import * as CSS from 'csstype'
import {
TRuleType,
TKeyframeType,
TFontType,
TStaticType,
TClearType,
} from 'fela-utils'
export type TRuleProps = {};
export type TRuleProps = {}
export type TRule<T = TRuleProps> = (props: T, renderer: IRenderer) => IStyle
export type TKeyFrame<T = TRuleProps> = (props: T, renderer: IRenderer) => {
from?: IStyle,
to?: IStyle,
export type TKeyFrame<T = TRuleProps> = (
props: T,
renderer: IRenderer
) => {
from?: IStyle
to?: IStyle
[persent: string]: IStyle | undefined;
};
[percent: string]: IStyle | undefined
}
type TRendererCreator = (config?: IConfig) => IRenderer;
type TRenderType = 'RULE' | 'KEYFRAME' | 'FONT' | 'STATIC';
type TRendererCreator = (config?: IConfig) => IRenderer
type TRenderType = 'RULE' | 'KEYFRAME' | 'FONT' | 'STATIC'
type TPlugin<T = Record<string, unknown>> = {
(
style: IStyle,
type: TRenderType,
renderer: IRenderer,
props: T,
): IStyle;
};
(style: IStyle, type: TRenderType, renderer: IRenderer, props: T): IStyle
}
type TEnhancer = (renderer: IRenderer) => IRenderer; //http://fela.js.org/docs/advanced/Enhancers.html
type TEnhancer = (renderer: IRenderer) => IRenderer //http://fela.js.org/docs/advanced/Enhancers.html
type TSubscribeMessageType = TRuleType | TKeyframeType | TFontType | TStaticType | TClearType
type TSubscribeMessageType =
| TRuleType
| TKeyframeType
| TFontType
| TStaticType
| TClearType
interface ISubscribeMessage {
type: TSubscribeMessageType;
type: TSubscribeMessageType
}
interface ISubscribeRuleOrStaticObjectMessage extends ISubscribeMessage { static?: boolean; declaration: string; selector: string; media: string; }
interface ISubscribeKeyframesMessage extends ISubscribeMessage { name: string; keyframe: string; }
interface ISubscribeFontFaceMessage extends ISubscribeMessage { fontFamily: string; fontFace: string; }
interface ISubscribeStaticStringMessage extends ISubscribeMessage { css: string; }
interface ISubscribeClearMessage extends ISubscribeMessage { }
interface ISubscribeRuleOrStaticObjectMessage extends ISubscribeMessage {
static?: boolean
declaration: string
selector: string
media: string
}
interface ISubscribeKeyframesMessage extends ISubscribeMessage {
name: string
keyframe: string
}
interface ISubscribeFontFaceMessage extends ISubscribeMessage {
fontFamily: string
fontFace: string
}
interface ISubscribeStaticStringMessage extends ISubscribeMessage {
css: string
}
interface ISubscribeClearMessage extends ISubscribeMessage {}
interface IRenderer {
renderRule<T = TRuleProps>(rule: TRule<T>, props: T): string
renderKeyframe<T = TRuleProps>(keyFrame: TKeyFrame<T>, props: T): string;
renderFont<T = TRuleProps>(family: string, files: Array<string>, props: T): void;
renderStatic(style: string, selector?: string): void;
renderStatic(style: IStyle, selector: string): void;
renderToString(): string;
subscribe(event: (msg: ISubscribeRuleOrStaticObjectMessage | ISubscribeKeyframesMessage | ISubscribeFontFaceMessage | ISubscribeStaticStringMessage | ISubscribeClearMessage) => void): { unsubscribe: () => void; }
clear(): void;
renderKeyframe<T = TRuleProps>(keyFrame: TKeyFrame<T>, props: T): string
renderFont<T = TRuleProps>(
family: string,
files: Array<string>,
props: T
): void
renderStatic(style: string, selector?: string): void
renderStatic(style: IStyle, selector: string): void
renderToString(): string
subscribe(
event: (
msg:
| ISubscribeRuleOrStaticObjectMessage
| ISubscribeKeyframesMessage
| ISubscribeFontFaceMessage
| ISubscribeStaticStringMessage
| ISubscribeClearMessage
) => void
): { unsubscribe: () => void }
clear(): void
}

@@ -52,35 +87,34 @@

interface IConfig {
plugins?: Array<TPlugin>;
keyframePrefixes?: Array<string>;
enhancers?: Array<TEnhancer>;
mediaQueryOrder?: Array<string>;
selectorPrefix?: string;
specificityPrefix?: string;
filterClassName?: (className: string) => boolean;
devMode?: boolean;
plugins?: Array<TPlugin>
keyframePrefixes?: Array<string>
enhancers?: Array<TEnhancer>
mediaQueryOrder?: Array<string>
selectorPrefix?: string
specificityPrefix?: string
filterClassName?: (className: string) => boolean
devMode?: boolean
}
type CSSObject = CSSProperties & CSSPseudos;
type CSSCustom = { [prop: string]: CSSCustomPrimitive | IStyle };
type CSSCustomPrimitive = IStylePrimitiveExtension[keyof IStylePrimitiveExtension];
type CSSObject = CSSProperties & CSSPseudos
type CSSProperties = CSS.Properties<number | string>;
type CSSPropertiesFallback = CSS.PropertiesFallback<number | string>;
type CSSCustom = { [prop: string]: CSSCustomPrimitive | IStyle }
type CSSCustomPrimitive = IStylePrimitiveExtension[keyof IStylePrimitiveExtension]
type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject; };
type CSSProperties = CSS.Properties<number | string>
type CSSPropertiesFallback = CSS.PropertiesFallback<number | string>
interface IStyleExtension { __brand?: never }
type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject }
interface IStyleExtension {
__brand?: never
}
interface IStylePrimitiveExtension {
_string: string;
_number: number;
_string: string
_number: number
}
export type IStyle =
| CSSObject
| CSSCustom
| IStyleExtension;
function createRenderer(config?: IConfig): IRenderer;
export type IStyle = CSSObject | CSSCustom | IStyleExtension
function createRenderer(config?: IConfig): IRenderer
function combineRules<A, B>(a: TRule<A>, b: TRule<B>): TRule<A & B>

@@ -90,35 +124,57 @@ function combineRules<A, B, C>(

b: TRule<B>,
c: TRule<C>,
c: TRule<C>
): TRule<A & B & C>
function combineRules(...rules: Array<TRule>): TRule
function enhance(...enhancers: Array<TEnhancer>): (rendererCreator: TRendererCreator) => TRendererCreator;
function enhance(
...enhancers: Array<TEnhancer>
): (rendererCreator: TRendererCreator) => TRendererCreator
}
declare module "fela-dom" {
import { IRenderer, TRenderType } from 'fela';
declare module 'fela-dom' {
import { IRenderer, TRenderType } from 'fela'
function render(renderer: IRenderer): void;
function rehydrate(renderer: IRenderer): void;
function renderToMarkup(renderer: IRenderer): string;
function renderToSheetList(renderer: IRenderer): {
css: string,
type: TRenderType,
media?: string,
support?: boolean,
}[];
function render(renderer: IRenderer): void
function rehydrate(renderer: IRenderer): void
function renderToMarkup(renderer: IRenderer): string
function renderToSheetList(
renderer: IRenderer
): {
css: string
type: TRenderType
media?: string
support?: boolean
}[]
}
declare module "fela-tools" {
import { TRule, TRuleProps, IStyle, IRenderer } from "fela";
declare module 'fela-tools' {
import { TRule, TRuleProps, IStyle, IRenderer } from 'fela'
export type TMultiRuleObject<Props = TRuleProps, Styles = {}> = {[key in keyof Styles]: TRule<Props> | IStyle}
export type TMultiRuleFunction<Props = TRuleProps, Styles = {}> = (props: Props, renderer: IRenderer) => TMultiRuleObject<Props, Styles>
export type TMultiRule<Props = TRuleProps, Styles = {}> = TMultiRuleObject<Props, Styles> | TMultiRuleFunction<Props, Styles>
export type TMultiRuleObject<Props = TRuleProps, Styles = {}> = {
[key in keyof Styles]: TRule<Props> | IStyle
}
export type TMultiRuleFunction<Props = TRuleProps, Styles = {}> = (
props: Props,
renderer: IRenderer
) => TMultiRuleObject<Props, Styles>
export type TMultiRule<Props = TRuleProps, Styles = {}> =
| TMultiRuleObject<Props, Styles>
| TMultiRuleFunction<Props, Styles>
export type TPartialMultiRuleObject<Props = TRuleProps, Styles = {}> = Partial<TMultiRuleObject<Props, Styles>>
export type TPartialMultiRuleFunction<Props = TRuleProps, Styles = {}> = (props: Props, renderer: IRenderer) => TPartialMultiRuleObject<Props, Styles>
export type TPartialMultiRule<Props = TRuleProps, Styles = {}> = TPartialMultiRuleObject<Props, Styles> | TPartialMultiRuleFunction<Props, Styles>
export type TPartialMultiRuleObject<
Props = TRuleProps,
Styles = {}
> = Partial<TMultiRuleObject<Props, Styles>>
export type TPartialMultiRuleFunction<Props = TRuleProps, Styles = {}> = (
props: Props,
renderer: IRenderer
) => TPartialMultiRuleObject<Props, Styles>
export type TPartialMultiRule<Props = TRuleProps, Styles = {}> =
| TPartialMultiRuleObject<Props, Styles>
| TPartialMultiRuleFunction<Props, Styles>
export type TNormalizedMultiRule<Props = TRuleProps, Styles = {}> = (props: Props, renderer: IRenderer) => {[key in keyof Styles]: TRule<Props>}
export type TNormalizedMultiRule<Props = TRuleProps, Styles = {}> = (
props: Props,
renderer: IRenderer
) => { [key in keyof Styles]: TRule<Props> }

@@ -132,3 +188,3 @@ function combineMultiRules<A, SA, B, SB>(

b: TMultiRule<B, SB>,
c: TMultiRule<C, SC>,
c: TMultiRule<C, SC>
): TNormalizedMultiRule<A & B & C, SA & SB & SC>

@@ -140,12 +196,10 @@ function combineMultiRules(...rules: Array<TMultiRule>): TNormalizedMultiRule

mapper: ((value: string) => object) | string
): object;
): object
function renderToElement(
renderer: IRenderer,
mountNode: { textContent: string },
): (() => void);
mountNode: { textContent: string }
): () => void
function renderToString(
renderer: IRenderer,
): string;
function renderToString(renderer: IRenderer): string
}

@@ -156,74 +210,76 @@

*/
declare module "fela-beautifier" {
import { TEnhancer } from "fela";
declare module 'fela-beautifier' {
import { TEnhancer } from 'fela'
export default function(options?: object): TEnhancer;
export default function (options?: object): TEnhancer
}
declare module "fela-identifier" {
import { TRule, TEnhancer } from "fela";
declare module 'fela-identifier' {
import { TRule, TEnhancer } from 'fela'
interface Configs {
prefix?: string;
generator?: (name?: string, index?: number) => string;
prefix?: string
generator?: (name?: string, index?: number) => string
}
type Identifier = (name?: string) => TRule & {
className: string;
toString(): string;
};
type Identifier = (
name?: string
) => TRule & {
className: string
toString(): string
}
export default function(configs?: Configs): TEnhancer & Identifier;
export default function (configs?: Configs): TEnhancer & Identifier
}
declare module "fela-layout-debugger" {
import { TEnhancer } from "fela";
declare module 'fela-layout-debugger' {
import { TEnhancer } from 'fela'
interface DebuggerOptions {
mode?: "outline" | "backgroundColor";
thickness?: number;
mode?: 'outline' | 'backgroundColor'
thickness?: number
}
export default function(options?: DebuggerOptions): TEnhancer;
export default function (options?: DebuggerOptions): TEnhancer
}
declare module "fela-logger" {
import { TEnhancer } from "fela";
declare module 'fela-logger' {
import { TEnhancer } from 'fela'
interface LoggerOptions {
logCSS?: boolean;
formatCSS?: boolean;
logCSS?: boolean
formatCSS?: boolean
}
export default function(options?: LoggerOptions): TEnhancer;
export default function (options?: LoggerOptions): TEnhancer
}
declare module "fela-monolithic" {
import { TEnhancer } from "fela";
declare module 'fela-monolithic' {
import { TEnhancer } from 'fela'
interface MonolithicOptions {
prettySelectors?: boolean;
prettySelectors?: boolean
}
export default function(options?: MonolithicOptions): TEnhancer;
export default function (options?: MonolithicOptions): TEnhancer
}
declare module "fela-perf" {
import { TEnhancer } from "fela";
declare module 'fela-perf' {
import { TEnhancer } from 'fela'
export default function(): TEnhancer;
export default function (): TEnhancer
}
declare module "fela-statistics" {
import { TEnhancer } from "fela";
declare module 'fela-statistics' {
import { TEnhancer } from 'fela'
export default function(): TEnhancer;
export default function (): TEnhancer
}
declare module "fela-utils" {
export type TRuleType = "RULE"
export type TKeyframeType = "KEYFRAME"
export type TFontType = "FONT"
export type TStaticType = "STATIC"
export type TClearType = "CLEAR"
declare module 'fela-utils' {
export type TRuleType = 'RULE'
export type TKeyframeType = 'KEYFRAME'
export type TFontType = 'FONT'
export type TStaticType = 'STATIC'
export type TClearType = 'CLEAR'

@@ -237,6 +293,6 @@ export const RULE_TYPE: TRuleType

declare module "fela-sort-media-query-mobile-first" {
import { TEnhancer } from "fela";
declare module 'fela-sort-media-query-mobile-first' {
import { TEnhancer } from 'fela'
export default function(): TEnhancer;
export default function (): TEnhancer
}

@@ -247,142 +303,157 @@

*/
declare module "fela-plugin-bidi" {
import { TPlugin } from "fela";
declare module 'fela-plugin-bidi' {
import { TPlugin } from 'fela'
export default function(flowDirection: 'ltr' | 'rtl'): TPlugin;
export default function (flowDirection: 'ltr' | 'rtl'): TPlugin
}
declare module "fela-plugin-custom-property" {
import { TPlugin } from "fela";
declare module 'fela-plugin-custom-property' {
import { TPlugin } from 'fela'
interface CustomProperties {
[property: string]: (value: any) => any,
[property: string]: (value: any) => any
}
export default function(properties: CustomProperties): TPlugin;
export default function (properties: CustomProperties): TPlugin
}
declare module "fela-plugin-embedded" {
import { TPlugin } from "fela";
declare module 'fela-plugin-embedded' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-extend" {
import { TPlugin } from "fela";
declare module 'fela-plugin-extend' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-friendly-pseudo-class" {
import { TPlugin } from "fela";
declare module 'fela-plugin-friendly-pseudo-class' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-important" {
import { TPlugin } from "fela";
declare module 'fela-plugin-important' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-isolation" {
import { TPlugin } from "fela";
declare module 'fela-plugin-isolation' {
import { TPlugin } from 'fela'
interface IsolationOptions {
exclude?: string[];
exclude?: string[]
}
export default function(options?: IsolationOptions): TPlugin;
export default function (options?: IsolationOptions): TPlugin
}
declare module "fela-plugin-logger" {
import { TPlugin } from "fela";
declare module 'fela-plugin-logger' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-named-keys" {
import { TPlugin } from "fela";
declare module 'fela-plugin-named-keys' {
import { TPlugin } from 'fela'
interface MediaQueryMap {
[key: string]: string;
[key: string]: string
}
export default function(mediaQueryMap: MediaQueryMap): TPlugin;
export default function (mediaQueryMap: MediaQueryMap): TPlugin
}
declare module "fela-plugin-native-media-query" {
import { TPlugin } from "fela";
declare module 'fela-plugin-native-media-query' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-placeholder-prefixer" {
import { TPlugin } from "fela";
declare module 'fela-plugin-placeholder-prefixer' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-fullscreen-prefixer" {
import { TPlugin } from "fela";
declare module 'fela-plugin-fullscreen-prefixer' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-pseudo-prefixer" {
import { TPlugin } from "fela";
declare module 'fela-plugin-pseudo-prefixer' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-theme-value" {
import { TPlugin } from "fela";
declare module 'fela-plugin-theme-value' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-prefixer" {
import { TPlugin } from "fela";
declare module 'fela-plugin-prefixer' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-rtl" {
import { TPlugin } from "fela";
declare module 'fela-plugin-rtl' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-simulate" {
import { TPlugin } from "fela";
declare module 'fela-plugin-simulate' {
import { TPlugin } from 'fela'
export default function(): TPlugin;
export default function (): TPlugin
}
declare module "fela-plugin-unit" {
import { TPlugin } from "fela";
declare module 'fela-plugin-unit' {
import { TPlugin } from 'fela'
export type Unit = "ch" | "em" | "ex" | "rem" | "vh" | "vw" | "vmin" | "vmax" | "px" | "cm" | "mm" | "in" | "pc" | "pt" | "mozmm";
export type Unit =
| 'ch'
| 'em'
| 'ex'
| 'rem'
| 'vh'
| 'vw'
| 'vmin'
| 'vmax'
| 'px'
| 'cm'
| 'mm'
| 'in'
| 'pc'
| 'pt'
| 'mozmm'
export interface UnitPerProperty {
[key: string]: string;
[key: string]: string
}
export default function(
export default function (
unit?: Unit,
unitPerProperty?: UnitPerProperty,
isUnitlessProperty?: (property: string) => boolean,
): TPlugin;
isUnitlessProperty?: (property: string) => boolean
): TPlugin
}
declare module "fela-plugin-validator" {
import { TPlugin } from "fela";
declare module 'fela-plugin-validator' {
import { TPlugin } from 'fela'
interface Configs {
logInvalid?: boolean;
deleteInvalid?: boolean;
useCSSLint?: boolean | object;
logInvalid?: boolean
deleteInvalid?: boolean
useCSSLint?: boolean | object
}
export default function(configs?: Configs): TPlugin;
export default function (configs?: Configs): TPlugin
}

@@ -393,5 +464,5 @@

*/
declare module "fela-preset-web" {
import { TPlugin } from "fela";
import { Unit, UnitPerProperty } from "fela-plugin-unit";
declare module 'fela-preset-web' {
import { TPlugin } from 'fela'
import { Unit, UnitPerProperty } from 'fela-plugin-unit'

@@ -404,13 +475,13 @@ type UnitConfig1 = [Unit]

export function createWebPreset({ unit }: { unit?: UnitConfig }): TPlugin[];
export function createWebPreset({ unit }: { unit?: UnitConfig }): TPlugin[]
const presets: TPlugin[];
export default presets;
const presets: TPlugin[]
export default presets
}
declare module "fela-preset-dev" {
import { TPlugin } from "fela";
declare module 'fela-preset-dev' {
import { TPlugin } from 'fela'
const presets: TPlugin[];
export default presets;
const presets: TPlugin[]
export default presets
}

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

'use strict';
"use strict";

@@ -6,19 +6,23 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = combineRules;
exports["default"] = combineRules;
var _assignStyle = require('css-in-js-utils/lib/assignStyle');
var _cssInJsUtils = require("css-in-js-utils");
var _assignStyle2 = _interopRequireDefault(_assignStyle);
var _fastLoops = require("fast-loops");
var _arrayReduce = require('fast-loops/lib/arrayReduce');
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
function _nonIterableSpread() { 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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function resolveRule(rule, props, renderer) {
if (Array.isArray(rule)) {
return resolveRule(combineRules.apply(undefined, _toConsumableArray(rule)), props, renderer);
return resolveRule(combineRules.apply(void 0, _toConsumableArray(rule)), props, renderer);
}

@@ -34,3 +38,3 @@

function combineRules() {
for (var _len = arguments.length, rules = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, rules = new Array(_len), _key = 0; _key < _len; _key++) {
rules[_key] = arguments[_key];

@@ -40,6 +44,5 @@ }

return function (props, renderer) {
return (0, _arrayReduce2.default)(rules, function (style, rule) {
var resolvedRule = resolveRule(rule, props, renderer);
return (0, _fastLoops.arrayReduce)(rules, function (style, rule) {
var resolvedRule = resolveRule(rule, props, renderer); // special combination of our special _className key
// special combination of our special _className key
if (resolvedRule && style._className) {

@@ -49,5 +52,5 @@ resolvedRule._className = style._className + (resolvedRule._className ? ' ' + resolvedRule._className : '');

return (0, _assignStyle2.default)(style, resolvedRule);
return (0, _cssInJsUtils.assignStyle)(style, resolvedRule);
}, {});
};
}

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

'use strict';
"use strict";

@@ -6,84 +6,55 @@ Object.defineProperty(exports, "__esModule", {

});
exports["default"] = createRenderer;
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; };
var _cssInJsUtils = require("css-in-js-utils");
exports.default = createRenderer;
var _fastLoops = require("fast-loops");
var _cssifyDeclaration = require('css-in-js-utils/lib/cssifyDeclaration');
var _isobject = _interopRequireDefault(require("isobject"));
var _cssifyDeclaration2 = _interopRequireDefault(_cssifyDeclaration);
var _felaUtils = require("fela-utils");
var _arrayEach = require('fast-loops/lib/arrayEach');
var _cssifyFontFace = _interopRequireDefault(require("./cssifyFontFace"));
var _arrayEach2 = _interopRequireDefault(_arrayEach);
var _cssifyKeyframe = _interopRequireDefault(require("./cssifyKeyframe"));
var _arrayReduce = require('fast-loops/lib/arrayReduce');
var _cssifyKeyframeRule = _interopRequireDefault(require("./cssifyKeyframeRule"));
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
var _cssifyStaticStyle = _interopRequireDefault(require("./cssifyStaticStyle"));
var _isobject = require('isobject');
var _generateAnimationName2 = _interopRequireDefault(require("./generateAnimationName"));
var _isobject2 = _interopRequireDefault(_isobject);
var _generateClassName2 = _interopRequireDefault(require("./generateClassName"));
var _felaUtils = require('fela-utils');
var _generateFontSource = _interopRequireDefault(require("./generateFontSource"));
var _cssifyFontFace = require('./cssifyFontFace');
var _generateStaticReference = _interopRequireDefault(require("./generateStaticReference"));
var _cssifyFontFace2 = _interopRequireDefault(_cssifyFontFace);
var _getFontLocals = _interopRequireDefault(require("./getFontLocals"));
var _cssifyKeyframe = require('./cssifyKeyframe');
var _isSafeClassName = _interopRequireDefault(require("./isSafeClassName"));
var _cssifyKeyframe2 = _interopRequireDefault(_cssifyKeyframe);
var _toCSSString = _interopRequireDefault(require("./toCSSString"));
var _cssifyKeyframeRule = require('./cssifyKeyframeRule');
var _validateSelectorPrefix = _interopRequireDefault(require("./validateSelectorPrefix"));
var _cssifyKeyframeRule2 = _interopRequireDefault(_cssifyKeyframeRule);
var _sortMediaQuery = _interopRequireDefault(require("./sortMediaQuery"));
var _cssifyStaticStyle = require('./cssifyStaticStyle');
var _excluded = ["localAlias"],
_excluded2 = ["_className"];
var _cssifyStaticStyle2 = _interopRequireDefault(_cssifyStaticStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _generateAnimationName2 = require('./generateAnimationName');
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; }
var _generateAnimationName3 = _interopRequireDefault(_generateAnimationName2);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _generateClassName2 = require('./generateClassName');
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var _generateClassName3 = _interopRequireDefault(_generateClassName2);
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
var _generateFontSource = require('./generateFontSource');
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
var _generateFontSource2 = _interopRequireDefault(_generateFontSource);
var _generateStaticReference = require('./generateStaticReference');
var _generateStaticReference2 = _interopRequireDefault(_generateStaticReference);
var _getFontLocals = require('./getFontLocals');
var _getFontLocals2 = _interopRequireDefault(_getFontLocals);
var _isSafeClassName = require('./isSafeClassName');
var _isSafeClassName2 = _interopRequireDefault(_isSafeClassName);
var _toCSSString = require('./toCSSString');
var _toCSSString2 = _interopRequireDefault(_toCSSString);
var _validateSelectorPrefix = require('./validateSelectorPrefix');
var _validateSelectorPrefix2 = _interopRequireDefault(_validateSelectorPrefix);
var _sortMediaQuery = require('./sortMediaQuery');
var _sortMediaQuery2 = _interopRequireDefault(_sortMediaQuery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function createRenderer() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var renderer = {

@@ -93,3 +64,3 @@ listeners: [],

plugins: config.plugins || [],
sortMediaQuery: config.sortMediaQuery || (0, _sortMediaQuery2.default)(config.mediaQueryOrder),
sortMediaQuery: config.sortMediaQuery || (0, _sortMediaQuery["default"])(config.mediaQueryOrder),
supportQueryOrder: config.supportQueryOrder || [],

@@ -99,10 +70,8 @@ styleNodeAttributes: config.styleNodeAttributes || {},

ruleOrder: [/^:link/, /^:visited/, /^:hover/, /^:focus-within/, /^:focus/, /^:active/],
selectorPrefix: (0, _validateSelectorPrefix2.default)(config.selectorPrefix),
selectorPrefix: (0, _validateSelectorPrefix["default"])(config.selectorPrefix),
specificityPrefix: config.specificityPrefix || '',
filterClassName: config.filterClassName || _isSafeClassName2.default,
filterClassName: config.filterClassName || _isSafeClassName["default"],
devMode: config.devMode || false,
uniqueRuleIdentifier: 0,
uniqueKeyframeIdentifier: 0,
nodes: {},

@@ -113,3 +82,2 @@ scoreIndex: {},

cache: {},
getNextRuleIdentifier: function getNextRuleIdentifier() {

@@ -123,3 +91,2 @@ return ++renderer.uniqueRuleIdentifier;

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return renderer._renderStyle(rule(props, renderer), props);

@@ -129,14 +96,10 @@ },

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var resolvedKeyframe = keyframe(props, renderer);
var processedKeyframe = (0, _felaUtils.processStyleWithPlugins)(renderer, resolvedKeyframe, _felaUtils.KEYFRAME_TYPE, props);
var keyframeReference = (0, _cssifyKeyframeRule["default"])(processedKeyframe);
var keyframeReference = (0, _cssifyKeyframeRule2.default)(processedKeyframe);
if (!renderer.cache.hasOwnProperty(keyframeReference)) {
// use another unique identifier to ensure minimal css markup
var animationName = renderer.selectorPrefix + renderer.generateAnimationName(props);
var cssKeyframe = (0, _cssifyKeyframe2.default)(processedKeyframe, animationName, renderer.keyframePrefixes, keyframeReference);
var cssKeyframe = (0, _cssifyKeyframe["default"])(processedKeyframe, animationName, renderer.keyframePrefixes, keyframeReference);
var change = {

@@ -147,4 +110,4 @@ type: _felaUtils.KEYFRAME_TYPE,

};
renderer.cache[keyframeReference] = change;
renderer.cache[keyframeReference] = change;
renderer._emitChange(change);

@@ -156,3 +119,3 @@ }

generateAnimationName: function generateAnimationName(_props) {
return (0, _generateAnimationName3.default)(renderer.getNextKeyframeIdentifier());
return (0, _generateAnimationName2["default"])(renderer.getNextKeyframeIdentifier());
},

@@ -163,17 +126,16 @@ renderFont: function renderFont(family, files) {

var localAlias = properties.localAlias,
otherProperties = _objectWithoutProperties(properties, ['localAlias']);
otherProperties = _objectWithoutProperties(properties, _excluded);
var fontReference = family + JSON.stringify(properties);
var fontLocals = (0, _getFontLocals2.default)(localAlias);
var fontLocals = (0, _getFontLocals["default"])(localAlias);
if (!renderer.cache.hasOwnProperty(fontReference)) {
var fontFamily = (0, _toCSSString2.default)(family);
var fontFamily = (0, _toCSSString["default"])(family);
var fontFace = _extends({}, otherProperties, {
src: (0, _generateFontSource2.default)(files, fontLocals),
var fontFace = _objectSpread(_objectSpread({}, otherProperties), {}, {
src: (0, _generateFontSource["default"])(files, fontLocals),
fontFamily: fontFamily
});
var cssFontFace = (0, _cssifyFontFace2.default)(fontFace);
var cssFontFace = (0, _cssifyFontFace["default"])(fontFace);
var change = {

@@ -184,4 +146,4 @@ type: _felaUtils.FONT_TYPE,

};
renderer.cache[fontReference] = change;
renderer.cache[fontReference] = change;
renderer._emitChange(change);

@@ -193,7 +155,6 @@ }

renderStatic: function renderStatic(staticStyle, selector) {
var staticReference = (0, _generateStaticReference2.default)(staticStyle, selector);
var staticReference = (0, _generateStaticReference["default"])(staticStyle, selector);
if (!renderer.cache.hasOwnProperty(staticReference)) {
var cssDeclarations = (0, _cssifyStaticStyle2.default)(staticStyle, renderer);
var cssDeclarations = (0, _cssifyStaticStyle["default"])(staticStyle, renderer);
var change = {

@@ -204,4 +165,4 @@ type: _felaUtils.STATIC_TYPE,

};
renderer.cache[staticReference] = change;
renderer.cache[staticReference] = change;
renderer._emitChange(change);

@@ -212,3 +173,2 @@ }

renderer.listeners.push(callback);
return {

@@ -232,21 +192,18 @@ unsubscribe: function unsubscribe() {

var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var processedStyle = (0, _felaUtils.processStyleWithPlugins)(renderer, style, _felaUtils.RULE_TYPE, props, renderer.unoptimizedPlugins || renderer.plugins);
return renderer._renderStyleToClassNames(processedStyle).slice(1);
},
_renderStyleToClassNames: function _renderStyleToClassNames(_ref) {
var _className = _ref._className,
style = _objectWithoutProperties(_ref, _excluded2);
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 _className = _ref._className,
style = _objectWithoutProperties(_ref, ['_className']);
var classNames = _className ? ' ' + _className : '';
for (var property in style) {
var value = style[property];
if ((0, _isobject2.default)(value)) {
if ((0, _isobject["default"])(value)) {
if ((0, _felaUtils.isNestedSelector)(property)) {

@@ -261,3 +218,3 @@ classNames += renderer._renderStyleToClassNames(value, pseudo + (0, _felaUtils.normalizeNestedProperty)(property), media, support);

} else {
console.warn('The object key "' + property + '" 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.');
console.warn("The object key \"".concat(property, "\" 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."));
}

@@ -276,7 +233,5 @@ } else {

};
var processed = (0, _arrayReduce2.default)(renderer.optimizedPlugins, function (processed, plugin) {
var processed = (0, _fastLoops.arrayReduce)(renderer.optimizedPlugins, function (processed, plugin) {
return plugin(processed, renderer);
}, pluginInterface);
var cacheReference = (0, _felaUtils.generateDeclarationReference)(processed.property, processed.value, processed.pseudo, processed.media, processed.support);

@@ -298,7 +253,6 @@

var cachedClassName = renderer.cache[declarationReference].className;
var cachedClassName = renderer.cache[declarationReference].className; // only append if we got a class cached
// only append if we got a class cached
if (cachedClassName) {
classNames += ' ' + cachedClassName;
classNames += " ".concat(cachedClassName);
}

@@ -317,3 +271,2 @@ }

};
return;

@@ -323,6 +276,4 @@ }

var className = renderer.selectorPrefix + renderer.generateClassName(property, value, pseudo, media, support);
var declaration = (0, _cssifyDeclaration2.default)(property, value);
var declaration = (0, _cssInJsUtils.cssifyDeclaration)(property, value);
var selector = (0, _felaUtils.generateCSSSelector)(className, pseudo, config.specificityPrefix, renderer.propertyPriority[property]);
var change = {

@@ -337,37 +288,34 @@ type: _felaUtils.RULE_TYPE,

};
renderer.cache[reference] = change;
renderer.cache[reference] = change;
renderer._emitChange(change);
},
generateClassName: function generateClassName(property, value, pseudo, media, support) {
return (0, _generateClassName3.default)(renderer.getNextRuleIdentifier, renderer.filterClassName);
return (0, _generateClassName2["default"])(renderer.getNextRuleIdentifier, renderer.filterClassName);
},
_emitChange: function _emitChange(change) {
(0, _arrayEach2.default)(renderer.listeners, function (listener) {
(0, _fastLoops.arrayEach)(renderer.listeners, function (listener) {
return listener(change);
});
}
};
}; // initial setup
// initial setup
renderer.keyframePrefixes.push('');
renderer.optimizedPlugins = (0, _fastLoops.arrayReduce)(renderer.plugins, function (plugins, plugin) {
if (plugin.optimized) {
plugins.push(plugin.optimized);
}
if (config.optimizeCaching) {
renderer.optimizedPlugins = renderer.plugins.filter(function (plugin) {
return plugin.optimized;
}).map(function (plugin) {
return plugin.optimized;
return plugins;
}, []); // only enable the cache map if we have optimized plugins
if (renderer.optimizedPlugins.length > 0) {
renderer.cacheMap = {};
renderer.unoptimizedPlugins = (0, _fastLoops.arrayFilter)(renderer.plugins, function (plugin) {
return !plugin.optimized;
});
// only enable the cache map if we have optimized plugins
if (renderer.optimizedPlugins.length > 0) {
renderer.cacheMap = {};
renderer.unoptimizedPlugins = renderer.plugins.filter(function (plugin) {
return !plugin.optimized;
});
}
}
if (config.enhancers) {
(0, _arrayEach2.default)(config.enhancers, function (enhancer) {
(0, _fastLoops.arrayEach)(config.enhancers, function (enhancer) {
renderer = enhancer(renderer);

@@ -374,0 +322,0 @@ });

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

'use strict';
"use strict";

@@ -6,12 +6,8 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = cssifyFontFace;
exports["default"] = cssifyFontFace;
var _cssifyObject = require('css-in-js-utils/lib/cssifyObject');
var _cssInJsUtils = require("css-in-js-utils");
var _cssifyObject2 = _interopRequireDefault(_cssifyObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cssifyFontFace(fontFace) {
return '@font-face{' + (0, _cssifyObject2.default)(fontFace) + '}';
return "@font-face{".concat((0, _cssInJsUtils.cssifyObject)(fontFace), "}");
}

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

'use strict';
"use strict";

@@ -6,23 +6,17 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = cssifyKeyframe;
exports["default"] = cssifyKeyframe;
var _arrayReduce = require('fast-loops/lib/arrayReduce');
var _fastLoops = require("fast-loops");
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
var _cssifyKeyframeRule = _interopRequireDefault(require("./cssifyKeyframeRule"));
var _cssifyKeyframeRule = require('./cssifyKeyframeRule');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _cssifyKeyframeRule2 = _interopRequireDefault(_cssifyKeyframeRule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cssifyKeyframe(frames, animationName) {
var prefixes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [''];
var prerendered = arguments[3];
var keyframe = prerendered || (0, _cssifyKeyframeRule2.default)(frames);
return (0, _arrayReduce2.default)(prefixes, function (cssKeyframe, prefix) {
return cssKeyframe + '@' + prefix + 'keyframes ' + animationName + '{' + keyframe + '}';
var prerendered = arguments.length > 3 ? arguments[3] : undefined;
var keyframe = prerendered || (0, _cssifyKeyframeRule["default"])(frames);
return (0, _fastLoops.arrayReduce)(prefixes, function (cssKeyframe, prefix) {
return "".concat(cssKeyframe, "@").concat(prefix, "keyframes ").concat(animationName, "{").concat(keyframe, "}");
}, '');
}

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

'use strict';
"use strict";

@@ -6,18 +6,12 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = cssifyKeyframeRule;
exports["default"] = cssifyKeyframeRule;
var _objectReduce = require('fast-loops/lib/objectReduce');
var _fastLoops = require("fast-loops");
var _objectReduce2 = _interopRequireDefault(_objectReduce);
var _cssInJsUtils = require("css-in-js-utils");
var _cssifyObject = require('css-in-js-utils/lib/cssifyObject');
var _cssifyObject2 = _interopRequireDefault(_cssifyObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cssifyKeyframeRule(frames) {
return (0, _objectReduce2.default)(frames, function (css, frame, percentage) {
return '' + css + percentage + '{' + (0, _cssifyObject2.default)(frame) + '}';
return (0, _fastLoops.objectReduce)(frames, function (css, frame, percentage) {
return "".concat(css).concat(percentage, "{").concat((0, _cssInJsUtils.cssifyObject)(frame), "}");
}, '');
}

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

'use strict';
"use strict";

@@ -6,24 +6,19 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = cssifyStaticStyle;
exports["default"] = cssifyStaticStyle;
var _cssifyObject = require('css-in-js-utils/lib/cssifyObject');
var _cssInJsUtils = require("css-in-js-utils");
var _cssifyObject2 = _interopRequireDefault(_cssifyObject);
var _felaUtils = require("fela-utils");
var _felaUtils = require('fela-utils');
var _minifyCSSString = _interopRequireDefault(require("./minifyCSSString"));
var _minifyCSSString = require('./minifyCSSString');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _minifyCSSString2 = _interopRequireDefault(_minifyCSSString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cssifyStaticStyle(staticStyle, renderer) {
if (typeof staticStyle === 'string') {
return (0, _minifyCSSString2.default)(staticStyle);
return (0, _minifyCSSString["default"])(staticStyle);
}
var processedStaticStyle = (0, _felaUtils.processStyleWithPlugins)(renderer, staticStyle, _felaUtils.STATIC_TYPE);
return (0, _cssifyObject2.default)(processedStaticStyle);
return (0, _cssInJsUtils.cssifyObject)(processedStaticStyle);
}

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

'use strict';
"use strict";

@@ -6,12 +6,8 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = enhance;
exports["default"] = enhance;
var _arrayReduce = require('fast-loops/lib/arrayReduce');
var _fastLoops = require("fast-loops");
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function enhance() {
for (var _len = arguments.length, enhancers = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, enhancers = new Array(_len), _key = 0; _key < _len; _key++) {
enhancers[_key] = arguments[_key];

@@ -22,3 +18,3 @@ }

return function (config) {
return (0, _arrayReduce2.default)(enhancers, function (enhancedRenderer, enhancer) {
return (0, _fastLoops.arrayReduce)(enhancers, function (enhancedRenderer, enhancer) {
enhancedRenderer = enhancer(enhancedRenderer);

@@ -25,0 +21,0 @@ return enhancedRenderer;

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

'use strict';
"use strict";

@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = generateAnimationName;
exports["default"] = generateAnimationName;
function generateAnimationName(id) {
return 'k' + id;
}

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

'use strict';
"use strict";

@@ -6,3 +6,3 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = generateClassName;
exports["default"] = generateClassName;
var chars = 'abcdefghijklmnopqrstuvwxyz';

@@ -16,6 +16,6 @@ var charLength = chars.length;

return chars[id - 1] + className;
}
} // Bitwise floor as safari performs much faster
// https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
// Bitwise floor as safari performs much faster
// https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
return generateUniqueClassName(id / charLength | 0, chars[id % charLength] + className);

@@ -28,3 +28,2 @@ }

};
var startId = getId();

@@ -31,0 +30,0 @@ var generatedClassName = generateUniqueClassName(startId);

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

'use strict';
"use strict";

@@ -6,38 +6,28 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = generateFontSource;
exports["default"] = generateFontSource;
var _arrayReduce = require('fast-loops/lib/arrayReduce');
var _fastLoops = require("fast-loops");
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
var _getFontUrl = _interopRequireDefault(require("./getFontUrl"));
var _getFontUrl = require('./getFontUrl');
var _getFontFormat = _interopRequireDefault(require("./getFontFormat"));
var _getFontUrl2 = _interopRequireDefault(_getFontUrl);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _getFontFormat = require('./getFontFormat');
var _getFontFormat2 = _interopRequireDefault(_getFontFormat);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function generateFontSource() {
var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var fontLocals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var localSource = (0, _arrayReduce2.default)(fontLocals, function (src, local, index) {
var localSource = (0, _fastLoops.arrayReduce)(fontLocals, function (src, local, index) {
var prefix = index > 0 ? ',' : '';
var localUrl = (0, _getFontUrl2.default)(local);
return '' + src + prefix + 'local(' + localUrl + ')';
var localUrl = (0, _getFontUrl["default"])(local);
return "".concat(src).concat(prefix, "local(").concat(localUrl, ")");
}, '');
var urlSource = (0, _arrayReduce2.default)(files, function (src, fileSource, index) {
var urlSource = (0, _fastLoops.arrayReduce)(files, function (src, fileSource, index) {
var prefix = index > 0 ? ',' : '';
var fileFormat = (0, _getFontFormat2.default)(fileSource);
var fileUrl = (0, _getFontUrl2.default)(fileSource);
return '' + src + prefix + 'url(' + fileUrl + ') format(\'' + fileFormat + '\')';
var fileFormat = (0, _getFontFormat["default"])(fileSource);
var fileUrl = (0, _getFontUrl["default"])(fileSource);
return "".concat(src).concat(prefix, "url(").concat(fileUrl, ") format('").concat(fileFormat, "')");
}, '');
var delimiter = localSource.length > 0 && urlSource.length > 0 ? ',' : '';
return '' + localSource + delimiter + urlSource;
return "".concat(localSource).concat(delimiter).concat(urlSource);
}

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

'use strict';
"use strict";

@@ -6,3 +6,4 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = generateStaticReference;
exports["default"] = generateStaticReference;
function generateStaticReference(style, selector) {

@@ -9,0 +10,0 @@ if (typeof style === 'string') {

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

'use strict';
"use strict";

@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = getFontFormat;
exports["default"] = getFontFormat;
var _isBase = require('./isBase64');
var _isBase = _interopRequireDefault(require("./isBase64"));
var _isBase2 = _interopRequireDefault(_isBase);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var formats = {

@@ -24,4 +22,2 @@ '.woff': 'woff',

};
var base64Formats = {

@@ -43,4 +39,5 @@ 'image/svg+xml': 'svg',

function getFontFormat(src) {
if ((0, _isBase2.default)(src)) {
if ((0, _isBase["default"])(src)) {
var mime = '';
for (var i = 5;; i++) {

@@ -58,2 +55,3 @@ // 'data:'.length === 5

var fmt = base64Formats[mime];
if (fmt) {

@@ -63,5 +61,6 @@ return fmt;

console.warn('A invalid base64 font was used. Please use one of the following mime type: ' + Object.keys(base64Formats).join(', ') + '.');
console.warn("A invalid base64 font was used. Please use one of the following mime type: ".concat(Object.keys(base64Formats).join(', '), "."));
} else {
var extension = '';
for (var _i = src.length - 1;; _i--) {

@@ -73,9 +72,7 @@ var _c = src.charAt(_i);

// of the string
var strippedSrc = src.slice(_i, src.length);
// removes all query string that are usually attached to the
var strippedSrc = src.slice(_i, src.length); // removes all query string that are usually attached to the
// font face strings e.g ./font-location/font.woff2?some-query
// Reference: https://github.com/robinweser/fela/issues/642
extension = strippedSrc.includes('?') ? strippedSrc.split('?', 1)[0] : strippedSrc;
break;

@@ -86,2 +83,3 @@ }

var _fmt = formats[extension];
if (_fmt) {

@@ -91,5 +89,6 @@ return _fmt;

console.warn('A invalid font-format was used in "' + src + '". Use one of these: ' + Object.keys(formats).join(', ') + '.');
console.warn("A invalid font-format was used in \"".concat(src, "\". Use one of these: ").concat(Object.keys(formats).join(', '), "."));
}
return '';
}

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

'use strict';
"use strict";

@@ -6,3 +6,4 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = getFontLocals;
exports["default"] = getFontLocals;
function getFontLocals(localAlias) {

@@ -9,0 +10,0 @@ if (typeof localAlias === 'string') {

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

'use strict';
"use strict";

@@ -6,16 +6,14 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = getFontUrl;
exports["default"] = getFontUrl;
var _isBase = require('./isBase64');
var _isBase = _interopRequireDefault(require("./isBase64"));
var _isBase2 = _interopRequireDefault(_isBase);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getFontUrl(src) {
if ((0, _isBase2.default)(src)) {
if ((0, _isBase["default"])(src)) {
return src;
}
return '\'' + src + '\'';
return "'".concat(src, "'");
}

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

'use strict';
"use strict";

@@ -6,20 +6,27 @@ Object.defineProperty(exports, "__esModule", {

});
exports.enhance = exports.combineRules = exports.createRenderer = undefined;
Object.defineProperty(exports, "combineRules", {
enumerable: true,
get: function get() {
return _combineRules["default"];
}
});
Object.defineProperty(exports, "createRenderer", {
enumerable: true,
get: function get() {
return _createRenderer["default"];
}
});
Object.defineProperty(exports, "enhance", {
enumerable: true,
get: function get() {
return _enhance["default"];
}
});
var _createRenderer = require('./createRenderer');
var _createRenderer = _interopRequireDefault(require("./createRenderer"));
var _createRenderer2 = _interopRequireDefault(_createRenderer);
var _combineRules = _interopRequireDefault(require("./combineRules"));
var _combineRules = require('./combineRules');
var _enhance = _interopRequireDefault(require("./enhance"));
var _combineRules2 = _interopRequireDefault(_combineRules);
var _enhance = require('./enhance');
var _enhance2 = _interopRequireDefault(_enhance);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.createRenderer = _createRenderer2.default;
exports.combineRules = _combineRules2.default;
exports.enhance = _enhance2.default;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

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

'use strict';
"use strict";

@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = isBase64;
exports["default"] = isBase64;
function isBase64(property) {
return property.substr(0, 5) === 'data:';
}

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

'use strict';
"use strict";

@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = isSafeClassName;
exports["default"] = isSafeClassName;
function isSafeClassName(className) {
return className.indexOf('ad') === -1;
}

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

'use strict';
"use strict";

@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = minifyCSSString;
exports["default"] = minifyCSSString;
function minifyCSSString(style) {
return style.replace(/\s{2,}/g, '');
}

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

});
exports.default = sortMediaQuery;
exports["default"] = sortMediaQuery;
function sortMediaQuery() {
var mediaQueryOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return function (a, b) {

@@ -19,2 +19,3 @@ if (mediaQueryOrder.indexOf(b) === -1) {

}
if (mediaQueryOrder.indexOf(a) === -1) {

@@ -21,0 +22,0 @@ return 1;

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

'use strict';
"use strict";

@@ -6,3 +6,4 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = toCSSString;
exports["default"] = toCSSString;
function toCSSString(value) {

@@ -13,3 +14,3 @@ if (value.charAt(0) === '"') {

return '"' + value + '"';
return "\"".concat(value, "\"");
}

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

'use strict';
"use strict";

@@ -6,3 +6,3 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = validateSelectorPrefix;
exports["default"] = validateSelectorPrefix;
var PREFIX_SYNTAX = /^[a-z_][a-z0-9-_]*$/gi;

@@ -14,3 +14,3 @@

if (selectorPrefix.length > 0 && selectorPrefix.match(PREFIX_SYNTAX) === null) {
console.error('An invalid selectorPrefix (' + selectorPrefix + ') 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');
console.error("An invalid selectorPrefix (".concat(selectorPrefix, ") 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"));
}

@@ -17,0 +17,0 @@

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

@@ -10,5 +10,2 @@ "typings": "index.d.ts",

"sideEffects": false,
"scripts": {
"build:umd": "webpack --config webpack.config.js"
},
"files": [

@@ -22,2 +19,15 @@ "LICENSE",

],
"scripts": {
"setup": "yarn build",
"clean": "rimraf lib es coverage",
"build": "yarn clean && yarn build:es && yarn build:lib",
"build:es": "babel src --out-dir es --ignore **/__tests__",
"build:lib": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__",
"build:umd": "webpack --config webpack.config.js",
"watch": "npm run watch:lib & npm run watch:es",
"watch:lib": "BABEL_ENV=commonjs babel src -d lib -w",
"watch:es": "babel src -d es -w",
"test": "jest --config=jest.config.js",
"coverage": "yarn test --coverage"
},
"repository": "https://github.com/robinweser/fela/",

@@ -44,6 +54,24 @@ "keywords": [

"fast-loops": "^1.0.0",
"fela-utils": "^11.7.0",
"fela-utils": "^12.0.0-rc.0",
"isobject": "^3.0.1"
},
"gitHead": "e067b284984d3dbfc259fcbffde9bb50679fda9b"
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.2",
"@babel/node": "^7.13.0",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/polyfill": "^7.7.0",
"@babel/preset-env": "^7.5.5",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^26.6.0",
"babel-loader": "^8.2.3",
"babel-plugin-transform-dev-warning": "^0.1.1",
"clean-webpack-plugin": "^3.0.0",
"cross-env": "^6.0.3",
"jest": "^26.6.0",
"rimraf": "^3.0.0",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.10"
},
"gitHead": "00f02f410f17a7693479ea3349bb3a9f223359af"
}

@@ -1,2 +0,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=10)}([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}},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(8),i=(r=o)&&r.__esModule?r:{default:r}},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";
!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";
/*!

@@ -7,2 +7,2 @@ * isobject <https://github.com/jonschlinkert/isobject>

* 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";function r(e){return(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})(e)}function o(e){return function(e){if(Array.isArray(e))return i(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 i(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 i(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 i(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 a(e){return e.filter((function(t,n){return e.lastIndexOf(t)===n}))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){for(var n=0,i=arguments.length<=1?0:arguments.length-1;n<i;++n){var u=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var f in u){var s=u[f],c=t[f];if(c&&s){if(Array.isArray(c)){t[f]=a(c.concat(s));continue}if(Array.isArray(s)){t[f]=a([c].concat(o(s)));continue}if("object"===r(s)){t[f]=e({},c,s);continue}}t[f]=s}}return t}},,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(9),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";n.r(t);var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}t.default=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t}},function(e,t,n){"use strict";n.r(t),n.d(t,"createRenderer",(function(){return F})),n.d(t,"combineRules",(function(){return q})),n.d(t,"enhance",(function(){return Q}));var r=n(2),o=n.n(r),i=n(3),a=n.n(i),u=n(0),f=n.n(u),s=n(4),c=n.n(s);function l(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 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)}function g(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 v=/undefined|null/,b=/url/;var _=n(1),x=n.n(_);var O=n(5),w=n.n(O);function P(e){return w()(e,(e,t,n)=>`${e}${n}{${x()(t)}}`,"")}const A="abcdefghijklmnopqrstuvwxyz",j=A.length;function S(e,t=(()=>!0)){const n=function e(t,n=""){return t<=j?A[t-1]+n:e(t/j|0,A[t%j]+n)}(e());return t(n)?n:S(e,t)}function N(e){return"data:"===e.substr(0,5)}function C(e){return N(e)?e:`'${e}'`}const M={".woff":"woff",".woff2":"woff2",".eot":"embedded-opentype",".ttf":"truetype",".otf":"opentype",".svg":"svg",".svgz":"svg"},$={"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 I(e=[],t=[]){const n=f()(t,(e,t,n)=>`${e}${n>0?",":""}local(${C(t)})`,""),r=f()(e,(e,t,n)=>{const r=n>0?",":"",o=function(e){if(N(e)){let t="";for(let n=5;;n++){const r=e.charAt(n);if(";"===r||","===r)break;t+=r}const n=$[t];if(n)return n;console.warn(`A invalid base64 font was used. Please use one of the following mime type: ${Object.keys($).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=M[t];if(n)return n;console.warn(`A invalid font-format was used in "${e}". Use one of these: ${Object.keys(M).join(", ")}.`)}return""}(t);return`${e}${r}url(${C(t)}) format('${o}')`},"");return`${n}${n.length>0&&r.length>0?",":""}${r}`}function k(e){return-1===e.indexOf("ad")}const T=/^[a-z_][a-z0-9-_]*$/gi;function R(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}function z(e=[]){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 F(e={}){let t={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],sortMediaQuery:e.sortMediaQuery||z(e.mediaQueryOrder),supportQueryOrder:e.supportQueryOrder||[],styleNodeAttributes:e.styleNodeAttributes||{},propertyPriority:e.propertyPriority||{},ruleOrder:[/^:link/,/^:visited/,/^:hover/,/^:focus-within/,/^:focus/,/^:active/],selectorPrefix:R(e.selectorPrefix),specificityPrefix:e.specificityPrefix||"",filterClassName:e.filterClassName||k,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=P(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||P(e);return f()(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,a=e+JSON.stringify(r),u=function(e){return"string"==typeof e?[e]:Array.isArray(e)?e.slice():[]}(o);if(!t.cache.hasOwnProperty(a)){const r='"'===(f=e).charAt(0)?f:`"${f}"`,o={type:"FONT",fontFace:function(e){return`@font-face{${x()(e)}}`}({...i,src:I(n,u),fontFamily:r}),fontFamily:r};t.cache[a]=o,t._emitChange(o)}var f;return t.cache[a].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 x()(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,t.unoptimizedPlugins||t.plugins);return t._renderStyleToClassNames(r).slice(1)},_renderStyleToClassNames({_className:e,...n},r="",o="",i=""){let a=e?" "+e:"";for(const e in n){const s=n[e];if(c()(s))if(p(e))a+=t._renderStyleToClassNames(s,r+("&"===(u=e).charAt(0)?u.slice(1):u),o,i);else if(y(e)){const n=m(o,e.slice(6).trim());a+=t._renderStyleToClassNames(s,r,n,i)}else if(h(e)){const n=m(i,e.slice(9).trim());a+=t._renderStyleToClassNames(s,r,o,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{let n=g(e,s,r,o,i);if(t.cacheMap){if(!t.cacheMap.hasOwnProperty(n)){const a={property:e,value:s,pseudo:r,media:o,support:i},u=f()(t.optimizedPlugins,(e,n)=>n(e,t),a),c=g(u.property,u.value,u.pseudo,u.media,u.support);t.cache.hasOwnProperty(c)||t._renderStyleToCache(c,u.property,u.value,u.pseudo,u.media,u.support),t.cacheMap[n]=c}n=t.cacheMap[n]}t.cache.hasOwnProperty(n)||t._renderStyleToCache(n,e,s,r,o,i);const u=t.cache[n].className;u&&(a+=" "+u)}}var u;return a},_renderStyleToCache(n,r,i,a,u,f){if(function(e){return null==e||"string"==typeof e&&v.test(e)&&!b.test(e)}(i))return void(t.cache[n]={className:""});const s=t.selectorPrefix+t.generateClassName(r,i,a,u,f),c=o()(r,i),l={type:"RULE",className:s,selector:function(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=("."+e).repeat(r);return""+n+o+t}(s,a,e.specificityPrefix,t.propertyPriority[r]),declaration:c,pseudo:a,media:u,support:f};t.cache[n]=l,t._emitChange(l)},generateClassName:(e,n,r,o,i)=>S(t.getNextRuleIdentifier,t.filterClassName),_emitChange(e){a()(t.listeners,t=>t(e))}};return t.keyframePrefixes.push(""),e.optimizeCaching&&(t.optimizedPlugins=t.plugins.filter(e=>e.optimized).map(e=>e.optimized),t.optimizedPlugins.length>0&&(t.cacheMap={},t.unoptimizedPlugins=t.plugins.filter(e=>!e.optimized))),e.enhancers&&a()(e.enhancers,e=>{t=e(t)}),t}var E=n(6),K=n.n(E);function q(...e){return(t,n)=>f()(e,(e,r)=>{const o=function e(t,n,r){return Array.isArray(t)?e(q(...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:"")),K()(e,o)},{})}function Q(...e){return t=>n=>f()(e,(e,t)=>e=t(e),t(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.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))}}}}])}));

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc