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

4339
node_modules/downshift/dist/downshift.cjs.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

4326
node_modules/downshift/dist/downshift.esm.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

4287
node_modules/downshift/dist/downshift.native.cjs.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

5612
node_modules/downshift/dist/downshift.umd.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/downshift/dist/downshift.umd.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/downshift/dist/downshift.umd.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/downshift/dist/downshift.umd.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/downshift/dist/src/hooks/reducer.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function downshiftCommonReducer(state: any, action: any, stateChangeTypes: any): any;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1 @@
export default function downshiftSelectReducer(state: any, action: any): any;

View File

@@ -0,0 +1,23 @@
export const MenuKeyDownArrowDown: any;
export const MenuKeyDownArrowUp: any;
export const MenuKeyDownEscape: any;
export const MenuKeyDownHome: any;
export const MenuKeyDownEnd: any;
export const MenuKeyDownEnter: any;
export const MenuKeyDownSpaceButton: any;
export const MenuKeyDownCharacter: any;
export const MenuBlur: any;
export const MenuMouseLeave: any;
export const ItemMouseMove: any;
export const ItemClick: any;
export const ToggleButtonClick: any;
export const ToggleButtonKeyDownArrowDown: any;
export const ToggleButtonKeyDownArrowUp: any;
export const ToggleButtonKeyDownCharacter: any;
export const FunctionToggleMenu: any;
export const FunctionOpenMenu: any;
export const FunctionCloseMenu: any;
export const FunctionSetHighlightedIndex: any;
export const FunctionSelectItem: any;
export const FunctionSetInputValue: any;
export const FunctionReset: any;

View File

@@ -0,0 +1,7 @@
export interface GetItemIndexByCharacterKeyOptions<Item> {
keysSoFar: string;
highlightedIndex: number;
items: Item[];
itemToString(item: Item | null): string;
getItemNodeFromIndex(index: number): HTMLElement | undefined;
}

View File

@@ -0,0 +1,23 @@
import { A11yStatusMessageOptions } from '../../types';
import { GetItemIndexByCharacterKeyOptions } from './types';
export declare function getItemIndexByCharacterKey<Item>({ keysSoFar, highlightedIndex, items, itemToString, getItemNodeFromIndex, }: GetItemIndexByCharacterKeyOptions<Item>): number;
/**
* Default implementation for status message. Only added when menu is open.
* Will specift if there are results in the list, and if so, how many,
* and what keys are relevant.
*
* @param {Object} param the downshift state and other relevant properties
* @return {String} the a11y status message
*/
declare function getA11yStatusMessage<Item>({ isOpen, resultCount, previousResultCount, }: A11yStatusMessageOptions<Item>): string;
export declare const defaultProps: {
getA11yStatusMessage: typeof getA11yStatusMessage;
itemToString: (item: any) => string;
stateReducer: (s: Object, a: Object) => Object;
getA11ySelectionMessage: (selectionParameters: Object) => string;
scrollIntoView: typeof import("../../utils").scrollIntoView;
circularNavigation: boolean;
environment: {};
};
export declare let validatePropTypes: (options: unknown, caller: Function) => void;
export {};

112
node_modules/downshift/dist/src/hooks/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,112 @@
export let useControlPropsValidator: typeof noop;
export function useScrollIntoView({ highlightedIndex, isOpen, itemRefs, getItemNodeFromIndex, menuElement, scrollIntoView, }: {
highlightedIndex: any;
isOpen: any;
itemRefs: any;
getItemNodeFromIndex: any;
menuElement: any;
scrollIntoView: any;
}): import("react").MutableRefObject<boolean>;
export function useA11yMessageSetter(getA11yMessage: any, dependencyArray: any, { isInitialMount, highlightedIndex, items, environment, ...rest }: {
[x: string]: any;
isInitialMount: any;
highlightedIndex: any;
items: any;
environment: any;
}): void;
export function useGetterPropsCalledChecker(): typeof noop;
/**
* Reuse the movement tracking of mouse and touch events.
*
* @param {boolean} isOpen Whether the dropdown is open or not.
* @param {Array<Object>} downshiftElementRefs Downshift element refs to track movement (toggleButton, menu etc.)
* @param {Object} environment Environment where component/hook exists.
* @param {Function} handleBlur Handler on blur from mouse or touch.
* @returns {Object} Ref containing whether mouseDown or touchMove event is happening
*/
export function useMouseAndTouchTracker(isOpen: boolean, downshiftElementRefs: Array<Object>, environment: Object, handleBlur: Function): Object;
export function getHighlightedIndexOnOpen(props: any, state: any, offset: any, getItemNodeFromIndex: any): any;
export function getInitialState(props: any): {
highlightedIndex: any;
isOpen: any;
selectedItem: any;
inputValue: any;
};
export function getInitialValue(props: any, propKey: any, defaultStateValues?: {
highlightedIndex: number;
isOpen: boolean;
selectedItem: null;
inputValue: string;
}): any;
export function getDefaultValue(props: any, propKey: any, defaultStateValues?: {
highlightedIndex: number;
isOpen: boolean;
selectedItem: null;
inputValue: string;
}): any;
export namespace defaultProps {
export { itemToString };
export { stateReducer };
export { getA11ySelectionMessage };
export { scrollIntoView };
export const circularNavigation: boolean;
export const environment: {};
}
/**
* Wraps the useEnhancedReducer and applies the controlled prop values before
* returning the new state.
*
* @param {Function} reducer Reducer function from downshift.
* @param {Object} initialState Initial state of the hook.
* @param {Object} props The hook props.
* @returns {Array} An array with the state and an action dispatcher.
*/
export function useControlledReducer(reducer: Function, initialState: Object, props: Object): any[];
/**
* Computes the controlled state using a the previous state, props,
* two reducers, one from downshift and an optional one from the user.
* Also calls the onChange handlers for state values that have changed.
*
* @param {Function} reducer Reducer function from downshift.
* @param {Object} initialState Initial state of the hook.
* @param {Object} props The hook props.
* @returns {Array} An array with the state and an action dispatcher.
*/
export function useEnhancedReducer(reducer: Function, initialState: Object, props: Object): any[];
export function useLatestRef(val: any): import("react").MutableRefObject<any>;
export function capitalizeString(string: any): string;
export function isAcceptedCharacterKey(key: any): boolean;
export function getItemIndex(index: any, item: any, items: any): any;
export function useElementIds({ id, labelId, menuId, getItemId, toggleButtonId, inputId, }: {
id?: string | undefined;
labelId: any;
menuId: any;
getItemId: any;
toggleButtonId: any;
inputId: any;
}): {
labelId: any;
menuId: any;
getItemId: any;
toggleButtonId: any;
inputId: any;
};
import { noop } from "../utils";
declare function itemToString(item: any): string;
/**
* Default state reducer that returns the changes.
*
* @param {Object} s state.
* @param {Object} a action with changes.
* @returns {Object} changes.
*/
declare function stateReducer(s: Object, a: Object): Object;
/**
* Returns a message to be added to aria-live region when item is selected.
*
* @param {Object} selectionParameters Parameters required to build the message.
* @returns {string} The a11y message.
*/
declare function getA11ySelectionMessage(selectionParameters: Object): string;
import { scrollIntoView } from "../utils";
export {};

2
node_modules/downshift/dist/src/is.macro.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _exports: any;
export = _exports;

View File

@@ -0,0 +1,2 @@
declare const _exports: any;
export = _exports;

6
node_modules/downshift/dist/src/set-a11y-status.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export default setStatus;
/**
* @param {String} status the status message
* @param {Object} documentProp document passed by the user.
*/
declare function setStatus(status: string, documentProp: Object): void;

10
node_modules/downshift/dist/src/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
export interface A11yStatusMessageOptions<Item> {
highlightedIndex: number | null;
inputValue: string;
isOpen: boolean;
itemToString: (item: Item | null) => string;
previousResultCount: number;
resultCount: number;
highlightedItem: Item;
selectedItem: Item | null;
}

156
node_modules/downshift/dist/src/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,156 @@
/**
* Accepts a parameter and returns it if it's a function
* or a noop function if it's not. This allows us to
* accept a callback, but not worry about it if it's not
* passed.
* @param {Function} cb the callback
* @return {Function} a function
*/
export function cbToCb(cb: Function): Function;
/**
* This is intended to be used to compose event handlers.
* They are executed in order until one of them sets
* `event.preventDownshiftDefault = true`.
* @param {...Function} fns the event handler functions
* @return {Function} the event handler to add to an element
*/
export function callAllEventHandlers(...fns: Function[]): Function;
export function handleRefs(...refs: any[]): (node: any) => void;
/**
* Simple debounce implementation. Will call the given
* function once after the time given has passed since
* it was last called.
* @param {Function} fn the function to call after the time
* @param {Number} time the time to wait
* @return {Function} the debounced function
*/
export function debounce(fn: Function, time: number): Function;
/**
* Scroll node into view if necessary
* @param {HTMLElement} node the element that should scroll into view
* @param {HTMLElement} menuNode the menu element of the component
*/
export function scrollIntoView(node: HTMLElement, menuNode: HTMLElement): void;
/**
* This generates a unique ID for an instance of Downshift
* @return {String} the unique ID
*/
export function generateId(): string;
/**
* Default implementation for status message. Only added when menu is open.
* Will specify if there are results in the list, and if so, how many,
* and what keys are relevant.
*
* @param {Object} param the downshift state and other relevant properties
* @return {String} the a11y status message
*/
export function getA11yStatusMessage({ isOpen, resultCount, previousResultCount }: Object): string;
/**
* Takes an argument and if it's an array, returns the first item in the array
* otherwise returns the argument
* @param {*} arg the maybe-array
* @param {*} defaultValue the value if arg is falsey not defined
* @return {*} the arg or it's first item
*/
export function unwrapArray(arg: any, defaultValue: any): any;
/**
* @param {Object} element (P)react element
* @return {Boolean} whether it's a DOM element
*/
export function isDOMElement(element: Object): boolean;
/**
* @param {Object} element (P)react element
* @return {Object} the props
*/
export function getElementProps(element: Object): Object;
export function noop(): void;
/**
* Throws a helpful error message for required properties. Useful
* to be used as a default in destructuring or object params.
* @param {String} fnName the function name
* @param {String} propName the prop name
*/
export function requiredProp(fnName: string, propName: string): void;
/**
* This is only used in tests
* @param {Number} num the number to set the idCounter to
*/
export function setIdCounter(num: number): void;
/**
* Resets idCounter to 0. Used for SSR.
*/
export function resetIdCounter(): void;
/**
* @param {Object} state the state object
* @return {Object} state that is relevant to downshift
*/
export function pickState(state?: Object): Object;
/**
* Simple check if the value passed is object literal
* @param {*} obj any things
* @return {Boolean} whether it's object literal
*/
export function isPlainObject(obj: any): boolean;
/**
* Normalizes the 'key' property of a KeyboardEvent in IE/Edge
* @param {Object} event a keyboardEvent object
* @return {String} keyboard key
*/
export function normalizeArrowKey(event: Object): string;
/**
* Returns the new index in the list, in a circular way. If next value is out of bonds from the total,
* it will wrap to either 0 or itemCount - 1.
*
* @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
* @param {number} baseIndex The initial position to move from.
* @param {number} itemCount The total number of items.
* @param {Function} getItemNodeFromIndex Used to check if item is disabled.
* @param {boolean} circular Specify if navigation is circular. Default is true.
* @returns {number} The new index after the move.
*/
export function getNextWrappingIndex(moveAmount: number, baseIndex: number, itemCount: number, getItemNodeFromIndex: Function, circular?: boolean): number;
/**
* Returns the next index in the list of an item that is not disabled.
*
* @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
* @param {number} baseIndex The initial position to move from.
* @param {number} itemCount The total number of items.
* @param {Function} getItemNodeFromIndex Used to check if item is disabled.
* @param {boolean} circular Specify if navigation is circular. Default is true.
* @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.
*/
export function getNextNonDisabledIndex(moveAmount: number, baseIndex: number, itemCount: number, getItemNodeFromIndex: Function, circular: boolean): number;
/**
* Checks if event target is within the downshift elements.
*
* @param {EventTarget} target Target to check.
* @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).
* @param {Window} environment The window context where downshift renders.
* @param {boolean} checkActiveElement Whether to also check activeElement.
*
* @returns {boolean} Whether or not the target is within downshift elements.
*/
export function targetWithinDownshift(target: EventTarget, downshiftElements: HTMLElement[], environment: Window, checkActiveElement?: boolean): boolean;
/**
* This will perform a shallow merge of the given state object
* with the state coming from props
* (for the controlled component scenario)
* This is used in state updater functions so they're referencing
* the right state regardless of where it comes from.
*
* @param {Object} state The state of the component/hook.
* @param {Object} props The props that may contain controlled values.
* @returns {Object} The merged controlled state.
*/
export function getState(state: Object, props: Object): Object;
/**
* This determines whether a prop is a "controlled prop" meaning it is
* state which is controlled by the outside of this component rather
* than within this component.
*
* @param {Object} props The props that may contain controlled values.
* @param {String} key the key to check
* @return {Boolean} whether it is a controlled controlled prop
*/
export function isControlledProp(props: Object, key: string): boolean;
export function validateControlledUnchanged(): void;

15
node_modules/downshift/dist/test/basic.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import * as React from 'react';
import { StateChangeOptions } from '../';
declare type Item = string;
interface Props {
}
interface State {
items: Array<Item>;
}
export default class App extends React.Component<Props, State> {
state: State;
onChange: (selectedItem: Item | null) => void;
onUserAction: (changes: StateChangeOptions<Item>) => void;
render(): JSX.Element;
}
export {};

13
node_modules/downshift/dist/test/custom.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import * as React from 'react';
declare type Item = string;
interface Props {
}
interface State {
items: Array<Item>;
}
export default class App extends React.Component<Props, State> {
state: State;
onChange: (selectedItem: Item) => void;
render(): JSX.Element;
}
export {};

1
node_modules/downshift/dist/test/setup.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
import '@testing-library/jest-dom/extend-expect';