Comparing version 5.0.8 to 6.0.0
@@ -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 }; |
@@ -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" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
30285
29
621
1
+ Addedcss-in-js-utils@2.0.0(transitive)
+ Addedfela-utils@7.0.5(transitive)
- Removedcss-in-js-utils@2.0.1(transitive)
- Removedfela-utils@6.0.1(transitive)
Updatedfela-tools@^5.0.8
Updatedfela-utils@^7.0.0