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>
21 lines
929 B
JavaScript
21 lines
929 B
JavaScript
/**
|
|
* Internal dependencies
|
|
*/
|
|
import isHTMLInputElement from './is-html-input-element';
|
|
|
|
/* eslint-disable jsdoc/valid-types */
|
|
/**
|
|
* Check whether the given element is a text field, where text field is defined
|
|
* by the ability to select within the input, or that it is contenteditable.
|
|
*
|
|
* See: https://html.spec.whatwg.org/#textFieldSelection
|
|
*
|
|
* @param {Node} node The HTML element.
|
|
* @return {node is HTMLElement} True if the element is an text field, false if not.
|
|
*/
|
|
export default function isTextField(node) {
|
|
/* eslint-enable jsdoc/valid-types */
|
|
const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number', 'email', 'time'];
|
|
return isHTMLInputElement(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' || /** @type {HTMLElement} */node.contentEditable === 'true';
|
|
}
|
|
//# sourceMappingURL=is-text-field.js.map
|