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>
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
import { createElement } from "react";
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
import { View } from 'react-native';
|
|
/**
|
|
* WordPress dependencies
|
|
*/
|
|
import { Children, cloneElement, forwardRef } from '@wordpress/element';
|
|
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
import styles from './style.scss';
|
|
export const BlockQuotation = forwardRef(({
|
|
...props
|
|
}, ref) => {
|
|
const {
|
|
style
|
|
} = props;
|
|
const blockQuoteStyle = [usePreferredColorSchemeStyle(styles.wpBlockQuoteLight, styles.wpBlockQuoteDark), style?.baseColors?.color?.text && {
|
|
borderLeftColor: style.baseColors.color.text
|
|
}, style?.color && {
|
|
borderLeftColor: style.color
|
|
}, style, style?.backgroundColor && styles.paddingWithBackground];
|
|
const colorStyle = style?.color ? {
|
|
color: style.color
|
|
} : {};
|
|
const newChildren = Children.map(props.children, child => {
|
|
const {
|
|
identifier,
|
|
attributeKey
|
|
} = child?.props || {};
|
|
const identifierKey = identifier !== null && identifier !== void 0 ? identifier : attributeKey;
|
|
if (identifierKey === 'citation') {
|
|
return cloneElement(child, {
|
|
style: {
|
|
...styles.wpBlockQuoteCitation,
|
|
...colorStyle
|
|
}
|
|
});
|
|
}
|
|
if (child && child.props.identifier === 'value') {
|
|
return cloneElement(child, {
|
|
tagsToEliminate: ['div'],
|
|
style: colorStyle
|
|
});
|
|
}
|
|
return child;
|
|
});
|
|
return createElement(View, {
|
|
ref: ref,
|
|
style: blockQuoteStyle
|
|
}, newChildren);
|
|
});
|
|
//# sourceMappingURL=index.native.js.map
|