flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
34
BACK_BACK/node_modules/postcss-minify-font-values/CHANGELOG.md
generated
vendored
Executable file
34
BACK_BACK/node_modules/postcss-minify-font-values/CHANGELOG.md
generated
vendored
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
# 4.0.0-rc.0
|
||||
|
||||
* Breaking: Drops support for Node 0.12, we now require at least Node 4.
|
||||
* Breaking: Update PostCSS to 6.0.0.
|
||||
* Breaking: `removeAfterKeyword` is now set to `false` by default. This is to
|
||||
avoid incorrectly discarding emoji font families.
|
||||
* Removed support for compressing whitespace, this is now delegated to
|
||||
postcss-normalize-whitespace.
|
||||
|
||||
# 1.0.5
|
||||
|
||||
* Resolves an issue where `var` would be removed from `font-family`
|
||||
values (@ben-eb).
|
||||
|
||||
# 1.0.4
|
||||
|
||||
* Ignores duplicated `monospace` definitions (@ben-eb).
|
||||
|
||||
# 1.0.3
|
||||
|
||||
* Resolves an issue where the module would remove quotes from font families
|
||||
that began with numbers (@ben-eb).
|
||||
|
||||
# 1.0.2
|
||||
|
||||
* Upgraded postcss-value-parser to version 3 (@TrySound).
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Add repository link to `package.json` (@TrySound).
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Initial release (@TrySound).
|
||||
22
BACK_BACK/node_modules/postcss-minify-font-values/LICENSE
generated
vendored
Executable file
22
BACK_BACK/node_modules/postcss-minify-font-values/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) Bogdan Chadkin <trysound@yandex.ru>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
81
BACK_BACK/node_modules/postcss-minify-font-values/README.md
generated
vendored
Executable file
81
BACK_BACK/node_modules/postcss-minify-font-values/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,81 @@
|
|||
# postcss-minify-font-values [![Build Status][ci-img]][ci]
|
||||
|
||||
> Minify font declarations with PostCSS.
|
||||
|
||||
This module will try to minimise the `font-family`, `font-weight` and `font` shorthand
|
||||
properties; it can unquote font families where necessary, detect & remove
|
||||
duplicates, and cut short a declaration after it finds a keyword. For more
|
||||
examples, see the [tests](test).
|
||||
|
||||
```css
|
||||
h1 {
|
||||
font:bold 2.2rem/.9 "Open Sans Condensed", sans-serif;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: "Helvetica Neue", Arial, sans-serif, Helvetica;
|
||||
font-weight: normal;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
h1 {
|
||||
font:700 2.2rem/.9 Open Sans Condensed,sans-serif
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: Helvetica Neue,Arial,sans-serif;
|
||||
font-weight: 400;
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### minifyFontValues([options])
|
||||
|
||||
#### options
|
||||
|
||||
##### removeAfterKeyword
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
Pass `true` to remove font families after the module encounters a font keyword,
|
||||
for example `sans-serif`.
|
||||
|
||||
##### removeDuplicates
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to disable the module from removing duplicated font families.
|
||||
|
||||
##### removeQuotes
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to disable the module from removing quotes from font families.
|
||||
Note that oftentimes, this is a *safe optimisation* & is done safely. For more
|
||||
details, see [Mathias Bynens' article][mathias].
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
postcss([ require('postcss-minify-font-values') ])
|
||||
```
|
||||
|
||||
See [PostCSS] docs for examples for your environment.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
# License
|
||||
|
||||
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
|
||||
|
||||
[mathias]: https://mathiasbynens.be/notes/unquoted-font-family
|
||||
[PostCSS]: https://github.com/postcss/postcss
|
||||
[ci-img]: https://travis-ci.org/cssnano/postcss-minify-font-values.svg
|
||||
[ci]: https://travis-ci.org/cssnano/postcss-minify-font-values
|
||||
55
BACK_BACK/node_modules/postcss-minify-font-values/dist/index.js
generated
vendored
Executable file
55
BACK_BACK/node_modules/postcss-minify-font-values/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
|
||||
|
||||
var _minifyWeight = require('./lib/minify-weight');
|
||||
|
||||
var _minifyWeight2 = _interopRequireDefault(_minifyWeight);
|
||||
|
||||
var _minifyFamily = require('./lib/minify-family');
|
||||
|
||||
var _minifyFamily2 = _interopRequireDefault(_minifyFamily);
|
||||
|
||||
var _minifyFont = require('./lib/minify-font');
|
||||
|
||||
var _minifyFont2 = _interopRequireDefault(_minifyFont);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function transform(opts, decl) {
|
||||
let tree;
|
||||
let prop = decl.prop.toLowerCase();
|
||||
|
||||
if (prop === 'font-weight') {
|
||||
decl.value = (0, _minifyWeight2.default)(decl.value);
|
||||
} else if (prop === 'font-family') {
|
||||
tree = (0, _postcssValueParser2.default)(decl.value);
|
||||
tree.nodes = (0, _minifyFamily2.default)(tree.nodes, opts);
|
||||
decl.value = tree.toString();
|
||||
} else if (prop === 'font') {
|
||||
tree = (0, _postcssValueParser2.default)(decl.value);
|
||||
tree.nodes = (0, _minifyFont2.default)(tree.nodes, opts);
|
||||
decl.value = tree.toString();
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = _postcss2.default.plugin('postcss-minify-font-values', opts => {
|
||||
opts = Object.assign({}, {
|
||||
removeAfterKeyword: false,
|
||||
removeDuplicates: true,
|
||||
removeQuotes: true
|
||||
}, opts);
|
||||
|
||||
return css => css.walkDecls(/font/i, transform.bind(null, opts));
|
||||
});
|
||||
module.exports = exports['default'];
|
||||
13
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/keywords.js
generated
vendored
Executable file
13
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/keywords.js
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = {
|
||||
style: ['italic', 'oblique'],
|
||||
variant: ['small-caps'],
|
||||
weight: ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'bold', 'lighter', 'bolder'],
|
||||
stretch: ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'],
|
||||
size: ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', 'larger', 'smaller']
|
||||
};
|
||||
module.exports = exports['default'];
|
||||
206
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-family.js
generated
vendored
Executable file
206
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-family.js
generated
vendored
Executable file
|
|
@ -0,0 +1,206 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (nodes, opts) {
|
||||
let family = [];
|
||||
let last = null;
|
||||
let i, max;
|
||||
|
||||
nodes.forEach((node, index, arr) => {
|
||||
if (node.type === 'string' || node.type === 'function') {
|
||||
family.push(node);
|
||||
} else if (node.type === 'word') {
|
||||
if (!last) {
|
||||
last = { type: 'word', value: '' };
|
||||
family.push(last);
|
||||
}
|
||||
|
||||
last.value += node.value;
|
||||
} else if (node.type === 'space') {
|
||||
if (last && index !== arr.length - 1) {
|
||||
last.value += ' ';
|
||||
}
|
||||
} else {
|
||||
last = null;
|
||||
}
|
||||
});
|
||||
|
||||
family = family.map(node => {
|
||||
if (node.type === 'string') {
|
||||
const isKeyword = regexKeyword.test(node.value);
|
||||
|
||||
if (!opts.removeQuotes || isKeyword || /[0-9]/.test(node.value.slice(0, 1))) {
|
||||
return (0, _postcssValueParser.stringify)(node);
|
||||
}
|
||||
|
||||
let escaped = escapeIdentifierSequence(node.value);
|
||||
|
||||
if (escaped.length < node.value.length + 2) {
|
||||
return escaped;
|
||||
}
|
||||
}
|
||||
|
||||
return (0, _postcssValueParser.stringify)(node);
|
||||
});
|
||||
|
||||
if (opts.removeAfterKeyword) {
|
||||
for (i = 0, max = family.length; i < max; i += 1) {
|
||||
if (~genericFontFamilykeywords.indexOf(family[i].toLowerCase())) {
|
||||
family = family.slice(0, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.removeDuplicates) {
|
||||
family = uniqs(family);
|
||||
}
|
||||
|
||||
return [{
|
||||
type: 'word',
|
||||
value: family.join()
|
||||
}];
|
||||
};
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _uniqs = require('./uniqs');
|
||||
|
||||
var _uniqs2 = _interopRequireDefault(_uniqs);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const uniqs = (0, _uniqs2.default)('monospace');
|
||||
const globalKeywords = ['inherit', 'initial', 'unset'];
|
||||
const genericFontFamilykeywords = ['sans-serif', 'serif', 'fantasy', 'cursive', 'monospace', 'system-ui'];
|
||||
|
||||
function makeArray(value, length) {
|
||||
let array = [];
|
||||
while (length--) {
|
||||
array[length] = value;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
const regexSimpleEscapeCharacters = /[ !"#$%&'()*+,.\/;<=>?@\[\\\]^`{|}~]/;
|
||||
|
||||
function escape(string, escapeForString) {
|
||||
let counter = 0;
|
||||
let character = null;
|
||||
let charCode = null;
|
||||
let value = null;
|
||||
let output = '';
|
||||
|
||||
while (counter < string.length) {
|
||||
character = string.charAt(counter++);
|
||||
charCode = character.charCodeAt();
|
||||
|
||||
// \r is already tokenized away at this point
|
||||
// `:` can be escaped as `\:`, but that fails in IE < 8
|
||||
if (!escapeForString && /[\t\n\v\f:]/.test(character)) {
|
||||
value = '\\' + charCode.toString(16) + ' ';
|
||||
} else if (!escapeForString && regexSimpleEscapeCharacters.test(character)) {
|
||||
value = '\\' + character;
|
||||
} else {
|
||||
value = character;
|
||||
}
|
||||
|
||||
output += value;
|
||||
}
|
||||
|
||||
if (!escapeForString) {
|
||||
if (/^-[-\d]/.test(output)) {
|
||||
output = '\\-' + output.slice(1);
|
||||
}
|
||||
|
||||
const firstChar = string.charAt(0);
|
||||
|
||||
if (/\d/.test(firstChar)) {
|
||||
output = '\\3' + firstChar + ' ' + output.slice(1);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
const regexKeyword = new RegExp(genericFontFamilykeywords.concat(globalKeywords).join('|'), 'i');
|
||||
const regexInvalidIdentifier = /^(-?\d|--)/;
|
||||
const regexSpaceAtStart = /^\x20/;
|
||||
const regexWhitespace = /[\t\n\f\r\x20]/g;
|
||||
const regexIdentifierCharacter = /^[a-zA-Z\d\xa0-\uffff_-]+$/;
|
||||
const regexConsecutiveSpaces = /(\\(?:[a-fA-F0-9]{1,6}\x20|\x20))?(\x20{2,})/g;
|
||||
const regexTrailingEscape = /\\[a-fA-F0-9]{0,6}\x20$/;
|
||||
const regexTrailingSpace = /\x20$/;
|
||||
|
||||
function escapeIdentifierSequence(string) {
|
||||
let identifiers = string.split(regexWhitespace);
|
||||
let index = 0;
|
||||
let result = [];
|
||||
let escapeResult;
|
||||
|
||||
while (index < identifiers.length) {
|
||||
let subString = identifiers[index++];
|
||||
|
||||
if (subString === '') {
|
||||
result.push(subString);
|
||||
continue;
|
||||
}
|
||||
|
||||
escapeResult = escape(subString, false);
|
||||
|
||||
if (regexIdentifierCharacter.test(subString)) {
|
||||
// the font family name part consists of allowed characters exclusively
|
||||
if (regexInvalidIdentifier.test(subString)) {
|
||||
// the font family name part starts with two hyphens, a digit, or a
|
||||
// hyphen followed by a digit
|
||||
if (index === 1) {
|
||||
// if this is the first item
|
||||
result.push(escapeResult);
|
||||
} else {
|
||||
// if it’s not the first item, we can simply escape the space
|
||||
// between the two identifiers to merge them into a single
|
||||
// identifier rather than escaping the start characters of the
|
||||
// second identifier
|
||||
result[index - 2] += '\\';
|
||||
result.push(escape(subString, true));
|
||||
}
|
||||
} else {
|
||||
// the font family name part doesn’t start with two hyphens, a digit,
|
||||
// or a hyphen followed by a digit
|
||||
result.push(escapeResult);
|
||||
}
|
||||
} else {
|
||||
// the font family name part contains invalid identifier characters
|
||||
result.push(escapeResult);
|
||||
}
|
||||
}
|
||||
|
||||
result = result.join(' ').replace(regexConsecutiveSpaces, ($0, $1, $2) => {
|
||||
const spaceCount = $2.length;
|
||||
const escapesNeeded = Math.floor(spaceCount / 2);
|
||||
const array = makeArray('\\ ', escapesNeeded);
|
||||
|
||||
if (spaceCount % 2) {
|
||||
array[escapesNeeded - 1] += '\\ ';
|
||||
}
|
||||
|
||||
return ($1 || '') + ' ' + array.join(' ');
|
||||
});
|
||||
|
||||
// Escape trailing spaces unless they’re already part of an escape
|
||||
if (regexTrailingSpace.test(result) && !regexTrailingEscape.test(result)) {
|
||||
result = result.replace(regexTrailingSpace, '\\ ');
|
||||
}
|
||||
|
||||
if (regexSpaceAtStart.test(result)) {
|
||||
result = '\\ ' + result.slice(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
;
|
||||
module.exports = exports['default'];
|
||||
55
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-font.js
generated
vendored
Executable file
55
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-font.js
generated
vendored
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (nodes, opts) {
|
||||
let i, max, node, familyStart, family;
|
||||
let hasSize = false;
|
||||
|
||||
for (i = 0, max = nodes.length; i < max; i += 1) {
|
||||
node = nodes[i];
|
||||
if (node.type === 'word') {
|
||||
if (hasSize) {
|
||||
continue;
|
||||
}
|
||||
const value = node.value.toLowerCase();
|
||||
if (value === 'normal' || ~_keywords2.default.style.indexOf(value) || ~_keywords2.default.variant.indexOf(value) || ~_keywords2.default.stretch.indexOf(value)) {
|
||||
familyStart = i;
|
||||
} else if (~_keywords2.default.weight.indexOf(value)) {
|
||||
node.value = (0, _minifyWeight2.default)(value);
|
||||
familyStart = i;
|
||||
} else if (~_keywords2.default.size.indexOf(value) || (0, _postcssValueParser.unit)(value)) {
|
||||
familyStart = i;
|
||||
hasSize = true;
|
||||
}
|
||||
} else if (node.type === 'div' && node.value === '/') {
|
||||
familyStart = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
familyStart += 2;
|
||||
family = (0, _minifyFamily2.default)(nodes.slice(familyStart), opts);
|
||||
return nodes.slice(0, familyStart).concat(family);
|
||||
};
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _keywords = require('./keywords');
|
||||
|
||||
var _keywords2 = _interopRequireDefault(_keywords);
|
||||
|
||||
var _minifyFamily = require('./minify-family');
|
||||
|
||||
var _minifyFamily2 = _interopRequireDefault(_minifyFamily);
|
||||
|
||||
var _minifyWeight = require('./minify-weight');
|
||||
|
||||
var _minifyWeight2 = _interopRequireDefault(_minifyWeight);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
;
|
||||
module.exports = exports['default'];
|
||||
14
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-weight.js
generated
vendored
Executable file
14
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/minify-weight.js
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (value) {
|
||||
const valueInLowerCase = value.toLowerCase();
|
||||
|
||||
return valueInLowerCase === 'normal' ? '400' : valueInLowerCase === 'bold' ? '700' : value;
|
||||
};
|
||||
|
||||
;
|
||||
module.exports = exports['default'];
|
||||
18
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/uniqs.js
generated
vendored
Executable file
18
BACK_BACK/node_modules/postcss-minify-font-values/dist/lib/uniqs.js
generated
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = uniqueExcept;
|
||||
function uniqueExcept(exclude) {
|
||||
return function unique() {
|
||||
const list = Array.prototype.concat.apply([], arguments);
|
||||
return list.filter((item, i) => {
|
||||
if (item.toLowerCase() === exclude) {
|
||||
return true;
|
||||
}
|
||||
return i === list.indexOf(item);
|
||||
});
|
||||
};
|
||||
};
|
||||
module.exports = exports["default"];
|
||||
38
BACK_BACK/node_modules/postcss-minify-font-values/package.json
generated
vendored
Executable file
38
BACK_BACK/node_modules/postcss-minify-font-values/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "postcss-minify-font-values",
|
||||
"version": "4.0.2",
|
||||
"description": "Minify font declarations with PostCSS",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"author": "Bogdan Chadkin <trysound@yandex.ru>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"css",
|
||||
"font",
|
||||
"font-family",
|
||||
"font-weight",
|
||||
"optimise",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-value-parser": "^3.0.0"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"scripts": {
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"cross-env": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue