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>
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import { createElement } from "react";
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
import { contextConnect, useContextSystem } from '../context';
|
|
import { DropdownContentWrapperDiv } from './styles';
|
|
function UnconnectedDropdownContentWrapper(props, forwardedRef) {
|
|
const {
|
|
paddingSize = 'small',
|
|
...derivedProps
|
|
} = useContextSystem(props, 'DropdownContentWrapper');
|
|
return createElement(DropdownContentWrapperDiv, {
|
|
...derivedProps,
|
|
paddingSize: paddingSize,
|
|
ref: forwardedRef
|
|
});
|
|
}
|
|
|
|
/**
|
|
* A convenience wrapper for the `renderContent` when you want to apply
|
|
* different padding. (Default is `paddingSize="small"`).
|
|
*
|
|
* ```jsx
|
|
* import {
|
|
* Dropdown,
|
|
* __experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
* } from '@wordpress/components';
|
|
*
|
|
* <Dropdown
|
|
* renderContent={ () => (
|
|
* <DropdownContentWrapper paddingSize="medium">
|
|
* My dropdown content
|
|
* </DropdownContentWrapper>
|
|
* ) }
|
|
* />
|
|
* ```
|
|
*/
|
|
export const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, 'DropdownContentWrapper');
|
|
export default DropdownContentWrapper;
|
|
//# sourceMappingURL=dropdown-content-wrapper.js.map
|