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>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _native = require("@emotion/native");
/**
* External dependencies
*/
var _default = _native.css;
exports.default = _default;
//# sourceMappingURL=emotion-css.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_native","require","_default","css","exports","default"],"sources":["@wordpress/components/src/text/styles/emotion-css.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/native';\n\nexport default css;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAKeC,WAAG;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}

View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fontFamily = void 0;
const fontFamily = '';
exports.fontFamily = fontFamily;
//# sourceMappingURL=font-family.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["fontFamily","exports"],"sources":["@wordpress/components/src/text/styles/font-family.native.js"],"sourcesContent":["export const fontFamily = '';\n"],"mappings":";;;;;;AAAO,MAAMA,UAAU,GAAG,EAAE;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA"}

View File

@@ -0,0 +1,152 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.text = void 0;
var _fontFamily = require("./font-family");
var _emotionCss = _interopRequireDefault(require("./emotion-css"));
var _colorsValues = require("../../utils/colors-values");
/**
* Internal dependencies
*/
const fontWeightNormal = `font-weight: 400;`;
const fontWeightMedium = `font-weight: 500;`;
const fontWeightSemibold = `font-weight: 600;`;
const title = `
${fontWeightNormal}
`;
const titleLarge = `
font-size: 32px;
line-height: 40px;
`;
const titleMedium = `
font-size: 24px;
line-height: 32px;
`;
const titleSmall = `
font-size: 20px;
line-height: 28px;
`;
const subtitle = `
${fontWeightSemibold}
font-size: 14px;
line-height: 20px;
`;
const subtitleLarge = `
font-size: 16px;
line-height: 24px;
`;
const subtitleSmall = `
font-size: 14px;
line-height: 20px;
`;
const body = `
${fontWeightNormal}
`;
const bodyLarge = `
font-size: 16px;
line-height: 24px;
`;
const bodySmall = `
font-size: 14px;
line-height: 20px;
`;
const button = `
${fontWeightSemibold}
font-size: 14px;
line-height: 20px;
`;
const caption = `
${fontWeightNormal}
font-size: 12px;
line-height: 16px;
`;
const label = `
${fontWeightSemibold}
font-size: 12px;
line-height: 16px;
`;
const sectionHeading = `
${fontWeightMedium}
font-size: 11px;
line-height: 1.4;
text-transform: uppercase;
color: ${_colorsValues.COLORS.gray[700]}
`;
/**
* @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'|'sectionheading'} TextVariant
*/
/**
* @param {TextVariant} variantName
*/
const variant = (variantName = 'body') => {
switch (variantName) {
case 'title.large':
return (0, _emotionCss.default)`
${title}
${titleLarge}
`;
case 'title.medium':
return (0, _emotionCss.default)`
${title}
${titleMedium}
`;
case 'title.small':
return (0, _emotionCss.default)`
${title}
${titleSmall}
`;
case 'subtitle':
return (0, _emotionCss.default)`
${subtitle}
${subtitleLarge}
`;
case 'subtitle.small':
return (0, _emotionCss.default)`
${subtitle}
${subtitleSmall}
`;
case 'body':
return (0, _emotionCss.default)`
${body}
`;
case 'body.large':
return (0, _emotionCss.default)`
${body}
${bodyLarge}
`;
case 'body.small':
return (0, _emotionCss.default)`
${body}
${bodySmall}
`;
case 'button':
return button;
case 'caption':
return caption;
case 'label':
return label;
case 'sectionheading':
return sectionHeading;
}
};
/**
* @typedef {Object} TextProps
* @property {TextVariant} variant one of TextVariant to be used
*/
/**
* @param {TextProps} props
*/
const text = props => (0, _emotionCss.default)`
${_fontFamily.fontFamily}
${variant(props.variant)}
`;
exports.text = text;
//# sourceMappingURL=text-mixins.native.js.map

File diff suppressed because one or more lines are too long