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,33 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = FocusableIframe;
var _react = require("react");
var _compose = require("@wordpress/compose");
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
/**
* WordPress dependencies
*/
function FocusableIframe({
iframeRef,
...props
}) {
const ref = (0, _compose.useMergeRefs)([iframeRef, (0, _compose.useFocusableIframe)()]);
(0, _deprecated.default)('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 (0, _react.createElement)("iframe", {
ref: ref,
...props
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_compose","require","_deprecated","_interopRequireDefault","FocusableIframe","iframeRef","props","ref","useMergeRefs","useFocusableIframe","deprecated","since","alternative","_react","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":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAQe,SAASG,eAAeA,CAAE;EACxCC,SAAS;EACT,GAAGC;AACkB,CAAC,EAAG;EACzB,MAAMC,GAAG,GAAG,IAAAC,qBAAY,EAAE,CAAEH,SAAS,EAAE,IAAAI,2BAAkB,EAAC,CAAC,CAAG,CAAC;EAC/D,IAAAC,mBAAU,EAAE,+BAA+B,EAAE;IAC5CC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH;EACA;EACA;EACA;EACA,OAAO,IAAAC,MAAA,CAAAC,aAAA;IAAQP,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AAC3C"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# 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":""}