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

react-fela

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fela - npm Package Compare versions

Comparing version 3.0.7 to 3.0.8

35

dist/react-fela.js

@@ -113,7 +113,2 @@ (function (global, factory) {

function createDOMInterface(renderer, node) {
// this counter is used to cache the amount of @media rules
// rendered using insertRule since the last full rerender with textContent
// using the counter enables to insert rules and @media rules separately
// which helps to ensure correct order and prevents rule order issue
var mediaRules = 0;
var isHydrating = false;

@@ -142,25 +137,8 @@

// weird behavior if used together with insertRule at runtime
if (change.type === 'rule' && false) {
var selector = change.selector;
var css = change.css;
var media = change.media;
var cssRule = selector + '{' + css + '}';
if (change.type === 'rule' && !change.media && false) {
var sheet = node.sheet;
var ruleLength = sheet.cssRules.length;
if (media && media.length > 0) {
// insert @media rules after basic rules, newest first
sheet.insertRule('@media ' + media + '{' + cssRule + '}', ruleLength - mediaRules);
mediaRules += 1;
} else {
// directly append new rules before everything else
sheet.insertRule(cssRule, 0);
}
// directly append new rules before media rules
sheet.insertRule(change.selector + '{' + change.css + '}', sheet.cssRules.length);
} else {
node.textContent = renderer.renderToString();
// the @media rules counter gets reset as the
// full rerender also includes all @media rules
mediaRules = 0;
}

@@ -286,3 +264,4 @@ }

var style = _ref.style;
var felaProps = babelHelpers.objectWithoutProperties(_ref, ['children', 'className', 'style']);
var passThrough = _ref.passThrough;
var felaProps = babelHelpers.objectWithoutProperties(_ref, ['children', 'className', 'style', 'passThrough']);
var renderer = _ref2.renderer;

@@ -292,3 +271,3 @@

// filter props to extract props to pass through
var componentProps = Object.keys(passThroughProps).reduce(function (output, prop) {
var componentProps = Object.keys(babelHelpers.extends({}, passThroughProps, passThrough)).reduce(function (output, prop) {
output[prop] = felaProps[prop];

@@ -311,3 +290,3 @@ if (!passThroughProps[prop]) {

// use the rule name as display name to better debug with react inspector ( see #99 )
// use the rule name as display name to better debug with react inspector
component.displayName = rule.name && rule.name || 'FelaComponent';

@@ -314,0 +293,0 @@

2

dist/react-fela.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.ReactFela=t(e.React)}(this,function(e){"use strict";function t(e,t){var r=0,n=!1,o={updateNode:function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("hydrate"===o.type&&(n=!o.done),!n)if("rule"===o.type){var i=o.selector,s=o.css,c=o.media,a=i+"{"+s+"}",u=t.sheet,l=u.cssRules.length;c&&c.length>0?(u.insertRule("@media "+c+"{"+a+"}",l-r),r+=1):u.insertRule(a,0)}else t.textContent=e.renderToString(),r=0}};return o}function r(e,r){if(!r||1!==r.nodeType)throw new Error("You need to specify a valid element node (nodeType = 1) to render into.");r.setAttribute("data-fela-stylesheet","");var n=t(e,r);e.subscribe(n.updateNode);var o=e.renderToString();r.textContent!==o&&(r.textContent=o)}function n(t){return function(r){var n,o;return o=n=function(e){function n(){return s.classCallCheck(this,n),s.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return s.inherits(n,e),s.createClass(n,[{key:"render",value:function(){var e=t(this.props)(this.context.renderer);return i.createElement(r,s.extends({},this.props,{styles:e}))}}]),n}(e.Component),n.displayName=r.displayName||r.name||"ConnectedFelaComponent",n.contextTypes=s.extends({},r.contextTypes,{renderer:e.PropTypes.object}),o}}function o(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(o,i){var c=o.children,a=o.className,u=o.style,l=s.objectWithoutProperties(o,["children","className","style"]),p=i.renderer,f=Object.keys(n).reduce(function(e,t){return e[t]=l[t],n[t]||delete l[t],e},{});f.style=u;var y=a?a+" ":"";return f.className=y+p.renderRule(t,l),e.createElement(r,f,c)};return o.contextTypes={renderer:e.PropTypes.object},o.displayName=t.name&&t.name||"FelaComponent",o}var i="default"in e?e.default:e,s={};s.typeof="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},s.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s.createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},s.objectWithoutProperties=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},s.possibleConstructorReturn=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};var c=function(e){function t(){return s.classCallCheck(this,t),s.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s.inherits(t,e),s.createClass(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.mountNode,n=e.renderer;t&&r(n,t)}},{key:"getChildContext",value:function(){return{renderer:this.props.renderer}}},{key:"render",value:function(){return this.props.children}}]),t}(e.Component);c.propTypes={renderer:e.PropTypes.object},c.childContextTypes={renderer:e.PropTypes.object};var a={Provider:c,connect:n,createComponent:o};return a});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.ReactFela=t(e.React)}(this,function(e){"use strict";function t(e,t){var r=!1,n={updateNode:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("hydrate"===n.type&&(r=!n.done),!r)if("rule"!==n.type||n.media)t.textContent=e.renderToString();else{var o=t.sheet;o.insertRule(n.selector+"{"+n.css+"}",o.cssRules.length)}}};return n}function r(e,r){if(!r||1!==r.nodeType)throw new Error("You need to specify a valid element node (nodeType = 1) to render into.");r.setAttribute("data-fela-stylesheet","");var n=t(e,r);e.subscribe(n.updateNode);var o=e.renderToString();r.textContent!==o&&(r.textContent=o)}function n(t){return function(r){var n,o;return o=n=function(e){function n(){return i.classCallCheck(this,n),i.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i.inherits(n,e),i.createClass(n,[{key:"render",value:function(){var e=t(this.props)(this.context.renderer);return s.createElement(r,i.extends({},this.props,{styles:e}))}}]),n}(e.Component),n.displayName=r.displayName||r.name||"ConnectedFelaComponent",n.contextTypes=i.extends({},r.contextTypes,{renderer:e.PropTypes.object}),o}}function o(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(o,s){var c=o.children,a=o.className,u=o.style,p=o.passThrough,l=i.objectWithoutProperties(o,["children","className","style","passThrough"]),f=s.renderer,y=Object.keys(i.extends({},n,p)).reduce(function(e,t){return e[t]=l[t],n[t]||delete l[t],e},{});y.style=u;var d=a?a+" ":"";return y.className=d+f.renderRule(t,l),e.createElement(r,y,c)};return o.contextTypes={renderer:e.PropTypes.object},o.displayName=t.name&&t.name||"FelaComponent",o}var s="default"in e?e.default:e,i={};i.typeof="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},i.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i.createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},i.objectWithoutProperties=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},i.possibleConstructorReturn=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};var c=function(e){function t(){return i.classCallCheck(this,t),i.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i.inherits(t,e),i.createClass(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.mountNode,n=e.renderer;t&&r(n,t)}},{key:"getChildContext",value:function(){return{renderer:this.props.renderer}}},{key:"render",value:function(){return this.props.children}}]),t}(e.Component);c.propTypes={renderer:e.PropTypes.object},c.childContextTypes={renderer:e.PropTypes.object};var a={Provider:c,connect:n,createComponent:o};return a});
{
"name": "react-fela",
"version": "3.0.7",
"version": "3.0.8",
"description": "React bindings for Fela",

@@ -25,4 +25,4 @@ "main": "index.js",

"react": "^15.3.2",
"fela": "3.0.7"
"fela": "3.0.8"
}
}

@@ -6,3 +6,3 @@ # React Fela

<img alt="npm downloads" src="https://img.shields.io/npm/dm/react-fela.svg">
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-1.64kb-brightgreen.svg">
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-1.61kb-brightgreen.svg">

@@ -23,5 +23,5 @@ This package only includes React bindings for [Fela](http://github.com/rofrischmann/fela).<br>

<!-- Development build (with warnings) -->
<script src="https://unpkg.com/react-fela@3.0.7/dist/react-fela.js"></script>
<script src="https://unpkg.com/react-fela@3.0.8/dist/react-fela.js"></script>
<!-- Production build (minified) -->
<script src="https://unpkg.com/react-fela@3.0.7/dist/react-fela.min.js"></script>
<script src="https://unpkg.com/react-fela@3.0.8/dist/react-fela.min.js"></script>
```

@@ -28,0 +28,0 @@

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