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

49
node_modules/@wordpress/warning/build-module/index.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
/**
* Internal dependencies
*/
import { logged } from './utils';
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' );
* }
* ...
* }
* ```
*/
export default function warning(message) {
if (!isDev()) {
return;
}
// Skip if already logged.
if (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.
}
logged.add(message);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["logged","isDev","SCRIPT_DEBUG","warning","message","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":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,SAAS;AAEhC,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;AACA,eAAe,SAASC,OAAOA,CAAEC,OAAO,EAAG;EAC1C,IAAK,CAAEH,KAAK,CAAC,CAAC,EAAG;IAChB;EACD;;EAEA;EACA,IAAKD,MAAM,CAACK,GAAG,CAAED,OAAQ,CAAC,EAAG;IAC5B;EACD;;EAEA;EACAE,OAAO,CAACC,IAAI,CAAEH,OAAQ,CAAC;;EAEvB;EACA;EACA;EACA,IAAI;IACH,MAAMI,KAAK,CAAEJ,OAAQ,CAAC;EACvB,CAAC,CAAC,OAAQK,CAAC,EAAG;IACb;EAAA;EAGDT,MAAM,CAACU,GAAG,CAAEN,OAAQ,CAAC;AACtB","ignoreList":[]}

View File

@@ -0,0 +1,8 @@
/**
* Object map tracking messages which have been logged, for use in ensuring a
* message is only logged once.
*
* @type {Set<string>}
*/
export const logged = new Set();
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["logged","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;AACA,OAAO,MAAMA,MAAM,GAAG,IAAIC,GAAG,CAAC,CAAC","ignoreList":[]}