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>
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
const { addErrorDetailIf, indentFor, listItemMarkerRe } =
|
|
require("../helpers");
|
|
const { flattenedLists } = require("./cache");
|
|
|
|
module.exports = {
|
|
"names": [ "MD007", "ul-indent" ],
|
|
"description": "Unordered list indentation",
|
|
"tags": [ "bullet", "ul", "indentation" ],
|
|
"function": function MD007(params, onError) {
|
|
const indent = Number(params.config.indent || 2);
|
|
const startIndented = !!params.config.start_indented;
|
|
const startIndent = Number(params.config.start_indent || indent);
|
|
flattenedLists().forEach((list) => {
|
|
if (list.unordered && list.parentsUnordered) {
|
|
list.items.forEach((item) => {
|
|
const { lineNumber, line } = item;
|
|
const expectedIndent =
|
|
(startIndented ? startIndent : 0) +
|
|
(list.nesting * indent);
|
|
const actualIndent = indentFor(item);
|
|
let range = null;
|
|
let editColumn = 1;
|
|
const match = line.match(listItemMarkerRe);
|
|
if (match) {
|
|
range = [ 1, match[0].length ];
|
|
editColumn += match[1].length - actualIndent;
|
|
}
|
|
addErrorDetailIf(
|
|
onError,
|
|
lineNumber,
|
|
expectedIndent,
|
|
actualIndent,
|
|
null,
|
|
null,
|
|
range,
|
|
{
|
|
editColumn,
|
|
"deleteCount": actualIndent,
|
|
"insertText": "".padEnd(expectedIndent)
|
|
});
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|