Conexio amb la api
This commit is contained in:
parent
207c0ba819
commit
b12369cb47
48513 changed files with 7391639 additions and 7 deletions
22
node_modules/postcss-normalize-url/LICENSE-MIT
generated
vendored
Executable file
22
node_modules/postcss-normalize-url/LICENSE-MIT
generated
vendored
Executable 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.
|
||||
55
node_modules/postcss-normalize-url/README.md
generated
vendored
Executable file
55
node_modules/postcss-normalize-url/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
# [postcss][postcss]-normalize-url
|
||||
|
||||
> [Normalize URLs](https://github.com/sindresorhus/normalize-url) with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-normalize-url) do:
|
||||
|
||||
```
|
||||
npm install postcss-normalize-url --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url("http://site.com:80/image.jpg")
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url(http://site.com/image.jpg)
|
||||
}
|
||||
```
|
||||
|
||||
Note that this module will also try to normalize relative URLs, and is capable
|
||||
of stripping unnecessary quotes. For more examples, see the [tests](test.js).
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
## API
|
||||
|
||||
### normalize([options])
|
||||
|
||||
Please see the [normalize-url documentation][docs]. By default,
|
||||
`normalizeProtocol`, `stripHash` & `stripWWW` are set to `false`.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Ben Briggs](http://beneb.info)
|
||||
|
||||
[docs]: https://github.com/sindresorhus/normalize-url#options
|
||||
[postcss]: https://github.com/postcss/postcss
|
||||
126
node_modules/postcss-normalize-url/dist/index.js
generated
vendored
Executable file
126
node_modules/postcss-normalize-url/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,126 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
|
||||
|
||||
var _normalizeUrl = _interopRequireDefault(require("normalize-url"));
|
||||
|
||||
var _isAbsoluteUrl = _interopRequireDefault(require("is-absolute-url"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const multiline = /\\[\r\n]/; // eslint-disable-next-line no-useless-escape
|
||||
|
||||
const escapeChars = /([\s\(\)"'])/g;
|
||||
|
||||
function convert(url, options) {
|
||||
if ((0, _isAbsoluteUrl.default)(url) || url.startsWith('//')) {
|
||||
let normalizedURL = null;
|
||||
|
||||
try {
|
||||
normalizedURL = (0, _normalizeUrl.default)(url, options);
|
||||
} catch (e) {
|
||||
normalizedURL = url;
|
||||
}
|
||||
|
||||
return normalizedURL;
|
||||
} // `path.normalize` always returns backslashes on Windows, need replace in `/`
|
||||
|
||||
|
||||
return _path.default.normalize(url).replace(new RegExp('\\' + _path.default.sep, 'g'), '/');
|
||||
}
|
||||
|
||||
function transformNamespace(rule) {
|
||||
rule.params = (0, _postcssValueParser.default)(rule.params).walk(node => {
|
||||
if (node.type === 'function' && node.value.toLowerCase() === 'url' && node.nodes.length) {
|
||||
node.type = 'string';
|
||||
node.quote = node.nodes[0].quote || '"';
|
||||
node.value = node.nodes[0].value;
|
||||
}
|
||||
|
||||
if (node.type === 'string') {
|
||||
node.value = node.value.trim();
|
||||
}
|
||||
|
||||
return false;
|
||||
}).toString();
|
||||
}
|
||||
|
||||
function transformDecl(decl, opts) {
|
||||
decl.value = (0, _postcssValueParser.default)(decl.value).walk(node => {
|
||||
if (node.type !== 'function' || node.value.toLowerCase() !== 'url') {
|
||||
return false;
|
||||
}
|
||||
|
||||
node.before = node.after = '';
|
||||
|
||||
if (!node.nodes.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let url = node.nodes[0];
|
||||
let escaped;
|
||||
url.value = url.value.trim().replace(multiline, ''); // Skip empty URLs
|
||||
// Empty URL function equals request to current stylesheet where it is declared
|
||||
|
||||
if (url.value.length === 0) {
|
||||
url.quote = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (/^data:(.*)?,/i.test(url.value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!/^.+-extension:\//i.test(url.value)) {
|
||||
url.value = convert(url.value, opts);
|
||||
}
|
||||
|
||||
if (escapeChars.test(url.value) && url.type === 'string') {
|
||||
escaped = url.value.replace(escapeChars, '\\$1');
|
||||
|
||||
if (escaped.length < url.value.length + 2) {
|
||||
url.value = escaped;
|
||||
url.type = 'word';
|
||||
}
|
||||
} else {
|
||||
url.type = 'word';
|
||||
}
|
||||
|
||||
return false;
|
||||
}).toString();
|
||||
}
|
||||
|
||||
function pluginCreator(opts) {
|
||||
opts = Object.assign({}, {
|
||||
normalizeProtocol: false,
|
||||
stripHash: false,
|
||||
stripWWW: false,
|
||||
stripTextFragment: false
|
||||
}, opts);
|
||||
return {
|
||||
postcssPlugin: 'postcss-normalize-url',
|
||||
|
||||
OnceExit(css) {
|
||||
css.walk(node => {
|
||||
if (node.type === 'decl') {
|
||||
return transformDecl(node, opts);
|
||||
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') {
|
||||
return transformNamespace(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
pluginCreator.postcss = true;
|
||||
var _default = pluginCreator;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
||||
78
node_modules/postcss-normalize-url/package.json
generated
vendored
Executable file
78
node_modules/postcss-normalize-url/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"_from": "postcss-normalize-url@^5.0.2",
|
||||
"_id": "postcss-normalize-url@5.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ==",
|
||||
"_location": "/postcss-normalize-url",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "postcss-normalize-url@^5.0.2",
|
||||
"name": "postcss-normalize-url",
|
||||
"escapedName": "postcss-normalize-url",
|
||||
"rawSpec": "^5.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano-preset-default"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz",
|
||||
"_shasum": "ddcdfb7cede1270740cf3e4dfc6008bd96abc763",
|
||||
"_spec": "postcss-normalize-url@^5.0.2",
|
||||
"_where": "/home/jack/Documents/JDA/m14/projecte_janmaroto/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": {
|
||||
"is-absolute-url": "^3.0.3",
|
||||
"normalize-url": "^6.0.1",
|
||||
"postcss-value-parser": "^4.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Normalize URLs with PostCSS",
|
||||
"devDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE-MIT"
|
||||
],
|
||||
"gitHead": "39b4cc089e8825d308df1fa8a7313d38d8f1f2f7",
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"keywords": [
|
||||
"css",
|
||||
"normalize",
|
||||
"optimise",
|
||||
"optimisation",
|
||||
"postcss",
|
||||
"postcss-plugin",
|
||||
"url"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"name": "postcss-normalize-url",
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cssnano/cssnano.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"",
|
||||
"prebuild": "rimraf dist",
|
||||
"prepare": "yarn build"
|
||||
},
|
||||
"version": "5.0.2"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue