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>
53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _react = require("react");
|
|
var _element = require("@wordpress/element");
|
|
var _styles = require("./styles");
|
|
var _colorAlgorithms = require("./color-algorithms");
|
|
var _utils = require("../utils");
|
|
/**
|
|
* WordPress dependencies
|
|
*/
|
|
|
|
/**
|
|
* `Theme` allows defining theme variables for components in the `@wordpress/components` package.
|
|
*
|
|
* Multiple `Theme` components can be nested in order to override specific theme variables.
|
|
*
|
|
*
|
|
* ```jsx
|
|
* const Example = () => {
|
|
* return (
|
|
* <Theme accent="red">
|
|
* <Button variant="primary">I'm red</Button>
|
|
* <Theme accent="blue">
|
|
* <Button variant="primary">I'm blue</Button>
|
|
* </Theme>
|
|
* </Theme>
|
|
* );
|
|
* };
|
|
* ```
|
|
*/
|
|
function Theme({
|
|
accent,
|
|
background,
|
|
className,
|
|
...props
|
|
}) {
|
|
const cx = (0, _utils.useCx)();
|
|
const classes = (0, _element.useMemo)(() => cx(...(0, _styles.colorVariables)((0, _colorAlgorithms.generateThemeVariables)({
|
|
accent,
|
|
background
|
|
})), className), [accent, background, className, cx]);
|
|
return (0, _react.createElement)(_styles.Wrapper, {
|
|
className: classes,
|
|
...props
|
|
});
|
|
}
|
|
var _default = Theme;
|
|
exports.default = _default;
|
|
//# sourceMappingURL=index.js.map
|