Files
formipay/node_modules/@wordpress/primitives/build/svg/index.native.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
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>
2026-04-18 17:02:14 +07:00

127 lines
3.1 KiB
JavaScript

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Circle", {
enumerable: true,
get: function () {
return _reactNativeSvg.Circle;
}
});
Object.defineProperty(exports, "Defs", {
enumerable: true,
get: function () {
return _reactNativeSvg.Defs;
}
});
Object.defineProperty(exports, "G", {
enumerable: true,
get: function () {
return _reactNativeSvg.G;
}
});
Object.defineProperty(exports, "Line", {
enumerable: true,
get: function () {
return _reactNativeSvg.Line;
}
});
Object.defineProperty(exports, "LinearGradient", {
enumerable: true,
get: function () {
return _reactNativeSvg.LinearGradient;
}
});
Object.defineProperty(exports, "Path", {
enumerable: true,
get: function () {
return _reactNativeSvg.Path;
}
});
Object.defineProperty(exports, "Polygon", {
enumerable: true,
get: function () {
return _reactNativeSvg.Polygon;
}
});
Object.defineProperty(exports, "RadialGradient", {
enumerable: true,
get: function () {
return _reactNativeSvg.RadialGradient;
}
});
Object.defineProperty(exports, "Rect", {
enumerable: true,
get: function () {
return _reactNativeSvg.Rect;
}
});
exports.SVG = void 0;
Object.defineProperty(exports, "Stop", {
enumerable: true,
get: function () {
return _reactNativeSvg.Stop;
}
});
Object.defineProperty(exports, "SvgXml", {
enumerable: true,
get: function () {
return _reactNativeSvg.SvgXml;
}
});
var _react = require("react");
var _reactNativeSvg = require("react-native-svg");
var _reactNative = require("react-native");
var _element = require("@wordpress/element");
var _compose = require("@wordpress/compose");
var _style = _interopRequireDefault(require("./style.scss"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const AnimatedSvg = _reactNative.Animated.createAnimatedComponent((0, _element.forwardRef)((props, ref) => (0, _react.createElement)(_reactNativeSvg.Svg, {
ref: ref,
...props
})));
const SVG = ({
className = '',
isPressed,
animated = false,
...props
}) => {
const colorScheme = (0, _compose.usePreferredColorScheme)();
const stylesFromClasses = className.split(' ').map(element => _style.default[element]).filter(Boolean);
const defaultStyle = isPressed ? _style.default[`is-pressed--${colorScheme}`] : _style.default['components-toolbar__control-' + colorScheme];
const propStyle = Array.isArray(props.style) ? props.style.reduce((acc, el) => {
return {
...acc,
...el
};
}, {}) : props.style;
const styleValues = Object.assign({}, defaultStyle, propStyle, ...stylesFromClasses);
const appliedProps = {
...props,
style: styleValues
};
const SvgWrapper = animated ? AnimatedSvg : _reactNativeSvg.Svg;
return (0, _react.createElement)(SvgWrapper
// We want to re-render when style color is changed.
, {
key: appliedProps.style.color,
height: "100%",
width: "100%",
...appliedProps
});
};
exports.SVG = SVG;
//# sourceMappingURL=index.native.js.map