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>
43 lines
1.6 KiB
JavaScript
43 lines
1.6 KiB
JavaScript
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = hiddenCaretRangeFromPoint;
|
|
var _caretRangeFromPoint = _interopRequireDefault(require("./caret-range-from-point"));
|
|
var _getComputedStyle = _interopRequireDefault(require("./get-computed-style"));
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
/**
|
|
* Get a collapsed range for a given point.
|
|
* Gives the container a temporary high z-index (above any UI).
|
|
* This is preferred over getting the UI nodes and set styles there.
|
|
*
|
|
* @param {Document} doc The document of the range.
|
|
* @param {number} x Horizontal position within the current viewport.
|
|
* @param {number} y Vertical position within the current viewport.
|
|
* @param {HTMLElement} container Container in which the range is expected to be found.
|
|
*
|
|
* @return {?Range} The best range for the given point.
|
|
*/
|
|
function hiddenCaretRangeFromPoint(doc, x, y, container) {
|
|
const originalZIndex = container.style.zIndex;
|
|
const originalPosition = container.style.position;
|
|
const {
|
|
position = 'static'
|
|
} = (0, _getComputedStyle.default)(container);
|
|
|
|
// A z-index only works if the element position is not static.
|
|
if (position === 'static') {
|
|
container.style.position = 'relative';
|
|
}
|
|
container.style.zIndex = '10000';
|
|
const range = (0, _caretRangeFromPoint.default)(doc, x, y);
|
|
container.style.zIndex = originalZIndex;
|
|
container.style.position = originalPosition;
|
|
return range;
|
|
}
|
|
//# sourceMappingURL=hidden-caret-range-from-point.js.map
|