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>
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = documentHasUncollapsedSelection;
|
|
var _documentHasTextSelection = _interopRequireDefault(require("./document-has-text-selection"));
|
|
var _inputFieldHasUncollapsedSelection = _interopRequireDefault(require("./input-field-has-uncollapsed-selection"));
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
/**
|
|
* Check whether the current document has any sort of (uncollapsed) selection.
|
|
* This includes ranges of text across elements and any selection inside
|
|
* textual `<input>` and `<textarea>` elements.
|
|
*
|
|
* @param {Document} doc The document to check.
|
|
*
|
|
* @return {boolean} Whether there is any recognizable text selection in the document.
|
|
*/
|
|
function documentHasUncollapsedSelection(doc) {
|
|
return (0, _documentHasTextSelection.default)(doc) || !!doc.activeElement && (0, _inputFieldHasUncollapsedSelection.default)(doc.activeElement);
|
|
}
|
|
//# sourceMappingURL=document-has-uncollapsed-selection.js.map
|