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>
74 lines
1.9 KiB
JavaScript
74 lines
1.9 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = rule;
|
|
exports.ruleName = exports.meta = exports.messages = void 0;
|
|
var _stylelint = require("stylelint");
|
|
var _utils = require("../../utils");
|
|
var _operatorNoUnspaced = require("../operator-no-unspaced");
|
|
var ruleName = (0, _utils.namespace)("operator-no-newline-after");
|
|
exports.ruleName = ruleName;
|
|
var messages = _stylelint.utils.ruleMessages(ruleName, {
|
|
rejected: function rejected(operator) {
|
|
return "Unexpected newline after \"".concat(operator, "\"");
|
|
}
|
|
});
|
|
exports.messages = messages;
|
|
var meta = {
|
|
url: (0, _utils.ruleUrl)(ruleName)
|
|
};
|
|
|
|
/**
|
|
* The checker function: whether there is a newline before THAT operator.
|
|
*/
|
|
exports.meta = meta;
|
|
function checkNewlineBefore(_ref) {
|
|
var string = _ref.string,
|
|
globalIndex = _ref.globalIndex,
|
|
startIndex = _ref.startIndex,
|
|
endIndex = _ref.endIndex,
|
|
node = _ref.node,
|
|
result = _ref.result;
|
|
var symbol = string.substring(startIndex, endIndex + 1);
|
|
var newLineBefore = false;
|
|
var index = endIndex + 1;
|
|
while (index && (0, _utils.isWhitespace)(string[index])) {
|
|
if (string[index] === "\n") {
|
|
newLineBefore = true;
|
|
break;
|
|
}
|
|
index++;
|
|
}
|
|
if (newLineBefore) {
|
|
_stylelint.utils.report({
|
|
ruleName: ruleName,
|
|
result: result,
|
|
node: node,
|
|
message: messages.rejected(symbol),
|
|
index: endIndex + globalIndex
|
|
});
|
|
}
|
|
}
|
|
function rule(expectation) {
|
|
return function (root, result) {
|
|
var validOptions = _stylelint.utils.validateOptions(result, ruleName, {
|
|
actual: expectation
|
|
});
|
|
if (!validOptions) {
|
|
return;
|
|
}
|
|
(0, _utils.eachRoot)(root, checkRoot);
|
|
function checkRoot(root) {
|
|
(0, _operatorNoUnspaced.calculationOperatorSpaceChecker)({
|
|
root: root,
|
|
result: result,
|
|
checker: checkNewlineBefore
|
|
});
|
|
}
|
|
};
|
|
}
|
|
rule.ruleName = ruleName;
|
|
rule.messages = messages;
|
|
rule.meta = meta; |