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,31 @@
/**
* WordPress dependencies
*/
import { cloneElement, forwardRef } from '@wordpress/element';
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
/**
* Return an SVG icon.
*
* @param {IconProps} props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
* @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element.
*
* @return {JSX.Element} Icon component
*/
function Icon({
icon,
size = 24,
...props
}, ref) {
return cloneElement(icon, {
width: size,
height: size,
...props,
ref
});
}
export default forwardRef(Icon);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["cloneElement","forwardRef","Icon","icon","size","props","ref","width","height"],"sources":["@wordpress/icons/src/icon/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element.\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props }, ref ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t\tref,\n\t} );\n}\n\nexport default forwardRef( Icon );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;;AAE7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAAE;EAAEC,IAAI;EAAEC,IAAI,GAAG,EAAE;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,EAAG;EACnD,OAAON,YAAY,CAAEG,IAAI,EAAE;IAC1BI,KAAK,EAAEH,IAAI;IACXI,MAAM,EAAEJ,IAAI;IACZ,GAAGC,KAAK;IACRC;EACD,CAAE,CAAC;AACJ;AAEA,eAAeL,UAAU,CAAEC,IAAK,CAAC","ignoreList":[]}