Files
formipay/node_modules/stylelint-scss/dist/rules/map-keys-quotes/index.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

85 lines
2.5 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = rule;
exports.ruleName = exports.meta = exports.messages = void 0;
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
var _stylelint = require("stylelint");
var _utils = require("../../utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var ruleName = (0, _utils.namespace)("map-keys-quotes");
exports.ruleName = ruleName;
var messages = _stylelint.utils.ruleMessages(ruleName, {
expected: "Expected keys in map to be quoted."
});
exports.messages = messages;
var meta = {
url: (0, _utils.ruleUrl)(ruleName)
};
exports.meta = meta;
var mathOperators = ["+", "/", "-", "*", "%"];
function rule(primary) {
return function (root, result) {
var validOptions = _stylelint.utils.validateOptions(result, ruleName, {
actual: primary,
possible: ["always"]
});
if (!validOptions) {
return;
}
root.walkDecls(function (decl) {
if (decl.prop[0] !== "$") {
return;
}
(0, _postcssValueParser["default"])(decl.value).walk(function (node) {
if (node.type === "function" && node.value === "" && isMap(node.nodes)) {
// Identify all of the map-keys and see if they're strings (not words).
var mapKeys = returnMapKeys(node.nodes);
mapKeys.forEach(function (map_key) {
if (mathOperators.includes(map_key.value)) {
return;
}
if (map_key.type === "word" && isNaN(map_key.value)) {
_stylelint.utils.report({
message: messages.expected,
node: decl,
result: result,
ruleName: ruleName
});
}
});
}
});
});
};
}
rule.ruleName = ruleName;
rule.messages = messages;
rule.meta = meta;
// Takes in a list of map nodes and identifies if they are a map.
// A map is identified by the pattern: [string/word colon(div) anything comma(div) ...]
function isMap(nodes) {
if (nodes.length < 4) {
return false;
}
if (nodes[0].type !== "word" && nodes[0].type !== "string") {
return false;
}
if (nodes[1].value !== ":") {
return false;
}
if (nodes[3].value !== ",") {
return false;
}
return true;
}
function returnMapKeys(array) {
var new_array = [];
for (var i = 0; i < array.length; i += 4) {
new_array.push(array[i]);
}
return new_array;
}