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>
129 lines
3.7 KiB
JavaScript
129 lines
3.7 KiB
JavaScript
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Stop = exports.SVG = exports.Rect = exports.RadialGradient = exports.Polygon = exports.Path = exports.LinearGradient = exports.Line = exports.G = exports.Defs = exports.Circle = void 0;
|
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
var _element = require("@wordpress/element");
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
/**
|
|
* WordPress dependencies
|
|
*/
|
|
|
|
/** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'circle'>} props
|
|
*
|
|
* @return {JSX.Element} Circle component
|
|
*/
|
|
const Circle = props => (0, _element.createElement)('circle', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'g'>} props
|
|
*
|
|
* @return {JSX.Element} G component
|
|
*/
|
|
exports.Circle = Circle;
|
|
const G = props => (0, _element.createElement)('g', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'line'>} props
|
|
*
|
|
* @return {JSX.Element} Path component
|
|
*/
|
|
exports.G = G;
|
|
const Line = props => (0, _element.createElement)('line', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'path'>} props
|
|
*
|
|
* @return {JSX.Element} Path component
|
|
*/
|
|
exports.Line = Line;
|
|
const Path = props => (0, _element.createElement)('path', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'polygon'>} props
|
|
*
|
|
* @return {JSX.Element} Polygon component
|
|
*/
|
|
exports.Path = Path;
|
|
const Polygon = props => (0, _element.createElement)('polygon', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'rect'>} props
|
|
*
|
|
* @return {JSX.Element} Rect component
|
|
*/
|
|
exports.Polygon = Polygon;
|
|
const Rect = props => (0, _element.createElement)('rect', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'defs'>} props
|
|
*
|
|
* @return {JSX.Element} Defs component
|
|
*/
|
|
exports.Rect = Rect;
|
|
const Defs = props => (0, _element.createElement)('defs', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props
|
|
*
|
|
* @return {JSX.Element} RadialGradient component
|
|
*/
|
|
exports.Defs = Defs;
|
|
const RadialGradient = props => (0, _element.createElement)('radialGradient', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props
|
|
*
|
|
* @return {JSX.Element} LinearGradient component
|
|
*/
|
|
exports.RadialGradient = RadialGradient;
|
|
const LinearGradient = props => (0, _element.createElement)('linearGradient', props);
|
|
|
|
/**
|
|
* @param {import('react').ComponentPropsWithoutRef<'stop'>} props
|
|
*
|
|
* @return {JSX.Element} Stop component
|
|
*/
|
|
exports.LinearGradient = LinearGradient;
|
|
const Stop = props => (0, _element.createElement)('stop', props);
|
|
exports.Stop = Stop;
|
|
const SVG = exports.SVG = (0, _element.forwardRef)(
|
|
/**
|
|
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
|
* Other props will be passed through to svg component.
|
|
* @param {import('react').ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
|
|
*
|
|
* @return {JSX.Element} Stop component
|
|
*/
|
|
({
|
|
className,
|
|
isPressed,
|
|
...props
|
|
}, ref) => {
|
|
const appliedProps = {
|
|
...props,
|
|
className: (0, _clsx.default)(className, {
|
|
'is-pressed': isPressed
|
|
}) || undefined,
|
|
'aria-hidden': true,
|
|
focusable: false
|
|
};
|
|
|
|
// Disable reason: We need to have a way to render HTML tag for web.
|
|
// eslint-disable-next-line react/forbid-elements
|
|
return (0, _element.createElement)("svg", {
|
|
...appliedProps,
|
|
ref: ref
|
|
});
|
|
});
|
|
SVG.displayName = 'SVG';
|
|
//# sourceMappingURL=index.js.map
|