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

fela-dom

Package Overview
Dependencies
Maintainers
2
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 8.0.4 to 10.0.0

4

es/dom/__helpers__/cleanHead.js
export default function cleanHead() {
var head = document.head;
var _document = document,
head = _document.head;
while (head.firstChild) {

@@ -4,0 +6,0 @@ head.removeChild(head.firstChild);

@@ -33,3 +33,6 @@ import { FONT_TYPE, STATIC_TYPE, KEYFRAME_TYPE, RULE_TYPE } from 'fela-utils';

return getRuleScore(support ? 4 : 3, media, mediaQueryOrder);
default:
// TODO: warning
return 9999;
}
}

@@ -24,4 +24,4 @@ import objectReduce from 'fast-loops/lib/objectReduce';

// to correctly inject the node just before it
var moreSpecificReference = objectReduce(nodes, function (closest, node, reference) {
return node.score > score && (!closest || nodes[closest].score > node.score) ? reference : closest;
var moreSpecificReference = objectReduce(nodes, function (closest, currentNode, reference) {
return currentNode.score > score && (!closest || nodes[closest].score > currentNode.score) ? reference : closest;
}, undefined);

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

/* eslint-disable consistent-return */
import objectEach from 'fast-loops/lib/objectEach';
import { RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE, CLEAR_TYPE, getRuleScore, generateCSSRule } from 'fela-utils';
import { RULE_TYPE, KEYFRAME_TYPE, FONT_TYPE, STATIC_TYPE, CLEAR_TYPE, generateCSSRule } from 'fela-utils';

@@ -36,4 +36,7 @@ import getNodeFromCache from './getNodeFromCache';

break;
default:
// TODO: warning
break;
}
};
}

@@ -14,3 +14,4 @@ import { generateCSSRule, generateCSSSupportRule, getRuleScore } from 'fela-utils';

if (renderer.devMode) {
return insertRuleInDevMode(renderer, node);
insertRuleInDevMode(renderer, node);
return;
}

@@ -22,2 +23,3 @@

var index = cssRules.length;

@@ -46,4 +48,10 @@

} catch (e) {
console.warn('An error occurred while inserting the rules into DOM.\n', declaration.replace(/;/g, ';\n'), e);
// We're disabled these warnings due to false-positive errors with browser prefixes
// See https://github.com/rofrischmann/fela/issues/634
// console.warn(
// `An error occurred while inserting the rules into DOM.\n`,
// declaration.replace(/;/g, ';\n'),
// e
// )
}
}

@@ -13,9 +13,9 @@ import { RULE_TYPE } from 'fela-utils';

var sheet = sheetList.find(function (sheet) {
var currentSheet = sheetList.find(function (sheet) {
return sheet.type === RULE_TYPE && sheet.media === media && sheet.support === support;
});
if (sheet) {
node.textContent = sheet.css;
if (currentSheet) {
node.textContent = currentSheet.css;
}
}

@@ -8,6 +8,6 @@

var mediaQuery = media ? '[media="' + media + '"]' : '';
var supportQuery = support ? '[data-fela-support="true"]' : '';
var mediaQuery = media ? '[media="' + media + '"]' : ':not([media])';
var supportQuery = support ? '[data-fela-support="true"]' : ':not([data-fela-support="true"])';
return document.querySelector('[data-fela-type="' + type + '"]' + supportQuery + mediaQuery);
}

@@ -14,2 +14,3 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

// eslint-disable-next-line no-cond-assign
while (decl = SUPPORT_REGEX.exec(css)) {

@@ -16,0 +17,0 @@ var _decl = decl,

@@ -8,3 +8,5 @@ "use strict";

function cleanHead() {
var head = document.head;
var _document = document,
head = _document.head;
while (head.firstChild) {

@@ -11,0 +13,0 @@ head.removeChild(head.firstChild);

@@ -39,3 +39,6 @@ 'use strict';

return getRuleScore(support ? 4 : 3, media, mediaQueryOrder);
default:
// TODO: warning
return 9999;
}
}

@@ -35,4 +35,4 @@ 'use strict';

// to correctly inject the node just before it
var moreSpecificReference = (0, _objectReduce2.default)(nodes, function (closest, node, reference) {
return node.score > score && (!closest || nodes[closest].score > node.score) ? reference : closest;
var moreSpecificReference = (0, _objectReduce2.default)(nodes, function (closest, currentNode, reference) {
return currentNode.score > score && (!closest || nodes[closest].score > currentNode.score) ? reference : closest;
}, undefined);

@@ -39,0 +39,0 @@

@@ -52,4 +52,7 @@ 'use strict';

break;
default:
// TODO: warning
break;
}
};
}

@@ -25,3 +25,4 @@ 'use strict';

if (renderer.devMode) {
return (0, _insertRuleInDevMode2.default)(renderer, node);
(0, _insertRuleInDevMode2.default)(renderer, node);
return;
}

@@ -33,2 +34,3 @@

var index = cssRules.length;

@@ -57,4 +59,10 @@

} catch (e) {
console.warn('An error occurred while inserting the rules into DOM.\n', declaration.replace(/;/g, ';\n'), e);
// We're disabled these warnings due to false-positive errors with browser prefixes
// See https://github.com/rofrischmann/fela/issues/634
// console.warn(
// `An error occurred while inserting the rules into DOM.\n`,
// declaration.replace(/;/g, ';\n'),
// e
// )
}
}

@@ -24,9 +24,9 @@ 'use strict';

var sheet = sheetList.find(function (sheet) {
var currentSheet = sheetList.find(function (sheet) {
return sheet.type === _felaUtils.RULE_TYPE && sheet.media === media && sheet.support === support;
});
if (sheet) {
node.textContent = sheet.css;
if (currentSheet) {
node.textContent = currentSheet.css;
}
}

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

var mediaQuery = media ? '[media="' + media + '"]' : '';
var supportQuery = support ? '[data-fela-support="true"]' : '';
var mediaQuery = media ? '[media="' + media + '"]' : ':not([media])';
var supportQuery = support ? '[data-fela-support="true"]' : ':not([data-fela-support="true"])';
return document.querySelector('[data-fela-type="' + type + '"]' + supportQuery + mediaQuery);
}

@@ -29,2 +29,3 @@ 'use strict';

// eslint-disable-next-line no-cond-assign
while (decl = SUPPORT_REGEX.exec(css)) {

@@ -31,0 +32,0 @@ var _decl = decl,

{
"name": "fela-dom",
"version": "8.0.4",
"version": "10.0.0",
"description": "Fela package for working with the DOM",

@@ -28,9 +28,10 @@ "main": "lib/index.js",

"fast-loops": "^1.0.1",
"fela-utils": "^8.1.3"
"fela-utils": "^10.0.0"
},
"devDependencies": {
"fela": "^6.2.3",
"fela-preset-web": "^8.0.13",
"fela-tools": "^5.2.3"
}
"fela": "^10.0.0",
"fela-preset-web": "^10.0.0",
"fela-tools": "^10.0.0"
},
"gitHead": "7f81d463beac94a7ae8d642119c6ff394f1e9788"
}
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