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,29 @@
import { createElement } from "react";
/**
* WordPress dependencies
*/
import { useMergeRefs, useFocusableIframe } from '@wordpress/compose';
import deprecated from '@wordpress/deprecated';
/**
* Internal dependencies
*/
export default function FocusableIframe({
iframeRef,
...props
}) {
const ref = useMergeRefs([iframeRef, useFocusableIframe()]);
deprecated('wp.components.FocusableIframe', {
since: '5.9',
alternative: 'wp.compose.useFocusableIframe'
});
// Disable reason: The rendered iframe is a pass-through component,
// assigning props inherited from the rendering parent. It's the
// responsibility of the parent to assign a title.
// eslint-disable-next-line jsx-a11y/iframe-has-title
return createElement("iframe", {
ref: ref,
...props
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useMergeRefs","useFocusableIframe","deprecated","FocusableIframe","iframeRef","props","ref","since","alternative","createElement"],"sources":["@wordpress/components/src/focusable-iframe/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs, useFocusableIframe } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { FocusableIframeProps } from './types';\n\nexport default function FocusableIframe( {\n\tiframeRef,\n\t...props\n}: FocusableIframeProps ) {\n\tconst ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );\n\tdeprecated( 'wp.components.FocusableIframe', {\n\t\tsince: '5.9',\n\t\talternative: 'wp.compose.useFocusableIframe',\n\t} );\n\t// Disable reason: The rendered iframe is a pass-through component,\n\t// assigning props inherited from the rendering parent. It's the\n\t// responsibility of the parent to assign a title.\n\t// eslint-disable-next-line jsx-a11y/iframe-has-title\n\treturn <iframe ref={ ref } { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,kBAAkB,QAAQ,oBAAoB;AACrE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C;AACA;AACA;;AAGA,eAAe,SAASC,eAAeA,CAAE;EACxCC,SAAS;EACT,GAAGC;AACkB,CAAC,EAAG;EACzB,MAAMC,GAAG,GAAGN,YAAY,CAAE,CAAEI,SAAS,EAAEH,kBAAkB,CAAC,CAAC,CAAG,CAAC;EAC/DC,UAAU,CAAE,+BAA+B,EAAE;IAC5CK,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH;EACA;EACA;EACA;EACA,OAAOC,aAAA;IAAQH,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AAC3C"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/focusable-iframe/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ComponentPropsWithoutRef } from 'react';\n\nexport interface FocusableIframeProps\n\textends ComponentPropsWithoutRef< 'iframe' > {\n\tiframeRef: React.Ref< HTMLIFrameElement >;\n}\n"],"mappings":""}