New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jss-preset-default

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-preset-default - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

4

changelog.md

@@ -0,1 +1,5 @@

## 0.8.0 / 2016-11-15
- added jss-expand
## 0.7.0 / 2016-10-31

@@ -2,0 +6,0 @@

@@ -91,2 +91,6 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _jssExpand = __webpack_require__(16);
var _jssExpand2 = _interopRequireDefault(_jssExpand);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -97,3 +101,3 @@

return {
plugins: [(0, _jssExtend2.default)(options.extend), (0, _jssNested2.default)(options.nested), (0, _jssCamelCase2.default)(options.camelCase), (0, _jssDefaultUnit2.default)(options.defaultUnit), (0, _jssVendorPrefixer2.default)(options.vendorPrefixer), (0, _jssPropsSort2.default)(options.propsSort), (0, _jssCompose2.default)(options.compose)]
plugins: [(0, _jssExtend2.default)(options.extend), (0, _jssNested2.default)(options.nested), (0, _jssCamelCase2.default)(options.camelCase), (0, _jssDefaultUnit2.default)(options.defaultUnit), (0, _jssExpand2.default)(options.expand), (0, _jssVendorPrefixer2.default)(options.vendorPrefixer), (0, _jssPropsSort2.default)(options.propsSort), (0, _jssCompose2.default)(options.compose)]
};

@@ -1101,2 +1105,305 @@ };

/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = jssExpand;
var _props = __webpack_require__(17);
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; }
/**
* Map values by given prop.
*
* @param {Array} array of values
* @param {String} original property
* @param {String} original rule
* @return {String} mapped values
*/
function mapValuesByProp(value, prop, rule) {
return value.map(function (item) {
return objectToString(item, prop, rule);
});
}
/**
* Convert array to string.
*
* @param {Array} array of values
* @param {String} original property
* @param {Object} sheme, for converting arrays in strings
* @param {Object} original rule
* @return {String} converted string
*/
function arrayToString(value, prop, scheme, rule) {
if (value[0].constructor === Object) return mapValuesByProp(value, prop, rule);
if (scheme[prop] == null) return value.join(',');
if (value[0].constructor === Array) return arrayToString(value[0], prop, scheme);
return value.join(' ');
}
/**
* Convert object to string.
*
* @param {Object} object of values
* @param {String} original property
* @param {Object} original rule
* @return {String} converted string
*/
function objectToString(value, prop, rule) {
if (!(_props.propObj[prop] || _props.customPropObj[prop])) return '';
var result = [];
// Check if exists any non-standart property
if (_props.customPropObj[prop]) {
for (var baseProp in _props.customPropObj[prop]) {
var propName = _props.customPropObj[prop][baseProp];
// If current property doesn't exist alerady in rule - add new one
if (value[baseProp] && !rule.prop(propName)) {
rule.prop(propName, styleDetector(_defineProperty({}, propName, value[baseProp]), rule)[propName]);
}
delete value[baseProp];
}
}
// Pass throught all standart props
if (Object.keys(value).length !== 0) {
for (var _baseProp in _props.propObj[prop]) {
if (value[_baseProp]) {
if (value[_baseProp].constructor === Array) {
result.push(arrayToString(value[_baseProp], _baseProp, _props.propArrayInObj));
} else result.push(value[_baseProp]);
continue;
}
// Add default value from props config.
if (_props.propObj[prop][_baseProp] != null) {
result.push(_props.propObj[prop][_baseProp]);
}
}
}
return result.join(' ');
}
/**
* Detect if a style needs to be converted.
*
* @param {Object} style
* @param {Object} rule
* @return {Object} convertedStyle
*/
function styleDetector(style, rule) {
for (var prop in style) {
var value = style[prop];
if (value.constructor === Object) {
if (prop === 'fallbacks') style[prop] = styleDetector(style[prop]);else {
style[prop] = objectToString(value, prop, rule);
// Avoid creating properties with empty values
if (!style[prop]) delete style[prop];
}
continue;
}
// Check double arrays to avoid recursion.
if (value.constructor === Array && value[0].constructor !== Array) {
if (prop === 'fallbacks') {
for (var index = 0; index < style[prop].length; index++) {
style[prop][index] = styleDetector(style[prop][index]);
}
continue;
}
style[prop] = arrayToString(value, prop, _props.propArray);
}
}
return style;
}
/**
* Adds possibility to write expanded styles.
*
* @param {Rule} rule
* @api public
*/
function jssExpand() {
return function (rule) {
var style = rule.style;
var type = rule.type;
if (!style || type !== 'regular') return;
if (Array.isArray(style)) {
// Pass rules one by one and reformat them
for (var index = 0; index < style.length; index++) {
style[index] = styleDetector(style[index], rule);
}
return;
}
rule.style = styleDetector(style, rule);
};
}
/***/ },
/* 17 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* A scheme for converting properties from array to regular style.
* All properties listed below will be transformed to a string separated by space.
*/
var propArray = exports.propArray = {
margin: true,
padding: true,
'border-radius': true,
'background-size': true,
'background-position': true,
'transform-origin': true
};
/**
* A scheme for converting arrays to regular styles inside of objects.
* For e.g.: "{position: [0, 0]}" => "background-position: 0 0;".
*/
var propArrayInObj = exports.propArrayInObj = {
position: true // background-position
};
/**
* A scheme for parsing and building correct styles from passed objects.
*/
var propObj = exports.propObj = {
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
margin: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
background: {
attachment: null,
color: null,
image: null,
position: null,
repeat: null
},
border: {
width: null,
style: null,
color: null
},
'border-top': {
width: null,
style: null,
color: null
},
'border-right': {
width: null,
style: null,
color: null
},
'border-bottom': {
width: null,
style: null,
color: null
},
'border-left': {
width: null,
style: null,
color: null
},
outline: {
width: null,
style: null,
color: null
},
'list-style': {
type: null,
position: null,
image: null
},
transition: {
property: null,
duration: null,
'timing-function': null,
timingFunction: null, // Needed for avoiding comilation issues with jss-camel-case
delay: null
},
animation: {
name: null,
duration: null,
'timing-function': null,
timingFunction: null, // Needed to avoid compilation issues with jss-camel-case
delay: null,
'iteration-count': null,
iterationCount: null, // Needed to avoid compilation issues with jss-camel-case
direction: null,
'fill-mode': null,
fillMode: null, // Needed to avoid compilation issues with jss-camel-case
'play-state': null,
playState: null // Needed to avoid compilation issues with jss-camel-case
},
'box-shadow': {
x: 0,
y: 0,
blur: null,
spread: null,
color: null,
inset: null
},
'text-shadow': {
x: 0,
y: 0,
blur: null,
color: null
},
flex: {
grow: null,
shrink: null,
basis: null
}
};
/**
* A scheme for converting non-standart properties inside object.
* For e.g.: include 'border-radius' property inside 'border' object.
*/
var customPropObj = exports.customPropObj = {
border: {
radius: 'border-radius'
},
background: {
size: 'background-size'
},
font: {
style: 'font-style',
variant: 'font-variant',
weight: 'font-weight',
stretch: 'font-stretch',
size: 'font-size',
family: 'font-family',
lineHeight: 'line-height', // Needed to avoid compilation issues with jss-camel-case
'line-height': 'line-height'
}
};
/***/ }

@@ -1103,0 +1410,0 @@ /******/ ])

4

dist/jss-preset-default.min.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssPreset=t():e.jssPreset=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=n(o),u=r(3),a=n(u),s=r(4),d=n(s),l=r(5),f=n(l),p=r(7),c=n(p),x=r(14),y=n(x),b=r(15),m=n(b);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{plugins:[(0,i.default)(e.extend),(0,a.default)(e.nested),(0,d.default)(e.camelCase),(0,f.default)(e.defaultUnit),(0,c.default)(e.vendorPrefixer),(0,y.default)(e.propsSort),(0,m.default)(e.compose)]}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return e&&"object"===("undefined"==typeof e?"undefined":u(e))&&!Array.isArray(e)}function i(e,t,r){if("string"==typeof r.extend){if(e.options&&e.options.sheet){var n=e.options.sheet.getRule(r.extend);n&&(n===e?(0,s.default)(!1,"[JSS] A rule tries to extend itself \r\n%s",e):i(e,t,n.originalStyle))}}else if(Array.isArray(r.extend))for(var u=0;u<r.extend.length;u++)i(e,t,r.extend[u]);else for(var a in r.extend)"extend"===a?i(e,t,r.extend.extend):o(r.extend[a])?(t[a]||(t[a]={}),i(e,t[a],r.extend[a])):t[a]=r.extend[a];for(var d in r)"extend"!==d&&(o(t[d])&&o(r[d])?i(e,t[d],r[d]):t[d]=r[d]);return t}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=r(2),s=n(a);t.default=function(){return function(e){e.style&&e.style.extend&&(e.style=i(e,{},e.style))}}},function(e,t,r){"use strict";var n=function(){};e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){function e(e){return function(t,r){var n=e.getRule(r);return n?n.selector:((0,s.default)(!1,"[JSS] Could not find the referenced rule %s. \r\n%s",r,n),r)}}function t(e,t,r){var n=r.getRule(e);if(!n)return void r.addRule(e,o({},t.name,t.style[e]));var i=n.getRule(t.name);return i?void(i.style=u({},i.style,t.style[e])):void n.addRule(t.name,t.style[e])}function r(e,t){for(var r=t.split(d),n=e.split(d),o="",u=0;u<r.length;u++)for(var a=r[u],s=0;s<n.length;s++){var f=n[s];o&&(o+=", "),o+=i(f)?f.replace(l,a):a+" "+f}return o}function n(e,t,r){if(r)return u({},r,{index:r.index+1});var n=e.options.nestingLevel;return n=void 0===n?1:n+1,u({},e.options,{named:!1,nestingLevel:n,index:t.indexOf(e)+1})}var i=function(e){return e.indexOf("&")!==-1};return function(o){if("regular"===o.type){var u=o.options.parent,a=void 0,s=void 0;for(var d in o.style){var l=i(d),p="@"===d[0];if(l||p){if(l){a=n(o,u,a);var c=r(d,o.selector);s||(s=e(u)),c=c.replace(f,s),u.addRule(c,o.style[d],a)}else p&&t(d,o,u);delete o.style[d]}}}}}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.default=i;var a=r(2),s=n(a),d=/\s*,\s*/g,l=/&/g,f=/\$([\w-]+)/g},function(e,t){"use strict";function r(e){return"-"+e.toLowerCase()}function n(e){var t={};for(var i in e){var u=e[i];i=i.replace(o,r),t[i]=u}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(n):t.fallbacks=n(e.fallbacks)),t}Object.defineProperty(t,"__esModule",{value:!0});var o=/([A-Z])/g;t.default=function(){return function(e){var t=e.style;if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=n(t[r]);else e.style=n(t)}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){if(!t)return t;var n=t;switch(t.constructor){case Object:if("fallbacks"===e){for(var u in t)t[u]=o(u,t[u],r);break}for(var a in t)t[a]=o(e+"-"+a,t[a],r);break;case Array:for(var s=0;s<t.length;s++)t[s]=o(e,t[s],r);break;case Number:n=i(e,t,r)}return n}function i(e,t,r){return"number"==typeof t&&0!==t&&(t+=r[e]||s.default[e]||""),t}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=t.style,n=t.type;if(r&&"regular"===n)for(var i in r)r[i]=o(i,r[i],e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var a=r(6),s=n(a)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"animation-delay":"ms","animation-duration":"ms","background-position-x":"px","background-position-y":"px","background-size":"px",border:"px","border-bottom":"px","border-bottom-left-radius":"px","border-bottom-right-radius":"px","border-bottom-width":"px","border-left":"px","border-left-width":"px","border-radius":"px","border-right":"px","border-right-width":"px","border-spacing":"px","border-top":"px","border-top-left-radius":"px","border-top-right-radius":"px","border-top-width":"px","border-width":"px","border-after-width":"px","border-before-width":"px","border-end-width":"px","border-horizontal-spacing":"px","border-start-width":"px","border-vertical-spacing":"px",bottom:"px","box-shadow-x":"px","box-shadow-y":"px","box-shadow-blur":"px","box-shadow-spread":"px","column-gap":"px","column-rule":"px","column-rule-width":"px","column-width":"px","flex-basis":"px","font-size":"px","font-size-delta":"px",height:"px",left:"px","letter-spacing":"px","logical-height":"px","logical-width":"px",margin:"px","margin-after":"px","margin-before":"px","margin-bottom":"px","margin-left":"px","margin-right":"px","margin-top":"px","max-height":"px","max-width":"px","margin-end":"px","margin-start":"px","mask-position-x":"px","mask-position-y":"px","mask-size":"px","max-logical-height":"px","max-logical-width":"px","min-height":"px","min-width":"px","min-logical-height":"px","min-logical-width":"px",motion:"px","motion-offset":"px",outline:"px","outline-offset":"px","outline-width":"px",padding:"px","padding-bottom":"px","padding-left":"px","padding-right":"px","padding-top":"px","padding-after":"px","padding-before":"px","padding-end":"px","padding-start":"px","perspective-origin-x":"%","perspective-origin-y":"%",perspective:"px",right:"px","shape-margin":"px",size:"px","text-indent":"px","text-shadow-x":"px","text-shadow-y":"px","text-shadow-blur":"px","text-stroke":"px","text-stroke-width":"px",top:"px","transform-origin":"%","transform-origin-x":"%","transform-origin-y":"%","transform-origin-z":"%","transition-delay":"ms","transition-duration":"ms","vertical-align":"px",width:"px","word-spacing":"px"}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(){return function(e){if("keyframe"===e.type)return void(e.selector="@"+u.prefix.css+e.selector.substr(1));if("regular"===e.type)for(var t in e.style){var r=e.style[t],n=!1,o=u.supportedProperty(t);o&&o!==t&&(n=!0);var i=!1,a=u.supportedValue(o,r);a&&a!==r&&(i=!0),(n||i)&&(n&&delete e.style[t],e.style[o||t]=a||r)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(8),u=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.supportedValue=t.supportedProperty=t.prefix=void 0;var o=r(9),i=n(o),u=r(11),a=n(u),s=r(13),d=n(s);t.default={prefix:i.default,supportedProperty:a.default,supportedValue:d.default},/**
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssPreset=t():e.jssPreset=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=n(o),l=r(3),u=n(l),a=r(4),s=n(a),d=r(5),f=n(d),p=r(7),c=n(p),x=r(14),y=n(x),b=r(15),m=n(b),g=r(16),v=n(g);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{plugins:[(0,i.default)(e.extend),(0,u.default)(e.nested),(0,s.default)(e.camelCase),(0,f.default)(e.defaultUnit),(0,v.default)(e.expand),(0,c.default)(e.vendorPrefixer),(0,y.default)(e.propsSort),(0,m.default)(e.compose)]}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return e&&"object"===("undefined"==typeof e?"undefined":l(e))&&!Array.isArray(e)}function i(e,t,r){if("string"==typeof r.extend){if(e.options&&e.options.sheet){var n=e.options.sheet.getRule(r.extend);n&&(n===e?(0,a.default)(!1,"[JSS] A rule tries to extend itself \r\n%s",e):i(e,t,n.originalStyle))}}else if(Array.isArray(r.extend))for(var l=0;l<r.extend.length;l++)i(e,t,r.extend[l]);else for(var u in r.extend)"extend"===u?i(e,t,r.extend.extend):o(r.extend[u])?(t[u]||(t[u]={}),i(e,t[u],r.extend[u])):t[u]=r.extend[u];for(var s in r)"extend"!==s&&(o(t[s])&&o(r[s])?i(e,t[s],r[s]):t[s]=r[s]);return t}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=r(2),a=n(u);t.default=function(){return function(e){e.style&&e.style.extend&&(e.style=i(e,{},e.style))}}},function(e,t,r){"use strict";var n=function(){};e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){function e(e){return function(t,r){var n=e.getRule(r);return n?n.selector:((0,a.default)(!1,"[JSS] Could not find the referenced rule %s. \r\n%s",r,n),r)}}function t(e,t,r){var n=r.getRule(e);if(!n)return void r.addRule(e,o({},t.name,t.style[e]));var i=n.getRule(t.name);return i?void(i.style=l({},i.style,t.style[e])):void n.addRule(t.name,t.style[e])}function r(e,t){for(var r=t.split(s),n=e.split(s),o="",l=0;l<r.length;l++)for(var u=r[l],a=0;a<n.length;a++){var f=n[a];o&&(o+=", "),o+=i(f)?f.replace(d,u):u+" "+f}return o}function n(e,t,r){if(r)return l({},r,{index:r.index+1});var n=e.options.nestingLevel;return n=void 0===n?1:n+1,l({},e.options,{named:!1,nestingLevel:n,index:t.indexOf(e)+1})}var i=function(e){return e.indexOf("&")!==-1};return function(o){if("regular"===o.type){var l=o.options.parent,u=void 0,a=void 0;for(var s in o.style){var d=i(s),p="@"===s[0];if(d||p){if(d){u=n(o,l,u);var c=r(s,o.selector);a||(a=e(l)),c=c.replace(f,a),l.addRule(c,o.style[s],u)}else p&&t(s,o,l);delete o.style[s]}}}}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.default=i;var u=r(2),a=n(u),s=/\s*,\s*/g,d=/&/g,f=/\$([\w-]+)/g},function(e,t){"use strict";function r(e){return"-"+e.toLowerCase()}function n(e){var t={};for(var i in e){var l=e[i];i=i.replace(o,r),t[i]=l}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(n):t.fallbacks=n(e.fallbacks)),t}Object.defineProperty(t,"__esModule",{value:!0});var o=/([A-Z])/g;t.default=function(){return function(e){var t=e.style;if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=n(t[r]);else e.style=n(t)}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){if(!t)return t;var n=t;switch(t.constructor){case Object:if("fallbacks"===e){for(var l in t)t[l]=o(l,t[l],r);break}for(var u in t)t[u]=o(e+"-"+u,t[u],r);break;case Array:for(var a=0;a<t.length;a++)t[a]=o(e,t[a],r);break;case Number:n=i(e,t,r)}return n}function i(e,t,r){return"number"==typeof t&&0!==t&&(t+=r[e]||a.default[e]||""),t}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=t.style,n=t.type;if(r&&"regular"===n)for(var i in r)r[i]=o(i,r[i],e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=r(6),a=n(u)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"animation-delay":"ms","animation-duration":"ms","background-position-x":"px","background-position-y":"px","background-size":"px",border:"px","border-bottom":"px","border-bottom-left-radius":"px","border-bottom-right-radius":"px","border-bottom-width":"px","border-left":"px","border-left-width":"px","border-radius":"px","border-right":"px","border-right-width":"px","border-spacing":"px","border-top":"px","border-top-left-radius":"px","border-top-right-radius":"px","border-top-width":"px","border-width":"px","border-after-width":"px","border-before-width":"px","border-end-width":"px","border-horizontal-spacing":"px","border-start-width":"px","border-vertical-spacing":"px",bottom:"px","box-shadow-x":"px","box-shadow-y":"px","box-shadow-blur":"px","box-shadow-spread":"px","column-gap":"px","column-rule":"px","column-rule-width":"px","column-width":"px","flex-basis":"px","font-size":"px","font-size-delta":"px",height:"px",left:"px","letter-spacing":"px","logical-height":"px","logical-width":"px",margin:"px","margin-after":"px","margin-before":"px","margin-bottom":"px","margin-left":"px","margin-right":"px","margin-top":"px","max-height":"px","max-width":"px","margin-end":"px","margin-start":"px","mask-position-x":"px","mask-position-y":"px","mask-size":"px","max-logical-height":"px","max-logical-width":"px","min-height":"px","min-width":"px","min-logical-height":"px","min-logical-width":"px",motion:"px","motion-offset":"px",outline:"px","outline-offset":"px","outline-width":"px",padding:"px","padding-bottom":"px","padding-left":"px","padding-right":"px","padding-top":"px","padding-after":"px","padding-before":"px","padding-end":"px","padding-start":"px","perspective-origin-x":"%","perspective-origin-y":"%",perspective:"px",right:"px","shape-margin":"px",size:"px","text-indent":"px","text-shadow-x":"px","text-shadow-y":"px","text-shadow-blur":"px","text-stroke":"px","text-stroke-width":"px",top:"px","transform-origin":"%","transform-origin-x":"%","transform-origin-y":"%","transform-origin-z":"%","transition-delay":"ms","transition-duration":"ms","vertical-align":"px",width:"px","word-spacing":"px"}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(){return function(e){if("keyframe"===e.type)return void(e.selector="@"+l.prefix.css+e.selector.substr(1));if("regular"===e.type)for(var t in e.style){var r=e.style[t],n=!1,o=l.supportedProperty(t);o&&o!==t&&(n=!0);var i=!1,u=l.supportedValue(o,r);u&&u!==r&&(i=!0),(n||i)&&(n&&delete e.style[t],e.style[o||t]=u||r)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(8),l=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.supportedValue=t.supportedProperty=t.prefix=void 0;var o=r(9),i=n(o),l=r(11),u=n(l),a=r(13),s=n(a);t.default={prefix:i.default,supportedProperty:u.default,supportedValue:s.default},/**
* CSS Vendor prefix detection and property feature testing.

@@ -8,2 +8,2 @@ *

*/
t.prefix=i.default,t.supportedProperty=a.default,t.supportedValue=d.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(10),i=n(o),u="",a="";if(i.default){var s={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},d=document.createElement("p").style,l="Transform";for(var f in s)if(f+l in d){u=f,a=s[f];break}}t.default={js:u,css:a}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=t.isBrowser="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return f?null!=p[e]?p[e]:((0,l.default)(e)in f.style?p[e]=e:s.default.js+(0,l.default)("-"+e)in f.style?p[e]=s.default.css+e:p[e]=!1,p[e]):e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(10),u=n(i),a=r(9),s=n(a),d=r(12),l=n(d),f=void 0,p={};if(u.default){f=document.createElement("p");var c=window.getComputedStyle(document.documentElement,"");for(var x in c)p[c[x]]=c[x]}},function(e,t){"use strict";function r(e){return e.replace(o,n)}function n(e,t){return t?t.toUpperCase():""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=/[-\s]+(.)?/g},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!l)return t;if("string"!=typeof t||!isNaN(parseInt(t,10)))return t;var r=e+t;if(null!=d[r])return d[r];try{l.style[e]=t}catch(e){return d[r]=!1,!1}return l.style[e]===t?d[r]=t:(t=s.default.css+t,"-ms-flex"===t&&(t="-ms-flexbox"),l.style[e]=t,l.style[e]===t&&(d[r]=t)),d[r]||(d[r]=!1),d[r]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(10),u=n(i),a=r(9),s=n(a),d={},l=void 0;u.default&&(l=document.createElement("p"))},function(e,t){"use strict";function r(){function e(e,t){return e.length>t.length}return function(t){var r=t.style,n=t.type;if(r&&"regular"===n){var o={},i=Object.keys(r).sort(e);for(var u in i)o[i[u]]=r[i[u]];t.style=o}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if("$"===t[0]){var r=e.options.sheet.getRule(t.substr(1));return r?r===e?((0,a.default)(!1,"[JSS] Cyclic composition detected. \r\n%s",e),!1):(o(e,r.className),!0):((0,a.default)(!1,"[JSS] Referenced rule is not defined. \r\n%s",e),!1)}var n=e.options.parent;return e.className+=" "+t,n.classes[e.name]=e.className,!0}function i(){return function(e){var t=e.style;if(t&&t.composes){if(e.options.named)if(Array.isArray(t.composes))for(var r=0;r<t.composes.length;r++)o(e,t.composes[r]);else o(e,t.composes);delete t.composes}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var u=r(2),a=n(u)}])});
t.prefix=i.default,t.supportedProperty=u.default,t.supportedValue=s.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(10),i=n(o),l="",u="";if(i.default){var a={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},s=document.createElement("p").style,d="Transform";for(var f in a)if(f+d in s){l=f,u=a[f];break}}t.default={js:l,css:u}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=t.isBrowser="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return f?null!=p[e]?p[e]:((0,d.default)(e)in f.style?p[e]=e:a.default.js+(0,d.default)("-"+e)in f.style?p[e]=a.default.css+e:p[e]=!1,p[e]):e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(10),l=n(i),u=r(9),a=n(u),s=r(12),d=n(s),f=void 0,p={};if(l.default){f=document.createElement("p");var c=window.getComputedStyle(document.documentElement,"");for(var x in c)p[c[x]]=c[x]}},function(e,t){"use strict";function r(e){return e.replace(o,n)}function n(e,t){return t?t.toUpperCase():""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=/[-\s]+(.)?/g},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!d)return t;if("string"!=typeof t||!isNaN(parseInt(t,10)))return t;var r=e+t;if(null!=s[r])return s[r];try{d.style[e]=t}catch(e){return s[r]=!1,!1}return d.style[e]===t?s[r]=t:(t=a.default.css+t,"-ms-flex"===t&&(t="-ms-flexbox"),d.style[e]=t,d.style[e]===t&&(s[r]=t)),s[r]||(s[r]=!1),s[r]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(10),l=n(i),u=r(9),a=n(u),s={},d=void 0;l.default&&(d=document.createElement("p"))},function(e,t){"use strict";function r(){function e(e,t){return e.length>t.length}return function(t){var r=t.style,n=t.type;if(r&&"regular"===n){var o={},i=Object.keys(r).sort(e);for(var l in i)o[i[l]]=r[i[l]];t.style=o}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if("$"===t[0]){var r=e.options.sheet.getRule(t.substr(1));return r?r===e?((0,u.default)(!1,"[JSS] Cyclic composition detected. \r\n%s",e),!1):(o(e,r.className),!0):((0,u.default)(!1,"[JSS] Referenced rule is not defined. \r\n%s",e),!1)}var n=e.options.parent;return e.className+=" "+t,n.classes[e.name]=e.className,!0}function i(){return function(e){var t=e.style;if(t&&t.composes){if(e.options.named)if(Array.isArray(t.composes))for(var r=0;r<t.composes.length;r++)o(e,t.composes[r]);else o(e,t.composes);delete t.composes}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var l=r(2),u=n(l)},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t,r){return e.map(function(e){return l(e,t,r)})}function i(e,t,r,n){return e[0].constructor===Object?o(e,t,n):null==r[t]?e.join(","):e[0].constructor===Array?i(e[0],t,r):e.join(" ")}function l(e,t,r){if(!s.propObj[t]&&!s.customPropObj[t])return"";var o=[];if(s.customPropObj[t])for(var l in s.customPropObj[t]){var a=s.customPropObj[t][l];e[l]&&!r.prop(a)&&r.prop(a,u(n({},a,e[l]),r)[a]),delete e[l]}if(0!==Object.keys(e).length)for(var d in s.propObj[t])e[d]?e[d].constructor===Array?o.push(i(e[d],d,s.propArrayInObj)):o.push(e[d]):null!=s.propObj[t][d]&&o.push(s.propObj[t][d]);return o.join(" ")}function u(e,t){for(var r in e){var n=e[r];if(n.constructor!==Object){if(n.constructor===Array&&n[0].constructor!==Array){if("fallbacks"===r){for(var o=0;o<e[r].length;o++)e[r][o]=u(e[r][o]);continue}e[r]=i(n,r,s.propArray)}}else"fallbacks"===r?e[r]=u(e[r]):(e[r]=l(n,r,t),e[r]||delete e[r])}return e}function a(){return function(e){var t=e.style,r=e.type;if(t&&"regular"===r)if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]=u(t[n],e);else e.style=u(t,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var s=r(17)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.propArray={margin:!0,padding:!0,"border-radius":!0,"background-size":!0,"background-position":!0,"transform-origin":!0},t.propArrayInObj={position:!0},t.propObj={padding:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0},background:{attachment:null,color:null,image:null,position:null,repeat:null},border:{width:null,style:null,color:null},"border-top":{width:null,style:null,color:null},"border-right":{width:null,style:null,color:null},"border-bottom":{width:null,style:null,color:null},"border-left":{width:null,style:null,color:null},outline:{width:null,style:null,color:null},"list-style":{type:null,position:null,image:null},transition:{property:null,duration:null,"timing-function":null,timingFunction:null,delay:null},animation:{name:null,duration:null,"timing-function":null,timingFunction:null,delay:null,"iteration-count":null,iterationCount:null,direction:null,"fill-mode":null,fillMode:null,"play-state":null,playState:null},"box-shadow":{x:0,y:0,blur:null,spread:null,color:null,inset:null},"text-shadow":{x:0,y:0,blur:null,color:null},flex:{grow:null,shrink:null,basis:null}},t.customPropObj={border:{radius:"border-radius"},background:{size:"background-size"},font:{style:"font-style",variant:"font-variant",weight:"font-weight",stretch:"font-stretch",size:"font-size",family:"font-family",lineHeight:"line-height","line-height":"line-height"}}}])});

@@ -35,2 +35,6 @@ 'use strict';

var _jssExpand = require('jss-expand');
var _jssExpand2 = _interopRequireDefault(_jssExpand);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -41,4 +45,4 @@

return {
plugins: [(0, _jssExtend2.default)(options.extend), (0, _jssNested2.default)(options.nested), (0, _jssCamelCase2.default)(options.camelCase), (0, _jssDefaultUnit2.default)(options.defaultUnit), (0, _jssVendorPrefixer2.default)(options.vendorPrefixer), (0, _jssPropsSort2.default)(options.propsSort), (0, _jssCompose2.default)(options.compose)]
plugins: [(0, _jssExtend2.default)(options.extend), (0, _jssNested2.default)(options.nested), (0, _jssCamelCase2.default)(options.camelCase), (0, _jssDefaultUnit2.default)(options.defaultUnit), (0, _jssExpand2.default)(options.expand), (0, _jssVendorPrefixer2.default)(options.vendorPrefixer), (0, _jssPropsSort2.default)(options.propsSort), (0, _jssCompose2.default)(options.compose)]
};
};
{
"name": "jss-preset-default",
"description": "Default preset for JSS with selected plugins.",
"version": "0.7.0",
"version": "0.8.0",
"author": {

@@ -54,2 +54,3 @@ "name": "Oleg Slobodskoi",

"jss-default-unit": "^4.1.0",
"jss-expand": "^1.6.0",
"jss-extend": "^2.0.4",

@@ -56,0 +57,0 @@ "jss-nested": "^2.5.0",

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