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,2 @@
export const BlockQuotation = 'blockquote';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["BlockQuotation"],"sources":["@wordpress/primitives/src/block-quotation/index.js"],"sourcesContent":["export const BlockQuotation = 'blockquote';\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,YAAY","ignoreList":[]}

View File

@@ -0,0 +1,56 @@
import { createElement } from "react";
/**
* External dependencies
*/
import { View } from 'react-native';
/**
* WordPress dependencies
*/
import { Children, cloneElement, forwardRef } from '@wordpress/element';
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
/**
* Internal dependencies
*/
import styles from './style.scss';
export const BlockQuotation = forwardRef(({
...props
}, ref) => {
const {
style
} = props;
const blockQuoteStyle = [usePreferredColorSchemeStyle(styles.wpBlockQuoteLight, styles.wpBlockQuoteDark), style?.baseColors?.color?.text && {
borderLeftColor: style.baseColors.color.text
}, style?.color && {
borderLeftColor: style.color
}, style, style?.backgroundColor && styles.paddingWithBackground];
const colorStyle = style?.color ? {
color: style.color
} : {};
const newChildren = Children.map(props.children, child => {
const {
identifier,
attributeKey
} = child?.props || {};
const identifierKey = identifier !== null && identifier !== void 0 ? identifier : attributeKey;
if (identifierKey === 'citation') {
return cloneElement(child, {
style: {
...styles.wpBlockQuoteCitation,
...colorStyle
}
});
}
if (child && child.props.identifier === 'value') {
return cloneElement(child, {
tagsToEliminate: ['div'],
style: colorStyle
});
}
return child;
});
return createElement(View, {
ref: ref,
style: blockQuoteStyle
}, newChildren);
});
//# sourceMappingURL=index.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["View","Children","cloneElement","forwardRef","usePreferredColorSchemeStyle","styles","BlockQuotation","props","ref","style","blockQuoteStyle","wpBlockQuoteLight","wpBlockQuoteDark","baseColors","color","text","borderLeftColor","backgroundColor","paddingWithBackground","colorStyle","newChildren","map","children","child","identifier","attributeKey","identifierKey","wpBlockQuoteCitation","tagsToEliminate","createElement"],"sources":["@wordpress/primitives/src/block-quotation/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, forwardRef } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport const BlockQuotation = forwardRef( ( { ...props }, ref ) => {\n\tconst { style } = props;\n\n\tconst blockQuoteStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.wpBlockQuoteLight,\n\t\t\tstyles.wpBlockQuoteDark\n\t\t),\n\t\tstyle?.baseColors?.color?.text && {\n\t\t\tborderLeftColor: style.baseColors.color.text,\n\t\t},\n\t\tstyle?.color && {\n\t\t\tborderLeftColor: style.color,\n\t\t},\n\t\tstyle,\n\t\tstyle?.backgroundColor && styles.paddingWithBackground,\n\t];\n\tconst colorStyle = style?.color ? { color: style.color } : {};\n\n\tconst newChildren = Children.map( props.children, ( child ) => {\n\t\tconst { identifier, attributeKey } = child?.props || {};\n\t\tconst identifierKey = identifier ?? attributeKey;\n\n\t\tif ( identifierKey === 'citation' ) {\n\t\t\treturn cloneElement( child, {\n\t\t\t\tstyle: {\n\t\t\t\t\t...styles.wpBlockQuoteCitation,\n\t\t\t\t\t...colorStyle,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t\tif ( child && child.props.identifier === 'value' ) {\n\t\t\treturn cloneElement( child, {\n\t\t\t\ttagsToEliminate: [ 'div' ],\n\t\t\t\tstyle: colorStyle,\n\t\t\t} );\n\t\t}\n\t\treturn child;\n\t} );\n\treturn (\n\t\t<View ref={ ref } style={ blockQuoteStyle }>\n\t\t\t{ newChildren }\n\t\t</View>\n\t);\n} );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;AACnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;AACvE,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AAEjC,OAAO,MAAMC,cAAc,GAAGH,UAAU,CAAE,CAAE;EAAE,GAAGI;AAAM,CAAC,EAAEC,GAAG,KAAM;EAClE,MAAM;IAAEC;EAAM,CAAC,GAAGF,KAAK;EAEvB,MAAMG,eAAe,GAAG,CACvBN,4BAA4B,CAC3BC,MAAM,CAACM,iBAAiB,EACxBN,MAAM,CAACO,gBACR,CAAC,EACDH,KAAK,EAAEI,UAAU,EAAEC,KAAK,EAAEC,IAAI,IAAI;IACjCC,eAAe,EAAEP,KAAK,CAACI,UAAU,CAACC,KAAK,CAACC;EACzC,CAAC,EACDN,KAAK,EAAEK,KAAK,IAAI;IACfE,eAAe,EAAEP,KAAK,CAACK;EACxB,CAAC,EACDL,KAAK,EACLA,KAAK,EAAEQ,eAAe,IAAIZ,MAAM,CAACa,qBAAqB,CACtD;EACD,MAAMC,UAAU,GAAGV,KAAK,EAAEK,KAAK,GAAG;IAAEA,KAAK,EAAEL,KAAK,CAACK;EAAM,CAAC,GAAG,CAAC,CAAC;EAE7D,MAAMM,WAAW,GAAGnB,QAAQ,CAACoB,GAAG,CAAEd,KAAK,CAACe,QAAQ,EAAIC,KAAK,IAAM;IAC9D,MAAM;MAAEC,UAAU;MAAEC;IAAa,CAAC,GAAGF,KAAK,EAAEhB,KAAK,IAAI,CAAC,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