Add yet-another-react-lightbox package and update .gitignore to exclude node_modules
This commit is contained in:
23
frontend/node_modules/@svgr/babel-preset/dist/index.d.ts
generated
vendored
23
frontend/node_modules/@svgr/babel-preset/dist/index.d.ts
generated
vendored
@@ -1,23 +0,0 @@
|
||||
import { ConfigAPI } from '@babel/core';
|
||||
import { Options as Options$1 } from '@svgr/babel-plugin-transform-svg-component';
|
||||
|
||||
interface Options extends Options$1 {
|
||||
ref?: boolean;
|
||||
titleProp?: boolean;
|
||||
descProp?: boolean;
|
||||
expandProps?: boolean | 'start' | 'end';
|
||||
dimensions?: boolean;
|
||||
icon?: boolean | string | number;
|
||||
native?: boolean;
|
||||
svgProps?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
replaceAttrValues?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
declare const plugin: (_: ConfigAPI, opts: Options) => {
|
||||
plugins: any[];
|
||||
};
|
||||
|
||||
export { Options, plugin as default };
|
||||
114
frontend/node_modules/@svgr/babel-preset/dist/index.js
generated
vendored
114
frontend/node_modules/@svgr/babel-preset/dist/index.js
generated
vendored
@@ -1,114 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var addJSXAttribute = require('@svgr/babel-plugin-add-jsx-attribute');
|
||||
var removeJSXAttribute = require('@svgr/babel-plugin-remove-jsx-attribute');
|
||||
var removeJSXEmptyExpression = require('@svgr/babel-plugin-remove-jsx-empty-expression');
|
||||
var replaceJSXAttributeValue = require('@svgr/babel-plugin-replace-jsx-attribute-value');
|
||||
var svgDynamicTitle = require('@svgr/babel-plugin-svg-dynamic-title');
|
||||
var svgEmDimensions = require('@svgr/babel-plugin-svg-em-dimensions');
|
||||
var transformReactNativeSVG = require('@svgr/babel-plugin-transform-react-native-svg');
|
||||
var transformSvgComponent = require('@svgr/babel-plugin-transform-svg-component');
|
||||
|
||||
const getAttributeValue = (value) => {
|
||||
const literal = typeof value === "string" && value.startsWith("{") && value.endsWith("}");
|
||||
return { value: literal ? value.slice(1, -1) : value, literal };
|
||||
};
|
||||
const propsToAttributes = (props) => {
|
||||
return Object.keys(props).map((name) => {
|
||||
const { literal, value } = getAttributeValue(props[name]);
|
||||
return { name, literal, value };
|
||||
});
|
||||
};
|
||||
function replaceMapToValues(replaceMap) {
|
||||
return Object.keys(replaceMap).map((value) => {
|
||||
const { literal, value: newValue } = getAttributeValue(replaceMap[value]);
|
||||
return { value, newValue, literal };
|
||||
});
|
||||
}
|
||||
const plugin = (_, opts) => {
|
||||
let toRemoveAttributes = ["version"];
|
||||
let toAddAttributes = [];
|
||||
if (opts.svgProps) {
|
||||
toAddAttributes = [...toAddAttributes, ...propsToAttributes(opts.svgProps)];
|
||||
}
|
||||
if (opts.ref) {
|
||||
toAddAttributes = [
|
||||
...toAddAttributes,
|
||||
{
|
||||
name: "ref",
|
||||
value: "ref",
|
||||
literal: true
|
||||
}
|
||||
];
|
||||
}
|
||||
if (opts.titleProp) {
|
||||
toAddAttributes = [
|
||||
...toAddAttributes,
|
||||
{
|
||||
name: "aria-labelledby",
|
||||
value: "titleId",
|
||||
literal: true
|
||||
}
|
||||
];
|
||||
}
|
||||
if (opts.descProp) {
|
||||
toAddAttributes = [
|
||||
...toAddAttributes,
|
||||
{
|
||||
name: "aria-describedby",
|
||||
value: "descId",
|
||||
literal: true
|
||||
}
|
||||
];
|
||||
}
|
||||
if (opts.expandProps) {
|
||||
toAddAttributes = [
|
||||
...toAddAttributes,
|
||||
{
|
||||
name: "props",
|
||||
spread: true,
|
||||
position: opts.expandProps === "start" || opts.expandProps === "end" ? opts.expandProps : void 0
|
||||
}
|
||||
];
|
||||
}
|
||||
if (!opts.dimensions) {
|
||||
toRemoveAttributes = [...toRemoveAttributes, "width", "height"];
|
||||
}
|
||||
const plugins = [
|
||||
[transformSvgComponent, opts],
|
||||
...opts.icon !== false && opts.dimensions ? [
|
||||
[
|
||||
svgEmDimensions,
|
||||
opts.icon !== true ? { width: opts.icon, height: opts.icon } : opts.native ? { width: 24, height: 24 } : {}
|
||||
]
|
||||
] : [],
|
||||
[
|
||||
removeJSXAttribute,
|
||||
{ elements: ["svg", "Svg"], attributes: toRemoveAttributes }
|
||||
],
|
||||
[
|
||||
addJSXAttribute,
|
||||
{ elements: ["svg", "Svg"], attributes: toAddAttributes }
|
||||
],
|
||||
removeJSXEmptyExpression
|
||||
];
|
||||
if (opts.replaceAttrValues) {
|
||||
plugins.push([
|
||||
replaceJSXAttributeValue,
|
||||
{ values: replaceMapToValues(opts.replaceAttrValues) }
|
||||
]);
|
||||
}
|
||||
if (opts.titleProp) {
|
||||
plugins.push(svgDynamicTitle);
|
||||
}
|
||||
if (opts.descProp) {
|
||||
plugins.push([svgDynamicTitle, { tag: "desc" }, "desc"]);
|
||||
}
|
||||
if (opts.native) {
|
||||
plugins.push(transformReactNativeSVG);
|
||||
}
|
||||
return { plugins };
|
||||
};
|
||||
|
||||
module.exports = plugin;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/node_modules/@svgr/babel-preset/dist/index.js.map
generated
vendored
1
frontend/node_modules/@svgr/babel-preset/dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user