Files
formipay/node_modules/stylelint-scss/dist/utils/isStandardRule.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

68 lines
2.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = _default;
var _isCustomPropertySet = _interopRequireDefault(require("./isCustomPropertySet"));
var _isStandardSelector = _interopRequireDefault(require("./isStandardSelector"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* Check whether a Node is a standard rule
*
* @param {import('postcss').Rule} rule
* @returns {boolean}
*/
function _default(rule) {
var _rule$raws, _rule$raws$selector;
// Get full selector
var selector = (rule === null || rule === void 0 ? void 0 : (_rule$raws = rule.raws) === null || _rule$raws === void 0 ? void 0 : (_rule$raws$selector = _rule$raws.selector) === null || _rule$raws$selector === void 0 ? void 0 : _rule$raws$selector.raw) || rule.selector;
if (!(0, _isStandardSelector["default"])(rule.selector)) {
return false;
}
// Custom property set (e.g. --custom-property-set: {})
if ((0, _isCustomPropertySet["default"])(rule)) {
return false;
}
// Called Less mixin (e.g. a { .mixin() })
// @ts-ignore TODO TYPES support LESS and SASS types somehow
if (rule.mixin) {
return false;
}
// Less detached rulesets
if (selector.startsWith("@") && selector.endsWith(":")) {
return false;
}
// Ignore Less &:extend rule
// @ts-ignore TODO TYPES support LESS and SASS types somehow
if (rule.extend) {
return false;
}
// Ignore mixin or &:extend rule
// https://github.com/shellscape/postcss-less/blob/master/lib/less-parser.js#L52
// @ts-ignore TODO TYPES support LESS and SASS types somehow
if (rule.params && rule.params[0]) {
return false;
}
// Non-outputting Less mixin definition (e.g. .mixin() {})
if (selector.endsWith(")") && !selector.includes(":")) {
return false;
}
// Less guards
if (/when\s+(not\s+)*\(/.test(selector)) {
return false;
}
// Ignore Scss nested properties
if (selector.endsWith(":")) {
return false;
}
return true;
}