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

56
node_modules/reakit/es/Id/Id.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
import { a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import { createComponent } from 'reakit-system/createComponent';
import { createHook } from 'reakit-system/createHook';
import { useContext, useState, useMemo } from 'react';
import { unstable_IdContext } from './IdProvider.js';
// Automatically generated
var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"];
var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]);
var unstable_useId = createHook({
keys: ID_KEYS,
useOptions: function useOptions(options, htmlProps) {
var generateId = useContext(unstable_IdContext);
var _React$useState = useState(function () {
// This comes from useIdState
if (options.unstable_idCountRef) {
options.unstable_idCountRef.current += 1;
return "-" + options.unstable_idCountRef.current;
} // If there's no useIdState, we check if `baseId` was passed (as a prop,
// not from useIdState).
if (options.baseId) {
return "-" + generateId("");
}
return "";
}),
suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState.
// If there's neither, then it'll fallback to Context's generateId.
// This generateId can result in a sequential ID (if there's a Provider)
// or a random string (without Provider).
var baseId = useMemo(function () {
return options.baseId || generateId();
}, [options.baseId, generateId]);
var id = htmlProps.id || options.id || "" + baseId + suffix;
return _objectSpread2(_objectSpread2({}, options), {}, {
id: id
});
},
useProps: function useProps(options, htmlProps) {
return _objectSpread2({
id: options.id
}, htmlProps);
}
});
var unstable_Id = createComponent({
as: "div",
useHook: unstable_useId
});
export { unstable_Id, unstable_useId };

30
node_modules/reakit/es/Id/IdProvider.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { createContext, useRef, useCallback, createElement } from 'react';
var defaultPrefix = "id";
function generateRandomString(prefix) {
if (prefix === void 0) {
prefix = defaultPrefix;
}
return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6);
}
var unstable_IdContext = /*#__PURE__*/createContext(generateRandomString);
function unstable_IdProvider(_ref) {
var children = _ref.children,
_ref$prefix = _ref.prefix,
prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix;
var count = useRef(0);
var generateId = useCallback(function (localPrefix) {
if (localPrefix === void 0) {
localPrefix = prefix;
}
return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current;
}, [prefix]);
return /*#__PURE__*/createElement(unstable_IdContext.Provider, {
value: generateId
}, children);
}
export { unstable_IdContext, unstable_IdProvider };

29
node_modules/reakit/es/Id/IdState.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import { useContext, useRef, useState } from 'react';
import { useSealedState } from 'reakit-utils/useSealedState';
import { unstable_IdContext } from './IdProvider.js';
function unstable_useIdState(initialState) {
if (initialState === void 0) {
initialState = {};
}
var _useSealedState = useSealedState(initialState),
initialBaseId = _useSealedState.baseId;
var generateId = useContext(unstable_IdContext);
var idCountRef = useRef(0);
var _React$useState = useState(function () {
return initialBaseId || generateId();
}),
baseId = _React$useState[0],
setBaseId = _React$useState[1];
return {
baseId: baseId,
setBaseId: setBaseId,
unstable_idCountRef: idCountRef
};
}
export { unstable_useIdState };

8
node_modules/reakit/es/Id/index.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import 'reakit-system/createComponent';
import 'reakit-system/createHook';
import 'react';
import 'reakit-utils/useSealedState';
export { unstable_IdContext, unstable_IdProvider } from './IdProvider.js';
export { unstable_Id, unstable_useId } from './Id.js';
export { unstable_useIdState } from './IdState.js';