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

fela-dom

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-dom - npm Package Compare versions

Comparing version 5.0.8 to 6.0.0

es/dom/connectDOMNodes.js

5

es/index.js

@@ -1,5 +0,6 @@

import render from './render';
import render from './dom/render';
import rehydrateCache from './dom/rehydration/rehydrateCache';
import renderToMarkup from './server/renderToMarkup';
import renderToSheetList from './server/renderToSheetList';
export { render, renderToMarkup, renderToSheetList };
export { render, rehydrateCache, renderToMarkup, renderToSheetList };

24

es/server/renderToMarkup.js

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

import { createStyleTagMarkup, RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE } from 'fela-utils';
import { createStyleTagMarkup, objectReduce, clusterCache, RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE } from 'fela-utils';

@@ -11,19 +11,19 @@ var sheetMap = {

export default function renderToMarkup(renderer) {
var markup = '';
var cacheCluster = clusterCache(renderer.cache, renderer.mediaQueryOrder);
for (var style in sheetMap) {
if (renderer[style].length > 0) {
markup += createStyleTagMarkup(renderer[style], sheetMap[style]);
var basicMarkup = objectReduce(sheetMap, function (markup, type, key) {
if (cacheCluster[key].length > 0) {
markup += createStyleTagMarkup(cacheCluster[key], type);
}
}
for (var media in renderer.mediaRules) {
var mediaCSS = renderer.mediaRules[media];
return markup;
}, '');
if (mediaCSS.length > 0) {
markup += createStyleTagMarkup(mediaCSS, RULE_TYPE, media);
return objectReduce(cacheCluster.mediaRules, function (markup, css, media) {
if (css.length > 0) {
markup += createStyleTagMarkup(css, RULE_TYPE, media);
}
}
return markup;
return markup;
}, basicMarkup);
}

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

import { RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE } from 'fela-utils';
import { clusterCache, objectReduce, RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE } from 'fela-utils';

@@ -12,26 +12,26 @@ var sheetMap = {

export default function renderToSheetList(renderer) {
var sheetList = [];
var cacheCluster = clusterCache(renderer.cache, renderer.mediaQueryOrder);
for (var style in sheetMap) {
if (renderer[style].length > 0) {
sheetList.push({
css: renderer[style],
type: sheetMap[style]
var sheetList = objectReduce(sheetMap, function (list, type, key) {
if (cacheCluster[key].length > 0) {
list.push({
css: cacheCluster[key],
type: type
});
}
}
for (var _media in renderer.mediaRules) {
var mediaCSS = renderer.mediaRules[_media];
return list;
}, []);
if (mediaCSS.length > 0) {
sheetList.push({
css: mediaCSS,
return objectReduce(cacheCluster.mediaRules, function (list, css, media) {
if (css.length > 0) {
list.push({
css: css,
type: RULE_TYPE,
media: _media
media: media
});
}
}
return sheetList;
return list;
}, sheetList);
}

@@ -6,8 +6,12 @@ 'use strict';

});
exports.renderToSheetList = exports.renderToMarkup = exports.render = undefined;
exports.renderToSheetList = exports.renderToMarkup = exports.rehydrateCache = exports.render = undefined;
var _render = require('./render');
var _render = require('./dom/render');
var _render2 = _interopRequireDefault(_render);
var _rehydrateCache = require('./dom/rehydration/rehydrateCache');
var _rehydrateCache2 = _interopRequireDefault(_rehydrateCache);
var _renderToMarkup = require('./server/renderToMarkup');

@@ -24,3 +28,4 @@

exports.render = _render2.default;
exports.rehydrateCache = _rehydrateCache2.default;
exports.renderToMarkup = _renderToMarkup2.default;
exports.renderToSheetList = _renderToSheetList2.default;

@@ -17,19 +17,19 @@ 'use strict';

function renderToMarkup(renderer) {
var markup = '';
var cacheCluster = (0, _felaUtils.clusterCache)(renderer.cache, renderer.mediaQueryOrder);
for (var style in sheetMap) {
if (renderer[style].length > 0) {
markup += (0, _felaUtils.createStyleTagMarkup)(renderer[style], sheetMap[style]);
var basicMarkup = (0, _felaUtils.objectReduce)(sheetMap, function (markup, type, key) {
if (cacheCluster[key].length > 0) {
markup += (0, _felaUtils.createStyleTagMarkup)(cacheCluster[key], type);
}
}
for (var media in renderer.mediaRules) {
var mediaCSS = renderer.mediaRules[media];
return markup;
}, '');
if (mediaCSS.length > 0) {
markup += (0, _felaUtils.createStyleTagMarkup)(mediaCSS, _felaUtils.RULE_TYPE, media);
return (0, _felaUtils.objectReduce)(cacheCluster.mediaRules, function (markup, css, media) {
if (css.length > 0) {
markup += (0, _felaUtils.createStyleTagMarkup)(css, _felaUtils.RULE_TYPE, media);
}
}
return markup;
return markup;
}, basicMarkup);
}

@@ -17,26 +17,26 @@ 'use strict';

function renderToSheetList(renderer) {
var sheetList = [];
var cacheCluster = (0, _felaUtils.clusterCache)(renderer.cache, renderer.mediaQueryOrder);
for (var style in sheetMap) {
if (renderer[style].length > 0) {
sheetList.push({
css: renderer[style],
type: sheetMap[style]
var sheetList = (0, _felaUtils.objectReduce)(sheetMap, function (list, type, key) {
if (cacheCluster[key].length > 0) {
list.push({
css: cacheCluster[key],
type: type
});
}
}
for (var _media in renderer.mediaRules) {
var mediaCSS = renderer.mediaRules[_media];
return list;
}, []);
if (mediaCSS.length > 0) {
sheetList.push({
css: mediaCSS,
return (0, _felaUtils.objectReduce)(cacheCluster.mediaRules, function (list, css, media) {
if (css.length > 0) {
list.push({
css: css,
type: _felaUtils.RULE_TYPE,
media: _media
media: media
});
}
}
return sheetList;
return list;
}, sheetList);
}
{
"name": "fela-dom",
"version": "5.0.8",
"version": "6.0.0",
"description": "Fela package for working with the DOM",

@@ -27,8 +27,8 @@ "main": "lib/index.js",

"dependencies": {
"fela-tools": "^5.0.7",
"fela-utils": "^6.0.1"
"fela-tools": "^5.0.8",
"fela-utils": "^7.0.0"
},
"devDependencies": {
"fela": "^5.2.0"
"fela": "^6.0.0"
}
}
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