Add yet-another-react-lightbox package and update .gitignore to exclude node_modules
This commit is contained in:
66
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/CHANGELOG.md
generated
vendored
66
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/CHANGELOG.md
generated
vendored
@@ -1,66 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [8.0.0](https://github.com/gregberge/svgr/compare/v7.0.0...v8.0.0) (2023-05-09)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [7.0.0](https://github.com/gregberge/svgr/compare/v6.5.1...v7.0.0) (2023-03-24)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [6.5.1](https://github.com/gregberge/svgr/compare/v6.5.0...v6.5.1) (2022-10-27)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
# [6.5.0](https://github.com/gregberge/svgr/compare/v6.4.0...v6.5.0) (2022-10-14)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
## [6.3.1](https://github.com/gregberge/svgr/compare/v6.3.0...v6.3.1) (2022-07-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix exports compat with ESM ([#749](https://github.com/gregberge/svgr/issues/749)) ([f3e304c](https://github.com/gregberge/svgr/commit/f3e304c166282f042ecd4d6c396a0798a7f0b490))
|
||||
|
||||
# [6.3.0](https://github.com/gregberge/svgr/compare/v6.2.1...v6.3.0) (2022-07-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **package.json:** fix exports ([#745](https://github.com/gregberge/svgr/issues/745)) ([2a368d1](https://github.com/gregberge/svgr/commit/2a368d1305949ec6426c7c7312c04224071ec2bd))
|
||||
|
||||
# [5.4.0](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-add-jsx-attribute/compare/v5.3.1...v5.4.0) (2020-04-27)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
## [5.0.1](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-add-jsx-attribute/compare/v5.0.0...v5.0.1) (2019-12-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix engines in package.json ([a45d6fc](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-add-jsx-attribute/commit/a45d6fc8b43402bec60ed4e9273f90fdc65a23a7))
|
||||
|
||||
# [4.2.0](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-add-jsx-attribute/compare/v4.1.0...v4.2.0) (2019-04-11)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
# [4.0.0](https://github.com/gregberge/svgr/compare/v3.1.0...v4.0.0) (2018-11-04)
|
||||
|
||||
### Features
|
||||
|
||||
- **v4:** new architecture ([ac8b8ca](https://github.com/gregberge/svgr/commit/ac8b8ca))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **v4:** - `template` option must now returns a Babel AST
|
||||
|
||||
* `@svgr/core` does not include svgo & prettier by default
|
||||
7
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/LICENSE
generated
vendored
7
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/LICENSE
generated
vendored
@@ -1,7 +0,0 @@
|
||||
Copyright 2017 Smooth Code
|
||||
|
||||
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.
|
||||
37
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/README.md
generated
vendored
37
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/README.md
generated
vendored
@@ -1,37 +0,0 @@
|
||||
# @svgr/babel-plugin-add-jsx-attribute
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install --save-dev @svgr/babel-plugin-add-jsx-attribute
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"@svgr/babel-plugin-add-jsx-attribute",
|
||||
{
|
||||
"elements": ["svg"],
|
||||
"attributes": [
|
||||
{
|
||||
"name": "width",
|
||||
"value": "200",
|
||||
"spread": false,
|
||||
"literal": false,
|
||||
"position": "end"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
20
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.d.ts
generated
vendored
20
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.d.ts
generated
vendored
@@ -1,20 +0,0 @@
|
||||
import { ConfigAPI, NodePath, types } from '@babel/core';
|
||||
|
||||
interface Attribute {
|
||||
name: string;
|
||||
value?: boolean | number | string | null;
|
||||
spread?: boolean;
|
||||
literal?: boolean;
|
||||
position?: 'start' | 'end';
|
||||
}
|
||||
interface Options {
|
||||
elements: string[];
|
||||
attributes: Attribute[];
|
||||
}
|
||||
declare const addJSXAttribute: (_: ConfigAPI, opts: Options) => {
|
||||
visitor: {
|
||||
JSXOpeningElement(path: NodePath<types.JSXOpeningElement>): void;
|
||||
};
|
||||
};
|
||||
|
||||
export { Attribute, Options, addJSXAttribute as default };
|
||||
79
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js
generated
vendored
79
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js
generated
vendored
@@ -1,79 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var core = require('@babel/core');
|
||||
|
||||
const positionMethod = {
|
||||
start: "unshiftContainer",
|
||||
end: "pushContainer"
|
||||
};
|
||||
const addJSXAttribute = (_, opts) => {
|
||||
function getAttributeValue({
|
||||
literal,
|
||||
value
|
||||
}) {
|
||||
if (typeof value === "boolean") {
|
||||
return core.types.jsxExpressionContainer(core.types.booleanLiteral(value));
|
||||
}
|
||||
if (typeof value === "number") {
|
||||
return core.types.jsxExpressionContainer(core.types.numericLiteral(value));
|
||||
}
|
||||
if (typeof value === "string" && literal) {
|
||||
return core.types.jsxExpressionContainer(
|
||||
core.template.ast(value).expression
|
||||
);
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
return core.types.stringLiteral(value);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getAttribute({ spread, name, value, literal }) {
|
||||
if (spread) {
|
||||
return core.types.jsxSpreadAttribute(core.types.identifier(name));
|
||||
}
|
||||
return core.types.jsxAttribute(
|
||||
core.types.jsxIdentifier(name),
|
||||
getAttributeValue({ value, literal })
|
||||
);
|
||||
}
|
||||
return {
|
||||
visitor: {
|
||||
JSXOpeningElement(path) {
|
||||
if (!core.types.isJSXIdentifier(path.node.name))
|
||||
return;
|
||||
if (!opts.elements.includes(path.node.name.name))
|
||||
return;
|
||||
opts.attributes.forEach(
|
||||
({
|
||||
name,
|
||||
value = null,
|
||||
spread = false,
|
||||
literal = false,
|
||||
position = "end"
|
||||
}) => {
|
||||
const method = positionMethod[position];
|
||||
const newAttribute = getAttribute({ spread, name, value, literal });
|
||||
const attributes = path.get("attributes");
|
||||
const isEqualAttribute = (attribute) => {
|
||||
if (spread)
|
||||
return attribute.isJSXSpreadAttribute() && attribute.get("argument").isIdentifier({ name });
|
||||
return attribute.isJSXAttribute() && attribute.get("name").isJSXIdentifier({ name });
|
||||
};
|
||||
const replaced = attributes.some((attribute) => {
|
||||
if (!isEqualAttribute(attribute))
|
||||
return false;
|
||||
attribute.replaceWith(newAttribute);
|
||||
return true;
|
||||
});
|
||||
if (!replaced) {
|
||||
path[method]("attributes", newAttribute);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = addJSXAttribute;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js.map
generated
vendored
1
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
40
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/package.json
generated
vendored
40
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/package.json
generated
vendored
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "@svgr/babel-plugin-add-jsx-attribute",
|
||||
"description": "Add JSX attribute",
|
||||
"version": "8.0.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"repository": "https://github.com/gregberge/svgr/tree/main/packages/babel-plugin-add-jsx-attribute",
|
||||
"author": "Greg Bergé <berge.greg@gmail.com>",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"homepage": "https://react-svgr.com",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/gregberge"
|
||||
},
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"scripts": {
|
||||
"reset": "rm -rf dist",
|
||||
"build": "rollup -c ../../build/rollup.config.mjs",
|
||||
"prepublishOnly": "pnpm run reset && pnpm run build"
|
||||
},
|
||||
"gitHead": "52a1079681477587ef0d842c0e78531adf2d2520"
|
||||
}
|
||||
4
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/tsconfig.json
generated
vendored
4
frontend/node_modules/@svgr/babel-plugin-add-jsx-attribute/tsconfig.json
generated
vendored
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user