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,6 @@
/**
* External dependencies
*/
import { css } from '@emotion/native';
export default css;
//# sourceMappingURL=emotion-css.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["css"],"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":"AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,iBAAiB;AAErC,eAAeA,GAAG"}

View File

@@ -0,0 +1,2 @@
export const fontFamily = '';
//# sourceMappingURL=font-family.native.js.map

View File

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

View File

@@ -0,0 +1,143 @@
/**
* Internal dependencies
*/
import { fontFamily } from './font-family';
import css from './emotion-css';
import { COLORS } from '../../utils/colors-values';
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: ${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 css`
${title}
${titleLarge}
`;
case 'title.medium':
return css`
${title}
${titleMedium}
`;
case 'title.small':
return css`
${title}
${titleSmall}
`;
case 'subtitle':
return css`
${subtitle}
${subtitleLarge}
`;
case 'subtitle.small':
return css`
${subtitle}
${subtitleSmall}
`;
case 'body':
return css`
${body}
`;
case 'body.large':
return css`
${body}
${bodyLarge}
`;
case 'body.small':
return css`
${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
*/
export const text = props => css`
${fontFamily}
${variant(props.variant)}
`;
//# sourceMappingURL=text-mixins.native.js.map

File diff suppressed because one or more lines are too long