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

8
node_modules/valtio/utils/addComputed.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* addComputed (DEPRECATED)
*
* @deprecated Please consider using `derive` or `proxyWithComputed` instead.
*/
export declare function addComputed_DEPRECATED<T extends object, U extends object>(proxyObject: T, computedFns_FAKE: {
[K in keyof U]: (snap_FAKE: T) => U[K];
}, targetObject?: any): any;

72
node_modules/valtio/utils/derive.d.ts generated vendored Normal file
View File

@@ -0,0 +1,72 @@
declare type DeriveGet = <T extends object>(proxyObject: T) => T;
declare type Subscription = {
s: object;
d: object;
k: string;
c: () => void;
n: boolean;
i: string[];
p?: Promise<void>;
};
export declare const unstable_deriveSubscriptions: {
add: (subscription: Subscription) => void;
remove: (subscription: Subscription) => void;
list: (derivedObject: object) => Subscription[];
};
/**
* derive
*
* This creates derived properties and attaches them
* to a new proxy object or an existing proxy object.
*
* @example
* import { proxy } from 'valtio'
* import { derive } from 'valtio/utils'
*
* const state = proxy({
* count: 1,
* })
*
* const derivedState = derive({
* doubled: (get) => get(state).count * 2,
* })
*
* derive({
* tripled: (get) => get(state).count * 3,
* }, {
* proxy: state,
* })
*/
export declare function derive<T extends object, U extends object>(derivedFns: {
[K in keyof U]: (get: DeriveGet) => U[K];
}, options?: {
proxy?: T;
sync?: boolean;
}): T & U;
/**
* underive
*
* This stops derived properties to evaluate.
* It will stop all (or specified by `keys` option) subscriptions.
* If you specify `delete` option, it will delete the properties
* and you can attach new derived properties.
*
* @example
* import { proxy } from 'valtio'
* import { derive, underive } from 'valtio/utils'
*
* const state = proxy({
* count: 1,
* })
*
* const derivedState = derive({
* doubled: (get) => get(state).count * 2,
* })
*
* underive(derivedState)
*/
export declare function underive<T extends object, U extends object>(proxyObject: T & U, options?: {
delete?: boolean;
keys?: (keyof U)[];
}): void;
export {};

10
node_modules/valtio/utils/devtools.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
declare type Options = {
enabled?: boolean;
name?: string;
};
export declare function devtools<T extends object>(proxyObject: T, options?: Options): (() => void) | undefined;
/**
* @deprecated Please use { name } option
*/
export declare function devtools<T extends object>(proxyObject: T, name?: string): (() => void) | undefined;
export {};

29
node_modules/valtio/utils/proxyMap.d.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
/**
* proxyMap
*
* This is to create a proxy which mimic the native Map behavior.
* The API is the same as Map API
*
* @example
* import { proxyMap } from 'valtio/utils'
* const state = proxyMap([["key", "value"]])
*
* //can be used inside a proxy as well
* const state = proxy({
* count: 1,
* map: proxyMap()
* })
*
* // When using an object as a key, you can wrap it with `ref` so it's not proxied
* // this is useful if you want to preserve the key equality
* import { ref } from 'valtio'
*
* const key = ref({})
* state.set(key, "value")
* state.get(key) //value
*
* const key = {}
* state.set(key, "value")
* state.get(key) //undefined
*/
export declare function proxyMap<K, V>(entries?: Iterable<readonly [K, V]> | null): Map<K, V>;

16
node_modules/valtio/utils/proxySet.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* proxySet
*
* This is to create a proxy which mimic the native Set behavior.
* The API is the same as Set API
*
* @example
* import { proxySet } from 'valtio/utils'
* const state = proxySet([1,2,3])
* //can be used inside a proxy as well
* const state = proxy({
* count: 1,
* set: proxySet()
* })
*/
export declare function proxySet<T>(initialValues?: Iterable<T> | null): Set<T>;

31
node_modules/valtio/utils/proxyWithComputed.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
import type { INTERNAL_Snapshot } from '../vanilla';
/**
* proxyWithComputed
*
* This is to create a proxy with initial object and additional object,
* which specifies getters for computed values with dependency tracking.
* It also accepts optional setters for computed values.
*
* [Notes]
* This comes with a cost and overlaps with useSnapshot.
* Do not try to optimize too early. It can worsen the performance.
* Measurement and comparison will be very important.
*
* @example
* import { proxyWithComputed } from 'valtio/utils'
* const state = proxyWithComputed({
* count: 1,
* }, {
* doubled: snap => snap.count * 2, // getter only
* tripled: {
* get: snap => snap.count * 3,
* set: (state, newValue) => { state.count = newValue / 3 }
* }, // with optional setter
* })
*/
export declare function proxyWithComputed<T extends object, U extends object>(initialObject: T, computedFns: {
[K in keyof U]: ((snap: INTERNAL_Snapshot<T>) => U[K]) | {
get: (snap: INTERNAL_Snapshot<T>) => U[K];
set?: (state: T, newValue: U[K]) => void;
};
}): T & U;

40
node_modules/valtio/utils/proxyWithHistory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import type { INTERNAL_Snapshot } from '../vanilla';
/**
* proxyWithHistory
*
* This creates a new proxy with history support.
* It includes following properties:
* - value: any value (does not have to be an object)
* - history: an array holding the history of snapshots
* - historyIndex: the history index to the current snapshot
* - canUndo: a function to return true if undo is available
* - undo: a function to go back history
* - canRedo: a function to return true if redo is available
* - redo: a function to go forward history
* - saveHistory: a function to save history
*
* [Notes]
* Suspense/promise is not supported.
*
* @example
* import { proxyWithHistory } from 'valtio/utils'
* const state = proxyWithHistory({
* count: 1,
* })
*/
export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boolean): {
value: V;
history: {
wip: INTERNAL_Snapshot<V> | undefined;
snapshots: INTERNAL_Snapshot<V>[];
index: number;
} & {
$$valtioRef: true;
};
canUndo: () => boolean;
undo: () => void;
canRedo: () => boolean;
redo: () => void;
saveHistory: () => void;
subscribe: () => () => void;
};

12
node_modules/valtio/utils/subscribeKey.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* subscribeKey
*
* The subscribeKey utility enables subscription to a primitive subproperty of a given state proxy.
* Subscriptions created with subscribeKey will only fire when the specified property changes.
* notifyInSync: same as the parameter to subscribe(); true disables batching of subscriptions.
*
* @example
* import { subscribeKey } from 'valtio/utils'
* subscribeKey(state, 'count', (v) => console.log('state.count has changed to', v))
*/
export declare function subscribeKey<T extends object, K extends keyof T>(proxyObject: T, key: K, callback: (value: T[K]) => void, notifyInSync?: boolean): () => void;

31
node_modules/valtio/utils/watch.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
declare type Cleanup = () => void;
declare type WatchGet = <T extends object>(proxyObject: T) => T;
declare type WatchCallback = (get: WatchGet) => Cleanup | void | undefined;
declare type WatchOptions = {
sync?: boolean;
};
/**
* watch
*
* Creates a reactive effect that automatically tracks proxy objects and
* reevaluates everytime one of the tracked proxy objects updates. It returns
* a cleanup function to stop the reactive effect from reevaluating.
*
* Callback is invoked immediately to detect the tracked objects.
*
* Callback passed to `watch` receives a `get` function that "tracks" the
* passed proxy object.
*
* Watch callbacks may return an optional cleanup function, which is evaluated
* whenever the callback reevaluates or when the cleanup function returned by
* `watch` is evaluated.
*
* `watch` calls inside `watch` are also automatically tracked and cleaned up
* whenever the parent `watch` reevaluates.
*
* @param callback
* @returns A cleanup function that stops the callback from reevaluating and
* also performs cleanups registered into `watch`.
*/
export declare function watch(callback: WatchCallback, options?: WatchOptions): Cleanup;
export {};