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

56
node_modules/@wordpress/warning/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = warning;
var _utils = require("./utils");
/**
* Internal dependencies
*/
function isDev() {
return typeof SCRIPT_DEBUG !== 'undefined' && SCRIPT_DEBUG === true;
}
/**
* Shows a warning with `message` if environment is not `production`.
*
* @param {string} message Message to show in the warning.
*
* @example
* ```js
* import warning from '@wordpress/warning';
*
* function MyComponent( props ) {
* if ( ! props.title ) {
* warning( '`props.title` was not passed' );
* }
* ...
* }
* ```
*/
function warning(message) {
if (!isDev()) {
return;
}
// Skip if already logged.
if (_utils.logged.has(message)) {
return;
}
// eslint-disable-next-line no-console
console.warn(message);
// Throwing an error and catching it immediately to improve debugging
// A consumer can use 'pause on caught exceptions'
// https://github.com/facebook/react/issues/4216
try {
throw Error(message);
} catch (x) {
// Do nothing.
}
_utils.logged.add(message);
}
//# sourceMappingURL=index.js.map

1
node_modules/@wordpress/warning/build/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["_utils","require","isDev","SCRIPT_DEBUG","warning","message","logged","has","console","warn","Error","x","add"],"sources":["@wordpress/warning/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { logged } from './utils';\n\nfunction isDev() {\n\treturn typeof SCRIPT_DEBUG !== 'undefined' && SCRIPT_DEBUG === true;\n}\n\n/**\n * Shows a warning with `message` if environment is not `production`.\n *\n * @param {string} message Message to show in the warning.\n *\n * @example\n * ```js\n * import warning from '@wordpress/warning';\n *\n * function MyComponent( props ) {\n * if ( ! props.title ) {\n * warning( '`props.title` was not passed' );\n * }\n * ...\n * }\n * ```\n */\nexport default function warning( message ) {\n\tif ( ! isDev() ) {\n\t\treturn;\n\t}\n\n\t// Skip if already logged.\n\tif ( logged.has( message ) ) {\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\t// Throwing an error and catching it immediately to improve debugging\n\t// A consumer can use 'pause on caught exceptions'\n\t// https://github.com/facebook/react/issues/4216\n\ttry {\n\t\tthrow Error( message );\n\t} catch ( x ) {\n\t\t// Do nothing.\n\t}\n\n\tlogged.add( message );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,KAAKA,CAAA,EAAG;EAChB,OAAO,OAAOC,YAAY,KAAK,WAAW,IAAIA,YAAY,KAAK,IAAI;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,OAAOA,CAAEC,OAAO,EAAG;EAC1C,IAAK,CAAEH,KAAK,CAAC,CAAC,EAAG;IAChB;EACD;;EAEA;EACA,IAAKI,aAAM,CAACC,GAAG,CAAEF,OAAQ,CAAC,EAAG;IAC5B;EACD;;EAEA;EACAG,OAAO,CAACC,IAAI,CAAEJ,OAAQ,CAAC;;EAEvB;EACA;EACA;EACA,IAAI;IACH,MAAMK,KAAK,CAAEL,OAAQ,CAAC;EACvB,CAAC,CAAC,OAAQM,CAAC,EAAG;IACb;EAAA;EAGDL,aAAM,CAACM,GAAG,CAAEP,OAAQ,CAAC;AACtB","ignoreList":[]}

14
node_modules/@wordpress/warning/build/utils.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.logged = void 0;
/**
* Object map tracking messages which have been logged, for use in ensuring a
* message is only logged once.
*
* @type {Set<string>}
*/
const logged = exports.logged = new Set();
//# sourceMappingURL=utils.js.map

1
node_modules/@wordpress/warning/build/utils.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["logged","exports","Set"],"sources":["@wordpress/warning/src/utils.js"],"sourcesContent":["/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n *\n * @type {Set<string>}\n */\nexport const logged = new Set();\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,IAAIE,GAAG,CAAC,CAAC","ignoreList":[]}