Comparing version 6.1.0 to 6.1.1
@@ -1,3 +0,3 @@ | ||
import reduce from 'lodash/reduce'; | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
import objectReduce from 'fast-loops/lib/objectReduce'; | ||
@@ -12,3 +12,3 @@ export default function combineRules() { | ||
return reduce(rules, function (style, rule) { | ||
return objectReduce(rules, function (style, rule) { | ||
return merge(style, rule(props, renderer)); | ||
@@ -15,0 +15,0 @@ }, {}); |
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 _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof 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; } | ||
@@ -7,4 +9,3 @@ | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
import isPlainObject from 'lodash/isPlainObject'; | ||
import forEach from 'lodash/forEach'; | ||
import arrayEach from 'fast-loops/lib/arrayEach'; | ||
@@ -24,2 +25,6 @@ import { generateCombinedMediaQuery, generateCSSRule, generateCSSSelector, isMediaQuery, isNestedSelector, isUndefinedValue, isSupport, normalizeNestedProperty, processStyleWithPlugins, STATIC_TYPE, RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, CLEAR_TYPE } from 'fela-utils'; | ||
function isPlainObject(obj) { | ||
return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && !Array.isArray(obj); | ||
} | ||
export default function createRenderer() { | ||
@@ -225,3 +230,3 @@ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_emitChange: function _emitChange(change) { | ||
forEach(renderer.listeners, function (listener) { | ||
arrayEach(renderer.listeners, function (listener) { | ||
return listener(change); | ||
@@ -236,3 +241,3 @@ }); | ||
if (config.enhancers) { | ||
forEach(config.enhancers, function (enhancer) { | ||
arrayEach(config.enhancers, function (enhancer) { | ||
renderer = enhancer(renderer); | ||
@@ -239,0 +244,0 @@ }); |
@@ -1,2 +0,3 @@ | ||
import reduce from 'lodash/reduce'; | ||
import arrayReduce from 'fast-loops/lib/arrayReduce'; | ||
import objectReduce from 'fast-loops/lib/objectReduce'; | ||
import cssifyObject from 'css-in-js-utils/lib/cssifyObject'; | ||
@@ -7,9 +8,9 @@ | ||
var keyframe = reduce(frames, function (css, frame, percentage) { | ||
var keyframe = objectReduce(frames, function (css, frame, percentage) { | ||
return '' + css + percentage + '{' + cssifyObject(frame) + '}'; | ||
}, ''); | ||
return reduce(prefixes, function (cssKeyframe, prefix) { | ||
return arrayReduce(prefixes, function (cssKeyframe, prefix) { | ||
return cssKeyframe + '@' + prefix + 'keyframes ' + animationName + '{' + keyframe + '}'; | ||
}, ''); | ||
} |
@@ -1,2 +0,2 @@ | ||
import reduce from 'lodash/reduce'; | ||
import arrayReduce from 'fast-loops/lib/arrayReduce'; | ||
@@ -10,3 +10,3 @@ export default function enhance() { | ||
return function (config) { | ||
return reduce(enhancers, function (enhancedRenderer, enhancer) { | ||
return arrayReduce(enhancers, function (enhancedRenderer, enhancer) { | ||
enhancedRenderer = enhancer(enhancedRenderer); | ||
@@ -13,0 +13,0 @@ return enhancedRenderer; |
import createRenderer from './createRenderer'; | ||
import combineRules from './combineRules'; | ||
import enhance from './enhance'; | ||
import css from './css'; | ||
export { createRenderer, combineRules, enhance }; | ||
export { createRenderer, combineRules, enhance, css }; |
@@ -8,6 +8,2 @@ 'use strict'; | ||
var _reduce = require('lodash/reduce'); | ||
var _reduce2 = _interopRequireDefault(_reduce); | ||
var _assignStyle = require('css-in-js-utils/lib/assignStyle'); | ||
@@ -17,2 +13,6 @@ | ||
var _objectReduce = require('fast-loops/lib/objectReduce'); | ||
var _objectReduce2 = _interopRequireDefault(_objectReduce); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -28,3 +28,3 @@ | ||
return (0, _reduce2.default)(rules, function (style, rule) { | ||
return (0, _objectReduce2.default)(rules, function (style, rule) { | ||
return merge(style, rule(props, renderer)); | ||
@@ -31,0 +31,0 @@ }, {}); |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
exports.default = createRenderer; | ||
@@ -20,10 +22,6 @@ | ||
var _isPlainObject = require('lodash/isPlainObject'); | ||
var _arrayEach = require('fast-loops/lib/arrayEach'); | ||
var _isPlainObject2 = _interopRequireDefault(_isPlainObject); | ||
var _arrayEach2 = _interopRequireDefault(_arrayEach); | ||
var _forEach = require('lodash/forEach'); | ||
var _forEach2 = _interopRequireDefault(_forEach); | ||
var _felaUtils = require('fela-utils'); | ||
@@ -75,2 +73,6 @@ | ||
function isPlainObject(obj) { | ||
return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && !Array.isArray(obj); | ||
} | ||
function createRenderer() { | ||
@@ -220,3 +222,3 @@ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
// TODO: this whole part could be trimmed | ||
if ((0, _isPlainObject2.default)(value)) { | ||
if (isPlainObject(value)) { | ||
if ((0, _felaUtils.isNestedSelector)(property)) { | ||
@@ -277,3 +279,3 @@ classNames += renderer._renderStyleToClassNames(value, pseudo + (0, _felaUtils.normalizeNestedProperty)(property), media, support); | ||
_emitChange: function _emitChange(change) { | ||
(0, _forEach2.default)(renderer.listeners, function (listener) { | ||
(0, _arrayEach2.default)(renderer.listeners, function (listener) { | ||
return listener(change); | ||
@@ -288,3 +290,3 @@ }); | ||
if (config.enhancers) { | ||
(0, _forEach2.default)(config.enhancers, function (enhancer) { | ||
(0, _arrayEach2.default)(config.enhancers, function (enhancer) { | ||
renderer = enhancer(renderer); | ||
@@ -291,0 +293,0 @@ }); |
@@ -8,6 +8,10 @@ 'use strict'; | ||
var _reduce = require('lodash/reduce'); | ||
var _arrayReduce = require('fast-loops/lib/arrayReduce'); | ||
var _reduce2 = _interopRequireDefault(_reduce); | ||
var _arrayReduce2 = _interopRequireDefault(_arrayReduce); | ||
var _objectReduce = require('fast-loops/lib/objectReduce'); | ||
var _objectReduce2 = _interopRequireDefault(_objectReduce); | ||
var _cssifyObject = require('css-in-js-utils/lib/cssifyObject'); | ||
@@ -22,9 +26,9 @@ | ||
var keyframe = (0, _reduce2.default)(frames, function (css, frame, percentage) { | ||
var keyframe = (0, _objectReduce2.default)(frames, function (css, frame, percentage) { | ||
return '' + css + percentage + '{' + (0, _cssifyObject2.default)(frame) + '}'; | ||
}, ''); | ||
return (0, _reduce2.default)(prefixes, function (cssKeyframe, prefix) { | ||
return (0, _arrayReduce2.default)(prefixes, function (cssKeyframe, prefix) { | ||
return cssKeyframe + '@' + prefix + 'keyframes ' + animationName + '{' + keyframe + '}'; | ||
}, ''); | ||
} |
@@ -8,5 +8,5 @@ 'use strict'; | ||
var _reduce = require('lodash/reduce'); | ||
var _arrayReduce = require('fast-loops/lib/arrayReduce'); | ||
var _reduce2 = _interopRequireDefault(_reduce); | ||
var _arrayReduce2 = _interopRequireDefault(_arrayReduce); | ||
@@ -22,3 +22,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
return function (config) { | ||
return (0, _reduce2.default)(enhancers, function (enhancedRenderer, enhancer) { | ||
return (0, _arrayReduce2.default)(enhancers, function (enhancedRenderer, enhancer) { | ||
enhancedRenderer = enhancer(enhancedRenderer); | ||
@@ -25,0 +25,0 @@ return enhancedRenderer; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.enhance = exports.combineRules = exports.createRenderer = undefined; | ||
exports.css = exports.enhance = exports.combineRules = exports.createRenderer = undefined; | ||
@@ -21,2 +21,6 @@ var _createRenderer = require('./createRenderer'); | ||
var _css = require('./css'); | ||
var _css2 = _interopRequireDefault(_css); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,2 +30,3 @@ | ||
exports.combineRules = _combineRules2.default; | ||
exports.enhance = _enhance2.default; | ||
exports.enhance = _enhance2.default; | ||
exports.css = _css2.default; |
{ | ||
"name": "fela", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "State-Driven Styling in JavaScript", | ||
@@ -35,8 +35,8 @@ "typings": "index.d.ts", | ||
"css-in-js-utils": "2.0.0", | ||
"fela-utils": "^8.0.0", | ||
"lodash": "^4.17.4" | ||
"fast-loops": "^1.0.0", | ||
"fela-utils": "^8.0.1" | ||
}, | ||
"devDependencies": { | ||
"fela-tools": "^5.0.14" | ||
"fela-tools": "^5.1.0" | ||
} | ||
} |
@@ -132,3 +132,5 @@ <h1><img alt="Fela" src="docs/res/logo.png" width="203"/></h1> | ||
* [React Styleguidist](http://fela.js.org/docs/introduction/Examples.html#styleguidist) ([source](packages/example-with-styleguidist)) | ||
* [Fela + React Native](http://fela.js.org/docs/introduction/Examples.html#react-native) ([source](packages/example-react-native)) | ||
* [React Native](http://fela.js.org/docs/introduction/Examples.html#react-native) ([source](packages/example-react-native)) | ||
* [ReasonReact](https://github.com/astrada/bs-react-fela-examples) | ||
* [Next](https://github.com/zeit/next.js/tree/master/examples/with-fela) | ||
* [Fela + Preact](http://fela.js.org/docs/introduction/Examples.html#preact) ([source](packages/example-preact)) | ||
@@ -138,3 +140,2 @@ * [Fela + Inferno](http://fela.js.org/docs/introduction/Examples.html#inferno) ([source](packages/example-inferno)) | ||
* [TypeScript](http://fela.js.org/docs/introduction/Examples.html#typescript) ([source](packages/example-angular2-typescript)) | ||
* [Fela + Next](https://github.com/zeit/next.js/tree/master/examples/with-fela) | ||
* [Fela + HyperScript](https://github.com/ahdinosaur/hyper-fela#example) | ||
@@ -176,4 +177,7 @@ * [Fela + Cycle](https://github.com/wcastand/cycle-fela-example) | ||
* [base-styling-components](https://github.com/pitr12/base-styling-components) - Abstract Box and Text Components | ||
* [bs-react-fela](https://github.com/astrada/bs-react-fela) - BuckleScript / ReasonReact bindings for Fela | ||
* [catstack](https://github.com/root-systems/catstack) - A modular mad science framework for teams working on production web apps | ||
* [css-in-js-playground](https://github.com/DSchau/css-in-js-playground) - A simple playground for CSS in JS solutions | ||
* [cf-ui](https://github.com/cloudflare/cf-ui) - Cloudflare UI Framework | ||
* [counter-component-with-react-mobx-fela](https://github.com/Mercateo/counter-component-with-react-mobx-fela) - Counter Component using Fela | ||
* [cycle-fela](https://github.com/wcastand/cycle-fela) - Cycle bindings for Fela | ||
@@ -183,2 +187,3 @@ * [dogstack](https://github.com/root-systems/dogstack) - A popular-choice grab-bag framework for teams working on production web apps | ||
* [fela-components](https://github.com/arturmuller/fela-components) - Styling library for React and Fela | ||
* [fela-react-helpers](https://github.com/vlad-zhukov/fela-react-helpers) - A set of useful helpers for Fela | ||
* [fela-react-prop](https://github.com/codepunkt/fela-react-prop) - Generate class names for fela style rule and apply them as property on a wrapped component | ||
@@ -188,4 +193,9 @@ * [fela-styles-connector](https://github.com/dustin-H/fela-styles-connector) - Simplified react-fela `connect` with auto-bound styles | ||
* [hyper-fela](https://github.com/ahdinosaur/hyper-fela) - HyperScript bindings for Fela | ||
* [htz-frontend](https://github.com/Haaretz/htz-frontend) - Source for Haaretz frontend app(s) | ||
* [kilvin](https://github.com/rofrischmann/kilvin) - Primitive React Layout Components with Fela | ||
* [olymp](https://github.com/olymp/olymp) - Create and build a next gen app using node, react, cssInJS and other cool stuff | ||
* [preact-fela-simple](https://github.com/pshev/preact-fela-simple) - Super simple Preact bindings for Fela | ||
* [reason-react-starter](https://github.com/drejohnson/reason-react-starter) - A ReasonReact starter kit using Fela | ||
* [storybook-addon-props-fela](https://github.com/Kilix/storybook-addon-props-fela): Document the props of your Fela components in storybook. | ||
* [superslider](https://github.com/adamgiacomelli/superslider) - Slider Component using Fela | ||
* [telaviv](https://github.com/dustin-H/telaviv) - React Universal Rendering | ||
@@ -196,3 +206,2 @@ * [vashet](https://github.com/derHowie/vashet) - ClojureScript wrapper for Fela | ||
## Support | ||
@@ -207,2 +216,3 @@ Got a question? Come and join us on [Gitter](https://gitter.im/rofrischmann/fela)! <br> | ||
- [abilis](https://www.abilis.de) | ||
- [Bookmyshow](https://in.bookmyshow.com/events) | ||
- [BdP LV RPS](http://www.bdp-rps.de) | ||
@@ -212,2 +222,3 @@ - [Cloudflare](https://www.cloudflare.com) | ||
- [HelloFresh](https://www.hellofresh.de) | ||
- [Indoqa](https://www.indoqa.com) | ||
- [Kilix](http://kilix.fr) | ||
@@ -214,0 +225,0 @@ - [Lusk](https://lusk.io) |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131907
38
1549
239
+ Addedfast-loops@^1.0.0
- Removedlodash@^4.17.4
- Removedlodash@4.17.21(transitive)
Updatedfela-utils@^8.0.1