Revert "Add yet-another-react-lightbox package and update .gitignore to exclude node_modules"

This reverts commit c92f4a5edd.
This commit is contained in:
Desktop
2025-11-13 00:36:40 +05:00
parent 77ec8af4d1
commit 84e12b5146
9304 changed files with 2008667 additions and 29 deletions

View File

@@ -0,0 +1,43 @@
'use strict';
var core = require('@babel/core');
const addJSXAttribute = (api, opts) => {
const getAttributeValue = (value, literal) => {
if (typeof value === "string" && literal) {
return core.types.jsxExpressionContainer(
core.template.ast(value).expression
);
}
if (typeof value === "string") {
return core.types.stringLiteral(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));
}
return null;
};
return {
visitor: {
JSXAttribute(path) {
const valuePath = path.get("value");
if (!valuePath.isStringLiteral())
return;
opts.values.forEach(({ value, newValue, literal }) => {
if (!valuePath.isStringLiteral({ value }))
return;
const attributeValue = getAttributeValue(newValue, literal);
if (attributeValue) {
valuePath.replaceWith(attributeValue);
}
});
}
}
};
};
module.exports = addJSXAttribute;
//# sourceMappingURL=index.js.map