diff options
| author | ruki <waruqi@gmail.com> | 2018-11-08 00:38:48 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-11-07 21:53:09 +0800 |
| commit | 26105034da4fcce7ac883c899d781f016559310d (patch) | |
| tree | c459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/autoprefixer/lib/hacks | |
| parent | 2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff) | |
| download | xmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip | |
switch to vuepress
Diffstat (limited to 'node_modules/autoprefixer/lib/hacks')
50 files changed, 4125 insertions, 0 deletions
diff --git a/node_modules/autoprefixer/lib/hacks/align-content.js b/node_modules/autoprefixer/lib/hacks/align-content.js new file mode 100644 index 00000000..482f5c38 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-content.js @@ -0,0 +1,86 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignContent = function (_Declaration) { + _inherits(AlignContent, _Declaration); + + function AlignContent() { + _classCallCheck(this, AlignContent); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2012 spec + */ + AlignContent.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-line-pack'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignContent.prototype.normalize = function normalize() { + return 'align-content'; + }; + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + + + AlignContent.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2012) { + decl.value = AlignContent.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return AlignContent; +}(Declaration); + +Object.defineProperty(AlignContent, 'names', { + enumerable: true, + writable: true, + value: ['align-content', 'flex-line-pack'] +}); +Object.defineProperty(AlignContent, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-between': 'justify', + 'space-around': 'distribute' + } +}); + + +module.exports = AlignContent;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/align-items.js b/node_modules/autoprefixer/lib/hacks/align-items.js new file mode 100644 index 00000000..a545cd05 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-items.js @@ -0,0 +1,83 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignItems = function (_Declaration) { + _inherits(AlignItems, _Declaration); + + function AlignItems() { + _classCallCheck(this, AlignItems); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + AlignItems.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-align'; + } else if (spec === 2012) { + return prefix + 'flex-align'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignItems.prototype.normalize = function normalize() { + return 'align-items'; + }; + + /** + * Change value for 2009 and 2012 specs + */ + + + AlignItems.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 || spec === 2012) { + decl.value = AlignItems.oldValues[decl.value] || decl.value; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return AlignItems; +}(Declaration); + +Object.defineProperty(AlignItems, 'names', { + enumerable: true, + writable: true, + value: ['align-items', 'flex-align', 'box-align'] +}); +Object.defineProperty(AlignItems, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start' + } +}); + + +module.exports = AlignItems;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/align-self.js b/node_modules/autoprefixer/lib/hacks/align-self.js new file mode 100644 index 00000000..b38cb4a7 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-self.js @@ -0,0 +1,84 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignSelf = function (_Declaration) { + _inherits(AlignSelf, _Declaration); + + function AlignSelf() { + _classCallCheck(this, AlignSelf); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2012 specs + */ + AlignSelf.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-item-align'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignSelf.prototype.normalize = function normalize() { + return 'align-self'; + }; + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + + + AlignSelf.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2012) { + decl.value = AlignSelf.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return AlignSelf; +}(Declaration); + +Object.defineProperty(AlignSelf, 'names', { + enumerable: true, + writable: true, + value: ['align-self', 'flex-item-align'] +}); +Object.defineProperty(AlignSelf, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start' + } +}); + + +module.exports = AlignSelf;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/animation.js b/node_modules/autoprefixer/lib/hacks/animation.js new file mode 100644 index 00000000..c226aaf9 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/animation.js @@ -0,0 +1,42 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var Animation = function (_Declaration) { + _inherits(Animation, _Declaration); + + function Animation() { + _classCallCheck(this, Animation); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Don’t add prefixes for modern values. + */ + Animation.prototype.check = function check(decl) { + return !decl.value.split(/\s+/).some(function (i) { + var lower = i.toLowerCase(); + return lower === 'reverse' || lower === 'alternate-reverse'; + }); + }; + + return Animation; +}(Declaration); + +Object.defineProperty(Animation, 'names', { + enumerable: true, + writable: true, + value: ['animation', 'animation-direction'] +}); + + +module.exports = Animation;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/appearance.js b/node_modules/autoprefixer/lib/hacks/appearance.js new file mode 100644 index 00000000..c965c749 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/appearance.js @@ -0,0 +1,44 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var utils = require('../utils'); + +var Appearance = function (_Declaration) { + _inherits(Appearance, _Declaration); + + function Appearance(name, prefixes, all) { + _classCallCheck(this, Appearance); + + var _this = _possibleConstructorReturn(this, _Declaration.call(this, name, prefixes, all)); + + if (_this.prefixes) { + _this.prefixes = utils.uniq(_this.prefixes.map(function (i) { + if (i === '-ms-') { + return '-webkit-'; + } else { + return i; + } + })); + } + return _this; + } + + return Appearance; +}(Declaration); + +Object.defineProperty(Appearance, 'names', { + enumerable: true, + writable: true, + value: ['appearance'] +}); + + +module.exports = Appearance;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/background-size.js b/node_modules/autoprefixer/lib/hacks/background-size.js new file mode 100644 index 00000000..56253c3c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/background-size.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BackgroundSize = function (_Declaration) { + _inherits(BackgroundSize, _Declaration); + + function BackgroundSize() { + _classCallCheck(this, BackgroundSize); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Duplication parameter for -webkit- browsers + */ + BackgroundSize.prototype.set = function set(decl, prefix) { + var value = decl.value.toLowerCase(); + if (prefix === '-webkit-' && value.indexOf(' ') === -1 && value !== 'contain' && value !== 'cover') { + decl.value = decl.value + ' ' + decl.value; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return BackgroundSize; +}(Declaration); + +Object.defineProperty(BackgroundSize, 'names', { + enumerable: true, + writable: true, + value: ['background-size'] +}); + + +module.exports = BackgroundSize;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/block-logical.js b/node_modules/autoprefixer/lib/hacks/block-logical.js new file mode 100644 index 00000000..afbe7db3 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/block-logical.js @@ -0,0 +1,52 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BlockLogical = function (_Declaration) { + _inherits(BlockLogical, _Declaration); + + function BlockLogical() { + _classCallCheck(this, BlockLogical); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use old syntax for -moz- and -webkit- + */ + BlockLogical.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + (prop.indexOf('-start') !== -1 ? prop.replace('-block-start', '-before') : prop.replace('-block-end', '-after')); + }; + + /** + * Return property name by spec + */ + + + BlockLogical.prototype.normalize = function normalize(prop) { + if (prop.indexOf('-before') !== -1) { + return prop.replace('-before', '-block-start'); + } else { + return prop.replace('-after', '-block-end'); + } + }; + + return BlockLogical; +}(Declaration); + +Object.defineProperty(BlockLogical, 'names', { + enumerable: true, + writable: true, + value: ['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end', 'border-before', 'border-after', 'margin-before', 'margin-after', 'padding-before', 'padding-after'] +}); + + +module.exports = BlockLogical;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/border-image.js b/node_modules/autoprefixer/lib/hacks/border-image.js new file mode 100644 index 00000000..a48e1135 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/border-image.js @@ -0,0 +1,40 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BorderImage = function (_Declaration) { + _inherits(BorderImage, _Declaration); + + function BorderImage() { + _classCallCheck(this, BorderImage); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Remove fill parameter for prefixed declarations + */ + BorderImage.prototype.set = function set(decl, prefix) { + decl.value = decl.value.replace(/\s+fill(\s)/, '$1'); + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return BorderImage; +}(Declaration); + +Object.defineProperty(BorderImage, 'names', { + enumerable: true, + writable: true, + value: ['border-image'] +}); + + +module.exports = BorderImage;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/border-radius.js b/node_modules/autoprefixer/lib/hacks/border-radius.js new file mode 100644 index 00000000..c553b8ce --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/border-radius.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BorderRadius = function (_Declaration) { + _inherits(BorderRadius, _Declaration); + + function BorderRadius() { + _classCallCheck(this, BorderRadius); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change syntax, when add Mozilla prefix + */ + BorderRadius.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-moz-') { + return prefix + (BorderRadius.toMozilla[prop] || prop); + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return unprefixed version of property + */ + + + BorderRadius.prototype.normalize = function normalize(prop) { + return BorderRadius.toNormal[prop] || prop; + }; + + return BorderRadius; +}(Declaration); + +Object.defineProperty(BorderRadius, 'names', { + enumerable: true, + writable: true, + value: ['border-radius'] +}); +Object.defineProperty(BorderRadius, 'toMozilla', { + enumerable: true, + writable: true, + value: {} +}); +Object.defineProperty(BorderRadius, 'toNormal', { + enumerable: true, + writable: true, + value: {} +}); +var _arr = ['top', 'bottom']; + + +for (var _i = 0; _i < _arr.length; _i++) { + var ver = _arr[_i];var _arr2 = ['left', 'right']; + + for (var _i2 = 0; _i2 < _arr2.length; _i2++) { + var hor = _arr2[_i2]; + var normal = 'border-' + ver + '-' + hor + '-radius'; + var mozilla = 'border-radius-' + ver + hor; + + BorderRadius.names.push(normal); + BorderRadius.names.push(mozilla); + + BorderRadius.toMozilla[normal] = mozilla; + BorderRadius.toNormal[mozilla] = normal; + } +} + +module.exports = BorderRadius;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/break-props.js b/node_modules/autoprefixer/lib/hacks/break-props.js new file mode 100644 index 00000000..4724f2f4 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/break-props.js @@ -0,0 +1,81 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BreakProps = function (_Declaration) { + _inherits(BreakProps, _Declaration); + + function BreakProps() { + _classCallCheck(this, BreakProps); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change name for -webkit- and -moz- prefix + */ + BreakProps.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'column-' + prop; + }; + + /** + * Return property name by final spec + */ + + + BreakProps.prototype.normalize = function normalize(prop) { + if (prop.indexOf('inside') !== -1) { + return 'break-inside'; + } else if (prop.indexOf('before') !== -1) { + return 'break-before'; + } else { + return 'break-after'; + } + }; + + /** + * Change prefixed value for avoid-column and avoid-page + */ + + + BreakProps.prototype.set = function set(decl, prefix) { + if (decl.prop === 'break-inside' && decl.value === 'avoid-column' || decl.value === 'avoid-page') { + decl.value = 'avoid'; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + /** + * Don’t prefix some values + */ + + + BreakProps.prototype.insert = function insert(decl, prefix, prefixes) { + if (decl.prop !== 'break-inside') { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else if (/region/i.test(decl.value) || /page/i.test(decl.value)) { + return undefined; + } else { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + }; + + return BreakProps; +}(Declaration); + +Object.defineProperty(BreakProps, 'names', { + enumerable: true, + writable: true, + value: ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after'] +}); + + +module.exports = BreakProps;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/color-adjust.js b/node_modules/autoprefixer/lib/hacks/color-adjust.js new file mode 100644 index 00000000..bb0c26fe --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/color-adjust.js @@ -0,0 +1,48 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var ColorAdjust = function (_Declaration) { + _inherits(ColorAdjust, _Declaration); + + function ColorAdjust() { + _classCallCheck(this, ColorAdjust); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for WebKit-based browsers + */ + ColorAdjust.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'print-color-adjust'; + }; + + /** + * Return property name by spec + */ + + + ColorAdjust.prototype.normalize = function normalize() { + return 'color-adjust'; + }; + + return ColorAdjust; +}(Declaration); + +Object.defineProperty(ColorAdjust, 'names', { + enumerable: true, + writable: true, + value: ['color-adjust', 'print-color-adjust'] +}); + + +module.exports = ColorAdjust;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/cross-fade.js b/node_modules/autoprefixer/lib/hacks/cross-fade.js new file mode 100644 index 00000000..764db3c5 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/cross-fade.js @@ -0,0 +1,58 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); +var list = require('postcss').list; + +var CrossFade = function (_Value) { + _inherits(CrossFade, _Value); + + function CrossFade() { + _classCallCheck(this, CrossFade); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + CrossFade.prototype.replace = function replace(string, prefix) { + var _this2 = this; + + return list.space(string).map(function (value) { + if (value.slice(0, +_this2.name.length + 1) !== _this2.name + '(') { + return value; + } + + var close = value.lastIndexOf(')'); + var after = value.slice(close + 1); + var args = value.slice(_this2.name.length + 1, close); + + if (prefix === '-webkit-') { + var match = args.match(/\d*.?\d+%?/); + if (match) { + args = args.slice(match[0].length).trim(); + args += ', ' + match[0]; + } else { + args += ', 0.5'; + } + } + return prefix + _this2.name + '(' + args + ')' + after; + }).join(' '); + }; + + return CrossFade; +}(Value); + +Object.defineProperty(CrossFade, 'names', { + enumerable: true, + writable: true, + value: ['cross-fade'] +}); + + +module.exports = CrossFade;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/display-flex.js b/node_modules/autoprefixer/lib/hacks/display-flex.js new file mode 100644 index 00000000..2937a6b2 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/display-flex.js @@ -0,0 +1,102 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var OldValue = require('../old-value'); +var Value = require('../value'); + +var DisplayFlex = function (_Value) { + _inherits(DisplayFlex, _Value); + + function DisplayFlex(name, prefixes) { + _classCallCheck(this, DisplayFlex); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'display-flex') { + _this.name = 'flex'; + } + return _this; + } + + /** + * Faster check for flex value + */ + + + DisplayFlex.prototype.check = function check(decl) { + return decl.prop === 'display' && decl.value === this.name; + }; + + /** + * Return value by spec + */ + + + DisplayFlex.prototype.prefixed = function prefixed(prefix) { + var spec = void 0, + value = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + + if (spec === 2009) { + if (this.name === 'flex') { + value = 'box'; + } else { + value = 'inline-box'; + } + } else if (spec === 2012) { + if (this.name === 'flex') { + value = 'flexbox'; + } else { + value = 'inline-flexbox'; + } + } else if (spec === 'final') { + value = this.name; + } + + return prefix + value; + }; + + /** + * Add prefix to value depend on flebox spec version + */ + + + DisplayFlex.prototype.replace = function replace(string, prefix) { + return this.prefixed(prefix); + }; + + /** + * Change value for old specs + */ + + + DisplayFlex.prototype.old = function old(prefix) { + var prefixed = this.prefixed(prefix); + if (!prefixed) return undefined; + return new OldValue(this.name, prefixed); + }; + + return DisplayFlex; +}(Value); + +Object.defineProperty(DisplayFlex, 'names', { + enumerable: true, + writable: true, + value: ['display-flex', 'inline-flex'] +}); + + +module.exports = DisplayFlex;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/display-grid.js b/node_modules/autoprefixer/lib/hacks/display-grid.js new file mode 100644 index 00000000..1bd61b80 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/display-grid.js @@ -0,0 +1,46 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var DisplayGrid = function (_Value) { + _inherits(DisplayGrid, _Value); + + function DisplayGrid(name, prefixes) { + _classCallCheck(this, DisplayGrid); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'display-grid') { + _this.name = 'grid'; + } + return _this; + } + + /** + * Faster check for flex value + */ + + + DisplayGrid.prototype.check = function check(decl) { + return decl.prop === 'display' && decl.value === this.name; + }; + + return DisplayGrid; +}(Value); + +Object.defineProperty(DisplayGrid, 'names', { + enumerable: true, + writable: true, + value: ['display-grid', 'inline-grid'] +}); + + +module.exports = DisplayGrid;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/filter-value.js b/node_modules/autoprefixer/lib/hacks/filter-value.js new file mode 100644 index 00000000..41ba2721 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/filter-value.js @@ -0,0 +1,37 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var FilterValue = function (_Value) { + _inherits(FilterValue, _Value); + + function FilterValue(name, prefixes) { + _classCallCheck(this, FilterValue); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'filter-function') { + _this.name = 'filter'; + } + return _this; + } + + return FilterValue; +}(Value); + +Object.defineProperty(FilterValue, 'names', { + enumerable: true, + writable: true, + value: ['filter', 'filter-function'] +}); + + +module.exports = FilterValue;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/filter.js b/node_modules/autoprefixer/lib/hacks/filter.js new file mode 100644 index 00000000..aeaeac36 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/filter.js @@ -0,0 +1,40 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var Filter = function (_Declaration) { + _inherits(Filter, _Declaration); + + function Filter() { + _classCallCheck(this, Filter); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Check is it Internet Explorer filter + */ + Filter.prototype.check = function check(decl) { + var v = decl.value; + return v.toLowerCase().indexOf('alpha(') === -1 && v.indexOf('DXImageTransform.Microsoft') === -1 && v.indexOf('data:image/svg+xml') === -1; + }; + + return Filter; +}(Declaration); + +Object.defineProperty(Filter, 'names', { + enumerable: true, + writable: true, + value: ['filter'] +}); + + +module.exports = Filter;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-basis.js b/node_modules/autoprefixer/lib/hacks/flex-basis.js new file mode 100644 index 00000000..62634844 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-basis.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexBasis = function (_Declaration) { + _inherits(FlexBasis, _Declaration); + + function FlexBasis() { + _classCallCheck(this, FlexBasis); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexBasis.prototype.normalize = function normalize() { + return 'flex-basis'; + }; + + /** + * Return flex property for 2012 spec + */ + + + FlexBasis.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-preferred-size'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + + + FlexBasis.prototype.set = function set(decl, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2012 || spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexBasis; +}(Declaration); + +Object.defineProperty(FlexBasis, 'names', { + enumerable: true, + writable: true, + value: ['flex-basis', 'flex-preferred-size'] +}); + + +module.exports = FlexBasis;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-direction.js b/node_modules/autoprefixer/lib/hacks/flex-direction.js new file mode 100644 index 00000000..7ca23e31 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-direction.js @@ -0,0 +1,112 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexDirection = function (_Declaration) { + _inherits(FlexDirection, _Declaration); + + function FlexDirection() { + _classCallCheck(this, FlexDirection); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexDirection.prototype.normalize = function normalize() { + return 'flex-direction'; + }; + + /** + * Use two properties for 2009 spec + */ + + + FlexDirection.prototype.insert = function insert(decl, prefix, prefixes) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec !== 2009) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else { + var already = decl.parent.some(function (i) { + return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction'; + }); + if (already) { + return undefined; + } + + var v = decl.value; + var orient = void 0, + dir = void 0; + if (v === 'inherit' || v === 'initial' || v === 'unset') { + orient = v; + dir = v; + } else { + orient = v.indexOf('row') !== -1 ? 'horizontal' : 'vertical'; + dir = v.indexOf('reverse') !== -1 ? 'reverse' : 'normal'; + } + + var cloned = this.clone(decl); + cloned.prop = prefix + 'box-orient'; + cloned.value = orient; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + decl.parent.insertBefore(decl, cloned); + + cloned = this.clone(decl); + cloned.prop = prefix + 'box-direction'; + cloned.value = dir; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + return decl.parent.insertBefore(decl, cloned); + } + }; + + /** + * Clean two properties for 2009 spec + */ + + + FlexDirection.prototype.old = function old(prop, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2009) { + return [prefix + 'box-orient', prefix + 'box-direction']; + } else { + return _Declaration.prototype.old.call(this, prop, prefix); + } + }; + + return FlexDirection; +}(Declaration); + +Object.defineProperty(FlexDirection, 'names', { + enumerable: true, + writable: true, + value: ['flex-direction', 'box-direction', 'box-orient'] +}); + + +module.exports = FlexDirection;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-flow.js b/node_modules/autoprefixer/lib/hacks/flex-flow.js new file mode 100644 index 00000000..74c7cef9 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-flow.js @@ -0,0 +1,83 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexFlow = function (_Declaration) { + _inherits(FlexFlow, _Declaration); + + function FlexFlow() { + _classCallCheck(this, FlexFlow); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use two properties for 2009 spec + */ + FlexFlow.prototype.insert = function insert(decl, prefix, prefixes) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec !== 2009) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else { + var values = decl.value.split(/\s+/).filter(function (i) { + return i !== 'wrap' && i !== 'nowrap' && 'wrap-reverse'; + }); + if (values.length === 0) { + return undefined; + } + + var already = decl.parent.some(function (i) { + return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction'; + }); + if (already) { + return undefined; + } + + var value = values[0]; + var orient = value.indexOf('row') !== -1 ? 'horizontal' : 'vertical'; + var dir = value.indexOf('reverse') !== -1 ? 'reverse' : 'normal'; + + var cloned = this.clone(decl); + cloned.prop = prefix + 'box-orient'; + cloned.value = orient; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + decl.parent.insertBefore(decl, cloned); + + cloned = this.clone(decl); + cloned.prop = prefix + 'box-direction'; + cloned.value = dir; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + return decl.parent.insertBefore(decl, cloned); + } + }; + + return FlexFlow; +}(Declaration); + +Object.defineProperty(FlexFlow, 'names', { + enumerable: true, + writable: true, + value: ['flex-flow', 'box-direction', 'box-orient'] +}); + + +module.exports = FlexFlow;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-grow.js b/node_modules/autoprefixer/lib/hacks/flex-grow.js new file mode 100644 index 00000000..2efc5b91 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-grow.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var Flex = function (_Declaration) { + _inherits(Flex, _Declaration); + + function Flex() { + _classCallCheck(this, Flex); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + Flex.prototype.normalize = function normalize() { + return 'flex'; + }; + + /** + * Return flex property for 2009 and 2012 specs + */ + + + Flex.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-flex'; + } else if (spec === 2012) { + return prefix + 'flex-positive'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + return Flex; +}(Declaration); + +Object.defineProperty(Flex, 'names', { + enumerable: true, + writable: true, + value: ['flex-grow', 'flex-positive'] +}); + + +module.exports = Flex;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-shrink.js b/node_modules/autoprefixer/lib/hacks/flex-shrink.js new file mode 100644 index 00000000..05ab9658 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-shrink.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexShrink = function (_Declaration) { + _inherits(FlexShrink, _Declaration); + + function FlexShrink() { + _classCallCheck(this, FlexShrink); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexShrink.prototype.normalize = function normalize() { + return 'flex-shrink'; + }; + + /** + * Return flex property for 2012 spec + */ + + + FlexShrink.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-negative'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + + + FlexShrink.prototype.set = function set(decl, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2012 || spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexShrink; +}(Declaration); + +Object.defineProperty(FlexShrink, 'names', { + enumerable: true, + writable: true, + value: ['flex-shrink', 'flex-negative'] +}); + + +module.exports = FlexShrink;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-spec.js b/node_modules/autoprefixer/lib/hacks/flex-spec.js new file mode 100644 index 00000000..06ebd104 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-spec.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Return flexbox spec versions by prefix + */ +module.exports = function (prefix) { + var spec = void 0; + if (prefix === '-webkit- 2009' || prefix === '-moz-') { + spec = 2009; + } else if (prefix === '-ms-') { + spec = 2012; + } else if (prefix === '-webkit-') { + spec = 'final'; + } + + if (prefix === '-webkit- 2009') { + prefix = '-webkit-'; + } + + return [spec, prefix]; +};
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex-wrap.js b/node_modules/autoprefixer/lib/hacks/flex-wrap.js new file mode 100644 index 00000000..bc514460 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-wrap.js @@ -0,0 +1,44 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexWrap = function (_Declaration) { + _inherits(FlexWrap, _Declaration); + + function FlexWrap() { + _classCallCheck(this, FlexWrap); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Don't add prefix for 2009 spec + */ + FlexWrap.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec !== 2009) { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexWrap; +}(Declaration); + +Object.defineProperty(FlexWrap, 'names', { + enumerable: true, + writable: true, + value: ['flex-wrap'] +}); + + +module.exports = FlexWrap;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/flex.js b/node_modules/autoprefixer/lib/hacks/flex.js new file mode 100644 index 00000000..4ebad1b6 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex.js @@ -0,0 +1,91 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var list = require('postcss').list; + +var Flex = function (_Declaration) { + _inherits(Flex, _Declaration); + + function Flex() { + _classCallCheck(this, Flex); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 spec + */ + Flex.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-flex'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + Flex.prototype.normalize = function normalize() { + return 'flex'; + }; + + /** + * Spec 2009 supports only first argument + * Spec 2012 disallows unitless basis + */ + + + Flex.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009) { + decl.value = list.space(decl.value)[0]; + decl.value = Flex.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 2012) { + var components = list.space(decl.value); + if (components.length === 3 && components[2] === '0') { + decl.value = components.slice(0, 2).concat('0px').join(' '); + } + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return Flex; +}(Declaration); + +Object.defineProperty(Flex, 'names', { + enumerable: true, + writable: true, + value: ['flex', 'box-flex'] +}); +Object.defineProperty(Flex, 'oldValues', { + enumerable: true, + writable: true, + value: { + auto: '1', + none: '0' + } +}); + + +module.exports = Flex;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/fullscreen.js b/node_modules/autoprefixer/lib/hacks/fullscreen.js new file mode 100644 index 00000000..805f81bf --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/fullscreen.js @@ -0,0 +1,45 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Selector = require('../selector'); + +var Fullscreen = function (_Selector) { + _inherits(Fullscreen, _Selector); + + function Fullscreen() { + _classCallCheck(this, Fullscreen); + + return _possibleConstructorReturn(this, _Selector.apply(this, arguments)); + } + + /** + * Return different selectors depend on prefix + */ + Fullscreen.prototype.prefixed = function prefixed(prefix) { + if (prefix === '-webkit-') { + return ':-webkit-full-screen'; + } else if (prefix === '-moz-') { + return ':-moz-full-screen'; + } else { + return ':' + prefix + 'fullscreen'; + } + }; + + return Fullscreen; +}(Selector); + +Object.defineProperty(Fullscreen, 'names', { + enumerable: true, + writable: true, + value: [':fullscreen'] +}); + + +module.exports = Fullscreen;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/gradient.js b/node_modules/autoprefixer/lib/hacks/gradient.js new file mode 100644 index 00000000..3e41a25c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/gradient.js @@ -0,0 +1,577 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); +var utils = require('../utils'); + +var parser = require('postcss-value-parser'); +var range = require('normalize-range'); + +var isDirection = /top|left|right|bottom/gi; + +var Gradient = function (_Value) { + _inherits(Gradient, _Value); + + function Gradient() { + var _temp, _this, _ret; + + _classCallCheck(this, Gradient); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Value.call.apply(_Value, [this].concat(args))), _this), Object.defineProperty(_this, 'directions', { + enumerable: true, + writable: true, + value: { + top: 'bottom', + left: 'right', + bottom: 'top', + right: 'left' + } + }), Object.defineProperty(_this, 'oldDirections', { + enumerable: true, + writable: true, + value: { + 'top': 'left bottom, left top', + 'left': 'right top, left top', + 'bottom': 'left top, left bottom', + 'right': 'left top, right top', + + 'top right': 'left bottom, right top', + 'top left': 'right bottom, left top', + 'right top': 'left bottom, right top', + 'right bottom': 'left top, right bottom', + 'bottom right': 'left top, right bottom', + 'bottom left': 'right top, left bottom', + 'left top': 'right bottom, left top', + 'left bottom': 'right top, left bottom' + } + }), _temp), _possibleConstructorReturn(_this, _ret); + } + + // Direction to replace + + + // Direction to replace + + + /** + * Change degrees for webkit prefix + */ + Gradient.prototype.replace = function replace(string, prefix) { + var ast = parser(string); + for (var _iterator = ast.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var node = _ref; + + if (node.type === 'function' && node.value === this.name) { + node.nodes = this.newDirection(node.nodes); + node.nodes = this.normalize(node.nodes); + if (prefix === '-webkit- old') { + var changes = this.oldWebkit(node); + if (!changes) { + return false; + } + } else { + node.nodes = this.convertDirection(node.nodes); + node.value = prefix + node.value; + } + } + } + return ast.toString(); + }; + + /** + * Replace first token + */ + + + Gradient.prototype.replaceFirst = function replaceFirst(params) { + for (var _len2 = arguments.length, words = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + words[_key2 - 1] = arguments[_key2]; + } + + var prefix = words.map(function (i) { + if (i === ' ') { + return { type: 'space', value: i }; + } else { + return { type: 'word', value: i }; + } + }); + return prefix.concat(params.slice(1)); + }; + + /** + * Convert angle unit to deg + */ + + + Gradient.prototype.normalizeUnit = function normalizeUnit(str, full) { + var num = parseFloat(str); + var deg = num / full * 360; + return deg + 'deg'; + }; + + /** + * Normalize angle + */ + + + Gradient.prototype.normalize = function normalize(nodes) { + if (!nodes[0]) return nodes; + + if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 400); + } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI); + } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 1); + } else if (nodes[0].value.indexOf('deg') !== -1) { + var num = parseFloat(nodes[0].value); + num = range.wrap(0, 360, num); + nodes[0].value = num + 'deg'; + } + + if (nodes[0].value === '0deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'top'); + } else if (nodes[0].value === '90deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'right'); + } else if (nodes[0].value === '180deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom'); + } else if (nodes[0].value === '270deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'left'); + } + + return nodes; + }; + + /** + * Replace old direction to new + */ + + + Gradient.prototype.newDirection = function newDirection(params) { + if (params[0].value === 'to') { + return params; + } + isDirection.lastIndex = 0; // reset search index of global regexp + if (!isDirection.test(params[0].value)) { + return params; + } + + params.unshift({ + type: 'word', + value: 'to' + }, { + type: 'space', + value: ' ' + }); + + for (var i = 2; i < params.length; i++) { + if (params[i].type === 'div') { + break; + } + if (params[i].type === 'word') { + params[i].value = this.revertDirection(params[i].value); + } + } + + return params; + }; + + /** + * Look for at word + */ + + + Gradient.prototype.isRadial = function isRadial(params) { + var state = 'before'; + for (var _iterator2 = params, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var param = _ref2; + + if (state === 'before' && param.type === 'space') { + state = 'at'; + } else if (state === 'at' && param.value === 'at') { + state = 'after'; + } else if (state === 'after' && param.type === 'space') { + return true; + } else if (param.type === 'div') { + break; + } else { + state = 'before'; + } + } + return false; + }; + + /** + * Change new direction to old + */ + + + Gradient.prototype.convertDirection = function convertDirection(params) { + if (params.length > 0) { + if (params[0].value === 'to') { + this.fixDirection(params); + } else if (params[0].value.indexOf('deg') !== -1) { + this.fixAngle(params); + } else if (this.isRadial(params)) { + this.fixRadial(params); + } + } + return params; + }; + + /** + * Replace `to top left` to `bottom right` + */ + + + Gradient.prototype.fixDirection = function fixDirection(params) { + params.splice(0, 2); + + for (var _iterator3 = params, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var param = _ref3; + + if (param.type === 'div') { + break; + } + if (param.type === 'word') { + param.value = this.revertDirection(param.value); + } + } + }; + + /** + * Add 90 degrees + */ + + + Gradient.prototype.fixAngle = function fixAngle(params) { + var first = params[0].value; + first = parseFloat(first); + first = Math.abs(450 - first) % 360; + first = this.roundFloat(first, 3); + params[0].value = first + 'deg'; + }; + + /** + * Fix radial direction syntax + */ + + + Gradient.prototype.fixRadial = function fixRadial(params) { + var first = []; + var second = []; + var a = void 0, + b = void 0, + c = void 0, + i = void 0, + next = void 0; + + for (i = 0; i < params.length - 2; i++) { + a = params[i]; + b = params[i + 1]; + c = params[i + 2]; + if (a.type === 'space' && b.value === 'at' && c.type === 'space') { + next = i + 3; + break; + } else { + first.push(a); + } + } + + var div = void 0; + for (i = next; i < params.length; i++) { + if (params[i].type === 'div') { + div = params[i]; + break; + } else { + second.push(params[i]); + } + } + + params.splice.apply(params, [0, i].concat(second, [div], first)); + }; + + Gradient.prototype.revertDirection = function revertDirection(word) { + return this.directions[word.toLowerCase()] || word; + }; + + /** + * Round float and save digits under dot + */ + + + Gradient.prototype.roundFloat = function roundFloat(float, digits) { + return parseFloat(float.toFixed(digits)); + }; + + /** + * Convert to old webkit syntax + */ + + + Gradient.prototype.oldWebkit = function oldWebkit(node) { + var nodes = node.nodes; + + var string = parser.stringify(node.nodes); + + if (this.name !== 'linear-gradient') { + return false; + } + if (nodes[0] && nodes[0].value.indexOf('deg') !== -1) { + return false; + } + if (string.indexOf('px') !== -1 || string.indexOf('-corner') !== -1 || string.indexOf('-side') !== -1) { + return false; + } + + var params = [[]]; + for (var _iterator4 = nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var i = _ref4; + + params[params.length - 1].push(i); + if (i.type === 'div' && i.value === ',') { + params.push([]); + } + } + + this.oldDirection(params); + this.colorStops(params); + + node.nodes = []; + for (var _iterator5 = params, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var param = _ref5; + + node.nodes = node.nodes.concat(param); + } + + node.nodes.unshift({ type: 'word', value: 'linear' }, this.cloneDiv(node.nodes)); + node.value = '-webkit-gradient'; + + return true; + }; + + /** + * Change direction syntax to old webkit + */ + + + Gradient.prototype.oldDirection = function oldDirection(params) { + var div = this.cloneDiv(params[0]); + + if (params[0][0].value !== 'to') { + return params.unshift([{ type: 'word', value: this.oldDirections.bottom }, div]); + } else { + var _words = []; + for (var _iterator6 = params[0].slice(2), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var node = _ref6; + + if (node.type === 'word') { + _words.push(node.value.toLowerCase()); + } + } + + _words = _words.join(' '); + var old = this.oldDirections[_words] || _words; + + params[0] = [{ type: 'word', value: old }, div]; + return params[0]; + } + }; + + /** + * Get div token from exists parameters + */ + + + Gradient.prototype.cloneDiv = function cloneDiv(params) { + for (var _iterator7 = params, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var i = _ref7; + + if (i.type === 'div' && i.value === ',') { + return i; + } + } + return { type: 'div', value: ',', after: ' ' }; + }; + + /** + * Change colors syntax to old webkit + */ + + + Gradient.prototype.colorStops = function colorStops(params) { + var result = []; + for (var i = 0; i < params.length; i++) { + var pos = void 0; + var param = params[i]; + var item = void 0; + if (i === 0) { + continue; + } + + var color = parser.stringify(param[0]); + if (param[1] && param[1].type === 'word') { + pos = param[1].value; + } else if (param[2] && param[2].type === 'word') { + pos = param[2].value; + } + + var stop = void 0; + if (i === 1 && (!pos || pos === '0%')) { + stop = 'from(' + color + ')'; + } else if (i === params.length - 1 && (!pos || pos === '100%')) { + stop = 'to(' + color + ')'; + } else if (pos) { + stop = 'color-stop(' + pos + ', ' + color + ')'; + } else { + stop = 'color-stop(' + color + ')'; + } + + var div = param[param.length - 1]; + params[i] = [{ type: 'word', value: stop }]; + if (div.type === 'div' && div.value === ',') { + item = params[i].push(div); + } + result.push(item); + } + return result; + }; + + /** + * Remove old WebKit gradient too + */ + + + Gradient.prototype.old = function old(prefix) { + if (prefix === '-webkit-') { + var type = this.name === 'linear-gradient' ? 'linear' : 'radial'; + var string = '-gradient'; + var regexp = utils.regexp('-webkit-(' + type + '-gradient|gradient\\(\\s*' + type + ')', false); + + return new OldValue(this.name, prefix + this.name, string, regexp); + } else { + return _Value.prototype.old.call(this, prefix); + } + }; + + /** + * Do not add non-webkit prefixes for list-style and object + */ + + + Gradient.prototype.add = function add(decl, prefix) { + var p = decl.prop; + if (p.indexOf('mask') !== -1) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return _Value.prototype.add.call(this, decl, prefix); + } + } else if (p === 'list-style' || p === 'list-style-image' || p === 'content') { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return _Value.prototype.add.call(this, decl, prefix); + } + } else { + return _Value.prototype.add.call(this, decl, prefix); + } + return undefined; + }; + + return Gradient; +}(Value); + +Object.defineProperty(Gradient, 'names', { + enumerable: true, + writable: true, + value: ['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient'] +}); + + +module.exports = Gradient;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-area.js b/node_modules/autoprefixer/lib/hacks/grid-area.js new file mode 100644 index 00000000..78d27165 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-area.js @@ -0,0 +1,59 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var utils = require('./grid-utils'); + +var GridArea = function (_Declaration) { + _inherits(GridArea, _Declaration); + + function GridArea() { + _classCallCheck(this, GridArea); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-area to separate -ms- prefixed properties + */ + GridArea.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var values = utils.parse(decl); + + var _utils$translate = utils.translate(values, 0, 2), + rowStart = _utils$translate[0], + rowSpan = _utils$translate[1]; + + var _utils$translate2 = utils.translate(values, 1, 3), + columnStart = _utils$translate2[0], + columnSpan = _utils$translate2[1]; + + [['grid-row', rowStart], ['grid-row-span', rowSpan], ['grid-column', columnStart], ['grid-column-span', columnSpan]].forEach(function (_ref) { + var prop = _ref[0], + value = _ref[1]; + + utils.insertDecl(decl, prop, value); + }); + + return undefined; + }; + + return GridArea; +}(Declaration); + +Object.defineProperty(GridArea, 'names', { + enumerable: true, + writable: true, + value: ['grid-area'] +}); + + +module.exports = GridArea;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-column-align.js b/node_modules/autoprefixer/lib/hacks/grid-column-align.js new file mode 100644 index 00000000..242f4be7 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-column-align.js @@ -0,0 +1,57 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridColumnAlign = function (_Declaration) { + _inherits(GridColumnAlign, _Declaration); + + function GridColumnAlign() { + _classCallCheck(this, GridColumnAlign); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not prefix flexbox values + */ + GridColumnAlign.prototype.check = function check(decl) { + return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline'; + }; + + /** + * Change property name for IE + */ + + + GridColumnAlign.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'grid-column-align'; + }; + + /** + * Change IE property back + */ + + + GridColumnAlign.prototype.normalize = function normalize() { + return 'justify-self'; + }; + + return GridColumnAlign; +}(Declaration); + +Object.defineProperty(GridColumnAlign, 'names', { + enumerable: true, + writable: true, + value: ['grid-column-align'] +}); + + +module.exports = GridColumnAlign;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-end.js b/node_modules/autoprefixer/lib/hacks/grid-end.js new file mode 100644 index 00000000..e1b68e92 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-end.js @@ -0,0 +1,71 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridEnd = function (_Declaration) { + _inherits(GridEnd, _Declaration); + + function GridEnd() { + _classCallCheck(this, GridEnd); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change repeating syntax for IE + */ + GridEnd.prototype.insert = function insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var clonedDecl = this.clone(decl); + + var startProp = decl.prop.replace(/end$/, 'start'); + var spanProp = prefix + decl.prop.replace(/end$/, 'span'); + + if (decl.parent.some(function (i) { + return i.prop === spanProp; + })) { + return undefined; + } + + clonedDecl.prop = spanProp; + + if (decl.value.includes('span')) { + clonedDecl.value = decl.value.replace(/span\s/i, ''); + } else { + var startDecl = void 0; + decl.parent.walkDecls(startProp, function (d) { + startDecl = d; + }); + if (startDecl) { + var value = Number(decl.value) - Number(startDecl.value) + ''; + clonedDecl.value = value; + } else { + decl.warn(result, 'Can not prefix ' + decl.prop + ' (' + startProp + ' is not found)'); + } + } + + decl.cloneBefore(clonedDecl); + + return undefined; + }; + + return GridEnd; +}(Declaration); + +Object.defineProperty(GridEnd, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-end', 'grid-column-end'] +}); + + +module.exports = GridEnd;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-row-align.js b/node_modules/autoprefixer/lib/hacks/grid-row-align.js new file mode 100644 index 00000000..8a1e634b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-row-align.js @@ -0,0 +1,57 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridRowAlign = function (_Declaration) { + _inherits(GridRowAlign, _Declaration); + + function GridRowAlign() { + _classCallCheck(this, GridRowAlign); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not prefix flexbox values + */ + GridRowAlign.prototype.check = function check(decl) { + return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline'; + }; + + /** + * Change property name for IE + */ + + + GridRowAlign.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'grid-row-align'; + }; + + /** + * Change IE property back + */ + + + GridRowAlign.prototype.normalize = function normalize() { + return 'align-self'; + }; + + return GridRowAlign; +}(Declaration); + +Object.defineProperty(GridRowAlign, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-align'] +}); + + +module.exports = GridRowAlign;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-row-column.js b/node_modules/autoprefixer/lib/hacks/grid-row-column.js new file mode 100644 index 00000000..70f0117c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-row-column.js @@ -0,0 +1,55 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var utils = require('./grid-utils'); + +var GridRowColumn = function (_Declaration) { + _inherits(GridRowColumn, _Declaration); + + function GridRowColumn() { + _classCallCheck(this, GridRowColumn); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-row / grid-column to separate -ms- prefixed properties + */ + GridRowColumn.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var values = utils.parse(decl); + + var _utils$translate = utils.translate(values, 0, 1), + start = _utils$translate[0], + span = _utils$translate[1]; + + [[decl.prop, start], [decl.prop + '-span', span]].forEach(function (_ref) { + var prop = _ref[0], + value = _ref[1]; + + utils.insertDecl(decl, prop, value); + }); + + return undefined; + }; + + return GridRowColumn; +}(Declaration); + +Object.defineProperty(GridRowColumn, 'names', { + enumerable: true, + writable: true, + value: ['grid-row', 'grid-column'] +}); + + +module.exports = GridRowColumn;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js b/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js new file mode 100644 index 00000000..10460fef --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js @@ -0,0 +1,68 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var _require = require('./grid-utils'), + prefixTrackProp = _require.prefixTrackProp, + prefixTrackValue = _require.prefixTrackValue; + +var GridRowsColumns = function (_Declaration) { + _inherits(GridRowsColumns, _Declaration); + + function GridRowsColumns() { + _classCallCheck(this, GridRowsColumns); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for IE + */ + GridRowsColumns.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-ms-') { + return prefixTrackProp({ prop: prop, prefix: prefix }); + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Change IE property back + */ + + + GridRowsColumns.prototype.normalize = function normalize(prop) { + return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1'); + }; + + /** + * Change repeating syntax for IE + */ + + + GridRowsColumns.prototype.set = function set(decl, prefix) { + if (prefix === '-ms-' && decl.value.indexOf('repeat(') !== -1) { + decl.value = prefixTrackValue({ value: decl.value }); + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return GridRowsColumns; +}(Declaration); + +Object.defineProperty(GridRowsColumns, 'names', { + enumerable: true, + writable: true, + value: ['grid-template-rows', 'grid-template-columns', 'grid-rows', 'grid-columns'] +}); + + +module.exports = GridRowsColumns;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-start.js b/node_modules/autoprefixer/lib/hacks/grid-start.js new file mode 100644 index 00000000..33ab920c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-start.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridStart = function (_Declaration) { + _inherits(GridStart, _Declaration); + + function GridStart() { + _classCallCheck(this, GridStart); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefix for unsupported value in IE + */ + GridStart.prototype.check = function check(decl) { + var value = decl.value; + return value.indexOf('/') === -1 || value.indexOf('span') !== -1; + }; + + /** + * Return a final spec property + */ + + + GridStart.prototype.normalize = function normalize(prop) { + return prop.replace('-start', ''); + }; + + /** + * Change property name for IE + */ + + + GridStart.prototype.prefixed = function prefixed(prop, prefix) { + var result = _Declaration.prototype.prefixed.call(this, prop, prefix); + if (prefix === '-ms-') { + result = result.replace('-start', ''); + } + return result; + }; + + return GridStart; +}(Declaration); + +Object.defineProperty(GridStart, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-start', 'grid-column-start'] +}); + + +module.exports = GridStart;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-template-areas.js b/node_modules/autoprefixer/lib/hacks/grid-template-areas.js new file mode 100644 index 00000000..9484581a --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-template-areas.js @@ -0,0 +1,115 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var _require = require('./grid-utils'), + parseGridAreas = _require.parseGridAreas, + insertAreas = _require.insertAreas, + prefixTrackProp = _require.prefixTrackProp, + prefixTrackValue = _require.prefixTrackValue, + getGridGap = _require.getGridGap, + warnGridGap = _require.warnGridGap; + +function getGridRows(tpl) { + return tpl.trim().slice(1, -1).split(/['"]\s*['"]?/g); +} + +var GridTemplateAreas = function (_Declaration) { + _inherits(GridTemplateAreas, _Declaration); + + function GridTemplateAreas() { + _classCallCheck(this, GridTemplateAreas); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-template-areas to separate -ms- prefixed properties + */ + GridTemplateAreas.prototype.insert = function insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var hasColumns = false; + var hasRows = false; + var parent = decl.parent; + var gap = getGridGap(decl); + + // remove already prefixed rows and columns + // without gutter to prevent doubling prefixes + parent.walkDecls(/-ms-grid-(rows|columns)/, function (i) { + return i.remove(); + }); + + // add empty tracks to rows and columns + parent.walkDecls(/grid-template-(rows|columns)/, function (trackDecl) { + if (trackDecl.prop === 'grid-template-rows') { + hasRows = true; + var prop = trackDecl.prop, + value = trackDecl.value; + + trackDecl.cloneBefore({ + prop: prefixTrackProp({ prop: prop, prefix: prefix }), + value: prefixTrackValue({ value: value, gap: gap.row }) + }); + } else { + hasColumns = true; + var _prop = trackDecl.prop, + _value = trackDecl.value; + + trackDecl.cloneBefore({ + prop: prefixTrackProp({ prop: _prop, prefix: prefix }), + value: prefixTrackValue({ value: _value, gap: gap.column }) + }); + } + }); + + var gridRows = getGridRows(decl.value); + + if (hasColumns && !hasRows && gap.row && gridRows.length > 1) { + decl.cloneBefore({ + prop: '-ms-grid-rows', + value: prefixTrackValue({ + value: 'repeat(' + gridRows.length + ', auto)', + gap: gap.row + }), + raws: {} + }); + } + + // warnings + warnGridGap({ + gap: gap, + hasColumns: hasColumns, + decl: decl, + result: result + }); + + var areas = parseGridAreas({ + rows: gridRows, + gap: gap + }); + + insertAreas(areas, decl, result); + + return decl; + }; + + return GridTemplateAreas; +}(Declaration); + +Object.defineProperty(GridTemplateAreas, 'names', { + enumerable: true, + writable: true, + value: ['grid-template-areas'] +}); + + +module.exports = GridTemplateAreas;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-template.js b/node_modules/autoprefixer/lib/hacks/grid-template.js new file mode 100644 index 00000000..c1f2b5bc --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-template.js @@ -0,0 +1,94 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var _require = require('./grid-utils'), + parseTemplate = _require.parseTemplate, + insertAreas = _require.insertAreas, + getGridGap = _require.getGridGap, + warnGridGap = _require.warnGridGap; + +var GridTemplate = function (_Declaration) { + _inherits(GridTemplate, _Declaration); + + function GridTemplate() { + _classCallCheck(this, GridTemplate); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-template to separate -ms- prefixed properties + */ + GridTemplate.prototype.insert = function insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + if (decl.parent.some(function (i) { + return i.prop === '-ms-grid-rows'; + })) { + return undefined; + } + + var gap = getGridGap(decl); + + var _parseTemplate = parseTemplate({ + decl: decl, + gap: gap + }), + rows = _parseTemplate.rows, + columns = _parseTemplate.columns, + areas = _parseTemplate.areas; + + var hasAreas = Object.keys(areas).length > 0; + var hasRows = Boolean(rows); + var hasColumns = Boolean(columns); + + warnGridGap({ + gap: gap, + hasColumns: hasColumns, + decl: decl, + result: result + }); + + if (hasRows && hasColumns || hasAreas) { + decl.cloneBefore({ + prop: '-ms-grid-rows', + value: rows, + raws: {} + }); + } + + if (hasColumns) { + decl.cloneBefore({ + prop: '-ms-grid-columns', + value: columns, + raws: {} + }); + } + + if (hasAreas) { + insertAreas(areas, decl, result); + } + + return decl; + }; + + return GridTemplate; +}(Declaration); + +Object.defineProperty(GridTemplate, 'names', { + enumerable: true, + writable: true, + value: ['grid-template'] +}); + + +module.exports = GridTemplate;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/grid-utils.js b/node_modules/autoprefixer/lib/hacks/grid-utils.js new file mode 100644 index 00000000..38b9ec05 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-utils.js @@ -0,0 +1,430 @@ +'use strict'; + +var parser = require('postcss-value-parser'); + +function convert(value) { + if (value && value.length === 2 && value[0] === 'span' && parseInt(value[1], 10) > 0) { + return [false, parseInt(value[1], 10)]; + } + + if (value && value.length === 1 && parseInt(value[0], 10) > 0) { + return [parseInt(value[0], 10), false]; + } + + return [false, false]; +} + +function translate(values, startIndex, endIndex) { + var startValue = values[startIndex]; + var endValue = values[endIndex]; + + if (!startValue) { + return [false, false]; + } + + var _convert = convert(startValue), + start = _convert[0], + spanStart = _convert[1]; + + var _convert2 = convert(endValue), + end = _convert2[0], + spanEnd = _convert2[1]; + + if (start && !endValue) { + return [start, false]; + } + + if (spanStart && end) { + return [end - spanStart, spanStart]; + } + + if (start && spanEnd) { + return [start, spanEnd]; + } + + if (start && end) { + return [start, end - start]; + } + + return [false, false]; +} + +function parse(decl) { + var node = parser(decl.value); + + var values = []; + var current = 0; + values[current] = []; + + for (var _iterator = node.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var i = _ref; + + if (i.type === 'div') { + current += 1; + values[current] = []; + } else if (i.type === 'word') { + values[current].push(i.value); + } + } + + return values; +} + +function insertDecl(decl, prop, value) { + if (value && !decl.parent.some(function (i) { + return i.prop === '-ms-' + prop; + })) { + decl.cloneBefore({ + prop: '-ms-' + prop, + value: value.toString() + }); + } +} + +// Track transforms + +function prefixTrackProp(_ref2) { + var prop = _ref2.prop, + prefix = _ref2.prefix; + + return prefix + prop.replace('template-', ''); +} + +function transformRepeat(_ref3, _ref4) { + var nodes = _ref3.nodes; + var gap = _ref4.gap; + + var _nodes$reduce = nodes.reduce(function (result, node) { + if (node.type === 'div' && node.value === ',') { + result.key = 'size'; + } else { + result[result.key].push(parser.stringify(node)); + } + return result; + }, { + key: 'count', + size: [], + count: [] + }), + count = _nodes$reduce.count, + size = _nodes$reduce.size; + + if (gap) { + var val = []; + for (var i = 1; i <= count; i++) { + if (gap && i > 1) { + val.push(gap); + } + val.push(size.join()); + } + return val.join(' '); + } + + return '(' + size.join('') + ')[' + count.join('') + ']'; +} + +function prefixTrackValue(_ref5) { + var value = _ref5.value, + gap = _ref5.gap; + + var result = parser(value).nodes.reduce(function (nodes, node) { + if (node.type === 'function' && node.value === 'repeat') { + return nodes.concat({ + type: 'word', + value: transformRepeat(node, { gap: gap }) + }); + } + if (gap && node.type === 'space') { + return nodes.concat({ + type: 'space', + value: ' ' + }, { + type: 'word', + value: gap + }, node); + } + return nodes.concat(node); + }, []); + + return parser.stringify(result); +} + +// Parse grid-template-areas + +var DOTS = /^\.+$/; + +function track(start, end) { + return { start: start, end: end, span: end - start }; +} + +function getColumns(line) { + return line.trim().split(/\s+/g); +} + +function parseGridAreas(_ref6) { + var rows = _ref6.rows, + gap = _ref6.gap; + + return rows.reduce(function (areas, line, rowIndex) { + + if (gap.row) rowIndex *= 2; + + if (line.trim() === '') return areas; + + getColumns(line).forEach(function (area, columnIndex) { + + if (DOTS.test(area)) return; + + if (gap.column) columnIndex *= 2; + + if (typeof areas[area] === 'undefined') { + + areas[area] = { + column: track(columnIndex + 1, columnIndex + 2), + row: track(rowIndex + 1, rowIndex + 2) + }; + } else { + var _areas$area = areas[area], + column = _areas$area.column, + row = _areas$area.row; + + + column.start = Math.min(column.start, columnIndex + 1); + column.end = Math.max(column.end, columnIndex + 2); + column.span = column.end - column.start; + + row.start = Math.min(row.start, rowIndex + 1); + row.end = Math.max(row.end, rowIndex + 2); + row.span = row.end - row.start; + } + }); + + return areas; + }, {}); +} + +// Parse grid-template + +function testTrack(node) { + return node.type === 'word' && /^\[.+\]$/.test(node.value); +} + +function verifyRowSize(result) { + if (result.areas.length > result.rows.length) { + result.rows.push('auto'); + } + return result; +} + +function parseTemplate(_ref7) { + var decl = _ref7.decl, + gap = _ref7.gap; + + var gridTemplate = parser(decl.value).nodes.reduce(function (result, node) { + var type = node.type, + value = node.value; + + + if (testTrack(node) || type === 'space') return result; + + // area + if (type === 'string') { + result = verifyRowSize(result); + result.areas.push(value); + } + + // values and function + if (type === 'word' || type === 'function') { + result[result.key].push(parser.stringify(node)); + } + + // devider(/) + if (type === 'div' && value === '/') { + result.key = 'columns'; + result = verifyRowSize(result); + } + + return result; + }, { + key: 'rows', + columns: [], + rows: [], + areas: [] + }); + + return { + areas: parseGridAreas({ + rows: gridTemplate.areas, + gap: gap + }), + columns: prefixTrackValue({ + value: gridTemplate.columns.join(' '), + gap: gap.column + }), + rows: prefixTrackValue({ + value: gridTemplate.rows.join(' '), + gap: gap.row + }) + }; +} + +// Insert parsed grid areas + +function getMSDecls(area) { + return [].concat({ + prop: '-ms-grid-row', + value: String(area.row.start) + }, area.row.span > 1 ? { + prop: '-ms-grid-row-span', + value: String(area.row.span) + } : [], { + prop: '-ms-grid-column', + value: String(area.column.start) + }, area.column.span > 1 ? { + prop: '-ms-grid-column-span', + value: String(area.column.span) + } : []); +} + +function getParentMedia(parent) { + if (parent.type === 'atrule' && parent.name === 'media') { + return parent; + } else if (!parent.parent) { + return false; + } + return getParentMedia(parent.parent); +} + +function insertAreas(areas, decl, result) { + var missed = Object.keys(areas); + + var parentMedia = getParentMedia(decl.parent); + var rules = []; + var areasLength = Object.keys(areas).length; + var areasCount = 0; + + decl.root().walkDecls('grid-area', function (gridArea) { + + var value = gridArea.value; + var area = areas[value]; + + missed = missed.filter(function (e) { + return e !== value; + }); + + if (area && parentMedia) { + + // create new rule + var rule = decl.parent.clone({ + selector: gridArea.parent.selector + }); + rule.removeAll(); + + // insert prefixed decls in new rule + getMSDecls(area).forEach(function (i) { + return rule.append(Object.assign(i, { + raws: { + between: gridArea.raws.between + } + })); + }); + + rules.push(rule); + areasCount++; + if (areasCount === areasLength) { + var next = gridArea.parent.next(); + + if (next && next.type === 'atrule' && next.name === 'media' && next.params === parentMedia.params && next.first.type === 'rule' && next.first.selector && parentMedia.first.selector && /^-ms-/.test(next.first.first.prop)) return undefined; + + var areaMedia = parentMedia.clone().removeAll().append(rules); + gridArea.parent.after(areaMedia); + } + + return undefined; + } + + if (area) { + gridArea.parent.walkDecls(/-ms-grid-(row|column)/, function (d) { + d.remove(); + }); + + // insert prefixed decls before grid-area + getMSDecls(area).forEach(function (i) { + return gridArea.cloneBefore(i); + }); + } + + return undefined; + }); + + if (missed.length > 0) { + decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')); + } +} + +// Gap utils + +function getGridGap(decl) { + + var gap = {}; + + // try to find gap + var testGap = /^(grid-)?((row|column)-)?gap$/; + decl.parent.walkDecls(testGap, function (_ref8) { + var prop = _ref8.prop, + value = _ref8.value; + + if (/^(grid-)?gap$/.test(prop)) { + var _parser$nodes = parser(value).nodes, + _parser$nodes$ = _parser$nodes[0], + row = _parser$nodes$ === undefined ? {} : _parser$nodes$, + _parser$nodes$2 = _parser$nodes[2], + column = _parser$nodes$2 === undefined ? {} : _parser$nodes$2; + + + gap.row = row.value; + gap.column = column.value || row.value; + } + if (/^(grid-)?row-gap$/.test(prop)) gap.row = value; + if (/^(grid-)?column-gap$/.test(prop)) gap.column = value; + }); + + return gap; +} + +function warnGridGap(_ref9) { + var gap = _ref9.gap, + hasColumns = _ref9.hasColumns, + decl = _ref9.decl, + result = _ref9.result; + + var hasBothGaps = gap.row && gap.column; + if (!hasColumns && (hasBothGaps || gap.column && !gap.row)) { + delete gap.column; + decl.warn(result, 'Can not impliment grid-gap without grid-tamplate-columns'); + } +} + +module.exports = { + parse: parse, + translate: translate, + parseTemplate: parseTemplate, + parseGridAreas: parseGridAreas, + insertAreas: insertAreas, + insertDecl: insertDecl, + prefixTrackProp: prefixTrackProp, + prefixTrackValue: prefixTrackValue, + getGridGap: getGridGap, + warnGridGap: warnGridGap +};
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/image-rendering.js b/node_modules/autoprefixer/lib/hacks/image-rendering.js new file mode 100644 index 00000000..9331fadb --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/image-rendering.js @@ -0,0 +1,82 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var ImageRendering = function (_Declaration) { + _inherits(ImageRendering, _Declaration); + + function ImageRendering() { + _classCallCheck(this, ImageRendering); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Add hack only for crisp-edges + */ + ImageRendering.prototype.check = function check(decl) { + return decl.value === 'pixelated'; + }; + + /** + * Change property name for IE + */ + + + ImageRendering.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-ms-') { + return '-ms-interpolation-mode'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Change property and value for IE + */ + + + ImageRendering.prototype.set = function set(decl, prefix) { + if (prefix !== '-ms-') return _Declaration.prototype.set.call(this, decl, prefix); + decl.prop = '-ms-interpolation-mode'; + decl.value = 'nearest-neighbor'; + return decl; + }; + + /** + * Return property name by spec + */ + + + ImageRendering.prototype.normalize = function normalize() { + return 'image-rendering'; + }; + + /** + * Warn on old value + */ + + + ImageRendering.prototype.process = function process(node, result) { + return _Declaration.prototype.process.call(this, node, result); + }; + + return ImageRendering; +}(Declaration); + +Object.defineProperty(ImageRendering, 'names', { + enumerable: true, + writable: true, + value: ['image-rendering', 'interpolation-mode'] +}); + + +module.exports = ImageRendering;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/image-set.js b/node_modules/autoprefixer/lib/hacks/image-set.js new file mode 100644 index 00000000..7af5255a --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/image-set.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var ImageSet = function (_Value) { + _inherits(ImageSet, _Value); + + function ImageSet() { + _classCallCheck(this, ImageSet); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + /** + * Use non-standard name for WebKit and Firefox + */ + ImageSet.prototype.replace = function replace(string, prefix) { + var fixed = _Value.prototype.replace.call(this, string, prefix); + if (prefix === '-webkit-') { + fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2'); + } + return fixed; + }; + + return ImageSet; +}(Value); + +Object.defineProperty(ImageSet, 'names', { + enumerable: true, + writable: true, + value: ['image-set'] +}); + + +module.exports = ImageSet;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/inline-logical.js b/node_modules/autoprefixer/lib/hacks/inline-logical.js new file mode 100644 index 00000000..7de072ac --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/inline-logical.js @@ -0,0 +1,48 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var InlineLogical = function (_Declaration) { + _inherits(InlineLogical, _Declaration); + + function InlineLogical() { + _classCallCheck(this, InlineLogical); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use old syntax for -moz- and -webkit- + */ + InlineLogical.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + prop.replace('-inline', ''); + }; + + /** + * Return property name by spec + */ + + + InlineLogical.prototype.normalize = function normalize(prop) { + return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2'); + }; + + return InlineLogical; +}(Declaration); + +Object.defineProperty(InlineLogical, 'names', { + enumerable: true, + writable: true, + value: ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end'] +}); + + +module.exports = InlineLogical;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/intrinsic.js b/node_modules/autoprefixer/lib/hacks/intrinsic.js new file mode 100644 index 00000000..af424a28 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/intrinsic.js @@ -0,0 +1,75 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); + +function _regexp(name) { + return new RegExp('(^|[\\s,(])(' + name + '($|[\\s),]))', 'gi'); +} + +var Intrinsic = function (_Value) { + _inherits(Intrinsic, _Value); + + function Intrinsic() { + _classCallCheck(this, Intrinsic); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + Intrinsic.prototype.regexp = function regexp() { + if (!this.regexpCache) this.regexpCache = _regexp(this.name); + return this.regexpCache; + }; + + Intrinsic.prototype.isStretch = function isStretch() { + return this.name === 'stretch' || this.name === 'fill' || this.name === 'fill-available'; + }; + + Intrinsic.prototype.replace = function replace(string, prefix) { + if (prefix === '-moz-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-moz-available$3'); + } else if (prefix === '-webkit-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-webkit-fill-available$3'); + } else { + return _Value.prototype.replace.call(this, string, prefix); + } + }; + + Intrinsic.prototype.old = function old(prefix) { + var prefixed = prefix + this.name; + if (this.isStretch()) { + if (prefix === '-moz-') { + prefixed = '-moz-available'; + } else if (prefix === '-webkit-') { + prefixed = '-webkit-fill-available'; + } + } + return new OldValue(this.name, prefixed, prefixed, _regexp(prefixed)); + }; + + Intrinsic.prototype.add = function add(decl, prefix) { + if (decl.prop.indexOf('grid') !== -1 && prefix !== '-webkit-') { + return undefined; + } + return _Value.prototype.add.call(this, decl, prefix); + }; + + return Intrinsic; +}(Value); + +Object.defineProperty(Intrinsic, 'names', { + enumerable: true, + writable: true, + value: ['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch'] +}); + + +module.exports = Intrinsic;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/justify-content.js b/node_modules/autoprefixer/lib/hacks/justify-content.js new file mode 100644 index 00000000..f6075b56 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/justify-content.js @@ -0,0 +1,91 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var JustifyContent = function (_Declaration) { + _inherits(JustifyContent, _Declaration); + + function JustifyContent() { + _classCallCheck(this, JustifyContent); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + JustifyContent.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-pack'; + } else if (spec === 2012) { + return prefix + 'flex-pack'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + JustifyContent.prototype.normalize = function normalize() { + return 'justify-content'; + }; + + /** + * Change value for 2009 and 2012 specs + */ + + + JustifyContent.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 || spec === 2012) { + var value = JustifyContent.oldValues[decl.value] || decl.value; + decl.value = value; + if (spec !== 2009 || value !== 'distribute') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return JustifyContent; +}(Declaration); + +Object.defineProperty(JustifyContent, 'names', { + enumerable: true, + writable: true, + value: ['justify-content', 'flex-pack', 'box-pack'] +}); +Object.defineProperty(JustifyContent, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-between': 'justify', + 'space-around': 'distribute' + } +}); + + +module.exports = JustifyContent;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/mask-border.js b/node_modules/autoprefixer/lib/hacks/mask-border.js new file mode 100644 index 00000000..79a0d554 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/mask-border.js @@ -0,0 +1,52 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var MaskBorder = function (_Declaration) { + _inherits(MaskBorder, _Declaration); + + function MaskBorder() { + _classCallCheck(this, MaskBorder); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + MaskBorder.prototype.normalize = function normalize() { + return this.name.replace('box-image', 'border'); + }; + + /** + * Return flex property for 2012 spec + */ + + + MaskBorder.prototype.prefixed = function prefixed(prop, prefix) { + var result = _Declaration.prototype.prefixed.call(this, prop, prefix); + if (prefix === '-webkit-') { + result = result.replace('border', 'box-image'); + } + return result; + }; + + return MaskBorder; +}(Declaration); + +Object.defineProperty(MaskBorder, 'names', { + enumerable: true, + writable: true, + value: ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat'] +}); + + +module.exports = MaskBorder;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/order.js b/node_modules/autoprefixer/lib/hacks/order.js new file mode 100644 index 00000000..b6f6110a --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/order.js @@ -0,0 +1,77 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var Order = function (_Declaration) { + _inherits(Order, _Declaration); + + function Order() { + _classCallCheck(this, Order); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + Order.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-ordinal-group'; + } else if (spec === 2012) { + return prefix + 'flex-order'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + Order.prototype.normalize = function normalize() { + return 'order'; + }; + + /** + * Fix value for 2009 spec + */ + + + Order.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 && /\d/.test(decl.value)) { + decl.value = (parseInt(decl.value) + 1).toString(); + return _Declaration.prototype.set.call(this, decl, prefix); + } else { + return _Declaration.prototype.set.call(this, decl, prefix); + } + }; + + return Order; +}(Declaration); + +Object.defineProperty(Order, 'names', { + enumerable: true, + writable: true, + value: ['order', 'flex-order', 'box-ordinal-group'] +}); + + +module.exports = Order;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js b/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js new file mode 100644 index 00000000..98ddb328 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var OverscrollBehavior = function (_Declaration) { + _inherits(OverscrollBehavior, _Declaration); + + function OverscrollBehavior() { + _classCallCheck(this, OverscrollBehavior); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for IE + */ + OverscrollBehavior.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'scroll-chaining'; + }; + + /** + * Return property name by spec + */ + + + OverscrollBehavior.prototype.normalize = function normalize() { + return 'overscroll-behavior'; + }; + + /** + * Change value for IE + */ + + + OverscrollBehavior.prototype.set = function set(decl, prefix) { + if (decl.value === 'auto') { + decl.value = 'chained'; + } else if (decl.value === 'none' || decl.value === 'contain') { + decl.value = 'none'; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return OverscrollBehavior; +}(Declaration); + +Object.defineProperty(OverscrollBehavior, 'names', { + enumerable: true, + writable: true, + value: ['overscroll-behavior', 'scroll-chaining'] +}); + + +module.exports = OverscrollBehavior;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/pixelated.js b/node_modules/autoprefixer/lib/hacks/pixelated.js new file mode 100644 index 00000000..dd5dddb6 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/pixelated.js @@ -0,0 +1,61 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); + +var Pixelated = function (_Value) { + _inherits(Pixelated, _Value); + + function Pixelated() { + _classCallCheck(this, Pixelated); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + /** + * Use non-standard name for WebKit and Firefox + */ + Pixelated.prototype.replace = function replace(string, prefix) { + if (prefix === '-webkit-') { + return string.replace(this.regexp(), '$1-webkit-optimize-contrast'); + } else if (prefix === '-moz-') { + return string.replace(this.regexp(), '$1-moz-crisp-edges'); + } else { + return _Value.prototype.replace.call(this, string, prefix); + } + }; + + /** + * Different name for WebKit and Firefox + */ + + + Pixelated.prototype.old = function old(prefix) { + if (prefix === '-webkit-') { + return new OldValue(this.name, '-webkit-optimize-contrast'); + } else if (prefix === '-moz-') { + return new OldValue(this.name, '-moz-crisp-edges'); + } else { + return _Value.prototype.old.call(this, prefix); + } + }; + + return Pixelated; +}(Value); + +Object.defineProperty(Pixelated, 'names', { + enumerable: true, + writable: true, + value: ['pixelated'] +}); + + +module.exports = Pixelated;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/placeholder.js b/node_modules/autoprefixer/lib/hacks/placeholder.js new file mode 100644 index 00000000..27a3064e --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/placeholder.js @@ -0,0 +1,58 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Selector = require('../selector'); + +var Placeholder = function (_Selector) { + _inherits(Placeholder, _Selector); + + function Placeholder() { + _classCallCheck(this, Placeholder); + + return _possibleConstructorReturn(this, _Selector.apply(this, arguments)); + } + + /** + * Add old mozilla to possible prefixes + */ + Placeholder.prototype.possible = function possible() { + return _Selector.prototype.possible.call(this).concat(['-moz- old', '-ms- old']); + }; + + /** + * Return different selectors depend on prefix + */ + + + Placeholder.prototype.prefixed = function prefixed(prefix) { + if (prefix === '-webkit-') { + return '::-webkit-input-placeholder'; + } else if (prefix === '-ms-') { + return '::-ms-input-placeholder'; + } else if (prefix === '-ms- old') { + return ':-ms-input-placeholder'; + } else if (prefix === '-moz- old') { + return ':-moz-placeholder'; + } else { + return '::' + prefix + 'placeholder'; + } + }; + + return Placeholder; +}(Selector); + +Object.defineProperty(Placeholder, 'names', { + enumerable: true, + writable: true, + value: ['::placeholder'] +}); + + +module.exports = Placeholder;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/text-decoration.js b/node_modules/autoprefixer/lib/hacks/text-decoration.js new file mode 100644 index 00000000..c1b44e06 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/text-decoration.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BASIC = ['none', 'underline', 'overline', 'line-through', 'blink', 'inherit', 'initial', 'unset']; + +var TextDecoration = function (_Declaration) { + _inherits(TextDecoration, _Declaration); + + function TextDecoration() { + _classCallCheck(this, TextDecoration); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefixes for basic values. + */ + TextDecoration.prototype.check = function check(decl) { + return decl.value.split(/\s+/).some(function (i) { + return BASIC.indexOf(i) === -1; + }); + }; + + return TextDecoration; +}(Declaration); + +Object.defineProperty(TextDecoration, 'names', { + enumerable: true, + writable: true, + value: ['text-decoration'] +}); + + +module.exports = TextDecoration;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js b/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js new file mode 100644 index 00000000..fe0b4283 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js @@ -0,0 +1,39 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var TextEmphasisPosition = function (_Declaration) { + _inherits(TextEmphasisPosition, _Declaration); + + function TextEmphasisPosition() { + _classCallCheck(this, TextEmphasisPosition); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + TextEmphasisPosition.prototype.set = function set(decl, prefix) { + if (prefix === '-webkit-') { + decl.value = decl.value.replace(/\s*(right|left)\s*/i, ''); + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return TextEmphasisPosition; +}(Declaration); + +Object.defineProperty(TextEmphasisPosition, 'names', { + enumerable: true, + writable: true, + value: ['text-emphasis-position'] +}); + + +module.exports = TextEmphasisPosition;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/transform-decl.js b/node_modules/autoprefixer/lib/hacks/transform-decl.js new file mode 100644 index 00000000..747bf1d0 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/transform-decl.js @@ -0,0 +1,118 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var TransformDecl = function (_Declaration) { + _inherits(TransformDecl, _Declaration); + + function TransformDecl() { + _classCallCheck(this, TransformDecl); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Recursively check all parents for @keyframes + */ + TransformDecl.prototype.keyframeParents = function keyframeParents(decl) { + var parent = decl.parent; + + while (parent) { + if (parent.type === 'atrule' && parent.name === 'keyframes') { + return true; + } + var _parent = parent; + parent = _parent.parent; + } + return false; + }; + + /** + * Is transform contain 3D commands + */ + + + TransformDecl.prototype.contain3d = function contain3d(decl) { + if (decl.prop === 'transform-origin') { + return false; + } + + for (var _iterator = TransformDecl.functions3d, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var func = _ref; + + if (decl.value.indexOf(func + '(') !== -1) { + return true; + } + } + + return false; + }; + + /** + * Replace rotateZ to rotate for IE 9 + */ + + + TransformDecl.prototype.set = function set(decl, prefix) { + decl = _Declaration.prototype.set.call(this, decl, prefix); + if (prefix === '-ms-') { + decl.value = decl.value.replace(/rotateZ/gi, 'rotate'); + } + return decl; + }; + + /** + * Don't add prefix for IE in keyframes + */ + + + TransformDecl.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix === '-ms-') { + if (!this.contain3d(decl) && !this.keyframeParents(decl)) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + } else if (prefix === '-o-') { + if (!this.contain3d(decl)) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + } else { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + return undefined; + }; + + return TransformDecl; +}(Declaration); + +Object.defineProperty(TransformDecl, 'names', { + enumerable: true, + writable: true, + value: ['transform', 'transform-origin'] +}); +Object.defineProperty(TransformDecl, 'functions3d', { + enumerable: true, + writable: true, + value: ['matrix3d', 'translate3d', 'translateZ', 'scale3d', 'scaleZ', 'rotate3d', 'rotateX', 'rotateY', 'perspective'] +}); + + +module.exports = TransformDecl;
\ No newline at end of file diff --git a/node_modules/autoprefixer/lib/hacks/writing-mode.js b/node_modules/autoprefixer/lib/hacks/writing-mode.js new file mode 100644 index 00000000..672060e0 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/writing-mode.js @@ -0,0 +1,50 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var WritingMode = function (_Declaration) { + _inherits(WritingMode, _Declaration); + + function WritingMode() { + _classCallCheck(this, WritingMode); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + WritingMode.prototype.set = function set(decl, prefix) { + if (prefix === '-ms-') { + decl.value = WritingMode.msValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else { + return _Declaration.prototype.set.call(this, decl, prefix); + } + }; + + return WritingMode; +}(Declaration); + +Object.defineProperty(WritingMode, 'names', { + enumerable: true, + writable: true, + value: ['writing-mode'] +}); +Object.defineProperty(WritingMode, 'msValues', { + enumerable: true, + writable: true, + value: { + 'horizontal-tb': 'lr-tb', + 'vertical-rl': 'tb-rl', + 'vertical-lr': 'tb-lr' + } +}); + + +module.exports = WritingMode;
\ No newline at end of file |
