mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-04 23:22:17 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
77
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/CHANGELOG.md
generated
vendored
Normal file
77
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.4.0](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/compare/v5.3.1...v5.4.0) (2020-04-27)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-svg-dynamic-title
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.1](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/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-svg-dynamic-title/commit/a45d6fc8b43402bec60ed4e9273f90fdc65a23a7))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.3.3](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/compare/v4.3.2...v4.3.3) (2019-09-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **babel-plugin-svg-dynamic-title:** dont render empty title ([#341](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/issues/341)) ([88b24c5](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/commit/88b24c5)), closes [#333](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/issues/333)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.3.1](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/compare/v4.3.0...v4.3.1) (2019-07-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **titleProp:** handle the existing title case by using element instead of value (children) ([#315](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/issues/315)) ([065e7a9](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/commit/065e7a9))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.3.0](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/compare/v4.2.0...v4.3.0) (2019-05-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* titleProps fallbacks to svg's title ([#311](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/issues/311)) ([8f92366](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/commit/8f92366))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.2.0](https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title/compare/v4.1.0...v4.2.0) (2019-04-11)
|
||||
|
||||
**Note:** Version bump only for package @svgr/babel-plugin-svg-dynamic-title
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [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
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/LICENSE
generated
vendored
Normal file
7
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
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.
|
21
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/README.md
generated
vendored
Normal file
21
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/README.md
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# @svgr/babel-plugin-svg-dynamic-title
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install --save-dev @svgr/babel-plugin-svg-dynamic-title
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@svgr/babel-plugin-svg-dynamic-title"]
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
85
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/lib/index.js
generated
vendored
Normal file
85
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
const elements = ['svg', 'Svg'];
|
||||
|
||||
const plugin = ({
|
||||
types: t
|
||||
}) => ({
|
||||
visitor: {
|
||||
JSXElement(path) {
|
||||
if (!elements.some(element => path.get('openingElement.name').isJSXIdentifier({
|
||||
name: element
|
||||
}))) {
|
||||
return;
|
||||
}
|
||||
|
||||
function createTitle(children = [], attributes = []) {
|
||||
return t.jsxElement(t.jsxOpeningElement(t.jsxIdentifier('title'), attributes), t.jsxClosingElement(t.jsxIdentifier('title')), children);
|
||||
}
|
||||
|
||||
function createTitleIdAttribute() {
|
||||
return t.jsxAttribute(t.jsxIdentifier('id'), t.jsxExpressionContainer(t.identifier('titleId')));
|
||||
}
|
||||
|
||||
function enhanceAttributes(attributes) {
|
||||
const existingId = attributes.find(attribute => attribute.name.name === 'id');
|
||||
|
||||
if (!existingId) {
|
||||
return [...attributes, createTitleIdAttribute()];
|
||||
}
|
||||
|
||||
existingId.value = t.jsxExpressionContainer(t.logicalExpression('||', t.identifier('titleId'), existingId.value));
|
||||
return attributes;
|
||||
}
|
||||
|
||||
function getTitleElement(existingTitle) {
|
||||
const titleExpression = t.identifier('title');
|
||||
|
||||
if (existingTitle) {
|
||||
existingTitle.openingElement.attributes = enhanceAttributes(existingTitle.openingElement.attributes);
|
||||
}
|
||||
|
||||
let titleElement = t.conditionalExpression(titleExpression, createTitle([t.jsxExpressionContainer(titleExpression)], existingTitle ? existingTitle.openingElement.attributes : [t.jsxAttribute(t.jsxIdentifier('id'), t.jsxExpressionContainer(t.identifier('titleId')))]), t.nullLiteral());
|
||||
|
||||
if (existingTitle && existingTitle.children && existingTitle.children.length) {
|
||||
// if title already exists
|
||||
// render as follows
|
||||
const fallbackTitleElement = existingTitle; // {title === undefined ? fallbackTitleElement : titleElement}
|
||||
|
||||
const conditionalExpressionForTitle = t.conditionalExpression(t.binaryExpression('===', titleExpression, t.identifier('undefined')), fallbackTitleElement, titleElement);
|
||||
titleElement = t.jsxExpressionContainer(conditionalExpressionForTitle);
|
||||
} else {
|
||||
titleElement = t.jsxExpressionContainer(titleElement);
|
||||
}
|
||||
|
||||
return titleElement;
|
||||
} // store the title element
|
||||
|
||||
|
||||
let titleElement;
|
||||
const hasTitle = path.get('children').some(childPath => {
|
||||
if (!childPath.isJSXElement()) return false;
|
||||
if (childPath.node === titleElement) return false;
|
||||
if (childPath.node.openingElement.name.name !== 'title') return false;
|
||||
titleElement = getTitleElement(childPath.node);
|
||||
childPath.replaceWith(titleElement);
|
||||
return true;
|
||||
}); // create a title element if not already create
|
||||
|
||||
titleElement = titleElement || getTitleElement();
|
||||
|
||||
if (!hasTitle) {
|
||||
// path.unshiftContainer is not working well :(
|
||||
// path.unshiftContainer('children', titleElement)
|
||||
path.node.children.unshift(titleElement);
|
||||
path.replaceWith(path.node);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var _default = plugin;
|
||||
exports.default = _default;
|
29
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/package.json
generated
vendored
Normal file
29
web/node_modules/@svgr/babel-plugin-svg-dynamic-title/package.json
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "@svgr/babel-plugin-svg-dynamic-title",
|
||||
"description": "Transform SVG by adding a dynamic title element",
|
||||
"version": "5.4.0",
|
||||
"main": "lib/index.js",
|
||||
"repository": "https://github.com/gregberge/svgr/tree/master/packages/babel-plugin-svg-dynamic-title",
|
||||
"author": "Greg Bergé <berge.greg@gmail.com>",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"homepage": "https://react-svgr.com",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/gregberge"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf lib/",
|
||||
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
|
||||
"prepublishOnly": "yarn run build"
|
||||
},
|
||||
"gitHead": "e9c9d2fbfbce7a6879c90cd8522101caf2406d42"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue