postcss-preset-env 6.2.0 → 6.5.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.
- package/CHANGELOG.md +31 -0
- package/README.md +1 -4
- package/index.js +480 -0
- package/index.js.map +1 -0
- package/index.mjs +476 -0
- package/index.mjs.map +1 -0
- package/package.json +25 -21
- package/index.cjs.js +0 -212
- package/index.es.mjs +0 -208
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changes to PostCSS Preset Env
|
|
2
2
|
|
|
3
|
+
### 6.5.0 (December 12, 2018)
|
|
4
|
+
|
|
5
|
+
- Added `css-blank-pseudo` polyfill
|
|
6
|
+
- Added `css-has-pseudo` polyfill
|
|
7
|
+
- Updated `autoprefixer` to 9.4.2 (minor)
|
|
8
|
+
- Updated `browserslist` to 4.3.5 (minor)
|
|
9
|
+
- Updated `caniuse-lite` to 1.0.30000918 (patch)
|
|
10
|
+
- Updated `css-prefers-color-scheme` to 3.1.1 (minor, patch for this project)
|
|
11
|
+
- Updated `cssdb` to 4.3.0 (minor)
|
|
12
|
+
- Updated `postcss` to 7.0.6 (patch)
|
|
13
|
+
|
|
14
|
+
### 6.4.0 (November 6, 2018)
|
|
15
|
+
|
|
16
|
+
- Fixed `exportTo` option to export Custom Media, Custom Properties, and Custom
|
|
17
|
+
Selectors all to the same function, object, or file
|
|
18
|
+
- Added `css-prefers-color-scheme` 3.0.0 (major, non-breaking for this project)
|
|
19
|
+
- Updated `cssdb` to 4.2.0 (minor)
|
|
20
|
+
|
|
21
|
+
### 6.3.1 (November 5, 2018)
|
|
22
|
+
|
|
23
|
+
- Updated `caniuse-lite` to 1.0.30000905 (patch)
|
|
24
|
+
- Updated `postcss-custom-properties` to 8.0.9 (patch)
|
|
25
|
+
|
|
26
|
+
### 6.3.0 (October 28, 2018)
|
|
27
|
+
|
|
28
|
+
- Added `postcss-double-position-gradients` 1.0.0 (major, non-breaking for this project)
|
|
29
|
+
- Updated `autoprefixer` to 9.3.1 (minor)
|
|
30
|
+
- Updated `browserslist` to 4.3.4 (patch)
|
|
31
|
+
- Updated `caniuse-lite` to 1.0.30000899 (patch)
|
|
32
|
+
- Updated `cssdb` to 4.1.0 (major, non-breaking for this project)
|
|
33
|
+
|
|
3
34
|
### 6.2.0 (October 22, 2018)
|
|
4
35
|
|
|
5
36
|
- Updated `autoprefixer` to 9.2.1 (minor)
|
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-img]][npm-url]
|
|
4
4
|
[![Build Status][cli-img]][cli-url]
|
|
5
|
-
[![Windows Build Status][win-img]][win-url]
|
|
6
5
|
[![Support Chat][git-img]][git-url]
|
|
7
6
|
|
|
8
7
|
[PostCSS Preset Env] lets you convert modern CSS into something most browsers
|
|
@@ -363,14 +362,12 @@ postcssPresetEnv({
|
|
|
363
362
|
});
|
|
364
363
|
```
|
|
365
364
|
|
|
366
|
-
[cli-img]: https://img.shields.io/travis/csstools/postcss-preset-env.svg
|
|
365
|
+
[cli-img]: https://img.shields.io/travis/csstools/postcss-preset-env/master.svg
|
|
367
366
|
[cli-url]: https://travis-ci.org/csstools/postcss-preset-env
|
|
368
367
|
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
|
|
369
368
|
[git-url]: https://gitter.im/postcss/postcss
|
|
370
369
|
[npm-img]: https://img.shields.io/npm/v/postcss-preset-env.svg
|
|
371
370
|
[npm-url]: https://www.npmjs.com/package/postcss-preset-env
|
|
372
|
-
[win-img]: https://img.shields.io/appveyor/ci/jonathantneal/postcss-preset-env.svg
|
|
373
|
-
[win-url]: https://ci.appveyor.com/project/jonathantneal/postcss-preset-env
|
|
374
371
|
|
|
375
372
|
[autoprefixer]: https://github.com/postcss/autoprefixer
|
|
376
373
|
[browserslist]: https://github.com/browserslist/browserslist#readme
|
package/index.js
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var autoprefixer = _interopDefault(require('autoprefixer'));
|
|
6
|
+
var browserslist = _interopDefault(require('browserslist'));
|
|
7
|
+
var cssdb = _interopDefault(require('cssdb'));
|
|
8
|
+
var postcssAttributeCaseInsensitive = _interopDefault(require('postcss-attribute-case-insensitive'));
|
|
9
|
+
var postcssBlankPseudo = _interopDefault(require('css-blank-pseudo/postcss'));
|
|
10
|
+
var postcssColorFunctionalNotation = _interopDefault(require('postcss-color-functional-notation'));
|
|
11
|
+
var postcssColorGray = _interopDefault(require('postcss-color-gray'));
|
|
12
|
+
var postcssColorHexAlpha = _interopDefault(require('postcss-color-hex-alpha'));
|
|
13
|
+
var postcssColorModFunction = _interopDefault(require('postcss-color-mod-function'));
|
|
14
|
+
var postcssColorRebeccapurple = _interopDefault(require('postcss-color-rebeccapurple'));
|
|
15
|
+
var postcssCustomMedia = _interopDefault(require('postcss-custom-media'));
|
|
16
|
+
var postcssCustomProperties = _interopDefault(require('postcss-custom-properties'));
|
|
17
|
+
var postcssCustomSelectors = _interopDefault(require('postcss-custom-selectors'));
|
|
18
|
+
var postcssDirPseudoClass = _interopDefault(require('postcss-dir-pseudo-class'));
|
|
19
|
+
var postcssDoublePositionGradients = _interopDefault(require('postcss-double-position-gradients'));
|
|
20
|
+
var postcssEnvFunction = _interopDefault(require('postcss-env-function'));
|
|
21
|
+
var postcssFocusVisible = _interopDefault(require('postcss-focus-visible'));
|
|
22
|
+
var postcssFocusWithin = _interopDefault(require('postcss-focus-within'));
|
|
23
|
+
var postcssFontVariant = _interopDefault(require('postcss-font-variant'));
|
|
24
|
+
var postcss = _interopDefault(require('postcss'));
|
|
25
|
+
var postcssGapProperties = _interopDefault(require('postcss-gap-properties'));
|
|
26
|
+
var postcssHasPseudo = _interopDefault(require('css-has-pseudo/postcss'));
|
|
27
|
+
var postcssImageSetPolyfill = _interopDefault(require('postcss-image-set-function'));
|
|
28
|
+
var postcssInitial = _interopDefault(require('postcss-initial'));
|
|
29
|
+
var postcssLabFunction = _interopDefault(require('postcss-lab-function'));
|
|
30
|
+
var postcssLogical = _interopDefault(require('postcss-logical'));
|
|
31
|
+
var postcssMediaMinmax = _interopDefault(require('postcss-media-minmax'));
|
|
32
|
+
var postcssNesting = _interopDefault(require('postcss-nesting'));
|
|
33
|
+
var postcssOverflowShorthand = _interopDefault(require('postcss-overflow-shorthand'));
|
|
34
|
+
var postcssPageBreak = _interopDefault(require('postcss-page-break'));
|
|
35
|
+
var postcssPlace = _interopDefault(require('postcss-place'));
|
|
36
|
+
var postcssPrefersColorScheme = _interopDefault(require('css-prefers-color-scheme/postcss'));
|
|
37
|
+
var postcssPseudoClassAnyLink = _interopDefault(require('postcss-pseudo-class-any-link'));
|
|
38
|
+
var postcssReplaceOverflowWrap = _interopDefault(require('postcss-replace-overflow-wrap'));
|
|
39
|
+
var postcssSelectorMatches = _interopDefault(require('postcss-selector-matches'));
|
|
40
|
+
var postcssSelectorNot = _interopDefault(require('postcss-selector-not'));
|
|
41
|
+
var caniuse = require('caniuse-lite');
|
|
42
|
+
var fs = _interopDefault(require('fs'));
|
|
43
|
+
var path = _interopDefault(require('path'));
|
|
44
|
+
|
|
45
|
+
var postcssFontFamilySystemUi = postcss.plugin('postcss-system-ui-font', () => root => {
|
|
46
|
+
root.walkDecls(propertyRegExp, decl => {
|
|
47
|
+
decl.value = decl.value.replace(systemUiMatch, systemUiReplace);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const propertyRegExp = /(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i;
|
|
51
|
+
const whitespace = '[\\f\\n\\r\\x09\\x20]';
|
|
52
|
+
const systemUiFamily = ['system-ui',
|
|
53
|
+
/* macOS 10.11-10.12 */
|
|
54
|
+
'-apple-system',
|
|
55
|
+
/* Windows 6+ */
|
|
56
|
+
'Segoe UI',
|
|
57
|
+
/* Android 4+ */
|
|
58
|
+
'Roboto',
|
|
59
|
+
/* Ubuntu 10.10+ */
|
|
60
|
+
'Ubuntu',
|
|
61
|
+
/* Gnome 3+ */
|
|
62
|
+
'Cantarell',
|
|
63
|
+
/* KDE Plasma 5+ */
|
|
64
|
+
'Noto Sans',
|
|
65
|
+
/* fallback */
|
|
66
|
+
'sans-serif'];
|
|
67
|
+
const systemUiMatch = new RegExp(`(^|,|${whitespace}+)(?:system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i');
|
|
68
|
+
const systemUiReplace = `$1${systemUiFamily.join(', ')}$2`;
|
|
69
|
+
|
|
70
|
+
var plugins = {
|
|
71
|
+
'all-property': postcssInitial,
|
|
72
|
+
'any-link-pseudo-class': postcssPseudoClassAnyLink,
|
|
73
|
+
'blank-pseudo-class': postcssBlankPseudo,
|
|
74
|
+
'break-properties': postcssPageBreak,
|
|
75
|
+
'case-insensitive-attributes': postcssAttributeCaseInsensitive,
|
|
76
|
+
'color-functional-notation': postcssColorFunctionalNotation,
|
|
77
|
+
'color-mod-function': postcssColorModFunction,
|
|
78
|
+
'custom-media-queries': postcssCustomMedia,
|
|
79
|
+
'custom-properties': postcssCustomProperties,
|
|
80
|
+
'custom-selectors': postcssCustomSelectors,
|
|
81
|
+
'dir-pseudo-class': postcssDirPseudoClass,
|
|
82
|
+
'double-position-gradients': postcssDoublePositionGradients,
|
|
83
|
+
'environment-variables': postcssEnvFunction,
|
|
84
|
+
'focus-visible-pseudo-class': postcssFocusVisible,
|
|
85
|
+
'focus-within-pseudo-class': postcssFocusWithin,
|
|
86
|
+
'font-variant-property': postcssFontVariant,
|
|
87
|
+
'gap-properties': postcssGapProperties,
|
|
88
|
+
'gray-function': postcssColorGray,
|
|
89
|
+
'has-pseudo-class': postcssHasPseudo,
|
|
90
|
+
'hexadecimal-alpha-notation': postcssColorHexAlpha,
|
|
91
|
+
'image-set-function': postcssImageSetPolyfill,
|
|
92
|
+
'lab-function': postcssLabFunction,
|
|
93
|
+
'logical-properties-and-values': postcssLogical,
|
|
94
|
+
'matches-pseudo-class': postcssSelectorMatches,
|
|
95
|
+
'media-query-ranges': postcssMediaMinmax,
|
|
96
|
+
'nesting-rules': postcssNesting,
|
|
97
|
+
'not-pseudo-class': postcssSelectorNot,
|
|
98
|
+
'overflow-property': postcssOverflowShorthand,
|
|
99
|
+
'overflow-wrap-property': postcssReplaceOverflowWrap,
|
|
100
|
+
'place-properties': postcssPlace,
|
|
101
|
+
'prefers-color-scheme-query': postcssPrefersColorScheme,
|
|
102
|
+
'rebeccapurple-color': postcssColorRebeccapurple,
|
|
103
|
+
'system-ui-font-family': postcssFontFamilySystemUi
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// return a list of features to be inserted before or after cssdb features
|
|
107
|
+
function getTransformedInsertions(insertions, placement) {
|
|
108
|
+
return Object.keys(insertions).map(id => [].concat(insertions[id]).map(plugin => ({
|
|
109
|
+
[placement]: true,
|
|
110
|
+
plugin,
|
|
111
|
+
id
|
|
112
|
+
}))).reduce((array, feature) => array.concat(feature), []);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function getUnsupportedBrowsersByFeature(feature) {
|
|
116
|
+
const caniuseFeature = caniuse.features[feature]; // if feature support can be determined
|
|
117
|
+
|
|
118
|
+
if (caniuseFeature) {
|
|
119
|
+
const stats = caniuse.feature(caniuseFeature).stats; // return an array of browsers and versions that do not support the feature
|
|
120
|
+
|
|
121
|
+
const results = Object.keys(stats).reduce((browsers, browser) => browsers.concat(Object.keys(stats[browser]).filter(version => stats[browser][version].indexOf('y') !== 0).map(version => `${browser} ${version}`)), []);
|
|
122
|
+
return results;
|
|
123
|
+
} else {
|
|
124
|
+
// otherwise, return that the feature does not work in any browser
|
|
125
|
+
return ['> 0%'];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ids ordered by required execution, then alphabetically
|
|
130
|
+
var idsByExecutionOrder = ['custom-media-queries', 'custom-properties', 'environment-variables', // run environment-variables here to access transpiled custom media params and properties
|
|
131
|
+
'image-set-function', // run images-set-function before nesting-rules so that it may fix nested media
|
|
132
|
+
'media-query-ranges', // run media-query-range and
|
|
133
|
+
'prefers-color-scheme-query', // run prefers-color-scheme-query here to prevent duplicate transpilation after nesting-rules
|
|
134
|
+
'nesting-rules', 'custom-selectors', // run custom-selectors after nesting-rules to correctly transpile &:--custom-selector
|
|
135
|
+
'any-link-pseudo-class', 'case-insensitive-attributes', 'focus-visible-pseudo-class', 'focus-within-pseudo-class', 'matches-pseudo-class', // run matches-pseudo-class and
|
|
136
|
+
'not-pseudo-class', // run not-pseudo-class after other selectors have been transpiled
|
|
137
|
+
'logical-properties-and-values', // run logical-properties-and-values before dir-pseudo-class
|
|
138
|
+
'dir-pseudo-class', 'all-property', // run all-property before other property polyfills
|
|
139
|
+
'color-functional-notation', 'double-position-gradients', 'gray-function', 'hexadecimal-alpha-notation', 'lab-function', 'rebeccapurple-color', 'color-mod-function', // run color-mod after other color modifications have finished
|
|
140
|
+
'blank-pseudo-class', 'break-properties', 'font-variant-property', 'has-pseudo-class', 'gap-properties', 'overflow-property', 'overflow-wrap-property', 'place-properties', 'system-ui-font-family'];
|
|
141
|
+
|
|
142
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
143
|
+
try {
|
|
144
|
+
var info = gen[key](arg);
|
|
145
|
+
var value = info.value;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
reject(error);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (info.done) {
|
|
152
|
+
resolve(value);
|
|
153
|
+
} else {
|
|
154
|
+
Promise.resolve(value).then(_next, _throw);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function _asyncToGenerator(fn) {
|
|
159
|
+
return function () {
|
|
160
|
+
var self = this,
|
|
161
|
+
args = arguments;
|
|
162
|
+
return new Promise(function (resolve, reject) {
|
|
163
|
+
var gen = fn.apply(self, args);
|
|
164
|
+
|
|
165
|
+
function _next(value) {
|
|
166
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function _throw(err) {
|
|
170
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
_next(undefined);
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Write Exports to CSS File
|
|
179
|
+
/* ========================================================================== */
|
|
180
|
+
|
|
181
|
+
function getCustomMediaAsCss(customMedia) {
|
|
182
|
+
const cssContent = Object.keys(customMedia).reduce((cssLines, name) => {
|
|
183
|
+
cssLines.push(`@custom-media ${name} ${customMedia[name]};`);
|
|
184
|
+
return cssLines;
|
|
185
|
+
}, []).join('\n');
|
|
186
|
+
const css = `${cssContent}\n`;
|
|
187
|
+
return css;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function getCustomPropertiesAsCss(customProperties) {
|
|
191
|
+
const cssContent = Object.keys(customProperties).reduce((cssLines, name) => {
|
|
192
|
+
cssLines.push(`\t${name}: ${customProperties[name]};`);
|
|
193
|
+
return cssLines;
|
|
194
|
+
}, []).join('\n');
|
|
195
|
+
const css = `:root {\n${cssContent}\n}\n`;
|
|
196
|
+
return css;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function getCustomSelectorsAsCss(customSelectors) {
|
|
200
|
+
const cssContent = Object.keys(customSelectors).reduce((cssLines, name) => {
|
|
201
|
+
cssLines.push(`@custom-selector ${name} ${customSelectors[name]};`);
|
|
202
|
+
return cssLines;
|
|
203
|
+
}, []).join('\n');
|
|
204
|
+
const css = `${cssContent}\n`;
|
|
205
|
+
return css;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function writeExportsToCssFile(_x, _x2, _x3, _x4) {
|
|
209
|
+
return _writeExportsToCssFile.apply(this, arguments);
|
|
210
|
+
}
|
|
211
|
+
/* Write Exports to JSON file
|
|
212
|
+
/* ========================================================================== */
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
function _writeExportsToCssFile() {
|
|
216
|
+
_writeExportsToCssFile = _asyncToGenerator(function* (to, customMedia, customProperties, customSelectors) {
|
|
217
|
+
const customPropertiesAsCss = getCustomPropertiesAsCss(customProperties);
|
|
218
|
+
const customMediaAsCss = getCustomMediaAsCss(customMedia);
|
|
219
|
+
const customSelectorsAsCss = getCustomSelectorsAsCss(customSelectors);
|
|
220
|
+
const css = `${customMediaAsCss}\n${customSelectorsAsCss}\n${customPropertiesAsCss}`;
|
|
221
|
+
yield writeFile(to, css);
|
|
222
|
+
});
|
|
223
|
+
return _writeExportsToCssFile.apply(this, arguments);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function writeExportsToJsonFile(_x5, _x6, _x7, _x8) {
|
|
227
|
+
return _writeExportsToJsonFile.apply(this, arguments);
|
|
228
|
+
}
|
|
229
|
+
/* Write Exports to Common JS file
|
|
230
|
+
/* ========================================================================== */
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
function _writeExportsToJsonFile() {
|
|
234
|
+
_writeExportsToJsonFile = _asyncToGenerator(function* (to, customMedia, customProperties, customSelectors) {
|
|
235
|
+
const jsonContent = JSON.stringify({
|
|
236
|
+
'custom-media': customMedia,
|
|
237
|
+
'custom-properties': customProperties,
|
|
238
|
+
'custom-selectors': customSelectors
|
|
239
|
+
}, null, ' ');
|
|
240
|
+
const json = `${jsonContent}\n`;
|
|
241
|
+
yield writeFile(to, json);
|
|
242
|
+
});
|
|
243
|
+
return _writeExportsToJsonFile.apply(this, arguments);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function getObjectWithKeyAsCjs(key, object) {
|
|
247
|
+
const jsContents = Object.keys(object).reduce((jsLines, name) => {
|
|
248
|
+
jsLines.push(`\t\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);
|
|
249
|
+
return jsLines;
|
|
250
|
+
}, []).join(',\n');
|
|
251
|
+
const cjs = `\n\t${key}: {\n${jsContents}\n\t}`;
|
|
252
|
+
return cjs;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function writeExportsToCjsFile(_x9, _x10, _x11, _x12) {
|
|
256
|
+
return _writeExportsToCjsFile.apply(this, arguments);
|
|
257
|
+
}
|
|
258
|
+
/* Write Exports to Module JS file
|
|
259
|
+
/* ========================================================================== */
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
function _writeExportsToCjsFile() {
|
|
263
|
+
_writeExportsToCjsFile = _asyncToGenerator(function* (to, customMedia, customProperties, customSelectors) {
|
|
264
|
+
const customMediaAsCjs = getObjectWithKeyAsCjs('customMedia', customMedia);
|
|
265
|
+
const customPropertiesAsCjs = getObjectWithKeyAsCjs('customProperties', customProperties);
|
|
266
|
+
const customSelectorsAsCjs = getObjectWithKeyAsCjs('customSelectors', customSelectors);
|
|
267
|
+
const cjs = `module.exports = {${customMediaAsCjs},${customPropertiesAsCjs},${customSelectorsAsCjs}\n};\n`;
|
|
268
|
+
yield writeFile(to, cjs);
|
|
269
|
+
});
|
|
270
|
+
return _writeExportsToCjsFile.apply(this, arguments);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function getObjectWithKeyAsMjs(key, object) {
|
|
274
|
+
const mjsContents = Object.keys(object).reduce((mjsLines, name) => {
|
|
275
|
+
mjsLines.push(`\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);
|
|
276
|
+
return mjsLines;
|
|
277
|
+
}, []).join(',\n');
|
|
278
|
+
const mjs = `export const ${key} = {\n${mjsContents}\n};\n`;
|
|
279
|
+
return mjs;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function writeExportsToMjsFile(_x13, _x14, _x15, _x16) {
|
|
283
|
+
return _writeExportsToMjsFile.apply(this, arguments);
|
|
284
|
+
}
|
|
285
|
+
/* Write Exports to Exports
|
|
286
|
+
/* ========================================================================== */
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
function _writeExportsToMjsFile() {
|
|
290
|
+
_writeExportsToMjsFile = _asyncToGenerator(function* (to, customMedia, customProperties, customSelectors) {
|
|
291
|
+
const customMediaAsMjs = getObjectWithKeyAsMjs('customMedia', customMedia);
|
|
292
|
+
const customPropertiesAsMjs = getObjectWithKeyAsMjs('customProperties', customProperties);
|
|
293
|
+
const customSelectorsAsMjs = getObjectWithKeyAsMjs('customSelectors', customSelectors);
|
|
294
|
+
const mjs = `${customMediaAsMjs}\n${customPropertiesAsMjs}\n${customSelectorsAsMjs}`;
|
|
295
|
+
yield writeFile(to, mjs);
|
|
296
|
+
});
|
|
297
|
+
return _writeExportsToMjsFile.apply(this, arguments);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function writeToExports(customExports, destinations) {
|
|
301
|
+
return Promise.all([].concat(destinations).map(
|
|
302
|
+
/*#__PURE__*/
|
|
303
|
+
function () {
|
|
304
|
+
var _ref = _asyncToGenerator(function* (destination) {
|
|
305
|
+
if (destination instanceof Function) {
|
|
306
|
+
yield destination({
|
|
307
|
+
customMedia: getObjectWithStringifiedKeys(customExports.customMedia),
|
|
308
|
+
customProperties: getObjectWithStringifiedKeys(customExports.customProperties),
|
|
309
|
+
customSelectors: getObjectWithStringifiedKeys(customExports.customSelectors)
|
|
310
|
+
});
|
|
311
|
+
} else {
|
|
312
|
+
// read the destination as an object
|
|
313
|
+
const opts = destination === Object(destination) ? destination : {
|
|
314
|
+
to: String(destination)
|
|
315
|
+
}; // transformer for Exports into a JSON-compatible object
|
|
316
|
+
|
|
317
|
+
const toJSON = opts.toJSON || getObjectWithStringifiedKeys;
|
|
318
|
+
|
|
319
|
+
if ('customMedia' in opts || 'customProperties' in opts || 'customSelectors' in opts) {
|
|
320
|
+
// write directly to an object as customProperties
|
|
321
|
+
opts.customMedia = toJSON(customExports.customMedia);
|
|
322
|
+
opts.customProperties = toJSON(customExports.customProperties);
|
|
323
|
+
opts.customSelectors = toJSON(customExports.customSelectors);
|
|
324
|
+
} else if ('custom-media' in opts || 'custom-properties' in opts || 'custom-selectors' in opts) {
|
|
325
|
+
// write directly to an object as custom-properties
|
|
326
|
+
opts['custom-media'] = toJSON(customExports.customMedia);
|
|
327
|
+
opts['custom-properties'] = toJSON(customExports.customProperties);
|
|
328
|
+
opts['custom-selectors'] = toJSON(customExports.customSelectors);
|
|
329
|
+
} else {
|
|
330
|
+
// destination pathname
|
|
331
|
+
const to = String(opts.to || ''); // type of file being written to
|
|
332
|
+
|
|
333
|
+
const type = (opts.type || path.extname(opts.to).slice(1)).toLowerCase(); // transformed Exports
|
|
334
|
+
|
|
335
|
+
const customMediaJSON = toJSON(customExports.customMedia);
|
|
336
|
+
const customPropertiesJSON = toJSON(customExports.customProperties);
|
|
337
|
+
const customSelectorsJSON = toJSON(customExports.customSelectors);
|
|
338
|
+
|
|
339
|
+
if (type === 'css') {
|
|
340
|
+
yield writeExportsToCssFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (type === 'js') {
|
|
344
|
+
yield writeExportsToCjsFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (type === 'json') {
|
|
348
|
+
yield writeExportsToJsonFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (type === 'mjs') {
|
|
352
|
+
yield writeExportsToMjsFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
return function (_x17) {
|
|
359
|
+
return _ref.apply(this, arguments);
|
|
360
|
+
};
|
|
361
|
+
}()));
|
|
362
|
+
}
|
|
363
|
+
/* Helper utilities
|
|
364
|
+
/* ========================================================================== */
|
|
365
|
+
|
|
366
|
+
function getObjectWithStringifiedKeys(object) {
|
|
367
|
+
return Object.keys(object).reduce((objectJSON, key) => {
|
|
368
|
+
objectJSON[key] = String(object[key]);
|
|
369
|
+
return objectJSON;
|
|
370
|
+
}, {});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function writeFile(to, text) {
|
|
374
|
+
return new Promise((resolve, reject) => {
|
|
375
|
+
fs.writeFile(to, text, error => {
|
|
376
|
+
if (error) {
|
|
377
|
+
reject(error);
|
|
378
|
+
} else {
|
|
379
|
+
resolve();
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function escapeForJS(string) {
|
|
386
|
+
return string.replace(/\\([\s\S])|(')/g, '\\$1$2').replace(/\n/g, '\\n').replace(/\r/g, '\\r');
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
var postcss$1 = postcss.plugin('postcss-preset-env', opts => {
|
|
390
|
+
// initialize options
|
|
391
|
+
const features = Object(Object(opts).features);
|
|
392
|
+
const insertBefore = Object(Object(opts).insertBefore);
|
|
393
|
+
const insertAfter = Object(Object(opts).insertAfter);
|
|
394
|
+
const browsers = Object(opts).browsers;
|
|
395
|
+
const stage = 'stage' in Object(opts) ? opts.stage === false ? 5 : parseInt(opts.stage) || 0 : 2;
|
|
396
|
+
const autoprefixerOptions = Object(opts).autoprefixer;
|
|
397
|
+
const sharedOpts = initializeSharedOpts(Object(opts));
|
|
398
|
+
const stagedAutoprefixer = autoprefixerOptions === false ? () => {} : autoprefixer(Object.assign({
|
|
399
|
+
browsers
|
|
400
|
+
}, autoprefixerOptions)); // polyfillable features (those with an available postcss plugin)
|
|
401
|
+
|
|
402
|
+
const polyfillableFeatures = cssdb.concat( // additional features to be inserted before cssdb features
|
|
403
|
+
getTransformedInsertions(insertBefore, 'insertBefore'), // additional features to be inserted after cssdb features
|
|
404
|
+
getTransformedInsertions(insertAfter, 'insertAfter')).filter( // inserted features or features with an available postcss plugin
|
|
405
|
+
feature => feature.insertBefore || feature.id in plugins).sort( // features sorted by execution order and then insertion order
|
|
406
|
+
(a, b) => idsByExecutionOrder.indexOf(a.id) - idsByExecutionOrder.indexOf(b.id) || (a.insertBefore ? -1 : b.insertBefore ? 1 : 0) || (a.insertAfter ? 1 : b.insertAfter ? -1 : 0)).map( // polyfillable features as an object
|
|
407
|
+
feature => {
|
|
408
|
+
// target browsers for the polyfill
|
|
409
|
+
const unsupportedBrowsers = getUnsupportedBrowsersByFeature(feature.caniuse);
|
|
410
|
+
return feature.insertBefore || feature.insertAfter ? {
|
|
411
|
+
browsers: unsupportedBrowsers,
|
|
412
|
+
plugin: feature.plugin,
|
|
413
|
+
id: `${feature.insertBefore ? 'before' : 'after'}-${feature.id}`,
|
|
414
|
+
stage: 6
|
|
415
|
+
} : {
|
|
416
|
+
browsers: unsupportedBrowsers,
|
|
417
|
+
plugin: plugins[feature.id],
|
|
418
|
+
id: feature.id,
|
|
419
|
+
stage: feature.stage
|
|
420
|
+
};
|
|
421
|
+
}); // staged features (those at or above the selected stage)
|
|
422
|
+
|
|
423
|
+
const stagedFeatures = polyfillableFeatures.filter(feature => feature.id in features ? features[feature.id] : feature.stage >= stage).map(feature => ({
|
|
424
|
+
browsers: feature.browsers,
|
|
425
|
+
plugin: typeof feature.plugin.process === 'function' ? features[feature.id] === true ? sharedOpts // if the plugin is enabled and has shared options
|
|
426
|
+
? feature.plugin(Object.assign({}, sharedOpts)) // otherwise, if the plugin is enabled
|
|
427
|
+
: feature.plugin() : sharedOpts // if the plugin has shared options and individual options
|
|
428
|
+
? feature.plugin(Object.assign({}, sharedOpts, features[feature.id])) // if the plugin has individual options
|
|
429
|
+
: feature.plugin(Object.assign({}, features[feature.id])) // if the plugin is already initialized
|
|
430
|
+
: feature.plugin,
|
|
431
|
+
id: feature.id
|
|
432
|
+
}));
|
|
433
|
+
return (root, result) => {
|
|
434
|
+
// browsers supported by the configuration
|
|
435
|
+
const supportedBrowsers = browserslist(browsers, {
|
|
436
|
+
path: result.root.source && result.root.source.input && result.root.source.input.file,
|
|
437
|
+
ignoreUnknownVersions: true
|
|
438
|
+
}); // features supported by the stage and browsers
|
|
439
|
+
|
|
440
|
+
const supportedFeatures = stagedFeatures.filter(feature => supportedBrowsers.some(supportedBrowser => browserslist(feature.browsers, {
|
|
441
|
+
ignoreUnknownVersions: true
|
|
442
|
+
}).some(polyfillBrowser => polyfillBrowser === supportedBrowser))); // polyfills run in execution order
|
|
443
|
+
|
|
444
|
+
const polyfills = supportedFeatures.reduce((promise, feature) => promise.then(() => feature.plugin(result.root, result)), Promise.resolve()).then(() => stagedAutoprefixer(result.root, result)).then(() => {
|
|
445
|
+
if (Object(opts).exportTo) {
|
|
446
|
+
writeToExports(sharedOpts.exportTo, opts.exportTo);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
return polyfills;
|
|
450
|
+
};
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
const initializeSharedOpts = opts => {
|
|
454
|
+
if ('importFrom' in opts || 'exportTo' in opts || 'preserve' in opts) {
|
|
455
|
+
const sharedOpts = {};
|
|
456
|
+
|
|
457
|
+
if ('importFrom' in opts) {
|
|
458
|
+
sharedOpts.importFrom = opts.importFrom;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if ('exportTo' in opts) {
|
|
462
|
+
sharedOpts.exportTo = {
|
|
463
|
+
customMedia: {},
|
|
464
|
+
customProperties: {},
|
|
465
|
+
customSelectors: {}
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if ('preserve' in opts) {
|
|
470
|
+
sharedOpts.preserve = opts.preserve;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return sharedOpts;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return false;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
module.exports = postcss$1;
|
|
480
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["src/patch/postcss-system-ui-font-family.js","src/lib/plugins-by-id.js","src/lib/get-transformed-insertions.js","src/lib/get-unsupported-browsers-by-feature.js","src/lib/ids-by-execution-order.js","src/lib/write-to-exports.js","src/postcss.js"],"sourcesContent":["import postcss from 'postcss';\n\nexport default postcss.plugin('postcss-system-ui-font', () => root => {\n\troot.walkDecls(propertyRegExp, decl => {\n\t\tdecl.value = decl.value.replace(systemUiMatch, systemUiReplace);\n\t});\n});\n\nconst propertyRegExp = /(?:^(?:-|\\\\002d){2})|(?:^font(?:-family)?$)/i;\nconst whitespace = '[\\\\f\\\\n\\\\r\\\\x09\\\\x20]';\nconst systemUiFamily = [\n\t'system-ui',\n\t/* macOS 10.11-10.12 */ '-apple-system',\n\t/* Windows 6+ */ 'Segoe UI',\n\t/* Android 4+ */ 'Roboto',\n\t/* Ubuntu 10.10+ */ 'Ubuntu',\n\t/* Gnome 3+ */ 'Cantarell',\n\t/* KDE Plasma 5+ */ 'Noto Sans',\n\t/* fallback */ 'sans-serif'\n];\nconst systemUiMatch = new RegExp(`(^|,|${whitespace}+)(?:system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i');\nconst systemUiReplace = `$1${systemUiFamily.join(', ')}$2`;\n","import postcssAttributeCaseInsensitive from 'postcss-attribute-case-insensitive';\nimport postcssBlankPseudo from 'css-blank-pseudo/postcss';\nimport postcssColorFunctionalNotation from 'postcss-color-functional-notation';\nimport postcssColorGray from 'postcss-color-gray';\nimport postcssColorHexAlpha from 'postcss-color-hex-alpha';\nimport postcssColorModFunction from 'postcss-color-mod-function';\nimport postcssColorRebeccapurple from 'postcss-color-rebeccapurple';\nimport postcssCustomMedia from 'postcss-custom-media';\nimport postcssCustomProperties from 'postcss-custom-properties';\nimport postcssCustomSelectors from 'postcss-custom-selectors';\nimport postcssDirPseudoClass from 'postcss-dir-pseudo-class';\nimport postcssDoublePositionGradients from 'postcss-double-position-gradients';\nimport postcssEnvFunction from 'postcss-env-function';\nimport postcssFocusVisible from 'postcss-focus-visible';\nimport postcssFocusWithin from 'postcss-focus-within';\nimport postcssFontVariant from 'postcss-font-variant';\nimport postcssFontFamilySystemUi from '../patch/postcss-system-ui-font-family';\nimport postcssGapProperties from 'postcss-gap-properties';\nimport postcssHasPseudo from 'css-has-pseudo/postcss';\nimport postcssImageSetPolyfill from 'postcss-image-set-function';\nimport postcssInitial from 'postcss-initial';\nimport postcssLabFunction from 'postcss-lab-function';\nimport postcssLogical from 'postcss-logical';\nimport postcssMediaMinmax from 'postcss-media-minmax';\nimport postcssNesting from 'postcss-nesting';\nimport postcssOverflowShorthand from 'postcss-overflow-shorthand';\nimport postcssPageBreak from 'postcss-page-break';\nimport postcssPlace from 'postcss-place';\nimport postcssPrefersColorScheme from 'css-prefers-color-scheme/postcss';\nimport postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';\nimport postcssReplaceOverflowWrap from 'postcss-replace-overflow-wrap';\nimport postcssSelectorMatches from 'postcss-selector-matches';\nimport postcssSelectorNot from 'postcss-selector-not';\n\n// postcss plugins ordered by id\nexport default {\n\t'all-property': postcssInitial,\n\t'any-link-pseudo-class': postcssPseudoClassAnyLink,\n\t'blank-pseudo-class': postcssBlankPseudo,\n\t'break-properties': postcssPageBreak,\n\t'case-insensitive-attributes': postcssAttributeCaseInsensitive,\n\t'color-functional-notation': postcssColorFunctionalNotation,\n\t'color-mod-function': postcssColorModFunction,\n\t'custom-media-queries': postcssCustomMedia,\n\t'custom-properties': postcssCustomProperties,\n\t'custom-selectors': postcssCustomSelectors,\n\t'dir-pseudo-class': postcssDirPseudoClass,\n\t'double-position-gradients': postcssDoublePositionGradients,\n\t'environment-variables': postcssEnvFunction,\n\t'focus-visible-pseudo-class': postcssFocusVisible,\n\t'focus-within-pseudo-class': postcssFocusWithin,\n\t'font-variant-property': postcssFontVariant,\n\t'gap-properties': postcssGapProperties,\n\t'gray-function': postcssColorGray,\n\t'has-pseudo-class': postcssHasPseudo,\n\t'hexadecimal-alpha-notation': postcssColorHexAlpha,\n\t'image-set-function': postcssImageSetPolyfill,\n\t'lab-function': postcssLabFunction,\n\t'logical-properties-and-values': postcssLogical,\n\t'matches-pseudo-class': postcssSelectorMatches,\n\t'media-query-ranges': postcssMediaMinmax,\n\t'nesting-rules': postcssNesting,\n\t'not-pseudo-class': postcssSelectorNot,\n\t'overflow-property': postcssOverflowShorthand,\n\t'overflow-wrap-property': postcssReplaceOverflowWrap,\n\t'place-properties': postcssPlace,\n\t'prefers-color-scheme-query': postcssPrefersColorScheme,\n\t'rebeccapurple-color': postcssColorRebeccapurple,\n\t'system-ui-font-family': postcssFontFamilySystemUi\n};\n","// return a list of features to be inserted before or after cssdb features\nexport default function getTransformedInsertions(insertions, placement) {\n\treturn Object.keys(insertions).map(\n\t\tid => [].concat(insertions[id]).map(\n\t\t\tplugin => ({\n\t\t\t\t[placement]: true,\n\t\t\t\tplugin,\n\t\t\t\tid\n\t\t\t})\n\t\t)\n\t).reduce(\n\t\t(array, feature) => array.concat(feature), []\n\t);\n}\n","import * as caniuse from 'caniuse-lite';\n\n// return a list of browsers that do not support the feature\nexport default function getUnsupportedBrowsersByFeature(feature) {\n\tconst caniuseFeature = caniuse.features[feature];\n\n\t// if feature support can be determined\n\tif (caniuseFeature) {\n\t\tconst stats = caniuse.feature(caniuseFeature).stats;\n\n\t\t// return an array of browsers and versions that do not support the feature\n\t\tconst results = Object.keys(stats).reduce(\n\t\t\t(browsers, browser) => browsers.concat(\n\t\t\t\tObject.keys(stats[browser]).filter(\n\t\t\t\t\tversion => stats[browser][version].indexOf('y') !== 0\n\t\t\t\t).map(\n\t\t\t\t\tversion => `${browser} ${version}`\n\t\t\t\t)\n\t\t\t),\n\t\t\t[]\n\t\t);\n\n\t\treturn results;\n\t} else {\n\t\t// otherwise, return that the feature does not work in any browser\n\t\treturn [ '> 0%' ];\n\t}\n}\n","// ids ordered by required execution, then alphabetically\nexport default [\n\t'custom-media-queries',\n\t'custom-properties',\n\t'environment-variables', // run environment-variables here to access transpiled custom media params and properties\n\t'image-set-function', // run images-set-function before nesting-rules so that it may fix nested media\n\t'media-query-ranges', // run media-query-range and\n\t'prefers-color-scheme-query', // run prefers-color-scheme-query here to prevent duplicate transpilation after nesting-rules\n\t'nesting-rules',\n\t'custom-selectors', // run custom-selectors after nesting-rules to correctly transpile &:--custom-selector\n\t'any-link-pseudo-class',\n\t'case-insensitive-attributes',\n\t'focus-visible-pseudo-class',\n\t'focus-within-pseudo-class',\n\t'matches-pseudo-class', // run matches-pseudo-class and\n\t'not-pseudo-class', // run not-pseudo-class after other selectors have been transpiled\n\t'logical-properties-and-values', // run logical-properties-and-values before dir-pseudo-class\n\t'dir-pseudo-class',\n\t'all-property', // run all-property before other property polyfills\n\t'color-functional-notation',\n\t'double-position-gradients',\n\t'gray-function',\n\t'hexadecimal-alpha-notation',\n\t'lab-function',\n\t'rebeccapurple-color',\n\t'color-mod-function', // run color-mod after other color modifications have finished\n\t'blank-pseudo-class',\n\t'break-properties',\n\t'font-variant-property',\n\t'has-pseudo-class',\n\t'gap-properties',\n\t'overflow-property',\n\t'overflow-wrap-property',\n\t'place-properties',\n\t'system-ui-font-family'\n];\n","/* eslint max-params: [\"error\", 4] */\n\nimport fs from 'fs';\nimport path from 'path';\n\n/* Write Exports to CSS File\n/* ========================================================================== */\n\nfunction getCustomMediaAsCss(customMedia) {\n\tconst cssContent = Object.keys(customMedia).reduce((cssLines, name) => {\n\t\tcssLines.push(`@custom-media ${name} ${customMedia[name]};`);\n\n\t\treturn cssLines;\n\t}, []).join('\\n');\n\tconst css = `${cssContent}\\n`;\n\n\treturn css;\n}\n\nfunction getCustomPropertiesAsCss(customProperties) {\n\tconst cssContent = Object.keys(customProperties).reduce((cssLines, name) => {\n\t\tcssLines.push(`\\t${name}: ${customProperties[name]};`);\n\n\t\treturn cssLines;\n\t}, []).join('\\n');\n\tconst css = `:root {\\n${cssContent}\\n}\\n`;\n\n\treturn css;\n}\n\nfunction getCustomSelectorsAsCss(customSelectors) {\n\tconst cssContent = Object.keys(customSelectors).reduce((cssLines, name) => {\n\t\tcssLines.push(`@custom-selector ${name} ${customSelectors[name]};`);\n\n\t\treturn cssLines;\n\t}, []).join('\\n');\n\tconst css = `${cssContent}\\n`;\n\n\treturn css;\n}\n\nasync function writeExportsToCssFile(to, customMedia, customProperties, customSelectors) {\n\tconst customPropertiesAsCss = getCustomPropertiesAsCss(customProperties);\n\tconst customMediaAsCss = getCustomMediaAsCss(customMedia);\n\tconst customSelectorsAsCss = getCustomSelectorsAsCss(customSelectors);\n\tconst css = `${customMediaAsCss}\\n${customSelectorsAsCss}\\n${customPropertiesAsCss}`;\n\n\tawait writeFile(to, css);\n}\n\n/* Write Exports to JSON file\n/* ========================================================================== */\n\nasync function writeExportsToJsonFile(to, customMedia, customProperties, customSelectors) {\n\tconst jsonContent = JSON.stringify({\n\t\t'custom-media': customMedia,\n\t\t'custom-properties': customProperties,\n\t\t'custom-selectors': customSelectors\n\t}, null, ' ');\n\tconst json = `${jsonContent}\\n`;\n\n\tawait writeFile(to, json);\n}\n\n/* Write Exports to Common JS file\n/* ========================================================================== */\n\nfunction getObjectWithKeyAsCjs(key, object) {\n\tconst jsContents = Object.keys(object).reduce((jsLines, name) => {\n\t\tjsLines.push(`\\t\\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);\n\n\t\treturn jsLines;\n\t}, []).join(',\\n');\n\tconst cjs = `\\n\\t${key}: {\\n${jsContents}\\n\\t}`;\n\n\treturn cjs;\n}\n\nasync function writeExportsToCjsFile(to, customMedia, customProperties, customSelectors) {\n\tconst customMediaAsCjs = getObjectWithKeyAsCjs('customMedia', customMedia);\n\tconst customPropertiesAsCjs = getObjectWithKeyAsCjs('customProperties', customProperties);\n\tconst customSelectorsAsCjs = getObjectWithKeyAsCjs('customSelectors', customSelectors);\n\tconst cjs = `module.exports = {${customMediaAsCjs},${customPropertiesAsCjs},${customSelectorsAsCjs}\\n};\\n`;\n\n\tawait writeFile(to, cjs);\n}\n\n/* Write Exports to Module JS file\n/* ========================================================================== */\n\nfunction getObjectWithKeyAsMjs(key, object) {\n\tconst mjsContents = Object.keys(object).reduce((mjsLines, name) => {\n\t\tmjsLines.push(`\\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);\n\n\t\treturn mjsLines;\n\t}, []).join(',\\n');\n\tconst mjs = `export const ${key} = {\\n${mjsContents}\\n};\\n`;\n\n\treturn mjs;\n}\n\nasync function writeExportsToMjsFile(to, customMedia, customProperties, customSelectors) {\n\tconst customMediaAsMjs = getObjectWithKeyAsMjs('customMedia', customMedia);\n\tconst customPropertiesAsMjs = getObjectWithKeyAsMjs('customProperties', customProperties);\n\tconst customSelectorsAsMjs = getObjectWithKeyAsMjs('customSelectors', customSelectors);\n\tconst mjs = `${customMediaAsMjs}\\n${customPropertiesAsMjs}\\n${customSelectorsAsMjs}`;\n\n\tawait writeFile(to, mjs);\n}\n\n/* Write Exports to Exports\n/* ========================================================================== */\n\nexport default function writeToExports(customExports, destinations) {\n\treturn Promise.all([].concat(destinations).map(async destination => {\n\t\tif (destination instanceof Function) {\n\t\t\tawait destination({\n\t\t\t\tcustomMedia: getObjectWithStringifiedKeys(customExports.customMedia),\n\t\t\t\tcustomProperties: getObjectWithStringifiedKeys(customExports.customProperties),\n\t\t\t\tcustomSelectors: getObjectWithStringifiedKeys(customExports.customSelectors)\n\t\t\t});\n\t\t} else {\n\t\t\t// read the destination as an object\n\t\t\tconst opts = destination === Object(destination) ? destination : { to: String(destination) };\n\n\t\t\t// transformer for Exports into a JSON-compatible object\n\t\t\tconst toJSON = opts.toJSON || getObjectWithStringifiedKeys;\n\n\t\t\tif ('customMedia' in opts || 'customProperties' in opts || 'customSelectors' in opts) {\n\t\t\t\t// write directly to an object as customProperties\n\t\t\t\topts.customMedia = toJSON(customExports.customMedia);\n\t\t\t\topts.customProperties = toJSON(customExports.customProperties);\n\t\t\t\topts.customSelectors = toJSON(customExports.customSelectors);\n\t\t\t} else if ('custom-media' in opts || 'custom-properties' in opts || 'custom-selectors' in opts) {\n\t\t\t\t// write directly to an object as custom-properties\n\t\t\t\topts['custom-media'] = toJSON(customExports.customMedia);\n\t\t\t\topts['custom-properties'] = toJSON(customExports.customProperties);\n\t\t\t\topts['custom-selectors'] = toJSON(customExports.customSelectors);\n\t\t\t} else {\n\t\t\t\t// destination pathname\n\t\t\t\tconst to = String(opts.to || '');\n\n\t\t\t\t// type of file being written to\n\t\t\t\tconst type = (opts.type || path.extname(opts.to).slice(1)).toLowerCase();\n\n\t\t\t\t// transformed Exports\n\t\t\t\tconst customMediaJSON = toJSON(customExports.customMedia);\n\t\t\t\tconst customPropertiesJSON = toJSON(customExports.customProperties);\n\t\t\t\tconst customSelectorsJSON = toJSON(customExports.customSelectors);\n\n\t\t\t\tif (type === 'css') {\n\t\t\t\t\tawait writeExportsToCssFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);\n\t\t\t\t}\n\n\t\t\t\tif (type === 'js') {\n\t\t\t\t\tawait writeExportsToCjsFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);\n\t\t\t\t}\n\n\t\t\t\tif (type === 'json') {\n\t\t\t\t\tawait writeExportsToJsonFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);\n\t\t\t\t}\n\n\t\t\t\tif (type === 'mjs') {\n\t\t\t\t\tawait writeExportsToMjsFile(to, customMediaJSON, customPropertiesJSON, customSelectorsJSON);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}));\n}\n\n/* Helper utilities\n/* ========================================================================== */\n\nfunction getObjectWithStringifiedKeys(object) {\n\treturn Object.keys(object).reduce((objectJSON, key) => {\n\t\tobjectJSON[key] = String(object[key]);\n\n\t\treturn objectJSON;\n\t}, {});\n}\n\nfunction writeFile(to, text) {\n\treturn new Promise((resolve, reject) => {\n\t\tfs.writeFile(to, text, error => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n}\n\nfunction escapeForJS(string) {\n\treturn string.replace(/\\\\([\\s\\S])|(')/g, '\\\\$1$2').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r');\n}\n","import autoprefixer from 'autoprefixer'\nimport browserslist from 'browserslist';\nimport cssdb from 'cssdb';\nimport postcss from 'postcss';\nimport plugins from './lib/plugins-by-id';\nimport getTransformedInsertions from './lib/get-transformed-insertions';\nimport getUnsupportedBrowsersByFeature from './lib/get-unsupported-browsers-by-feature';\nimport idsByExecutionOrder from './lib/ids-by-execution-order';\nimport writeToExports from './lib/write-to-exports';\n\nexport default postcss.plugin('postcss-preset-env', opts => {\n\t// initialize options\n\tconst features = Object(Object(opts).features);\n\tconst insertBefore = Object(Object(opts).insertBefore);\n\tconst insertAfter = Object(Object(opts).insertAfter);\n\tconst browsers = Object(opts).browsers;\n\tconst stage = 'stage' in Object(opts)\n\t\t? opts.stage === false\n\t\t\t? 5\n\t\t: parseInt(opts.stage) || 0\n\t: 2;\n\tconst autoprefixerOptions = Object(opts).autoprefixer;\n\tconst sharedOpts = initializeSharedOpts(Object(opts));\n\tconst stagedAutoprefixer = autoprefixerOptions === false\n\t\t? () => {}\n\t: autoprefixer(Object.assign({ browsers }, autoprefixerOptions));\n\n\t// polyfillable features (those with an available postcss plugin)\n\tconst polyfillableFeatures = cssdb.concat(\n\t\t// additional features to be inserted before cssdb features\n\t\tgetTransformedInsertions(insertBefore, 'insertBefore'),\n\t\t// additional features to be inserted after cssdb features\n\t\tgetTransformedInsertions(insertAfter, 'insertAfter')\n\t).filter(\n\t\t// inserted features or features with an available postcss plugin\n\t\tfeature => feature.insertBefore || feature.id in plugins\n\t).sort(\n\t\t// features sorted by execution order and then insertion order\n\t\t(a, b) => idsByExecutionOrder.indexOf(a.id) - idsByExecutionOrder.indexOf(b.id) || (a.insertBefore ? -1 : b.insertBefore ? 1 : 0) || (a.insertAfter ? 1 : b.insertAfter ? -1 : 0)\n\t).map(\n\t\t// polyfillable features as an object\n\t\tfeature => {\n\t\t\t// target browsers for the polyfill\n\t\t\tconst unsupportedBrowsers = getUnsupportedBrowsersByFeature(feature.caniuse);\n\n\t\t\treturn feature.insertBefore || feature.insertAfter ? {\n\t\t\t\tbrowsers: unsupportedBrowsers,\n\t\t\t\tplugin: feature.plugin,\n\t\t\t\tid: `${feature.insertBefore ? 'before' : 'after'}-${feature.id}`,\n\t\t\t\tstage: 6\n\t\t\t} : {\n\t\t\t\tbrowsers: unsupportedBrowsers,\n\t\t\t\tplugin: plugins[feature.id],\n\t\t\t\tid: feature.id,\n\t\t\t\tstage: feature.stage\n\t\t\t};\n\t\t}\n\t);\n\n\t// staged features (those at or above the selected stage)\n\tconst stagedFeatures = polyfillableFeatures.filter(\n\t\tfeature => feature.id in features\n\t\t\t? features[feature.id]\n\t\t: feature.stage >= stage\n\t).map(\n\t\tfeature => ({\n\t\t\tbrowsers: feature.browsers,\n\t\t\tplugin: typeof feature.plugin.process === 'function'\n\t\t\t\t? features[feature.id] === true\n\t\t\t\t\t? sharedOpts\n\t\t\t\t\t\t// if the plugin is enabled and has shared options\n\t\t\t\t\t\t? feature.plugin(Object.assign({}, sharedOpts))\n\t\t\t\t\t// otherwise, if the plugin is enabled\n\t\t\t\t\t: feature.plugin()\n\t\t\t\t: sharedOpts\n\t\t\t\t\t// if the plugin has shared options and individual options\n\t\t\t\t\t? feature.plugin(Object.assign({}, sharedOpts, features[feature.id]))\n\t\t\t\t// if the plugin has individual options\n\t\t\t\t: feature.plugin(Object.assign({}, features[feature.id]))\n\t\t\t// if the plugin is already initialized\n\t\t\t: feature.plugin,\n\t\t\tid: feature.id\n\t\t})\n\t);\n\n\treturn (root, result) => {\n\t\t// browsers supported by the configuration\n\t\tconst supportedBrowsers = browserslist(browsers, {\n\t\t\tpath: result.root.source && result.root.source.input && result.root.source.input.file,\n\t\t\tignoreUnknownVersions: true\n\t\t});\n\n\t\t// features supported by the stage and browsers\n\t\tconst supportedFeatures = stagedFeatures.filter(\n\t\t\tfeature => supportedBrowsers.some(\n\t\t\t\tsupportedBrowser => browserslist(feature.browsers, {\n\t\t\t\t\tignoreUnknownVersions: true\n\t\t\t\t}).some(\n\t\t\t\t\tpolyfillBrowser => polyfillBrowser === supportedBrowser\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// polyfills run in execution order\n\t\tconst polyfills = supportedFeatures.reduce(\n\t\t\t(promise, feature) => promise.then(\n\t\t\t\t() => feature.plugin(result.root, result)\n\t\t\t),\n\t\t\tPromise.resolve()\n\t\t).then(\n\t\t\t() => stagedAutoprefixer(result.root, result)\n\t\t).then(\n\t\t\t() => {\n\t\t\t\tif (Object(opts).exportTo) {\n\t\t\t\t\twriteToExports(sharedOpts.exportTo, opts.exportTo);\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\n\t\treturn polyfills;\n\t};\n});\n\nconst initializeSharedOpts = opts => {\n\tif ('importFrom' in opts || 'exportTo' in opts || 'preserve' in opts) {\n\t\tconst sharedOpts = {};\n\n\t\tif ('importFrom' in opts) {\n\t\t\tsharedOpts.importFrom = opts.importFrom;\n\t\t}\n\n\t\tif ('exportTo' in opts) {\n\t\t\tsharedOpts.exportTo = {\n\t\t\t\tcustomMedia: {},\n\t\t\t\tcustomProperties: {},\n\t\t\t\tcustomSelectors: {},\n\t\t\t};\n\t\t}\n\n\t\tif ('preserve' in opts) {\n\t\t\tsharedOpts.preserve = opts.preserve;\n\t\t}\n\n\t\treturn sharedOpts;\n\t}\n\n\treturn false;\n};\n"],"names":["postcss","plugin","root","walkDecls","propertyRegExp","decl","value","replace","systemUiMatch","systemUiReplace","whitespace","systemUiFamily","RegExp","join","postcssInitial","postcssPseudoClassAnyLink","postcssBlankPseudo","postcssPageBreak","postcssAttributeCaseInsensitive","postcssColorFunctionalNotation","postcssColorModFunction","postcssCustomMedia","postcssCustomProperties","postcssCustomSelectors","postcssDirPseudoClass","postcssDoublePositionGradients","postcssEnvFunction","postcssFocusVisible","postcssFocusWithin","postcssFontVariant","postcssGapProperties","postcssColorGray","postcssHasPseudo","postcssColorHexAlpha","postcssImageSetPolyfill","postcssLabFunction","postcssLogical","postcssSelectorMatches","postcssMediaMinmax","postcssNesting","postcssSelectorNot","postcssOverflowShorthand","postcssReplaceOverflowWrap","postcssPlace","postcssPrefersColorScheme","postcssColorRebeccapurple","postcssFontFamilySystemUi","getTransformedInsertions","insertions","placement","Object","keys","map","id","concat","reduce","array","feature","getUnsupportedBrowsersByFeature","caniuseFeature","caniuse","stats","results","browsers","browser","filter","version","indexOf","getCustomMediaAsCss","customMedia","cssContent","cssLines","name","push","css","getCustomPropertiesAsCss","customProperties","getCustomSelectorsAsCss","customSelectors","writeExportsToCssFile","to","customPropertiesAsCss","customMediaAsCss","customSelectorsAsCss","writeFile","writeExportsToJsonFile","jsonContent","JSON","stringify","json","getObjectWithKeyAsCjs","key","object","jsContents","jsLines","escapeForJS","cjs","writeExportsToCjsFile","customMediaAsCjs","customPropertiesAsCjs","customSelectorsAsCjs","getObjectWithKeyAsMjs","mjsContents","mjsLines","mjs","writeExportsToMjsFile","customMediaAsMjs","customPropertiesAsMjs","customSelectorsAsMjs","writeToExports","customExports","destinations","Promise","all","destination","Function","getObjectWithStringifiedKeys","opts","String","toJSON","type","path","extname","slice","toLowerCase","customMediaJSON","customPropertiesJSON","customSelectorsJSON","objectJSON","text","resolve","reject","fs","error","string","features","insertBefore","insertAfter","stage","parseInt","autoprefixerOptions","autoprefixer","sharedOpts","initializeSharedOpts","stagedAutoprefixer","assign","polyfillableFeatures","cssdb","plugins","sort","a","b","idsByExecutionOrder","unsupportedBrowsers","stagedFeatures","process","result","supportedBrowsers","browserslist","source","input","file","ignoreUnknownVersions","supportedFeatures","some","supportedBrowser","polyfillBrowser","polyfills","promise","then","exportTo","importFrom","preserve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gCAAeA,OAAO,CAACC,MAAR,CAAe,wBAAf,EAAyC,MAA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