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,13 @@
# Block Quotation
A drop-in replacement for the HTML [blockquote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote) element that works both on the web and in the mobile apps. It indicates that the enclosed text is an extended quotation.
## Usage
```jsx
import { BlockQuotation } from '@wordpress/components';
const MyBlockQuotation = () => (
<BlockQuotation>...Quote content</BlockQuotation>
);
```

View File

@@ -0,0 +1 @@
export const BlockQuotation = 'blockquote';

View File

@@ -0,0 +1,59 @@
/**
* 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 ?? 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 (
<View ref={ ref } style={ blockQuoteStyle }>
{ newChildren }
</View>
);
} );

View File

@@ -0,0 +1,25 @@
%wpBlockQuote-shared {
border-left-width: 4px;
border-left-style: solid;
padding-left: $block-edge-to-content;
margin-left: 0;
}
.wpBlockQuoteLight {
@extend %wpBlockQuote-shared;
border-left-color: $black;
}
.wpBlockQuoteDark {
@extend %wpBlockQuote-shared;
border-left-color: $white;
}
.wpBlockQuoteCitation {
margin-top: 16px;
font-size: 14px;
}
.paddingWithBackground {
padding-top: $block-edge-to-content - $block-selected-margin;
}