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,36 @@
import { createElement } from "react";
/**
* WordPress dependencies
*/
import { memo } from '@wordpress/element';
/**
* Internal dependencies
*/
import CyclePickerCell from '../bottom-sheet/cycle-picker-cell';
function CycleSelectControl({
help,
instanceId,
label,
multiple = false,
onChange,
options = [],
className,
hideLabelFromVision,
...props
}) {
const id = `inspector-select-control-${instanceId}`;
return createElement(CyclePickerCell, {
label: label,
hideLabelFromVision: hideLabelFromVision,
id: id,
help: help,
className: className,
onChangeValue: onChange,
"aria-describedby": !!help ? `${id}__help` : undefined,
multiple: multiple,
options: options,
...props
});
}
export default memo(CycleSelectControl);
//# sourceMappingURL=index.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["memo","CyclePickerCell","CycleSelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","createElement","onChangeValue","undefined"],"sources":["@wordpress/components/src/mobile/cycle-select-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport CyclePickerCell from '../bottom-sheet/cycle-picker-cell';\n\nfunction CycleSelectControl( {\n\thelp,\n\tinstanceId,\n\tlabel,\n\tmultiple = false,\n\tonChange,\n\toptions = [],\n\tclassName,\n\thideLabelFromVision,\n\t...props\n} ) {\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn (\n\t\t<CyclePickerCell\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t\tonChangeValue={ onChange }\n\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\tmultiple={ multiple }\n\t\t\toptions={ options }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default memo( CycleSelectControl );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,eAAe,MAAM,mCAAmC;AAE/D,SAASC,kBAAkBA,CAAE;EAC5BC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,SAAS;EACTC,mBAAmB;EACnB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,EAAE,GAAI,4BAA4BR,UAAY,EAAC;EAErD,OACCS,aAAA,CAACZ,eAAe;IACfI,KAAK,EAAGA,KAAO;IACfK,mBAAmB,EAAGA,mBAAqB;IAC3CE,EAAE,EAAGA,EAAI;IACTT,IAAI,EAAGA,IAAM;IACbM,SAAS,EAAGA,SAAW;IACvBK,aAAa,EAAGP,QAAU;IAC1B,oBAAmB,CAAC,CAAEJ,IAAI,GAAI,GAAGS,EAAI,QAAO,GAAGG,SAAW;IAC1DT,QAAQ,EAAGA,QAAU;IACrBE,OAAO,EAAGA,OAAS;IAAA,GACdG;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeX,IAAI,CAAEE,kBAAmB,CAAC"}