Conexio amb la api
This commit is contained in:
parent
207c0ba819
commit
b12369cb47
48513 changed files with 7391639 additions and 7 deletions
78
node_modules/postcss-reduce-transforms/CHANGELOG.md
generated
vendored
Executable file
78
node_modules/postcss-reduce-transforms/CHANGELOG.md
generated
vendored
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [5.0.1](https://github.com/cssnano/cssnano/compare/postcss-reduce-transforms@5.0.0...postcss-reduce-transforms@5.0.1) (2021-05-19)
|
||||
|
||||
**Note:** Version bump only for package postcss-reduce-transforms
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0](https://github.com/cssnano/cssnano/compare/postcss-reduce-transforms@5.0.0-rc.2...postcss-reduce-transforms@5.0.0) (2021-04-06)
|
||||
|
||||
**Note:** Version bump only for package postcss-reduce-transforms
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-rc.2](https://github.com/cssnano/cssnano/compare/postcss-reduce-transforms@5.0.0-rc.1...postcss-reduce-transforms@5.0.0-rc.2) (2021-03-15)
|
||||
|
||||
**Note:** Version bump only for package postcss-reduce-transforms
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-rc.1](https://github.com/cssnano/cssnano/compare/postcss-reduce-transforms@5.0.0-rc.0...postcss-reduce-transforms@5.0.0-rc.1) (2021-03-04)
|
||||
|
||||
**Note:** Version bump only for package postcss-reduce-transforms
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 5.0.0-rc.0 (2021-02-19)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* minimum require version of node is 10.13 ([#871](https://github.com/cssnano/cssnano/issues/871)) ([28bda24](https://github.com/cssnano/cssnano/commit/28bda243e32ce3ba89b3c358a5f78727b3732f11))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* migarete to PostCSS 8 ([#975](https://github.com/cssnano/cssnano/issues/975)) ([40b82dc](https://github.com/cssnano/cssnano/commit/40b82dca7f53ac02cd4fe62846dec79b898ccb49))
|
||||
* **postcss-reduce-transforms:** improve optimizations ([#745](https://github.com/cssnano/cssnano/issues/745)) ([b0f0d89](https://github.com/cssnano/cssnano/commit/b0f0d892316d7b77e8033a6dc8d67745043a5072))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* minimum supported `postcss` version is `8.2.1`
|
||||
* minimum require version of node is 10.13
|
||||
|
||||
|
||||
|
||||
## 4.1.9 (2019-02-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **fix-postcss-reduce-transforms:** cache ([#691](https://github.com/cssnano/cssnano/issues/691)) ([e07309f](https://github.com/cssnano/cssnano/commit/e07309ff0c07fb36ef2340bbed6b3aee3dad18be))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **postcss-reduce-transforms:** increase perf ([#688](https://github.com/cssnano/cssnano/issues/688)) ([84ccba0](https://github.com/cssnano/cssnano/commit/84ccba00cead30e80510525cbcd27ba259c26065))
|
||||
|
||||
|
||||
|
||||
## 4.1.1 (2018-09-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **postcss-merge-longhand:** not mangle border output ([#555](https://github.com/cssnano/cssnano/issues/555)) ([9a70605](https://github.com/cssnano/cssnano/commit/9a706050b621e7795a9bf74eb7110b5c81804ffe)), closes [#553](https://github.com/cssnano/cssnano/issues/553) [#554](https://github.com/cssnano/cssnano/issues/554)
|
||||
22
node_modules/postcss-reduce-transforms/LICENSE-MIT
generated
vendored
Executable file
22
node_modules/postcss-reduce-transforms/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.
|
||||
47
node_modules/postcss-reduce-transforms/README.md
generated
vendored
Executable file
47
node_modules/postcss-reduce-transforms/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
# [postcss][postcss]-reduce-transforms
|
||||
|
||||
> Reduce transform functions with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-reduce-transforms) do:
|
||||
|
||||
```
|
||||
npm install postcss-reduce-transforms --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
This module will reduce transform functions where possible. For more examples,
|
||||
see the [tests](src/__tests__/index.js).
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1 {
|
||||
transform: rotate3d(0, 0, 1, 20deg);
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
transform: rotate(20deg);
|
||||
}
|
||||
```
|
||||
|
||||
## 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
|
||||
257
node_modules/postcss-reduce-transforms/dist/index.js
generated
vendored
Executable file
257
node_modules/postcss-reduce-transforms/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,257 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _postcssValueParser = _interopRequireWildcard(require("postcss-value-parser"));
|
||||
|
||||
var _cssnanoUtils = require("cssnano-utils");
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getValues(list, node, index) {
|
||||
if (index % 2 === 0) {
|
||||
let value = NaN;
|
||||
|
||||
if (node.type === 'function' && (node.value === 'var' || node.value === 'env') && node.nodes.length === 1) {
|
||||
value = (0, _postcssValueParser.stringify)(node.nodes);
|
||||
} else if (node.type === 'word') {
|
||||
value = parseFloat(node.value);
|
||||
}
|
||||
|
||||
return [...list, value];
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
function matrix3d(node, values) {
|
||||
if (values.length !== 16) {
|
||||
return;
|
||||
} // matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1) => matrix(a, b, c, d, tx, ty)
|
||||
|
||||
|
||||
if (values[15] && values[2] === 0 && values[3] === 0 && values[6] === 0 && values[7] === 0 && values[8] === 0 && values[9] === 0 && values[10] === 1 && values[11] === 0 && values[14] === 0 && values[15] === 1) {
|
||||
const {
|
||||
nodes
|
||||
} = node;
|
||||
node.value = 'matrix';
|
||||
node.nodes = [nodes[0], // a
|
||||
nodes[1], // ,
|
||||
nodes[2], // b
|
||||
nodes[3], // ,
|
||||
nodes[8], // c
|
||||
nodes[9], // ,
|
||||
nodes[10], // d
|
||||
nodes[11], // ,
|
||||
nodes[24], // tx
|
||||
nodes[25], // ,
|
||||
nodes[26] // ty
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
const rotate3dMappings = [['rotateX', [1, 0, 0]], // rotate3d(1, 0, 0, a) => rotateX(a)
|
||||
['rotateY', [0, 1, 0]], // rotate3d(0, 1, 0, a) => rotateY(a)
|
||||
['rotate', [0, 0, 1]] // rotate3d(0, 0, 1, a) => rotate(a)
|
||||
];
|
||||
const rotate3dMatch = (0, _cssnanoUtils.getMatch)(rotate3dMappings);
|
||||
|
||||
function rotate3d(node, values) {
|
||||
if (values.length !== 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = node;
|
||||
const match = rotate3dMatch(values.slice(0, 3));
|
||||
|
||||
if (match.length) {
|
||||
node.value = match;
|
||||
node.nodes = [nodes[6]];
|
||||
}
|
||||
}
|
||||
|
||||
function rotateZ(node, values) {
|
||||
if (values.length !== 1) {
|
||||
return;
|
||||
} // rotateZ(rz) => rotate(rz)
|
||||
|
||||
|
||||
node.value = 'rotate';
|
||||
}
|
||||
|
||||
function scale(node, values) {
|
||||
if (values.length !== 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = node;
|
||||
const [first, second] = values; // scale(sx, sy) => scale(sx)
|
||||
|
||||
if (first === second) {
|
||||
node.nodes = [nodes[0]];
|
||||
return;
|
||||
} // scale(sx, 1) => scaleX(sx)
|
||||
|
||||
|
||||
if (second === 1) {
|
||||
node.value = 'scaleX';
|
||||
node.nodes = [nodes[0]];
|
||||
return;
|
||||
} // scale(1, sy) => scaleY(sy)
|
||||
|
||||
|
||||
if (first === 1) {
|
||||
node.value = 'scaleY';
|
||||
node.nodes = [nodes[2]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function scale3d(node, values) {
|
||||
if (values.length !== 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = node;
|
||||
const [first, second, third] = values; // scale3d(sx, 1, 1) => scaleX(sx)
|
||||
|
||||
if (second === 1 && third === 1) {
|
||||
node.value = 'scaleX';
|
||||
node.nodes = [nodes[0]];
|
||||
return;
|
||||
} // scale3d(1, sy, 1) => scaleY(sy)
|
||||
|
||||
|
||||
if (first === 1 && third === 1) {
|
||||
node.value = 'scaleY';
|
||||
node.nodes = [nodes[2]];
|
||||
return;
|
||||
} // scale3d(1, 1, sz) => scaleZ(sz)
|
||||
|
||||
|
||||
if (first === 1 && second === 1) {
|
||||
node.value = 'scaleZ';
|
||||
node.nodes = [nodes[4]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function translate(node, values) {
|
||||
if (values.length !== 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = node; // translate(tx, 0) => translate(tx)
|
||||
|
||||
if (values[1] === 0) {
|
||||
node.nodes = [nodes[0]];
|
||||
return;
|
||||
} // translate(0, ty) => translateY(ty)
|
||||
|
||||
|
||||
if (values[0] === 0) {
|
||||
node.value = 'translateY';
|
||||
node.nodes = [nodes[2]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function translate3d(node, values) {
|
||||
if (values.length !== 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = node; // translate3d(0, 0, tz) => translateZ(tz)
|
||||
|
||||
if (values[0] === 0 && values[1] === 0) {
|
||||
node.value = 'translateZ';
|
||||
node.nodes = [nodes[4]];
|
||||
}
|
||||
}
|
||||
|
||||
const reducers = {
|
||||
matrix3d,
|
||||
rotate3d,
|
||||
rotateZ,
|
||||
scale,
|
||||
scale3d,
|
||||
translate,
|
||||
translate3d
|
||||
};
|
||||
|
||||
function normalizeReducerName(name) {
|
||||
const lowerCasedName = name.toLowerCase();
|
||||
|
||||
if (lowerCasedName === 'rotatez') {
|
||||
return 'rotateZ';
|
||||
}
|
||||
|
||||
return lowerCasedName;
|
||||
}
|
||||
|
||||
function reduce(node) {
|
||||
const {
|
||||
nodes,
|
||||
type,
|
||||
value
|
||||
} = node;
|
||||
const normalizedReducerName = normalizeReducerName(value);
|
||||
|
||||
if (type === 'function' && Object.prototype.hasOwnProperty.call(reducers, normalizedReducerName)) {
|
||||
reducers[normalizedReducerName](node, nodes.reduce(getValues, []));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function pluginCreator() {
|
||||
return {
|
||||
postcssPlugin: 'postcss-reduce-transforms',
|
||||
|
||||
prepare() {
|
||||
const cache = {};
|
||||
return {
|
||||
OnceExit(css) {
|
||||
css.walkDecls(/transform$/i, decl => {
|
||||
const value = decl.value;
|
||||
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cache[value]) {
|
||||
decl.value = cache[value];
|
||||
return;
|
||||
}
|
||||
|
||||
const result = (0, _postcssValueParser.default)(value).walk(reduce).toString();
|
||||
decl.value = result;
|
||||
cache[value] = result;
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
pluginCreator.postcss = true;
|
||||
var _default = pluginCreator;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
||||
68
node_modules/postcss-reduce-transforms/package.json
generated
vendored
Executable file
68
node_modules/postcss-reduce-transforms/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"_from": "postcss-reduce-transforms@^5.0.1",
|
||||
"_id": "postcss-reduce-transforms@5.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA==",
|
||||
"_location": "/postcss-reduce-transforms",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "postcss-reduce-transforms@^5.0.1",
|
||||
"name": "postcss-reduce-transforms",
|
||||
"escapedName": "postcss-reduce-transforms",
|
||||
"rawSpec": "^5.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano-preset-default"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.0.1.tgz",
|
||||
"_shasum": "93c12f6a159474aa711d5269923e2383cedcf640",
|
||||
"_spec": "postcss-reduce-transforms@^5.0.1",
|
||||
"_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": {
|
||||
"cssnano-utils": "^2.0.1",
|
||||
"postcss-value-parser": "^4.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Reduce transform functions with PostCSS.",
|
||||
"devDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14.0"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE-MIT",
|
||||
"dist"
|
||||
],
|
||||
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc",
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"name": "postcss-reduce-transforms",
|
||||
"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": "del-cli dist",
|
||||
"prepublish": "yarn build"
|
||||
},
|
||||
"version": "5.0.1"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue