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

53
node_modules/reakit/es/Disclosure/Disclosure.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import { createComponent } from 'reakit-system/createComponent';
import { createHook } from 'reakit-system/createHook';
import 'reakit-utils/shallowEqual';
import { useCallback } from 'react';
import 'reakit-utils/useForkRef';
import 'reakit-utils/isButton';
import 'reakit-warning';
import { useLiveRef } from 'reakit-utils/useLiveRef';
import 'reakit-utils/isSelfTarget';
import 'reakit-utils/useIsomorphicEffect';
import 'reakit-utils/hasFocusWithin';
import 'reakit-utils/isPortalEvent';
import 'reakit-utils/dom';
import 'reakit-utils/tabbable';
import '../Role/Role.js';
import '../Tabbable/Tabbable.js';
import '../Clickable/Clickable.js';
import { useButton } from '../Button/Button.js';
import { D as DISCLOSURE_KEYS } from '../__keys-e6a5cfbe.js';
var useDisclosure = createHook({
name: "Disclosure",
compose: useButton,
keys: DISCLOSURE_KEYS,
useProps: function useProps(options, _ref) {
var htmlOnClick = _ref.onClick,
ariaControls = _ref["aria-controls"],
htmlProps = _objectWithoutPropertiesLoose(_ref, ["onClick", "aria-controls"]);
var onClickRef = useLiveRef(htmlOnClick);
var controls = ariaControls ? ariaControls + " " + options.baseId : options.baseId;
var onClick = useCallback(function (event) {
var _onClickRef$current, _options$toggle;
(_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
if (event.defaultPrevented) return;
(_options$toggle = options.toggle) === null || _options$toggle === void 0 ? void 0 : _options$toggle.call(options);
}, [options.toggle]);
return _objectSpread2({
"aria-expanded": !!options.visible,
"aria-controls": controls,
onClick: onClick
}, htmlProps);
}
});
var Disclosure = createComponent({
as: "button",
memo: true,
useHook: useDisclosure
});
export { Disclosure, useDisclosure };

93
node_modules/reakit/es/Disclosure/DisclosureContent.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import { createComponent } from 'reakit-system/createComponent';
import { createHook } from 'reakit-system/createHook';
import 'reakit-utils/shallowEqual';
import { useState, useRef, useEffect, useCallback } from 'react';
import { useLiveRef } from 'reakit-utils/useLiveRef';
import { isSelfTarget } from 'reakit-utils/isSelfTarget';
import { useRole } from '../Role/Role.js';
import { a as DISCLOSURE_CONTENT_KEYS } from '../__keys-e6a5cfbe.js';
var useDisclosureContent = createHook({
name: "DisclosureContent",
compose: useRole,
keys: DISCLOSURE_CONTENT_KEYS,
useProps: function useProps(options, _ref) {
var htmlOnTransitionEnd = _ref.onTransitionEnd,
htmlOnAnimationEnd = _ref.onAnimationEnd,
htmlStyle = _ref.style,
htmlProps = _objectWithoutPropertiesLoose(_ref, ["onTransitionEnd", "onAnimationEnd", "style"]);
var animating = options.animated && options.animating;
var _React$useState = useState(null),
transition = _React$useState[0],
setTransition = _React$useState[1];
var hidden = !options.visible && !animating;
var style = hidden ? _objectSpread2({
display: "none"
}, htmlStyle) : htmlStyle;
var onTransitionEndRef = useLiveRef(htmlOnTransitionEnd);
var onAnimationEndRef = useLiveRef(htmlOnAnimationEnd);
var raf = useRef(0);
useEffect(function () {
if (!options.animated) return undefined; // Double RAF is needed so the browser has enough time to paint the
// default styles before processing the `data-enter` attribute. Otherwise
// it wouldn't be considered a transition.
// See https://github.com/reakit/reakit/issues/643
raf.current = window.requestAnimationFrame(function () {
raf.current = window.requestAnimationFrame(function () {
if (options.visible) {
setTransition("enter");
} else if (animating) {
setTransition("leave");
} else {
setTransition(null);
}
});
});
return function () {
return window.cancelAnimationFrame(raf.current);
};
}, [options.animated, options.visible, animating]);
var onEnd = useCallback(function (event) {
if (!isSelfTarget(event)) return;
if (!animating) return; // Ignores number animated
if (options.animated === true) {
var _options$stopAnimatio;
(_options$stopAnimatio = options.stopAnimation) === null || _options$stopAnimatio === void 0 ? void 0 : _options$stopAnimatio.call(options);
}
}, [options.animated, animating, options.stopAnimation]);
var onTransitionEnd = useCallback(function (event) {
var _onTransitionEndRef$c;
(_onTransitionEndRef$c = onTransitionEndRef.current) === null || _onTransitionEndRef$c === void 0 ? void 0 : _onTransitionEndRef$c.call(onTransitionEndRef, event);
onEnd(event);
}, [onEnd]);
var onAnimationEnd = useCallback(function (event) {
var _onAnimationEndRef$cu;
(_onAnimationEndRef$cu = onAnimationEndRef.current) === null || _onAnimationEndRef$cu === void 0 ? void 0 : _onAnimationEndRef$cu.call(onAnimationEndRef, event);
onEnd(event);
}, [onEnd]);
return _objectSpread2({
id: options.baseId,
"data-enter": transition === "enter" ? "" : undefined,
"data-leave": transition === "leave" ? "" : undefined,
onTransitionEnd: onTransitionEnd,
onAnimationEnd: onAnimationEnd,
hidden: hidden,
style: style
}, htmlProps);
}
});
var DisclosureContent = createComponent({
as: "div",
useHook: useDisclosureContent
});
export { DisclosureContent, useDisclosureContent };

100
node_modules/reakit/es/Disclosure/DisclosureState.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import { useState, useEffect, useCallback, useRef } from 'react';
import { warning } from 'reakit-warning';
import { useIsomorphicEffect } from 'reakit-utils/useIsomorphicEffect';
import { useSealedState } from 'reakit-utils/useSealedState';
import '../Id/IdProvider.js';
import { unstable_useIdState } from '../Id/IdState.js';
function useLastValue(value) {
var lastValue = useRef(null);
useIsomorphicEffect(function () {
lastValue.current = value;
}, [value]);
return lastValue;
}
function useDisclosureState(initialState) {
if (initialState === void 0) {
initialState = {};
}
var _useSealedState = useSealedState(initialState),
_useSealedState$visib = _useSealedState.visible,
initialVisible = _useSealedState$visib === void 0 ? false : _useSealedState$visib,
_useSealedState$anima = _useSealedState.animated,
initialAnimated = _useSealedState$anima === void 0 ? false : _useSealedState$anima,
sealed = _objectWithoutPropertiesLoose(_useSealedState, ["visible", "animated"]);
var id = unstable_useIdState(sealed);
var _React$useState = useState(initialVisible),
visible = _React$useState[0],
setVisible = _React$useState[1];
var _React$useState2 = useState(initialAnimated),
animated = _React$useState2[0],
setAnimated = _React$useState2[1];
var _React$useState3 = useState(false),
animating = _React$useState3[0],
setAnimating = _React$useState3[1];
var lastVisible = useLastValue(visible);
var visibleHasChanged = lastVisible.current != null && lastVisible.current !== visible;
if (animated && !animating && visibleHasChanged) {
// Sets animating to true when when visible is updated
setAnimating(true);
}
useEffect(function () {
if (typeof animated === "number" && animating) {
var timeout = setTimeout(function () {
return setAnimating(false);
}, animated);
return function () {
clearTimeout(timeout);
};
}
if (animated && animating && process.env.NODE_ENV === "development") {
var _timeout = setTimeout(function () {
process.env.NODE_ENV !== "production" ? warning(animating, "It's been 8 seconds but stopAnimation has not been called. Does the disclousure element have a CSS transition?") : void 0;
}, 8000);
return function () {
clearTimeout(_timeout);
};
}
return function () {};
}, [animated, animating]);
var show = useCallback(function () {
return setVisible(true);
}, []);
var hide = useCallback(function () {
return setVisible(false);
}, []);
var toggle = useCallback(function () {
return setVisible(function (v) {
return !v;
});
}, []);
var stopAnimation = useCallback(function () {
return setAnimating(false);
}, []);
return _objectSpread2(_objectSpread2({}, id), {}, {
visible: visible,
animated: animated,
animating: animating,
show: show,
hide: hide,
toggle: toggle,
setVisible: setVisible,
setAnimated: setAnimated,
stopAnimation: stopAnimation
});
}
export { useDisclosureState };

26
node_modules/reakit/es/Disclosure/index.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import '../_rollupPluginBabelHelpers-1f0bf8c2.js';
import 'reakit-system/createComponent';
import 'reakit-system/createHook';
import 'reakit-utils/shallowEqual';
import 'react';
import 'reakit-utils/useForkRef';
import 'reakit-utils/isButton';
import 'reakit-warning';
import 'reakit-utils/useLiveRef';
import 'reakit-utils/isSelfTarget';
import 'reakit-utils/useIsomorphicEffect';
import 'reakit-utils/hasFocusWithin';
import 'reakit-utils/isPortalEvent';
import 'reakit-utils/dom';
import 'reakit-utils/tabbable';
import '../Role/Role.js';
import '../Tabbable/Tabbable.js';
import '../Clickable/Clickable.js';
import '../Button/Button.js';
import 'reakit-utils/useSealedState';
import '../Id/IdProvider.js';
import '../Id/IdState.js';
export { useDisclosureState } from './DisclosureState.js';
import '../__keys-e6a5cfbe.js';
export { DisclosureContent, useDisclosureContent } from './DisclosureContent.js';
export { Disclosure, useDisclosure } from './Disclosure.js';