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,33 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useDebouncedInput;
var _element = require("@wordpress/element");
var _useDebounce = _interopRequireDefault(require("../use-debounce"));
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Helper hook for input fields that need to debounce the value before using it.
*
* @param {any} defaultValue The default value to use.
* @return {[string, Function, string]} The input value, the setter and the debounced input value.
*/
function useDebouncedInput(defaultValue = '') {
const [input, setInput] = (0, _element.useState)(defaultValue);
const [debouncedInput, setDebouncedState] = (0, _element.useState)(defaultValue);
const setDebouncedInput = (0, _useDebounce.default)(setDebouncedState, 250);
(0, _element.useEffect)(() => {
setDebouncedInput(input);
}, [input]);
return [input, setInput, debouncedInput];
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_element","require","_useDebounce","_interopRequireDefault","useDebouncedInput","defaultValue","input","setInput","useState","debouncedInput","setDebouncedState","setDebouncedInput","useDebounce","useEffect"],"sources":["@wordpress/compose/src/hooks/use-debounced-input/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDebounce from '../use-debounce';\n\n/**\n * Helper hook for input fields that need to debounce the value before using it.\n *\n * @param {any} defaultValue The default value to use.\n * @return {[string, Function, string]} The input value, the setter and the debounced input value.\n */\nexport default function useDebouncedInput( defaultValue = '' ) {\n\tconst [ input, setInput ] = useState( defaultValue );\n\tconst [ debouncedInput, setDebouncedState ] = useState( defaultValue );\n\n\tconst setDebouncedInput = useDebounce( setDebouncedState, 250 );\n\n\tuseEffect( () => {\n\t\tsetDebouncedInput( input );\n\t}, [ input ] );\n\n\treturn [ input, setInput, debouncedInput ];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,iBAAiBA,CAAEC,YAAY,GAAG,EAAE,EAAG;EAC9D,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAEH,YAAa,CAAC;EACpD,MAAM,CAAEI,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAF,iBAAQ,EAAEH,YAAa,CAAC;EAEtE,MAAMM,iBAAiB,GAAG,IAAAC,oBAAW,EAAEF,iBAAiB,EAAE,GAAI,CAAC;EAE/D,IAAAG,kBAAS,EAAE,MAAM;IAChBF,iBAAiB,CAAEL,KAAM,CAAC;EAC3B,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC;EAEd,OAAO,CAAEA,KAAK,EAAEC,QAAQ,EAAEE,cAAc,CAAE;AAC3C","ignoreList":[]}