Comparing version 1.2.0 to 2.0.0
@@ -18,6 +18,2 @@ 'use strict'; | ||
var _diffStyle = require('../utils/diffStyle'); | ||
var _diffStyle2 = _interopRequireDefault(_diffStyle); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -37,6 +33,3 @@ | ||
renderer.rules = {}; | ||
renderer.base = {}; | ||
renderer.ids = []; | ||
this._emitChange(); | ||
}, | ||
@@ -59,8 +52,2 @@ | ||
renderer.ids.push(rule); | ||
// directly render the static base style to be able | ||
// to diff future dynamic style with those | ||
if (Object.keys(props).length > 0) { | ||
renderer.renderRule(rule, {}); | ||
} | ||
} | ||
@@ -75,12 +62,10 @@ | ||
if (!renderer.rules.hasOwnProperty(ref)) { | ||
var diffedStyle = (0, _diffStyle2.default)(renderer._resolveStyle(rule, props), renderer.base[ruleId]); | ||
var style = (0, _processStyle2.default)(renderer._resolveStyle(rule, props), { | ||
type: 'rule', | ||
id: ruleId, | ||
props: props, | ||
rule: rule | ||
}, renderer.plugins); | ||
if (Object.keys(diffedStyle).length > 0) { | ||
var style = (0, _processStyle2.default)(diffedStyle, { | ||
type: 'rule', | ||
id: ruleId, | ||
props: props, | ||
rule: rule | ||
}, renderer.plugins); | ||
if (Object.keys(style).length > 0) { | ||
renderer.rules[ref] = _reactNative.StyleSheet.create({ | ||
@@ -92,7 +77,2 @@ style: style | ||
} | ||
// keep static style to diff dynamic onces later on | ||
if (ref === ruleId.toString()) { | ||
renderer.base[ruleId] = rule(props); | ||
} | ||
} | ||
@@ -99,0 +79,0 @@ |
@@ -17,3 +17,3 @@ 'use strict'; | ||
if (extension.condition) { | ||
(0, _assign2.default)(style, extension.style); | ||
(0, _assign2.default)(style, extend(extension.style)); | ||
} | ||
@@ -20,0 +20,0 @@ } else { |
{ | ||
"name": "fela", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Fast & Dynamic Styling in JavaScript", | ||
@@ -10,2 +10,3 @@ "main": "index.js", | ||
"README.md", | ||
"index.d.ts", | ||
"index.js", | ||
@@ -12,0 +13,0 @@ "/lib", |
Sorry, the diff of this file is not supported yet
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
106235
40
1637