first
This commit is contained in:
22
node_modules/postcss-normalize-unicode/LICENSE-MIT
generated
vendored
Normal file
22
node_modules/postcss-normalize-unicode/LICENSE-MIT
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
|
||||
|
||||
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.
|
46
node_modules/postcss-normalize-unicode/README.md
generated
vendored
Normal file
46
node_modules/postcss-normalize-unicode/README.md
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# [postcss][postcss]-normalize-unicode
|
||||
|
||||
> Normalize unicode with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-normalize-unicode) do:
|
||||
|
||||
```
|
||||
npm install postcss-normalize-unicode --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
@font-face{
|
||||
font-family: test;
|
||||
unicode-range: u+2b00-2bff
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
@font-face{
|
||||
font-family: test;
|
||||
unicode-range: u+2b??
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Ben Briggs](http://beneb.info)
|
||||
|
||||
[postcss]: https://github.com/postcss/postcss
|
15
node_modules/postcss-normalize-unicode/node_modules/.bin/browserslist
generated
vendored
Normal file
15
node_modules/postcss-normalize-unicode/node_modules/.bin/browserslist
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../../../browserslist/cli.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../../../browserslist/cli.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/postcss-normalize-unicode/node_modules/.bin/browserslist.cmd
generated
vendored
Normal file
7
node_modules/postcss-normalize-unicode/node_modules/.bin/browserslist.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\browserslist\cli.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\..\..\browserslist\cli.js" %*
|
||||
)
|
69
node_modules/postcss-normalize-unicode/package.json
generated
vendored
Normal file
69
node_modules/postcss-normalize-unicode/package.json
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"_from": "postcss-normalize-unicode@^5.1.1",
|
||||
"_id": "postcss-normalize-unicode@5.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==",
|
||||
"_location": "/postcss-normalize-unicode",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "postcss-normalize-unicode@^5.1.1",
|
||||
"name": "postcss-normalize-unicode",
|
||||
"escapedName": "postcss-normalize-unicode",
|
||||
"rawSpec": "^5.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano-preset-default"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz",
|
||||
"_shasum": "f67297fca3fea7f17e0d2caa40769afc487aa030",
|
||||
"_spec": "postcss-normalize-unicode@^5.1.1",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\cssnano-preset-default",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"browserslist": "^4.21.4",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Normalize unicode-range descriptors, and can convert to wildcard ranges.",
|
||||
"devDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14.0"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"LICENSE-MIT",
|
||||
"types"
|
||||
],
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"keywords": [
|
||||
"css",
|
||||
"postcss",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"name": "postcss-normalize-unicode",
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cssnano/cssnano.git"
|
||||
},
|
||||
"types": "types/index.d.ts",
|
||||
"version": "5.1.1"
|
||||
}
|
132
node_modules/postcss-normalize-unicode/src/index.js
generated
vendored
Normal file
132
node_modules/postcss-normalize-unicode/src/index.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
'use strict';
|
||||
const browserslist = require('browserslist');
|
||||
const valueParser = require('postcss-value-parser');
|
||||
|
||||
const regexLowerCaseUPrefix = /^u(?=\+)/;
|
||||
|
||||
/**
|
||||
* @param {string} range
|
||||
* @return {string}
|
||||
*/
|
||||
function unicode(range) {
|
||||
const values = range.slice(2).split('-');
|
||||
|
||||
if (values.length < 2) {
|
||||
return range;
|
||||
}
|
||||
|
||||
const left = values[0].split('');
|
||||
const right = values[1].split('');
|
||||
|
||||
if (left.length !== right.length) {
|
||||
return range;
|
||||
}
|
||||
|
||||
const merged = mergeRangeBounds(left, right);
|
||||
|
||||
if (merged) {
|
||||
return merged;
|
||||
}
|
||||
|
||||
return range;
|
||||
}
|
||||
/**
|
||||
* @param {string[]} left
|
||||
* @param {string[]} right
|
||||
* @return {false|string}
|
||||
*/
|
||||
function mergeRangeBounds(left, right) {
|
||||
let questionCounter = 0;
|
||||
let group = 'u+';
|
||||
for (const [index, value] of left.entries()) {
|
||||
if (value === right[index] && questionCounter === 0) {
|
||||
group = group + value;
|
||||
} else if (value === '0' && right[index] === 'f') {
|
||||
questionCounter++;
|
||||
group = group + '?';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// The maximum number of wildcard characters (?) for ranges is 5.
|
||||
if (questionCounter < 6) {
|
||||
return group;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* IE and Edge before 16 version ignore the unicode-range if the 'U' is lowercase
|
||||
*
|
||||
* https://caniuse.com/#search=unicode-range
|
||||
*
|
||||
* @param {string} browser
|
||||
* @return {boolean}
|
||||
*/
|
||||
function hasLowerCaseUPrefixBug(browser) {
|
||||
return browserslist('ie <=11, edge <= 15').includes(browser);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {string}
|
||||
*/
|
||||
function transform(value, isLegacy = false) {
|
||||
return valueParser(value)
|
||||
.walk((child) => {
|
||||
if (child.type === 'unicode-range') {
|
||||
const transformed = unicode(child.value.toLowerCase());
|
||||
|
||||
child.value = isLegacy
|
||||
? transformed.replace(regexLowerCaseUPrefix, 'U')
|
||||
: transformed;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<void>}
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
function pluginCreator() {
|
||||
return {
|
||||
postcssPlugin: 'postcss-normalize-unicode',
|
||||
/** @param {import('postcss').Result & {opts: browserslist.Options}} result*/
|
||||
prepare(result) {
|
||||
const cache = new Map();
|
||||
const resultOpts = result.opts || {};
|
||||
const browsers = browserslist(null, {
|
||||
stats: resultOpts.stats,
|
||||
path: __dirname,
|
||||
env: resultOpts.env,
|
||||
});
|
||||
const isLegacy = browsers.some(hasLowerCaseUPrefixBug);
|
||||
|
||||
return {
|
||||
OnceExit(css) {
|
||||
css.walkDecls(/^unicode-range$/i, (decl) => {
|
||||
const value = decl.value;
|
||||
|
||||
if (cache.has(value)) {
|
||||
decl.value = cache.get(value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const newValue = transform(value, isLegacy);
|
||||
|
||||
decl.value = newValue;
|
||||
cache.set(value, newValue);
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
pluginCreator.postcss = true;
|
||||
module.exports = pluginCreator;
|
9
node_modules/postcss-normalize-unicode/types/index.d.ts
generated
vendored
Normal file
9
node_modules/postcss-normalize-unicode/types/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export = pluginCreator;
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<void>}
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
declare function pluginCreator(): import('postcss').Plugin;
|
||||
declare namespace pluginCreator {
|
||||
const postcss: true;
|
||||
}
|
Reference in New Issue
Block a user