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>
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import { createElement } from "react";
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
import { contextConnect } from '../context';
|
|
import { View } from '../view';
|
|
import useTruncate from './hook';
|
|
function UnconnectedTruncate(props, forwardedRef) {
|
|
const truncateProps = useTruncate(props);
|
|
return createElement(View, {
|
|
as: "span",
|
|
...truncateProps,
|
|
ref: forwardedRef
|
|
});
|
|
}
|
|
|
|
/**
|
|
* `Truncate` is a typography primitive that trims text content.
|
|
* For almost all cases, it is recommended that `Text`, `Heading`, or
|
|
* `Subheading` is used to render text content. However,`Truncate` is
|
|
* available for custom implementations.
|
|
*
|
|
* ```jsx
|
|
* import { __experimentalTruncate as Truncate } from `@wordpress/components`;
|
|
*
|
|
* function Example() {
|
|
* return (
|
|
* <Truncate>
|
|
* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex
|
|
* neque, vulputate a diam et, luctus convallis lacus. Vestibulum ac
|
|
* mollis mi. Morbi id elementum massa.
|
|
* </Truncate>
|
|
* );
|
|
* }
|
|
* ```
|
|
*/
|
|
export const Truncate = contextConnect(UnconnectedTruncate, 'Truncate');
|
|
export default Truncate;
|
|
//# sourceMappingURL=component.js.map
|