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

27
node_modules/reakit/ts/Composite/Composite.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import * as React from "react";
import { TabbableOptions, TabbableHTMLProps } from "../Tabbable";
import { CompositeStateReturn } from "./CompositeState";
export declare type CompositeOptions = TabbableOptions & Pick<Partial<CompositeStateReturn>, "baseId" | "unstable_virtual" | "currentId" | "orientation" | "unstable_moves" | "wrap" | "groups"> & Pick<CompositeStateReturn, "items" | "setCurrentId" | "first" | "last" | "move">;
export declare type CompositeHTMLProps = TabbableHTMLProps;
export declare type CompositeProps = CompositeOptions & CompositeHTMLProps;
export declare const useComposite: {
(options?: CompositeOptions | undefined, htmlProps?: TabbableHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): TabbableHTMLProps;
unstable_propsAreEqual: (prev: import("../Role/Role").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & Pick<Partial<CompositeStateReturn>, "wrap" | "orientation" | "baseId" | "currentId" | "unstable_virtual" | "groups" | "unstable_moves"> & Pick<CompositeStateReturn, "move" | "first" | "last" | "items" | "setCurrentId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}, next: import("../Role/Role").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & Pick<Partial<CompositeStateReturn>, "wrap" | "orientation" | "baseId" | "currentId" | "unstable_virtual" | "groups" | "unstable_moves"> & Pick<CompositeStateReturn, "move" | "first" | "last" | "items" | "setCurrentId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: CompositeOptions, htmlProps: TabbableHTMLProps) => CompositeOptions;
};
export declare const Composite: import("reakit-system/ts/createComponent").Component<"div", CompositeOptions>;

22
node_modules/reakit/ts/Composite/CompositeGroup.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import * as React from "react";
import { GroupOptions, GroupHTMLProps } from "../Group/Group";
import { unstable_IdOptions, unstable_IdHTMLProps } from "../Id/Id";
import { CompositeStateReturn } from "./CompositeState";
export declare type CompositeGroupOptions = GroupOptions & unstable_IdOptions & Pick<CompositeStateReturn, "registerGroup" | "unregisterGroup"> & Pick<Partial<CompositeStateReturn>, "currentId" | "unstable_moves" | "items">;
export declare type CompositeGroupHTMLProps = GroupHTMLProps & unstable_IdHTMLProps;
export declare type CompositeGroupProps = CompositeGroupOptions & CompositeGroupHTMLProps;
export declare const useCompositeGroup: {
(options?: CompositeGroupOptions | undefined, htmlProps?: import("..").RoleHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").RoleHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<CompositeStateReturn, "registerGroup" | "unregisterGroup"> & Pick<Partial<CompositeStateReturn>, "currentId" | "items" | "unstable_moves"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}, next: import("..").RoleOptions & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<CompositeStateReturn, "registerGroup" | "unregisterGroup"> & Pick<Partial<CompositeStateReturn>, "currentId" | "items" | "unstable_moves"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: CompositeGroupOptions, htmlProps: import("..").RoleHTMLProps) => CompositeGroupOptions;
};
export declare const CompositeGroup: import("reakit-system/ts/createComponent").Component<"div", CompositeGroupOptions>;

38
node_modules/reakit/ts/Composite/CompositeItem.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import * as React from "react";
import { ClickableOptions, ClickableHTMLProps } from "../Clickable/Clickable";
import { unstable_IdOptions, unstable_IdHTMLProps } from "../Id/Id";
import { CompositeStateReturn } from "./CompositeState";
export declare type CompositeItemOptions = ClickableOptions & unstable_IdOptions & Pick<Partial<CompositeStateReturn>, "unstable_virtual" | "baseId" | "orientation" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<CompositeStateReturn, "items" | "currentId" | "registerItem" | "unregisterItem" | "setCurrentId" | "next" | "previous" | "up" | "down" | "first" | "last">;
export declare type CompositeItemHTMLProps = ClickableHTMLProps & unstable_IdHTMLProps;
export declare type CompositeItemProps = CompositeItemOptions & CompositeItemHTMLProps;
export declare const useCompositeItem: {
(options?: CompositeItemOptions | undefined, htmlProps?: import("..").TabbableHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").TabbableHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: CompositeItemOptions, htmlProps: import("..").TabbableHTMLProps) => CompositeItemOptions;
};
export declare const CompositeItem: import("reakit-system/ts/createComponent").Component<"button", CompositeItemOptions>;

View File

@@ -0,0 +1,17 @@
import * as React from "react";
import { RoleOptions, RoleHTMLProps } from "../Role/Role";
import { CompositeStateReturn } from "./CompositeState";
export declare type unstable_CompositeItemWidgetOptions = RoleOptions & Pick<Partial<CompositeStateReturn>, "wrap"> & Pick<CompositeStateReturn, "unstable_hasActiveWidget" | "unstable_setHasActiveWidget" | "currentId">;
export declare type unstable_CompositeItemWidgetHTMLProps = RoleHTMLProps;
export declare type unstable_CompositeItemWidgetProps = unstable_CompositeItemWidgetOptions & unstable_CompositeItemWidgetHTMLProps;
export declare const unstable_useCompositeItemWidget: {
(options?: unstable_CompositeItemWidgetOptions | undefined, htmlProps?: RoleHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): RoleHTMLProps;
unstable_propsAreEqual: (prev: RoleOptions & Pick<Partial<CompositeStateReturn>, "wrap"> & Pick<CompositeStateReturn, "currentId" | "unstable_hasActiveWidget" | "unstable_setHasActiveWidget"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}, next: RoleOptions & Pick<Partial<CompositeStateReturn>, "wrap"> & Pick<CompositeStateReturn, "currentId" | "unstable_hasActiveWidget" | "unstable_setHasActiveWidget"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_CompositeItemWidgetOptions, htmlProps: RoleHTMLProps) => unstable_CompositeItemWidgetOptions;
};
export declare const unstable_CompositeItemWidget: import("reakit-system/ts/createComponent").Component<"div", unstable_CompositeItemWidgetOptions>;

287
node_modules/reakit/ts/Composite/CompositeState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,287 @@
import * as React from "react";
import { SealedInitialState } from "reakit-utils/useSealedState";
import { unstable_IdState, unstable_IdActions, unstable_IdInitialState, unstable_IdStateReturn } from "../Id/IdState";
import { Item, Group, Orientation } from "./__utils/types";
export declare function useCompositeState(initialState?: SealedInitialState<CompositeInitialState>): CompositeStateReturn;
export declare type CompositeState = unstable_IdState & {
/**
* If enabled, the composite element will act as an
* [aria-activedescendant](https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_focus_activedescendant)
* container instead of
* [roving tabindex](https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex).
* DOM focus will remain on the composite while its items receive virtual focus.
* @default false
*/
unstable_virtual: boolean;
/**
* Determines how `next` and `previous` functions will behave. If `rtl` is
* set to `true`, they will be inverted. This only affects the composite
* widget behavior. You still need to set `dir="rtl"` on HTML/CSS.
* @default false
*/
rtl: boolean;
/**
* Defines the orientation of the composite widget. If the composite has a
* single row or column (one-dimensional), the `orientation` value determines
* which arrow keys can be used to move focus:
* - `undefined`: all arrow keys work.
* - `horizontal`: only left and right arrow keys work.
* - `vertical`: only up and down arrow keys work.
*
* It doesn't have any effect on two-dimensional composites.
* @default undefined
*/
orientation?: Orientation;
/**
* Lists all the composite items with their `id`, DOM `ref`, `disabled` state
* and `groupId` if any. This state is automatically updated when
* `registerItem` and `unregisterItem` are called.
* @example
* const composite = useCompositeState();
* composite.items.forEach((item) => {
* const { id, ref, disabled, groupId } = item;
* ...
* });
*/
items: Item[];
/**
* Lists all the composite groups with their `id` and DOM `ref`. This state
* is automatically updated when `registerGroup` and `unregisterGroup` are
* called.
* @example
* const composite = useCompositeState();
* composite.groups.forEach((group) => {
* const { id, ref } = group;
* ...
* });
*/
groups: Group[];
/**
* The current focused item `id`.
* - `undefined` will automatically focus the first enabled composite item.
* - `null` will focus the base composite element and users will be able to
* navigate out of it using arrow keys.
* - If `currentId` is initially set to `null`, the base composite element
* itself will have focus and users will be able to navigate to it using
* arrow keys.
* @default undefined
* @example
* // First enabled item has initial focus
* useCompositeState();
* // Base composite element has initial focus
* useCompositeState({ currentId: null });
* // Specific composite item element has initial focus
* useCompositeState({ currentId: "item-id" });
*/
currentId?: string | null;
/**
* On one-dimensional composites:
* - `true` loops from the last item to the first item and vice-versa.
* - `horizontal` loops only if `orientation` is `horizontal` or not set.
* - `vertical` loops only if `orientation` is `vertical` or not set.
* - If `currentId` is initially set to `null`, the composite element will
* be focused in between the last and first items.
*
* On two-dimensional composites:
* - `true` loops from the last row/column item to the first item in the
* same row/column and vice-versa. If it's the last item in the last row, it
* moves to the first item in the first row and vice-versa.
* - `horizontal` loops only from the last row item to the first item in
* the same row.
* - `vertical` loops only from the last column item to the first item in
* the column row.
* - If `currentId` is initially set to `null`, vertical loop will have no
* effect as moving down from the last row or up from the first row will
* focus the composite element.
* - If `wrap` matches the value of `loop`, it'll wrap between the last
* item in the last row or column and the first item in the first row or
* column and vice-versa.
* @default false
*/
loop: boolean | Orientation;
/**
* **Has effect only on two-dimensional composites**. If enabled, moving to
* the next item from the last one in a row or column will focus the first
* item in the next row or column and vice-versa.
* - `true` wraps between rows and columns.
* - `horizontal` wraps only between rows.
* - `vertical` wraps only between columns.
* - If `loop` matches the value of `wrap`, it'll wrap between the last
* item in the last row or column and the first item in the first row or
* column and vice-versa.
* @default false
*/
wrap: boolean | Orientation;
/**
* **Has effect only on two-dimensional composites**. If enabled, moving up
* or down when there's no next item or the next item is disabled will shift
* to the item right before it.
* @default false
*/
shift: boolean;
/**
* Stores the number of moves that have been performed by calling `move`,
* `next`, `previous`, `up`, `down`, `first` or `last`.
* @default 0
*/
unstable_moves: number;
/**
* @default false
* @private
*/
unstable_hasActiveWidget: boolean;
/**
* @default false
* @private
*/
unstable_includesBaseElement: boolean;
};
export declare type CompositeActions = unstable_IdActions & {
/**
* Registers a composite item.
* @example
* const ref = React.useRef();
* const composite = useCompositeState();
* React.useEffect(() => {
* composite.registerItem({ ref, id: "id" });
* return () => composite.unregisterItem("id");
* }, []);
*/
registerItem: (item: Item) => void;
/**
* Unregisters a composite item.
* @example
* const ref = React.useRef();
* const composite = useCompositeState();
* React.useEffect(() => {
* composite.registerItem({ ref, id: "id" });
* return () => composite.unregisterItem("id");
* }, []);
*/
unregisterItem: (id: string) => void;
/**
* Registers a composite group.
* @example
* const ref = React.useRef();
* const composite = useCompositeState();
* React.useEffect(() => {
* composite.registerGroup({ ref, id: "id" });
* return () => composite.unregisterGroup("id");
* }, []);
*/
registerGroup: (group: Group) => void;
/**
* Unregisters a composite group.
* @example
* const ref = React.useRef();
* const composite = useCompositeState();
* React.useEffect(() => {
* composite.registerGroup({ ref, id: "id" });
* return () => composite.unregisterGroup("id");
* }, []);
*/
unregisterGroup: (id: string) => void;
/**
* Moves focus to a given item ID.
* @example
* const composite = useCompositeState();
* composite.move("item-2"); // focus item 2
*/
move: (id: string | null) => void;
/**
* Moves focus to the next item.
*/
next: (unstable_allTheWay?: boolean) => void;
/**
* Moves focus to the previous item.
*/
previous: (unstable_allTheWay?: boolean) => void;
/**
* Moves focus to the item above.
*/
up: (unstable_allTheWay?: boolean) => void;
/**
* Moves focus to the item below.
*/
down: (unstable_allTheWay?: boolean) => void;
/**
* Moves focus to the first item.
*/
first: () => void;
/**
* Moves focus to the last item.
*/
last: () => void;
/**
* Sorts the `composite.items` based on the items position in the DOM. This
* is especially useful after modifying the composite items order in the DOM.
* Most of the time, though, you don't need to manually call this function as
* the re-ordering happens automatically.
*/
sort: () => void;
/**
* Sets `virtual`.
*/
unstable_setVirtual: React.Dispatch<React.SetStateAction<CompositeState["unstable_virtual"]>>;
/**
* Sets `rtl`.
* @example
* const composite = useCompositeState({ rtl: true });
* composite.setRTL(false);
*/
setRTL: React.Dispatch<React.SetStateAction<CompositeState["rtl"]>>;
/**
* Sets `orientation`.
*/
setOrientation: React.Dispatch<React.SetStateAction<CompositeState["orientation"]>>;
/**
* Sets `currentId`. This is different from `composite.move` as this only
* updates the `currentId` state without moving focus. When the composite
* widget gets focused by the user, the item referred by the `currentId`
* state will get focus.
* @example
* const composite = useCompositeState({ currentId: "item-1" });
* // Updates `composite.currentId` to `item-2`
* composite.setCurrentId("item-2");
*/
setCurrentId: React.Dispatch<React.SetStateAction<CompositeState["currentId"]>>;
/**
* Sets `loop`.
*/
setLoop: React.Dispatch<React.SetStateAction<CompositeState["loop"]>>;
/**
* Sets `wrap`.
*/
setWrap: React.Dispatch<React.SetStateAction<CompositeState["wrap"]>>;
/**
* Sets `shift`.
*/
setShift: React.Dispatch<React.SetStateAction<CompositeState["shift"]>>;
/**
* Resets to initial state.
* @example
* // On initial render, currentId will be item-1 and loop will be true
* const composite = useCompositeState({
* currentId: "item-1",
* loop: true,
* });
* // On next render, currentId will be item-2 and loop will be false
* composite.setCurrentId("item-2");
* composite.setLoop(false);
* // On next render, currentId will be item-1 and loop will be true
* composite.reset();
*/
reset: () => void;
/**
* Sets `includesBaseElement`.
* @private
*/
unstable_setIncludesBaseElement: React.Dispatch<React.SetStateAction<CompositeState["unstable_includesBaseElement"]>>;
/**
* Sets `hasActiveWidget`.
* @private
*/
unstable_setHasActiveWidget: React.Dispatch<React.SetStateAction<CompositeState["unstable_hasActiveWidget"]>>;
};
export declare type CompositeInitialState = unstable_IdInitialState & Partial<Pick<CompositeState, "unstable_virtual" | "rtl" | "orientation" | "currentId" | "loop" | "wrap" | "shift" | "unstable_includesBaseElement">>;
export declare type CompositeStateReturn = unstable_IdStateReturn & CompositeState & CompositeActions;

4
node_modules/reakit/ts/Composite/__keys.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export declare const COMPOSITE_KEYS: readonly ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
export declare const COMPOSITE_GROUP_KEYS: readonly ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
export declare const COMPOSITE_ITEM_KEYS: readonly ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
export declare const COMPOSITE_ITEM_WIDGET_KEYS: readonly ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];

View File

@@ -0,0 +1 @@
export declare function addItemAtIndex<T extends any[]>(array: T, item: T[number], index: number): any[];

View File

@@ -0,0 +1,5 @@
import { Item } from "./types";
/**
* Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]]
*/
export declare function fillGroups(groups: Item[][], currentId?: string | null, shift?: boolean): Item[][];

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function findDOMIndex(items: Item[], item: Item): number;

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function findEnabledItemById(items: Item[], id?: string | null): Item | undefined;

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function findFirstEnabledItem(items: Item[], excludeId?: string): Item | undefined;

View File

@@ -0,0 +1 @@
export declare function flatten<T>(grid: T[][]): T[];

View File

@@ -0,0 +1,2 @@
import { CompositeState } from "../CompositeState";
export declare function getCurrentId(options: Pick<CompositeState, "currentId" | "items">, passedId?: CompositeState["currentId"]): string | null | undefined;

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function getItemsInGroup(items: Item[], groupId?: string): Item[];

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function getMaxLength(rows: Item[][]): number;

View File

@@ -0,0 +1,2 @@
import { Orientation } from "./types";
export declare function getOppositeOrientation(orientation?: Orientation): "horizontal" | "vertical" | undefined;

View File

@@ -0,0 +1,2 @@
import { Item } from "./types";
export declare function groupItems(items: Item[]): Item[][];

View File

@@ -0,0 +1 @@
export declare function isElementPreceding(element1: Element, element2: Element): boolean;

View File

@@ -0,0 +1,7 @@
import { Item } from "./types";
export declare function placeItemsAfter(items: Item[], id: string, shouldInsertNullItem?: boolean): (Item | {
id: null;
ref: {
current: null;
};
})[];

View File

@@ -0,0 +1 @@
export declare function reverse<T>(array: T[]): T[];

View File

@@ -0,0 +1 @@
export declare function setTextFieldValue(element: HTMLElement, value: string): void;

View File

@@ -0,0 +1,6 @@
import * as React from "react";
declare type Item = {
ref: React.RefObject<HTMLElement | null>;
};
export declare function sortBasedOnDOMPosition<T extends Item>(items: T[]): T[];
export {};

12
node_modules/reakit/ts/Composite/__utils/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/// <reference types="react" />
export declare type Group = {
id: string;
ref: React.RefObject<HTMLElement>;
};
export declare type Item = {
id: string | null;
ref: React.RefObject<HTMLElement>;
groupId?: Group["id"];
disabled?: boolean;
};
export declare type Orientation = "horizontal" | "vertical";

View File

@@ -0,0 +1,4 @@
import { Item } from "./types";
declare type SetItems = (items: Item[]) => void;
export declare function useSortBasedOnDOMPosition(items: Item[], setItems: SetItems): void;
export {};

View File

@@ -0,0 +1,7 @@
declare type UserFocusElement = HTMLElement & {
userFocus?: boolean;
};
export declare function userFocus(element: UserFocusElement): void;
export declare function hasUserFocus(element: UserFocusElement): boolean;
export declare function setUserFocus(element: UserFocusElement, value: boolean): void;
export {};

View File

@@ -0,0 +1,5 @@
import { Item } from "./types";
/**
* Turns [row1, row1, row2, row2] into [row1, row2, row1, row2]
*/
export declare function verticalizeItems(items: Item[]): Item[];

9
node_modules/reakit/ts/Composite/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export * from "./Composite";
export * from "./CompositeGroup";
export * from "./CompositeItem";
export * from "./CompositeItemWidget";
export * from "./CompositeState";
export { useCompositeState as unstable_useCompositeState } from "./CompositeState";
export { Composite as unstable_Composite } from "./Composite";
export { CompositeGroup as unstable_CompositeGroup } from "./CompositeGroup";
export { CompositeItem as unstable_CompositeItem } from "./CompositeItem";