Comparing version 2.0.0-0 to 2.0.0-1
@@ -5,5 +5,5 @@ module.exports = function(api) { | ||
return { | ||
presets: [["@babel/preset-env"]], | ||
plugins: [["@babel/plugin-transform-runtime", { corejs: 3 }]] | ||
presets: [['@babel/preset-env']], | ||
plugins: [['@babel/plugin-transform-runtime']] | ||
}; | ||
}; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _getIterator2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/get-iterator")); | ||
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/entries")); | ||
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice")); | ||
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array")); | ||
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat")); | ||
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map")); | ||
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); | ||
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce")); | ||
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map")); | ||
var _utils = require("./utils"); | ||
var globalStylesheet = new _map2["default"](); | ||
var globalStylesheet = new Map(); | ||
var _default = { | ||
create: function create(styles) { | ||
var _context; | ||
var stylesheet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalStylesheet; | ||
if (!(stylesheet instanceof _map2["default"])) throw new Error("".concat(stylesheet, " should be a Map")); | ||
return (0, _reduce["default"])(_context = (0, _keys["default"])(styles)).call(_context, function (acc, key) { | ||
if (!(stylesheet instanceof Map)) throw new Error("".concat(stylesheet, " should be a Map")); | ||
return Object.keys(styles).reduce(function (acc, key) { | ||
var _seperateStyles = (0, _utils.seperateStyles)(styles[key]), | ||
@@ -56,7 +31,5 @@ style = _seperateStyles.style, | ||
if (pseudos.length) { | ||
(0, _map["default"])(pseudos).call(pseudos, function (selector) { | ||
var _context2; | ||
pseudos.map(function (selector) { | ||
delete style[selector]; | ||
var pseudoClassName = (0, _concat["default"])(_context2 = "".concat(className)).call(_context2, selector); | ||
var pseudoClassName = "".concat(className).concat(selector); | ||
if (stylesheet.has(pseudoClassName)) return false; | ||
@@ -68,3 +41,3 @@ stylesheet.set(pseudoClassName, styles[key][selector]); | ||
if (mediaQueries.length) { | ||
(0, _map["default"])(mediaQueries).call(mediaQueries, function (selector) { | ||
mediaQueries.map(function (selector) { | ||
var mqSelector = selector; | ||
@@ -75,6 +48,6 @@ var mqStyles = styles[key][selector]; | ||
if ((0, _isArray["default"])(selector)) { | ||
if (Array.isArray(selector)) { | ||
mqSelector = selector[0]; | ||
mqStyles = selector[1]; | ||
mqPseudos = (0, _slice["default"])(selector).call(selector, 2); | ||
mqPseudos = selector.slice(2); | ||
} | ||
@@ -89,11 +62,9 @@ | ||
mqStylesheet = mqStylesheet || stylesheet.set(mqSelector, new _map2["default"]()).get(mqSelector); | ||
mqStylesheet = mqStylesheet || stylesheet.set(mqSelector, new Map()).get(mqSelector); | ||
mqStylesheet.set(className, mqStyles); | ||
if (mqPseudos.length) { | ||
(0, _map["default"])(mqPseudos).call(mqPseudos, function (pseudo) { | ||
var _context3; | ||
mqPseudos.map(function (pseudo) { | ||
delete mqStyles[pseudo]; | ||
var pseudoClassName = (0, _concat["default"])(_context3 = "".concat(className)).call(_context3, pseudo); | ||
var pseudoClassName = "".concat(className).concat(pseudo); | ||
if (mqStylesheet.has(pseudoClassName)) return false; | ||
@@ -115,3 +86,3 @@ mqStylesheet.set(pseudoClassName, styles[key][mqSelector][pseudo]); | ||
var stylesheet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalStylesheet; | ||
var stylesheetEntries = (0, _entries["default"])(stylesheet).call(stylesheet); | ||
var stylesheetEntries = stylesheet.entries(); | ||
var css = ''; | ||
@@ -124,16 +95,12 @@ var mediaQueries = ''; | ||
try { | ||
for (var _iterator = (0, _getIterator2["default"])(stylesheetEntries), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _context6, _context7; | ||
for (var _iterator = stylesheetEntries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var entry = _step.value; | ||
var className = entry[0]; | ||
var styles = entry[1]; | ||
var isMap = styles instanceof _map2["default"]; | ||
var isMap = styles instanceof Map; | ||
if (!isMap && (0, _utils.isEmpty)(styles)) continue; | ||
if (isMap) { | ||
var _context4, _context5; | ||
var mediaQueryCSS = this.render(options, stylesheet.get(className)); | ||
mediaQueries += options.pretty ? (0, _concat["default"])(_context4 = "".concat(className, " {\n")).call(_context4, mediaQueryCSS, "}\n") : (0, _concat["default"])(_context5 = "".concat(className, "{")).call(_context5, mediaQueryCSS, "}"); | ||
mediaQueries += options.pretty ? "".concat(className, " {\n").concat(mediaQueryCSS, "}\n") : "".concat(className, "{").concat(mediaQueryCSS, "}"); | ||
continue; | ||
@@ -143,3 +110,3 @@ } | ||
var markup = (0, _utils.createMarkup)(styles); | ||
css += options.pretty ? (0, _concat["default"])(_context6 = ".".concat(className, " {\n")).call(_context6, markup.split(';').join(';\n'), "}\n") : (0, _concat["default"])(_context7 = ".".concat(className, "{")).call(_context7, markup, "}"); | ||
css += options.pretty ? ".".concat(className, " {\n").concat(markup.split(';').join(';\n'), "}\n") : ".".concat(className, "{").concat(markup, "}"); | ||
} | ||
@@ -168,5 +135,5 @@ } catch (err) { | ||
}, | ||
Map: _map2["default"], | ||
Map: Map, | ||
__stylesheet: globalStylesheet | ||
}; | ||
exports["default"] = _default; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.shorthandPropertyExpansions = exports.isUnitlessNumber = void 0; | ||
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); | ||
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each")); | ||
var _context; | ||
/** | ||
@@ -91,4 +80,4 @@ * Copyright 2013-present, Facebook, Inc. | ||
(0, _forEach["default"])(_context = (0, _keys["default"])(isUnitlessNumber)).call(_context, function (prop) { | ||
(0, _forEach["default"])(prefixes).call(prefixes, function (prefix) { | ||
Object.keys(isUnitlessNumber).forEach(function (prop) { | ||
prefixes.forEach(function (prefix) { | ||
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; | ||
@@ -159,2 +148,2 @@ }); | ||
}; | ||
exports.shorthandPropertyExpansions = shorthandPropertyExpansions; | ||
exports.shorthandPropertyExpansions = shorthandPropertyExpansions; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.createMarkupForStyles = createMarkupForStyles; | ||
exports.setValueForStyles = setValueForStyles; | ||
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of")); | ||
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice")); | ||
var _CSSProperty = require("./CSSProperty"); | ||
@@ -85,3 +78,3 @@ | ||
warnedStyleNames[name] = true; | ||
(0, _fbjs.warning)(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + (0, _slice["default"])(name).call(name, 1), checkRenderMessage(owner)); | ||
(0, _fbjs.warning)(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)); | ||
}; | ||
@@ -132,3 +125,3 @@ | ||
if ((0, _indexOf["default"])(name).call(name, '-') > -1) { | ||
if (name.indexOf('-') > -1) { | ||
warnHyphenatedStyleName(name, owner); | ||
@@ -231,2 +224,2 @@ } else if (badVendoredStyleNamePattern.test(name)) { | ||
} | ||
} | ||
} |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = dangerousStyleValue; | ||
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim")); | ||
var _CSSProperty = require("./CSSProperty"); | ||
@@ -90,6 +83,6 @@ | ||
value = (0, _trim["default"])(value).call(value); | ||
value = value.trim(); | ||
} | ||
return value + 'px'; | ||
} | ||
} |
"use strict"; | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.hyphenateStyleName = hyphenateStyleName; | ||
@@ -177,2 +174,2 @@ exports.camelizeStyleName = camelizeStyleName; | ||
exports.warning = warning; | ||
exports.warning = warning; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.sortObject = sortObject; | ||
@@ -22,22 +19,8 @@ exports.createHash = createHash; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof")); | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int")); | ||
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat")); | ||
var _isInteger = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/number/is-integer")); | ||
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); | ||
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort")); | ||
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce")); | ||
var _CSSPropertyOperations = require("./CSSPropertyOperations"); | ||
function sortObject(obj) { | ||
var _context, _context2; | ||
return (0, _reduce["default"])(_context = (0, _sort["default"])(_context2 = (0, _keys["default"])(obj)).call(_context2)).call(_context, function (acc, key) { | ||
return Object.keys(obj).sort().reduce(function (acc, key) { | ||
var val = obj[key]; | ||
@@ -62,3 +45,3 @@ if (val || val === 0) acc[key] = val; | ||
function stringifyObject(obj) { | ||
var keys = (0, _keys["default"])(obj); | ||
var keys = Object.keys(obj); | ||
var str = ''; | ||
@@ -76,6 +59,4 @@ | ||
function extendedToString(num, base) { | ||
var _context3; | ||
var conversion = ''; | ||
if (base > SYMBOL_SET.length || base <= 1 || !(0, _isInteger["default"])(base)) throw new Error((0, _concat["default"])(_context3 = "".concat(base, " should be an integer between 1 and ")).call(_context3, SYMBOL_SET.length)); | ||
if (base > SYMBOL_SET.length || base <= 1 || !Number.isInteger(base)) throw new Error("".concat(base, " should be an integer between 1 and ").concat(SYMBOL_SET.length)); | ||
@@ -87,3 +68,3 @@ while (num >= 1) { | ||
return base < 11 ? (0, _parseInt2["default"])(conversion) : conversion; | ||
return base < 11 ? parseInt(conversion) : conversion; | ||
} | ||
@@ -101,3 +82,3 @@ | ||
function isEmpty(obj) { | ||
return !(0, _keys["default"])(obj).length; | ||
return !Object.keys(obj).length; | ||
} | ||
@@ -118,4 +99,2 @@ | ||
function handle(type, acc, _ref3) { | ||
var _context4, _context5; | ||
var style = _ref3.style, | ||
@@ -125,4 +104,4 @@ rule = _ref3.rule; | ||
var hash = createClassName(sortObject(style)); | ||
var rules = pseudos.length ? [(0, _concat["default"])(_context4 = []).call(_context4, rule, style, pseudos)] : rule; | ||
acc[type] = (0, _concat["default"])(_context5 = acc[type]).call(_context5, rules); | ||
var rules = pseudos.length ? [[].concat(rule, style, pseudos)] : rule; | ||
acc[type] = acc[type].concat(rules); | ||
acc.style[rule] = hash; | ||
@@ -133,5 +112,3 @@ return acc; | ||
function seperateStyles(styles) { | ||
var _context6; | ||
return (0, _reduce["default"])(_context6 = (0, _keys["default"])(styles)).call(_context6, function (acc, rule) { | ||
return Object.keys(styles).reduce(function (acc, rule) { | ||
var content = { | ||
@@ -164,2 +141,2 @@ style: styles[rule], | ||
}); | ||
} | ||
} |
{ | ||
"name": "stilr", | ||
"version": "2.0.0-0", | ||
"version": "2.0.0-1", | ||
"description": "Encapsulated styling for your javascript components with all the power of javascript and CSS combined. Usefull with React", | ||
@@ -40,3 +40,3 @@ "author": "Kodyl ApS", | ||
"dependencies": { | ||
"@babel/runtime-corejs3": "^7.0.0" | ||
"@babel/runtime": "^7.0.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
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
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
63808
1520
+ Added@babel/runtime@^7.0.0
+ Added@babel/runtime@7.26.0(transitive)
- Removed@babel/runtime-corejs3@^7.0.0
- Removed@babel/runtime-corejs3@7.26.0(transitive)
- Removedcore-js-pure@3.39.0(transitive)