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>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

View File

@@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = parseNestedPropRoot;
/**
* Attempts to parse a selector as if it"s a root for a group of nested props
* E.g.: `margin: {`, `font: 10px/1.1 Arial {` ("{" excluded)
*/
function parseNestedPropRoot(propString) {
var modesEntered = [{
mode: "normal",
character: null,
isCalculationEnabled: true
}];
var result = {};
var lastModeIndex = 0;
var propName = "";
for (var i = 0; i < propString.length; i++) {
var character = propString[i];
var prevCharacter = propString[i - 1];
// If entering/exiting a string
if (character === '"' || character === "'") {
if (modesEntered[lastModeIndex].isCalculationEnabled === true) {
modesEntered.push({
mode: "string",
isCalculationEnabled: false,
character: character
});
lastModeIndex++;
} else if (modesEntered[lastModeIndex].mode === "string" && modesEntered[lastModeIndex].character === character && prevCharacter !== "\\") {
modesEntered.pop();
lastModeIndex--;
}
}
// If entering/exiting interpolation
if (character === "{") {
modesEntered.push({
mode: "interpolation",
isCalculationEnabled: true
});
lastModeIndex++;
} else if (character === "}") {
modesEntered.pop();
lastModeIndex--;
}
// Check for : outside fn call, string or interpolation. It must be at the
// end of a string or have a whitespace between it and following value
if (modesEntered[lastModeIndex].mode === "normal" && character === ":" && prevCharacter !== "\\") {
var propValueStr = propString.substring(i + 1);
if (propValueStr.length) {
var propValue = {
before: /^(\s*)/.exec(propValueStr)[1],
value: propValueStr.trim()
};
// It's a declaration if 1) there is a whitespace after :, or
// 2) the value is a number with/without a unit (starts with a number
// or a dot), or
// 3) the value is a variable (starts with $), or
// 4) the value a string, surprisingly
if (propValue.before === "" && !/^[\d.$'"]/.test(propValue.value)) {
return null;
}
// +1 for the colon
propValue.sourceIndex = propValue.before.length + i + 1;
result.propValue = propValue;
}
result.propName = {
after: /(\s*)$/.exec(propName)[1],
value: propName.trim()
};
return result;
}
propName += character;
}
return null;
}