autoprefixer 6.7.6 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/AUTHORS +1 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +10 -16
  4. package/data/prefixes.js +551 -517
  5. package/lib/at-rule.js +55 -38
  6. package/lib/autoprefixer.js +89 -63
  7. package/lib/brackets.js +59 -39
  8. package/lib/browsers.js +102 -65
  9. package/lib/declaration.js +212 -121
  10. package/lib/hacks/align-content.js +65 -38
  11. package/lib/hacks/align-items.js +62 -38
  12. package/lib/hacks/align-self.js +63 -36
  13. package/lib/hacks/appearance.js +42 -0
  14. package/lib/hacks/background-size.js +29 -20
  15. package/lib/hacks/block-logical.js +36 -21
  16. package/lib/hacks/border-image.js +26 -16
  17. package/lib/hacks/border-radius.js +60 -39
  18. package/lib/hacks/break-props.js +69 -44
  19. package/lib/hacks/cross-fade.js +40 -37
  20. package/lib/hacks/display-flex.js +81 -31
  21. package/lib/hacks/display-grid.js +29 -19
  22. package/lib/hacks/filter-value.js +66 -45
  23. package/lib/hacks/filter.js +26 -17
  24. package/lib/hacks/flex-basis.js +60 -30
  25. package/lib/hacks/flex-direction.js +85 -53
  26. package/lib/hacks/flex-flow.js +67 -49
  27. package/lib/hacks/flex-grow.js +45 -26
  28. package/lib/hacks/flex-shrink.js +60 -30
  29. package/lib/hacks/flex-spec.js +18 -8
  30. package/lib/hacks/flex-values.js +39 -20
  31. package/lib/hacks/flex-wrap.js +29 -20
  32. package/lib/hacks/flex.js +68 -43
  33. package/lib/hacks/fullscreen.js +31 -21
  34. package/lib/hacks/gradient.js +462 -302
  35. package/lib/hacks/grid-column-align.js +55 -0
  36. package/lib/hacks/grid-end.js +53 -28
  37. package/lib/hacks/grid-row-align.js +39 -19
  38. package/lib/hacks/grid-start.js +80 -48
  39. package/lib/hacks/grid-template.js +91 -55
  40. package/lib/hacks/image-rendering.js +63 -33
  41. package/lib/hacks/image-set.js +28 -20
  42. package/lib/hacks/inline-logical.js +32 -17
  43. package/lib/hacks/intrinsic.js +66 -0
  44. package/lib/hacks/justify-content.js +69 -42
  45. package/lib/hacks/mask-border.js +36 -21
  46. package/lib/hacks/order.js +58 -35
  47. package/lib/hacks/pixelated.js +44 -30
  48. package/lib/hacks/placeholder.js +40 -25
  49. package/lib/hacks/text-emphasis-position.js +27 -20
  50. package/lib/hacks/transform-decl.js +94 -52
  51. package/lib/hacks/writing-mode.js +37 -27
  52. package/lib/info.js +117 -78
  53. package/lib/old-selector.js +84 -58
  54. package/lib/old-value.js +22 -20
  55. package/lib/prefixer.js +164 -95
  56. package/lib/prefixes.js +446 -351
  57. package/lib/processor.js +394 -278
  58. package/lib/resolution.js +135 -75
  59. package/lib/selector.js +145 -84
  60. package/lib/supports.js +330 -210
  61. package/lib/transition.js +396 -243
  62. package/lib/utils.js +84 -48
  63. package/lib/value.js +118 -80
  64. package/package.json +54 -14
  65. package/lib/hacks/justify-items.js +0 -31
  66. package/lib/hacks/stretch.js +0 -45
@@ -1,162 +1,253 @@
1
- (function() {
2
- var Browsers, Declaration, Prefixer, utils,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- Prefixer = require('./prefixer');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Browsers = require('./browsers');
5
+ 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; }
9
6
 
10
- utils = require('./utils');
7
+ 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) : subClass.__proto__ = superClass; }
11
8
 
12
- Declaration = (function(superClass) {
13
- extend(Declaration, superClass);
9
+ var Prefixer = require('./prefixer');
10
+ var Browsers = require('./browsers');
11
+ var utils = require('./utils');
12
+
13
+ var Declaration = function (_Prefixer) {
14
+ _inherits(Declaration, _Prefixer);
14
15
 
15
16
  function Declaration() {
16
- return Declaration.__super__.constructor.apply(this, arguments);
17
+ _classCallCheck(this, Declaration);
18
+
19
+ return _possibleConstructorReturn(this, _Prefixer.apply(this, arguments));
17
20
  }
18
21
 
19
- Declaration.prototype.check = function(decl) {
20
- return true;
22
+ /**
23
+ * Always true, because we already get prefixer by property name
24
+ */
25
+ Declaration.prototype.check = function check() /* decl */{
26
+ return true;
21
27
  };
22
28
 
23
- Declaration.prototype.prefixed = function(prop, prefix) {
24
- return prefix + prop;
29
+ /**
30
+ * Return prefixed version of property
31
+ */
32
+
33
+
34
+ Declaration.prototype.prefixed = function prefixed(prop, prefix) {
35
+ return prefix + prop;
25
36
  };
26
37
 
27
- Declaration.prototype.normalize = function(prop) {
28
- return prop;
38
+ /**
39
+ * Return unprefixed version of property
40
+ */
41
+
42
+
43
+ Declaration.prototype.normalize = function normalize(prop) {
44
+ return prop;
29
45
  };
30
46
 
31
- Declaration.prototype.otherPrefixes = function(value, prefix) {
32
- var j, len, other, ref;
33
- ref = Browsers.prefixes();
34
- for (j = 0, len = ref.length; j < len; j++) {
35
- other = ref[j];
36
- if (other === prefix) {
37
- continue;
38
- }
39
- if (value.indexOf(other) !== -1) {
40
- return true;
47
+ /**
48
+ * Check `value`, that it contain other prefixes, rather than `prefix`
49
+ */
50
+
51
+
52
+ Declaration.prototype.otherPrefixes = function otherPrefixes(value, prefix) {
53
+ for (var _iterator = Browsers.prefixes(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
54
+ var _ref;
55
+
56
+ if (_isArray) {
57
+ if (_i >= _iterator.length) break;
58
+ _ref = _iterator[_i++];
59
+ } else {
60
+ _i = _iterator.next();
61
+ if (_i.done) break;
62
+ _ref = _i.value;
63
+ }
64
+
65
+ var other = _ref;
66
+
67
+ if (other === prefix) {
68
+ continue;
69
+ }
70
+ if (value.indexOf(other) !== -1) {
71
+ return true;
72
+ }
41
73
  }
42
- }
43
- return false;
74
+ return false;
44
75
  };
45
76
 
46
- Declaration.prototype.set = function(decl, prefix) {
47
- decl.prop = this.prefixed(decl.prop, prefix);
48
- return decl;
49
- };
77
+ /**
78
+ * Set prefix to declaration
79
+ */
50
80
 
51
- Declaration.prototype.needCascade = function(decl) {
52
- return decl._autoprefixerCascade || (decl._autoprefixerCascade = this.all.options.cascade !== false && decl.raw('before').indexOf('\n') !== -1);
81
+
82
+ Declaration.prototype.set = function set(decl, prefix) {
83
+ decl.prop = this.prefixed(decl.prop, prefix);
84
+ return decl;
53
85
  };
54
86
 
55
- Declaration.prototype.maxPrefixed = function(prefixes, decl) {
56
- var j, len, max, prefix;
57
- if (decl._autoprefixerMax) {
58
- return decl._autoprefixerMax;
59
- }
60
- max = 0;
61
- for (j = 0, len = prefixes.length; j < len; j++) {
62
- prefix = prefixes[j];
63
- prefix = utils.removeNote(prefix);
64
- if (prefix.length > max) {
65
- max = prefix.length;
87
+ /**
88
+ * Should we use visual cascade for prefixes
89
+ */
90
+
91
+
92
+ Declaration.prototype.needCascade = function needCascade(decl) {
93
+ if (!decl._autoprefixerCascade) {
94
+ decl._autoprefixerCascade = this.all.options.cascade !== false && decl.raw('before').indexOf('\n') !== -1;
66
95
  }
67
- }
68
- return decl._autoprefixerMax = max;
96
+ return decl._autoprefixerCascade;
69
97
  };
70
98
 
71
- Declaration.prototype.calcBefore = function(prefixes, decl, prefix) {
72
- var before, diff, i, j, max, ref;
73
- if (prefix == null) {
74
- prefix = '';
75
- }
76
- before = decl.raw('before');
77
- max = this.maxPrefixed(prefixes, decl);
78
- diff = max - utils.removeNote(prefix).length;
79
- for (i = j = 0, ref = diff; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
80
- before += ' ';
81
- }
82
- return before;
83
- };
99
+ /**
100
+ * Return maximum length of possible prefixed property
101
+ */
102
+
84
103
 
85
- Declaration.prototype.restoreBefore = function(decl) {
86
- var lines, min;
87
- lines = decl.raw('before').split("\n");
88
- min = lines[lines.length - 1];
89
- this.all.group(decl).up(function(prefixed) {
90
- var array, last;
91
- array = prefixed.raw('before').split("\n");
92
- last = array[array.length - 1];
93
- if (last.length < min.length) {
94
- return min = last;
104
+ Declaration.prototype.maxPrefixed = function maxPrefixed(prefixes, decl) {
105
+ if (decl._autoprefixerMax) {
106
+ return decl._autoprefixerMax;
95
107
  }
96
- });
97
- lines[lines.length - 1] = min;
98
- return decl.raws.before = lines.join("\n");
108
+
109
+ var max = 0;
110
+ for (var _iterator2 = prefixes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
111
+ var _ref2;
112
+
113
+ if (_isArray2) {
114
+ if (_i2 >= _iterator2.length) break;
115
+ _ref2 = _iterator2[_i2++];
116
+ } else {
117
+ _i2 = _iterator2.next();
118
+ if (_i2.done) break;
119
+ _ref2 = _i2.value;
120
+ }
121
+
122
+ var prefix = _ref2;
123
+
124
+ prefix = utils.removeNote(prefix);
125
+ if (prefix.length > max) {
126
+ max = prefix.length;
127
+ }
128
+ }
129
+ decl._autoprefixerMax = max;
130
+
131
+ return decl._autoprefixerMax;
132
+ };
133
+
134
+ /**
135
+ * Calculate indentation to create visual cascade
136
+ */
137
+
138
+
139
+ Declaration.prototype.calcBefore = function calcBefore(prefixes, decl) {
140
+ var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
141
+
142
+ var max = this.maxPrefixed(prefixes, decl);
143
+ var diff = max - utils.removeNote(prefix).length;
144
+
145
+ var before = decl.raw('before');
146
+ before += Array(diff).fill(' ').join('');
147
+
148
+ return before;
99
149
  };
100
150
 
101
- Declaration.prototype.insert = function(decl, prefix, prefixes) {
102
- var already, cloned;
103
- cloned = this.set(this.clone(decl), prefix);
104
- if (!cloned) {
105
- return;
106
- }
107
- already = decl.parent.some(function(i) {
108
- return i.prop === cloned.prop && i.value === cloned.value;
109
- });
110
- if (already) {
111
- return;
112
- }
113
- if (this.needCascade(decl)) {
114
- cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
115
- }
116
- return decl.parent.insertBefore(decl, cloned);
151
+ /**
152
+ * Remove visual cascade
153
+ */
154
+
155
+
156
+ Declaration.prototype.restoreBefore = function restoreBefore(decl) {
157
+ var lines = decl.raw('before').split('\n');
158
+ var min = lines[lines.length - 1];
159
+
160
+ this.all.group(decl).up(function (prefixed) {
161
+ var array = prefixed.raw('before').split('\n');
162
+ var last = array[array.length - 1];
163
+ if (last.length < min.length) {
164
+ min = last;
165
+ }
166
+ });
167
+
168
+ lines[lines.length - 1] = min;
169
+ decl.raws.before = lines.join('\n');
117
170
  };
118
171
 
119
- Declaration.prototype.isAlready = function(decl, prefixed) {
120
- var already;
121
- already = this.all.group(decl).up(function(i) {
122
- return i.prop === prefixed;
123
- });
124
- already || (already = this.all.group(decl).down(function(i) {
125
- return i.prop === prefixed;
126
- }));
127
- return already;
172
+ /**
173
+ * Clone and insert new declaration
174
+ */
175
+
176
+
177
+ Declaration.prototype.insert = function insert(decl, prefix, prefixes) {
178
+ var cloned = this.set(this.clone(decl), prefix);
179
+ if (!cloned) return undefined;
180
+
181
+ var already = decl.parent.some(function (i) {
182
+ return i.prop === cloned.prop && i.value === cloned.value;
183
+ });
184
+ if (already) {
185
+ return undefined;
186
+ }
187
+
188
+ if (this.needCascade(decl)) {
189
+ cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
190
+ }
191
+ return decl.parent.insertBefore(decl, cloned);
128
192
  };
129
193
 
130
- Declaration.prototype.add = function(decl, prefix, prefixes) {
131
- var prefixed;
132
- prefixed = this.prefixed(decl.prop, prefix);
133
- if (this.isAlready(decl, prefixed) || this.otherPrefixes(decl.value, prefix)) {
134
- return;
135
- }
136
- return this.insert(decl, prefix, prefixes);
194
+ /**
195
+ * Did this declaration has this prefix above
196
+ */
197
+
198
+
199
+ Declaration.prototype.isAlready = function isAlready(decl, prefixed) {
200
+ var already = this.all.group(decl).up(function (i) {
201
+ return i.prop === prefixed;
202
+ });
203
+ if (!already) {
204
+ already = this.all.group(decl).down(function (i) {
205
+ return i.prop === prefixed;
206
+ });
207
+ }
208
+ return already;
137
209
  };
138
210
 
139
- Declaration.prototype.process = function(decl) {
140
- var prefixes;
141
- if (this.needCascade(decl)) {
142
- prefixes = Declaration.__super__.process.apply(this, arguments);
143
- if (prefixes != null ? prefixes.length : void 0) {
144
- this.restoreBefore(decl);
145
- return decl.raws.before = this.calcBefore(prefixes, decl);
211
+ /**
212
+ * Clone and add prefixes for declaration
213
+ */
214
+
215
+
216
+ Declaration.prototype.add = function add(decl, prefix, prefixes) {
217
+ var prefixed = this.prefixed(decl.prop, prefix);
218
+ if (this.isAlready(decl, prefixed) || this.otherPrefixes(decl.value, prefix)) {
219
+ return undefined;
146
220
  }
147
- } else {
148
- return Declaration.__super__.process.apply(this, arguments);
149
- }
221
+ return this.insert(decl, prefix, prefixes);
150
222
  };
151
223
 
152
- Declaration.prototype.old = function(prop, prefix) {
153
- return [this.prefixed(prop, prefix)];
224
+ /**
225
+ * Add spaces for visual cascade
226
+ */
227
+
228
+
229
+ Declaration.prototype.process = function process(decl) {
230
+ if (this.needCascade(decl)) {
231
+ var prefixes = _Prefixer.prototype.process.call(this, decl);
232
+ if (prefixes && prefixes.length) {
233
+ this.restoreBefore(decl);
234
+ decl.raws.before = this.calcBefore(prefixes, decl);
235
+ }
236
+ } else {
237
+ _Prefixer.prototype.process.call(this, decl);
238
+ }
154
239
  };
155
240
 
156
- return Declaration;
241
+ /**
242
+ * Return list of prefixed properties to clean old prefixes
243
+ */
157
244
 
158
- })(Prefixer);
159
245
 
160
- module.exports = Declaration;
246
+ Declaration.prototype.old = function old(prop, prefix) {
247
+ return [this.prefixed(prop, prefix)];
248
+ };
249
+
250
+ return Declaration;
251
+ }(Prefixer);
161
252
 
162
- }).call(this);
253
+ module.exports = Declaration;
@@ -1,57 +1,84 @@
1
- (function() {
2
- var AlignContent, Declaration, flexSpec,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
5
+ 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; }
9
6
 
10
- AlignContent = (function(superClass) {
11
- extend(AlignContent, superClass);
7
+ 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) : subClass.__proto__ = superClass; }
8
+
9
+ var flexSpec = require('./flex-spec');
10
+ var Declaration = require('../declaration');
11
+
12
+ var AlignContent = function (_Declaration) {
13
+ _inherits(AlignContent, _Declaration);
12
14
 
13
15
  function AlignContent() {
14
- return AlignContent.__super__.constructor.apply(this, arguments);
16
+ _classCallCheck(this, AlignContent);
17
+
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
15
19
  }
16
20
 
17
- AlignContent.names = ['align-content', 'flex-line-pack'];
21
+ /**
22
+ * Change property name for 2012 spec
23
+ */
24
+ AlignContent.prototype.prefixed = function prefixed(prop, prefix) {
25
+ var spec = void 0;
18
26
 
19
- AlignContent.oldValues = {
20
- 'flex-end': 'end',
21
- 'flex-start': 'start',
22
- 'space-between': 'justify',
23
- 'space-around': 'distribute'
24
- };
27
+ var _flexSpec = flexSpec(prefix);
28
+
29
+ spec = _flexSpec[0];
30
+ prefix = _flexSpec[1];
25
31
 
26
- AlignContent.prototype.prefixed = function(prop, prefix) {
27
- var ref, spec;
28
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
29
- if (spec === 2012) {
30
- return prefix + 'flex-line-pack';
31
- } else {
32
- return AlignContent.__super__.prefixed.apply(this, arguments);
33
- }
32
+ if (spec === 2012) {
33
+ return prefix + 'flex-line-pack';
34
+ } else {
35
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
36
+ }
34
37
  };
35
38
 
36
- AlignContent.prototype.normalize = function(prop) {
37
- return 'align-content';
39
+ /**
40
+ * Return property name by final spec
41
+ */
42
+
43
+
44
+ AlignContent.prototype.normalize = function normalize() {
45
+ return 'align-content';
38
46
  };
39
47
 
40
- AlignContent.prototype.set = function(decl, prefix) {
41
- var spec;
42
- spec = flexSpec(prefix)[0];
43
- if (spec === 2012) {
44
- decl.value = AlignContent.oldValues[decl.value] || decl.value;
45
- return AlignContent.__super__.set.call(this, decl, prefix);
46
- } else if (spec === 'final') {
47
- return AlignContent.__super__.set.apply(this, arguments);
48
- }
48
+ /**
49
+ * Change value for 2012 spec and ignore prefix for 2009
50
+ */
51
+
52
+
53
+ AlignContent.prototype.set = function set(decl, prefix) {
54
+ var spec = flexSpec(prefix)[0];
55
+ if (spec === 2012) {
56
+ decl.value = AlignContent.oldValues[decl.value] || decl.value;
57
+ return _Declaration.prototype.set.call(this, decl, prefix);
58
+ } else if (spec === 'final') {
59
+ return _Declaration.prototype.set.call(this, decl, prefix);
60
+ }
61
+ return undefined;
49
62
  };
50
63
 
51
64
  return AlignContent;
65
+ }(Declaration);
52
66
 
53
- })(Declaration);
67
+ Object.defineProperty(AlignContent, 'names', {
68
+ enumerable: true,
69
+ writable: true,
70
+ value: ['align-content', 'flex-line-pack']
71
+ });
72
+ Object.defineProperty(AlignContent, 'oldValues', {
73
+ enumerable: true,
74
+ writable: true,
75
+ value: {
76
+ 'flex-end': 'end',
77
+ 'flex-start': 'start',
78
+ 'space-between': 'justify',
79
+ 'space-around': 'distribute'
80
+ }
81
+ });
54
82
 
55
- module.exports = AlignContent;
56
83
 
57
- }).call(this);
84
+ module.exports = AlignContent;
@@ -1,57 +1,81 @@
1
- (function() {
2
- var AlignItems, Declaration, flexSpec,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
5
+ 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; }
9
6
 
10
- AlignItems = (function(superClass) {
11
- extend(AlignItems, superClass);
7
+ 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) : subClass.__proto__ = superClass; }
8
+
9
+ var flexSpec = require('./flex-spec');
10
+ var Declaration = require('../declaration');
11
+
12
+ var AlignItems = function (_Declaration) {
13
+ _inherits(AlignItems, _Declaration);
12
14
 
13
15
  function AlignItems() {
14
- return AlignItems.__super__.constructor.apply(this, arguments);
16
+ _classCallCheck(this, AlignItems);
17
+
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
15
19
  }
16
20
 
17
- AlignItems.names = ['align-items', 'flex-align', 'box-align'];
21
+ /**
22
+ * Change property name for 2009 and 2012 specs
23
+ */
24
+ AlignItems.prototype.prefixed = function prefixed(prop, prefix) {
25
+ var spec = void 0;
18
26
 
19
- AlignItems.oldValues = {
20
- 'flex-end': 'end',
21
- 'flex-start': 'start'
22
- };
27
+ var _flexSpec = flexSpec(prefix);
28
+
29
+ spec = _flexSpec[0];
30
+ prefix = _flexSpec[1];
23
31
 
24
- AlignItems.prototype.prefixed = function(prop, prefix) {
25
- var ref, spec;
26
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
27
- if (spec === 2009) {
28
- return prefix + 'box-align';
29
- } else if (spec === 2012) {
30
- return prefix + 'flex-align';
31
- } else {
32
- return AlignItems.__super__.prefixed.apply(this, arguments);
33
- }
32
+ if (spec === 2009) {
33
+ return prefix + 'box-align';
34
+ } else if (spec === 2012) {
35
+ return prefix + 'flex-align';
36
+ } else {
37
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
38
+ }
34
39
  };
35
40
 
36
- AlignItems.prototype.normalize = function(prop) {
37
- return 'align-items';
41
+ /**
42
+ * Return property name by final spec
43
+ */
44
+
45
+
46
+ AlignItems.prototype.normalize = function normalize() {
47
+ return 'align-items';
38
48
  };
39
49
 
40
- AlignItems.prototype.set = function(decl, prefix) {
41
- var spec;
42
- spec = flexSpec(prefix)[0];
43
- if (spec === 2009 || spec === 2012) {
44
- decl.value = AlignItems.oldValues[decl.value] || decl.value;
45
- return AlignItems.__super__.set.call(this, decl, prefix);
46
- } else {
47
- return AlignItems.__super__.set.apply(this, arguments);
48
- }
50
+ /**
51
+ * Change value for 2009 and 2012 specs
52
+ */
53
+
54
+
55
+ AlignItems.prototype.set = function set(decl, prefix) {
56
+ var spec = flexSpec(prefix)[0];
57
+ if (spec === 2009 || spec === 2012) {
58
+ decl.value = AlignItems.oldValues[decl.value] || decl.value;
59
+ }
60
+ return _Declaration.prototype.set.call(this, decl, prefix);
49
61
  };
50
62
 
51
63
  return AlignItems;
64
+ }(Declaration);
52
65
 
53
- })(Declaration);
66
+ Object.defineProperty(AlignItems, 'names', {
67
+ enumerable: true,
68
+ writable: true,
69
+ value: ['align-items', 'flex-align', 'box-align']
70
+ });
71
+ Object.defineProperty(AlignItems, 'oldValues', {
72
+ enumerable: true,
73
+ writable: true,
74
+ value: {
75
+ 'flex-end': 'end',
76
+ 'flex-start': 'start'
77
+ }
78
+ });
54
79
 
55
- module.exports = AlignItems;
56
80
 
57
- }).call(this);
81
+ module.exports = AlignItems;