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>
76 lines
2.4 KiB
TypeScript
76 lines
2.4 KiB
TypeScript
import * as React from "react";
|
|
import { SealedInitialState } from "reakit-utils/useSealedState";
|
|
import { DialogState, DialogActions, DialogInitialState, DialogStateReturn } from "../Dialog/DialogState";
|
|
declare type Placement = "auto-start" | "auto" | "auto-end" | "top-start" | "top" | "top-end" | "right-start" | "right" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left" | "left-start";
|
|
export declare type PopoverState = DialogState & {
|
|
/**
|
|
* The reference element.
|
|
*/
|
|
unstable_referenceRef: React.RefObject<HTMLElement | null>;
|
|
/**
|
|
* The popover element.
|
|
* @private
|
|
*/
|
|
unstable_popoverRef: React.RefObject<HTMLElement | null>;
|
|
/**
|
|
* The arrow element.
|
|
* @private
|
|
*/
|
|
unstable_arrowRef: React.RefObject<HTMLElement | null>;
|
|
/**
|
|
* Popover styles.
|
|
* @private
|
|
*/
|
|
unstable_popoverStyles: React.CSSProperties;
|
|
/**
|
|
* Arrow styles.
|
|
* @private
|
|
*/
|
|
unstable_arrowStyles: React.CSSProperties;
|
|
/**
|
|
* `placement` passed to the hook.
|
|
* @private
|
|
*/
|
|
unstable_originalPlacement: Placement;
|
|
/**
|
|
* @private
|
|
*/
|
|
unstable_update: () => boolean;
|
|
/**
|
|
* Actual `placement`.
|
|
*/
|
|
placement: Placement;
|
|
};
|
|
export declare type PopoverActions = DialogActions & {
|
|
/**
|
|
* Change the `placement` state.
|
|
*/
|
|
place: React.Dispatch<React.SetStateAction<Placement>>;
|
|
};
|
|
export declare type PopoverInitialState = DialogInitialState & Partial<Pick<PopoverState, "placement">> & {
|
|
/**
|
|
* Whether or not the popover should have `position` set to `fixed`.
|
|
*/
|
|
unstable_fixed?: boolean;
|
|
/**
|
|
* Flip the popover's placement when it starts to overlap its reference
|
|
* element.
|
|
*/
|
|
unstable_flip?: boolean;
|
|
/**
|
|
* Offset between the reference and the popover: [main axis, alt axis]. Should not be combined with `gutter`.
|
|
*/
|
|
unstable_offset?: [number | string, number | string];
|
|
/**
|
|
* Offset between the reference and the popover on the main axis. Should not be combined with `unstable_offset`.
|
|
*/
|
|
gutter?: number;
|
|
/**
|
|
* Prevents popover from being positioned outside the boundary.
|
|
*/
|
|
unstable_preventOverflow?: boolean;
|
|
};
|
|
export declare type PopoverStateReturn = DialogStateReturn & PopoverState & PopoverActions;
|
|
export declare function usePopoverState(initialState?: SealedInitialState<PopoverInitialState>): PopoverStateReturn;
|
|
export {};
|