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,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BlockQuotation = void 0;
const BlockQuotation = exports.BlockQuotation = 'blockquote';
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,66 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BlockQuotation = void 0;
var _react = require("react");
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 BlockQuotation = exports.BlockQuotation = (0, _element.forwardRef)(({
...props
}, ref) => {
const {
style
} = props;
const blockQuoteStyle = [(0, _compose.usePreferredColorSchemeStyle)(_style.default.wpBlockQuoteLight, _style.default.wpBlockQuoteDark), style?.baseColors?.color?.text && {
borderLeftColor: style.baseColors.color.text
}, style?.color && {
borderLeftColor: style.color
}, style, style?.backgroundColor && _style.default.paddingWithBackground];
const colorStyle = style?.color ? {
color: style.color
} : {};
const newChildren = _element.Children.map(props.children, child => {
const {
identifier,
attributeKey
} = child?.props || {};
const identifierKey = identifier !== null && identifier !== void 0 ? identifier : attributeKey;
if (identifierKey === 'citation') {
return (0, _element.cloneElement)(child, {
style: {
..._style.default.wpBlockQuoteCitation,
...colorStyle
}
});
}
if (child && child.props.identifier === 'value') {
return (0, _element.cloneElement)(child, {
tagsToEliminate: ['div'],
style: colorStyle
});
}
return child;
});
return (0, _react.createElement)(_reactNative.View, {
ref: ref,
style: blockQuoteStyle
}, newChildren);
});
//# sourceMappingURL=index.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","_element","_compose","_style","_interopRequireDefault","BlockQuotation","exports","forwardRef","props","ref","style","blockQuoteStyle","usePreferredColorSchemeStyle","styles","wpBlockQuoteLight","wpBlockQuoteDark","baseColors","color","text","borderLeftColor","backgroundColor","paddingWithBackground","colorStyle","newChildren","Children","map","children","child","identifier","attributeKey","identifierKey","cloneElement","wpBlockQuoteCitation","tagsToEliminate","_react","createElement","View"],"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":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAIA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAZA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMK,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,mBAAU,EAAE,CAAE;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAM;EAClE,MAAM;IAAEC;EAAM,CAAC,GAAGF,KAAK;EAEvB,MAAMG,eAAe,GAAG,CACvB,IAAAC,qCAA4B,EAC3BC,cAAM,CAACC,iBAAiB,EACxBD,cAAM,CAACE,gBACR,CAAC,EACDL,KAAK,EAAEM,UAAU,EAAEC,KAAK,EAAEC,IAAI,IAAI;IACjCC,eAAe,EAAET,KAAK,CAACM,UAAU,CAACC,KAAK,CAACC;EACzC,CAAC,EACDR,KAAK,EAAEO,KAAK,IAAI;IACfE,eAAe,EAAET,KAAK,CAACO;EACxB,CAAC,EACDP,KAAK,EACLA,KAAK,EAAEU,eAA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