fela-plugin-responsive-value
Advanced tools
Comparing version 11.7.0 to 12.0.0-rc.0
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } | ||
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
import isPlainObject from 'isobject'; | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
import arrayEach from 'fast-loops/lib/arrayEach'; | ||
import { assignStyle } from 'css-in-js-utils'; | ||
import { arrayEach } from 'fast-loops'; | ||
function resolveResponsiveValues(style, properties, getMediaQueries, props) { | ||
var _loop = function _loop(property) { | ||
var value = style[property]; | ||
var value = style[property]; // resolve nested styles | ||
// resolve nested styles | ||
if (isPlainObject(value)) { | ||
@@ -27,3 +36,2 @@ style[property] = resolveResponsiveValues(value, properties, getMediaQueries, props); | ||
style[property] = defaultValue; | ||
arrayEach(mediaQueries.slice(0, mediaValues.length), function (query, index) { | ||
@@ -45,3 +53,2 @@ assignStyle(style, _defineProperty({}, query, _defineProperty({}, property, mediaValues[index]))); | ||
var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return function (style, type, renderer, props) { | ||
@@ -48,0 +55,0 @@ return resolveResponsiveValues(style, properties, getMediaQueries, props); |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,28 +6,31 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = responsiveValue; | ||
exports["default"] = responsiveValue; | ||
var _isobject = require('isobject'); | ||
var _isobject = _interopRequireDefault(require("isobject")); | ||
var _isobject2 = _interopRequireDefault(_isobject); | ||
var _cssInJsUtils = require("css-in-js-utils"); | ||
var _assignStyle2 = require('css-in-js-utils/lib/assignStyle'); | ||
var _fastLoops = require("fast-loops"); | ||
var _assignStyle3 = _interopRequireDefault(_assignStyle2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _arrayEach = require('fast-loops/lib/arrayEach'); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var _arrayEach2 = _interopRequireDefault(_arrayEach); | ||
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function resolveResponsiveValues(style, properties, getMediaQueries, props) { | ||
var _loop = function _loop(property) { | ||
var value = style[property]; | ||
var value = style[property]; // resolve nested styles | ||
// resolve nested styles | ||
if ((0, _isobject2.default)(value)) { | ||
if ((0, _isobject["default"])(value)) { | ||
style[property] = resolveResponsiveValues(value, properties, getMediaQueries, props); | ||
@@ -45,5 +48,4 @@ } | ||
style[property] = defaultValue; | ||
(0, _arrayEach2.default)(mediaQueries.slice(0, mediaValues.length), function (query, index) { | ||
(0, _assignStyle3.default)(style, _defineProperty({}, query, _defineProperty({}, property, mediaValues[index]))); | ||
(0, _fastLoops.arrayEach)(mediaQueries.slice(0, mediaValues.length), function (query, index) { | ||
(0, _cssInJsUtils.assignStyle)(style, _defineProperty({}, query, _defineProperty({}, property, mediaValues[index]))); | ||
}); | ||
@@ -63,3 +65,2 @@ } | ||
var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return function (style, type, renderer, props) { | ||
@@ -66,0 +67,0 @@ return resolveResponsiveValues(style, properties, getMediaQueries, props); |
{ | ||
"name": "fela-plugin-responsive-value", | ||
"version": "11.7.0", | ||
"version": "12.0.0-rc.0", | ||
"description": "Fela plugin to resolve responsive array values", | ||
@@ -13,4 +13,18 @@ "main": "lib/index.js", | ||
"lib/**", | ||
"es/**" | ||
"es/**", | ||
"umd/**" | ||
], | ||
"scripts": { | ||
"setup": "yarn build", | ||
"clean": "rimraf lib es coverage", | ||
"build": "yarn clean && yarn build:es && yarn build:lib", | ||
"build:es": "babel src --out-dir es --ignore **/__tests__", | ||
"build:lib": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__", | ||
"build:umd": "webpack --config webpack.config.js", | ||
"watch": "npm run watch:lib & npm run watch:es", | ||
"watch:lib": "BABEL_ENV=commonjs babel src -d lib -w", | ||
"watch:es": "babel src -d es -w", | ||
"test": "jest --config=jest.config.js", | ||
"coverage": "yarn test --coverage" | ||
}, | ||
"repository": "https://github.com/robinweser/fela/", | ||
@@ -31,3 +45,20 @@ "keywords": [ | ||
}, | ||
"gitHead": "e067b284984d3dbfc259fcbffde9bb50679fda9b" | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/node": "^7.13.0", | ||
"@babel/plugin-transform-modules-commonjs": "^7.5.0", | ||
"@babel/polyfill": "^7.7.0", | ||
"@babel/preset-env": "^7.5.5", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^26.6.0", | ||
"babel-loader": "^8.2.3", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"cross-env": "^6.0.3", | ||
"jest": "^26.6.0", | ||
"rimraf": "^3.0.0", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
"gitHead": "00f02f410f17a7693479ea3349bb3a9f223359af" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
15560
6
96
15
2