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

substyle

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

substyle - npm Package Compare versions

Comparing version 9.3.0 to 9.4.0

10

es6/createSubstyle.js
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -64,7 +64,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

var derivedClassNames = deriveClassNames(baseClassName, elementKeys, modifierKeys);
return createSubstyle(_objectSpread({}, (style || defaultStyle) && {
return createSubstyle(_objectSpread(_objectSpread(_objectSpread({}, (style || defaultStyle) && {
style: merge.apply(void 0, [{}].concat(_toConsumableArray(collectSelectedStyles(defaultStyle)), _toConsumableArray(collectSelectedStyles(style))))
}, {}, derivedClassNames && {
}), derivedClassNames && {
className: derivedClassNames.join(' ')
}, {}, classNames && {
}), classNames && {
classNames: classNames

@@ -83,3 +83,3 @@ }), propsDecorator);

})) : classNameSplit;
var propsForSpread = propsDecorator(_objectSpread({}, styleProps, {}, mappedClassNames.length > 0 ? {
var propsForSpread = propsDecorator(_objectSpread(_objectSpread({}, styleProps), mappedClassNames.length > 0 ? {
className: mappedClassNames.join(' ')

@@ -86,0 +86,0 @@ } : {})); // assign `style`, `className`, and/or any props added by the decorator to the return function object

import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -14,5 +14,5 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

className = _ref.className;
return _objectSpread({}, style ? {
return _objectSpread(_objectSpread({}, style ? {
style: pickDirectStyles(style, defaultObjectPropsWhitelist)
} : {}, {}, className ? {
} : {}), className ? {
className: className

@@ -19,0 +19,0 @@ } : {});

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

import PropsDecoratorProvider from './PropsDecoratorProvider';
import PropsDecoratorProvider, { PropsDecoratorContext } from './PropsDecoratorProvider';
import createSubstyle from './createSubstyle';

@@ -6,3 +6,3 @@ import defaultPropsDecorator from './defaultPropsDecorator';

import useStyles from './useStyles';
export { createSubstyle, PropsDecoratorProvider, defaultPropsDecorator, inline };
export { createSubstyle, PropsDecoratorProvider, PropsDecoratorContext, defaultPropsDecorator, inline };
export default useStyles;
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -13,4 +13,4 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

return args.reduce(function (result, arg) {
return _objectSpread({}, result, {}, typeof arg === 'function' ? arg : {}, {
style: _objectSpread({}, result.style, {}, typeof arg === 'function' ? arg.style : arg)
return _objectSpread(_objectSpread(_objectSpread({}, result), typeof arg === 'function' ? arg : {}), {}, {
style: _objectSpread(_objectSpread({}, result.style), typeof arg === 'function' ? arg.style : arg)
});

@@ -17,0 +17,0 @@ }, {});

import { createContext } from 'react';
import defaultPropsDecorator from './defaultPropsDecorator';
export var PropsDecoratorContext = createContext(defaultPropsDecorator);
export var PropsDecoratorContext = /*#__PURE__*/createContext(defaultPropsDecorator);
export default PropsDecoratorContext.Provider;

@@ -28,3 +28,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -81,7 +81,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

var derivedClassNames = deriveClassNames(baseClassName, elementKeys, modifierKeys);
return createSubstyle(_objectSpread({}, (style || defaultStyle) && {
return createSubstyle(_objectSpread(_objectSpread(_objectSpread({}, (style || defaultStyle) && {
style: _utils.merge.apply(void 0, [{}].concat((0, _toConsumableArray2.default)(collectSelectedStyles(defaultStyle)), (0, _toConsumableArray2.default)(collectSelectedStyles(style))))
}, {}, derivedClassNames && {
}), derivedClassNames && {
className: derivedClassNames.join(' ')
}, {}, classNames && {
}), classNames && {
classNames: classNames

@@ -99,3 +99,3 @@ }), propsDecorator);

})) : classNameSplit;
var propsForSpread = propsDecorator(_objectSpread({}, styleProps, {}, mappedClassNames.length > 0 ? {
var propsForSpread = propsDecorator(_objectSpread(_objectSpread({}, styleProps), mappedClassNames.length > 0 ? {
className: mappedClassNames.join(' ')

@@ -102,0 +102,0 @@ } : {})); // assign `style`, `className`, and/or any props added by the decorator to the return function object

@@ -14,3 +14,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -25,5 +25,5 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

className = _ref.className;
return _objectSpread({}, style ? {
return _objectSpread(_objectSpread({}, style ? {
style: (0, _pickStyles.pickDirectStyles)(style, defaultObjectPropsWhitelist)
} : {}, {}, className ? {
} : {}), className ? {
className: className

@@ -30,0 +30,0 @@ } : {});

@@ -5,2 +5,4 @@ "use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {

@@ -15,2 +17,8 @@ value: true

});
Object.defineProperty(exports, "PropsDecoratorContext", {
enumerable: true,
get: function get() {
return _PropsDecoratorProvider.PropsDecoratorContext;
}
});
Object.defineProperty(exports, "createSubstyle", {

@@ -36,3 +44,3 @@ enumerable: true,

var _PropsDecoratorProvider = _interopRequireDefault(require("./PropsDecoratorProvider"));
var _PropsDecoratorProvider = _interopRequireWildcard(require("./PropsDecoratorProvider"));

@@ -47,3 +55,7 @@ var _createSubstyle = _interopRequireDefault(require("./createSubstyle"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _default = _useStyles.default;
exports.default = _default;

@@ -12,3 +12,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -23,4 +23,4 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

return args.reduce(function (result, arg) {
return _objectSpread({}, result, {}, typeof arg === 'function' ? arg : {}, {
style: _objectSpread({}, result.style, {}, typeof arg === 'function' ? arg.style : arg)
return _objectSpread(_objectSpread(_objectSpread({}, result), typeof arg === 'function' ? arg : {}), {}, {
style: _objectSpread(_objectSpread({}, result.style), typeof arg === 'function' ? arg.style : arg)
});

@@ -27,0 +27,0 @@ }, {});

@@ -14,5 +14,5 @@ "use strict";

var PropsDecoratorContext = (0, _react.createContext)(_defaultPropsDecorator.default);
var PropsDecoratorContext = /*#__PURE__*/(0, _react.createContext)(_defaultPropsDecorator.default);
exports.PropsDecoratorContext = PropsDecoratorContext;
var _default = PropsDecoratorContext.Provider;
exports.default = _default;
{
"name": "substyle",
"version": "9.3.0",
"version": "9.4.0",
"description": "Universal styling for reusable React components",

@@ -60,3 +60,3 @@ "main": "lib/index.js",

},
"gitHead": "8b24cbd4a35fa0573b79ab60cb95e4e15de08c2f"
"gitHead": "6302cfe068c384a36b41cb9b9f024b55ea953773"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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