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>
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
/**
|
|
* WordPress dependencies
|
|
*/
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
/**
|
|
* Build the explanatory text to be placed before the aria live regions.
|
|
*
|
|
* This text is initially hidden from assistive technologies by using a `hidden`
|
|
* HTML attribute which is then removed once a message fills the aria-live regions.
|
|
*
|
|
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
|
*/
|
|
export default function addIntroText() {
|
|
const introText = document.createElement('p');
|
|
introText.id = 'a11y-speak-intro-text';
|
|
introText.className = 'a11y-speak-intro-text';
|
|
introText.textContent = __('Notifications');
|
|
introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
|
introText.setAttribute('hidden', 'hidden');
|
|
const {
|
|
body
|
|
} = document;
|
|
if (body) {
|
|
body.appendChild(introText);
|
|
}
|
|
return introText;
|
|
}
|
|
//# sourceMappingURL=add-intro-text.js.map
|