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

140
node_modules/reakit/ts/Dialog/Dialog.d.ts generated vendored Normal file
View File

@@ -0,0 +1,140 @@
import * as React from "react";
import { DisclosureContentOptions, DisclosureContentHTMLProps } from "../Disclosure/DisclosureContent";
import { DialogStateReturn } from "./DialogState";
export declare type DialogOptions = DisclosureContentOptions & Pick<Partial<DialogStateReturn>, "modal" | "hide" | "unstable_disclosureRef"> & Pick<DialogStateReturn, "baseId"> & {
/**
* When enabled, user can hide the dialog by pressing `Escape`.
*/
hideOnEsc?: boolean;
/**
* When enabled, user can hide the dialog by clicking outside it.
*/
hideOnClickOutside?: boolean;
/**
* When enabled, user can't scroll on body when the dialog is visible.
* This option doesn't work if the dialog isn't modal.
*/
preventBodyScroll?: boolean;
/**
* The element that will be focused when the dialog shows.
* When not set, the first tabbable element within the dialog will be used.
*/
unstable_initialFocusRef?: React.RefObject<HTMLElement>;
/**
* The element that will be focused when the dialog hides.
* When not set, the disclosure component will be used.
*/
unstable_finalFocusRef?: React.RefObject<HTMLElement>;
/**
* Whether or not the dialog should be a child of its parent.
* Opening a nested orphan dialog will close its parent dialog if
* `hideOnClickOutside` is set to `true` on the parent.
* It will be set to `false` if `modal` is `false`.
*/
unstable_orphan?: boolean;
/**
* Whether or not to move focus when the dialog shows.
* @private
*/
unstable_autoFocusOnShow?: boolean;
/**
* Whether or not to move focus when the dialog hides.
* @private
*/
unstable_autoFocusOnHide?: boolean;
};
export declare type DialogHTMLProps = DisclosureContentHTMLProps;
export declare type DialogProps = DialogOptions & DialogHTMLProps;
export declare const useDialog: {
(options?: DialogOptions | undefined, htmlProps?: import("..").RoleHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").RoleHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & Pick<Partial<import("..").DisclosureStateReturn>, "visible" | "baseId" | "animated" | "animating" | "stopAnimation"> & Pick<Partial<DialogStateReturn>, "hide" | "modal" | "unstable_disclosureRef"> & Pick<DialogStateReturn, "baseId"> & {
/**
* When enabled, user can hide the dialog by pressing `Escape`.
*/
hideOnEsc?: boolean | undefined;
/**
* When enabled, user can hide the dialog by clicking outside it.
*/
hideOnClickOutside?: boolean | undefined;
/**
* When enabled, user can't scroll on body when the dialog is visible.
* This option doesn't work if the dialog isn't modal.
*/
preventBodyScroll?: boolean | undefined;
/**
* The element that will be focused when the dialog shows.
* When not set, the first tabbable element within the dialog will be used.
*/
unstable_initialFocusRef?: React.RefObject<HTMLElement> | undefined;
/**
* The element that will be focused when the dialog hides.
* When not set, the disclosure component will be used.
*/
unstable_finalFocusRef?: React.RefObject<HTMLElement> | undefined;
/**
* Whether or not the dialog should be a child of its parent.
* Opening a nested orphan dialog will close its parent dialog if
* `hideOnClickOutside` is set to `true` on the parent.
* It will be set to `false` if `modal` is `false`.
*/
unstable_orphan?: boolean | undefined;
/**
* Whether or not to move focus when the dialog shows.
* @private
*/
unstable_autoFocusOnShow?: boolean | undefined;
/**
* Whether or not to move focus when the dialog hides.
* @private
*/
unstable_autoFocusOnHide?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}, next: import("..").RoleOptions & Pick<Partial<import("..").DisclosureStateReturn>, "visible" | "baseId" | "animated" | "animating" | "stopAnimation"> & Pick<Partial<DialogStateReturn>, "hide" | "modal" | "unstable_disclosureRef"> & Pick<DialogStateReturn, "baseId"> & {
/**
* When enabled, user can hide the dialog by pressing `Escape`.
*/
hideOnEsc?: boolean | undefined;
/**
* When enabled, user can hide the dialog by clicking outside it.
*/
hideOnClickOutside?: boolean | undefined;
/**
* When enabled, user can't scroll on body when the dialog is visible.
* This option doesn't work if the dialog isn't modal.
*/
preventBodyScroll?: boolean | undefined;
/**
* The element that will be focused when the dialog shows.
* When not set, the first tabbable element within the dialog will be used.
*/
unstable_initialFocusRef?: React.RefObject<HTMLElement> | undefined;
/**
* The element that will be focused when the dialog hides.
* When not set, the disclosure component will be used.
*/
unstable_finalFocusRef?: React.RefObject<HTMLElement> | undefined;
/**
* Whether or not the dialog should be a child of its parent.
* Opening a nested orphan dialog will close its parent dialog if
* `hideOnClickOutside` is set to `true` on the parent.
* It will be set to `false` if `modal` is `false`.
*/
unstable_orphan?: boolean | undefined;
/**
* Whether or not to move focus when the dialog shows.
* @private
*/
unstable_autoFocusOnShow?: boolean | undefined;
/**
* Whether or not to move focus when the dialog hides.
* @private
*/
unstable_autoFocusOnHide?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: DialogOptions, htmlProps: import("..").RoleHTMLProps) => DialogOptions;
};
export declare const Dialog: import("reakit-system/ts/createComponent").Component<"div", DialogOptions>;

17
node_modules/reakit/ts/Dialog/DialogBackdrop.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import * as React from "react";
import { DisclosureContentOptions, DisclosureContentHTMLProps } from "../Disclosure/DisclosureContent";
import { DialogStateReturn } from "./DialogState";
export declare type DialogBackdropOptions = DisclosureContentOptions & Pick<Partial<DialogStateReturn>, "modal">;
export declare type DialogBackdropHTMLProps = DisclosureContentHTMLProps;
export declare type DialogBackdropProps = DialogBackdropOptions & DialogBackdropHTMLProps;
export declare const useDialogBackdrop: {
(options?: DialogBackdropOptions | undefined, htmlProps?: import("..").RoleHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").RoleHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & Pick<Partial<import("..").DisclosureStateReturn>, "visible" | "baseId" | "animated" | "animating" | "stopAnimation"> & Pick<Partial<DialogStateReturn>, "modal"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}, next: import("..").RoleOptions & Pick<Partial<import("..").DisclosureStateReturn>, "visible" | "baseId" | "animated" | "animating" | "stopAnimation"> & Pick<Partial<DialogStateReturn>, "modal"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: DialogBackdropOptions, htmlProps: import("..").RoleHTMLProps) => DialogBackdropOptions;
};
export declare const DialogBackdrop: import("reakit-system/ts/createComponent").Component<"div", DialogBackdropOptions>;

33
node_modules/reakit/ts/Dialog/DialogDisclosure.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import * as React from "react";
import { DisclosureOptions, DisclosureHTMLProps } from "../Disclosure/Disclosure";
import { DialogStateReturn } from "./DialogState";
export declare type DialogDisclosureOptions = DisclosureOptions & Pick<Partial<DialogStateReturn>, "unstable_disclosureRef"> & Pick<DialogStateReturn, "toggle">;
export declare type DialogDisclosureHTMLProps = DisclosureHTMLProps;
export declare type DialogDisclosureProps = DialogDisclosureOptions & DialogDisclosureHTMLProps;
export declare const useDialogDisclosure: {
(options?: DialogDisclosureOptions | undefined, htmlProps?: import("..").ButtonHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").ButtonHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").DisclosureStateReturn>, "visible"> & Pick<import("..").DisclosureStateReturn, "toggle" | "baseId"> & Pick<Partial<DialogStateReturn>, "unstable_disclosureRef"> & Pick<DialogStateReturn, "toggle"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.ButtonHTMLAttributes<any>, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").DisclosureStateReturn>, "visible"> & Pick<import("..").DisclosureStateReturn, "toggle" | "baseId"> & Pick<Partial<DialogStateReturn>, "unstable_disclosureRef"> & Pick<DialogStateReturn, "toggle"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.ButtonHTMLAttributes<any>) => boolean;
__keys: readonly any[];
__useOptions: (options: DialogDisclosureOptions, htmlProps: import("..").ButtonHTMLProps) => DialogDisclosureOptions;
};
export declare const DialogDisclosure: import("reakit-system/ts/createComponent").Component<"button", DialogDisclosureOptions>;

26
node_modules/reakit/ts/Dialog/DialogState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import * as React from "react";
import { SealedInitialState } from "reakit-utils/useSealedState";
import { DisclosureState, DisclosureActions, DisclosureInitialState, DisclosureStateReturn } from "../Disclosure/DisclosureState";
export declare type DialogState = DisclosureState & {
/**
* Toggles Dialog's `modal` state.
* - Non-modal: `preventBodyScroll` doesn't work and focus is free.
* - Modal: `preventBodyScroll` is automatically enabled, focus is
* trapped within the dialog and the dialog is rendered within a `Portal`
* by default.
*/
modal: boolean;
/**
* @private
*/
unstable_disclosureRef: React.MutableRefObject<HTMLElement | null>;
};
export declare type DialogActions = DisclosureActions & {
/**
* Sets `modal`.
*/
setModal: React.Dispatch<React.SetStateAction<DialogState["modal"]>>;
};
export declare type DialogInitialState = DisclosureInitialState & Partial<Pick<DialogState, "modal">>;
export declare type DialogStateReturn = DisclosureStateReturn & DialogState & DialogActions;
export declare function useDialogState(initialState?: SealedInitialState<DialogInitialState>): DialogStateReturn;

3
node_modules/reakit/ts/Dialog/__keys.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export declare const DIALOG_KEYS: readonly ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "modal", "unstable_disclosureRef", "setModal", "hideOnEsc", "hideOnClickOutside", "preventBodyScroll", "unstable_initialFocusRef", "unstable_finalFocusRef", "unstable_orphan", "unstable_autoFocusOnShow", "unstable_autoFocusOnHide"];
export declare const DIALOG_BACKDROP_KEYS: readonly ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "modal", "unstable_disclosureRef", "setModal"];
export declare const DIALOG_DISCLOSURE_KEYS: readonly ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "modal", "unstable_disclosureRef", "setModal"];

View File

@@ -0,0 +1,2 @@
import * as React from "react";
export declare const DialogBackdropContext: React.Context<string | undefined>;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useDisableHoverOutside(portalRef: React.RefObject<HTMLElement>, nestedDialogs: Array<React.RefObject<HTMLElement>>, options: DialogOptions): void;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useDisclosureRef(dialogRef: React.RefObject<HTMLElement>, options: DialogOptions): React.MutableRefObject<HTMLElement | null>;

View File

@@ -0,0 +1,2 @@
import * as React from "react";
export declare function useEventListenerOutside(containerRef: React.RefObject<HTMLElement>, disclosureRef: React.RefObject<HTMLElement>, nestedDialogs: Array<React.RefObject<HTMLElement>>, eventType: string, listener?: (e: Event) => void, shouldListen?: boolean, capture?: boolean): void;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useFocusOnBlur(dialogRef: React.RefObject<HTMLElement>, options: DialogOptions): (event: React.FocusEvent<HTMLElement>) => void;

View File

@@ -0,0 +1,7 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
/**
* When the focused child gets removed from the DOM, we make sure to move focus
* to the dialog.
*/
export declare function useFocusOnChildUnmount(dialogRef: React.RefObject<HTMLElement>, options: DialogOptions): void;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useFocusOnHide(dialogRef: React.RefObject<HTMLElement>, disclosureRef: React.RefObject<HTMLElement>, options: DialogOptions): void;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useFocusOnShow(dialogRef: React.RefObject<HTMLElement>, nestedDialogs: Array<React.RefObject<HTMLElement>>, options: DialogOptions): void;

View File

@@ -0,0 +1,4 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function isFocusTrap(element: Element): boolean;
export declare function useFocusTrap(dialogRef: React.RefObject<HTMLElement>, visibleModals: Array<React.RefObject<HTMLElement>>, options: DialogOptions): void;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function useHideOnClickOutside(dialogRef: React.RefObject<HTMLElement>, disclosureRef: React.RefObject<HTMLElement>, nestedDialogs: Array<React.RefObject<HTMLElement>>, options: DialogOptions): void;

View File

@@ -0,0 +1,9 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
declare type DialogRef = React.RefObject<HTMLElement>;
export declare function useNestedDialogs(dialogRef: DialogRef, options: DialogOptions): {
dialogs: DialogRef[];
visibleModals: DialogRef[];
wrap: (element: React.ReactNode) => JSX.Element;
};
export {};

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function usePortalRef(dialogRef: React.RefObject<HTMLElement>, options: DialogOptions): React.MutableRefObject<HTMLElement | null>;

View File

@@ -0,0 +1,3 @@
import * as React from "react";
import { DialogOptions } from "../Dialog";
export declare function usePreventBodyScroll(targetRef: React.RefObject<HTMLElement>, options: DialogOptions): void;

4
node_modules/reakit/ts/Dialog/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export * from "./Dialog";
export * from "./DialogBackdrop";
export * from "./DialogDisclosure";
export * from "./DialogState";