Files
formipay/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

31 lines
1.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getImplicitRoleForImg;
var _jsxAstUtils = require("jsx-ast-utils");
/**
* Returns the implicit role for an img tag.
*/
function getImplicitRoleForImg(attributes) {
var _getLiteralPropValue;
var alt = (0, _jsxAstUtils.getProp)(attributes, 'alt');
if (alt && (0, _jsxAstUtils.getLiteralPropValue)(alt) === '') {
return '';
}
/**
* If the src attribute can be determined to be an svg, allow the role to be set to 'img'
* so that VoiceOver on Safari can be better supported.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#identifying_svg_as_an_image
* @see https://bugs.webkit.org/show_bug.cgi?id=216364
*/
var src = (0, _jsxAstUtils.getProp)(attributes, 'src');
if (src && (_getLiteralPropValue = (0, _jsxAstUtils.getLiteralPropValue)(src)) !== null && _getLiteralPropValue !== void 0 && _getLiteralPropValue.includes('.svg')) {
return '';
}
return 'img';
}
module.exports = exports.default;