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

2
node_modules/proxy-compare/dist/index.modern.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
const e=Symbol(),t=Symbol(),r=Symbol();let n=(e,t)=>new Proxy(e,t);const o=Object.getPrototypeOf,s=new WeakMap,c=e=>e&&(s.has(e)?s.get(e):o(e)===Object.prototype||o(e)===Array.prototype),l=e=>"object"==typeof e&&null!==e,a=new WeakMap,f=e=>e[r]||e,i=(s,l,p)=>{if(!c(s))return s;const y=f(s),u=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.writable))(y);let g=p&&p.get(y);return g&&g[1].f===u||(g=((n,o)=>{const s={f:o};let c=!1;const l=(t,r)=>{if(!c){let o=s.a.get(n);o||(o=new Set,s.a.set(n,o)),r&&o.has(e)||o.add(t)}},a={get:(e,t)=>t===r?n:(l(t),i(e[t],s.a,s.c)),has:(e,r)=>r===t?(c=!0,s.a.delete(n),!0):(l(r),r in e),getOwnPropertyDescriptor:(e,t)=>(l(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:t=>(l(e),Reflect.ownKeys(t))};return o&&(a.set=a.deleteProperty=()=>!1),[a,s]})(y,u),g[1].p=n(u?(e=>{let t=a.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const r=Object.getOwnPropertyDescriptors(e);Object.values(r).forEach(e=>{e.configurable=!0}),t=Object.create(o(e),r)}a.set(e,t)}return t})(y):y,g[0]),p&&p.set(y,g)),g[1].a=l,g[1].c=p,g[1].p},p=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])},y=(t,r,n,o)=>{if(Object.is(t,r))return!1;if(!l(t)||!l(r))return!0;const s=n.get(f(t));if(!s)return!0;if(o){const e=o.get(t);if(e&&e.n===r)return e.g;o.set(t,{n:r,g:!1})}let c=null;for(const l of s){const s=l===e?p(t,r):y(t[l],r[l],n,o);if(!0!==s&&!1!==s||(c=s),c)break}return null===c&&(c=!0),o&&o.set(t,{n:r,g:c}),c},u=e=>!!c(e)&&t in e,g=e=>c(e)&&e[r]||null,b=(e,t=!0)=>{s.set(e,t)},O=(e,t)=>{const r=[],n=new WeakSet,o=(e,s)=>{if(n.has(e))return;l(e)&&n.add(e);const c=l(e)&&t.get(f(e));c?c.forEach(t=>{o(e[t],s?[...s,t]:[t])}):s&&r.push(s)};return o(e),r},w=e=>{n=e};export{O as affectedToPathList,i as createProxy,g as getUntracked,y as isChanged,b as markToTrack,w as replaceNewProxy,u as trackMemo};
//# sourceMappingURL=index.modern.mjs.map

1
node_modules/proxy-compare/dist/index.modern.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/proxy-compare/dist/index.modern.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
const e=Symbol(),t=Symbol(),r=Symbol();let n=(e,t)=>new Proxy(e,t);const o=Object.getPrototypeOf,s=new WeakMap,c=e=>e&&(s.has(e)?s.get(e):o(e)===Object.prototype||o(e)===Array.prototype),l=e=>"object"==typeof e&&null!==e,a=new WeakMap,f=e=>e[r]||e,i=(s,l,p)=>{if(!c(s))return s;const y=f(s),u=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.writable))(y);let g=p&&p.get(y);return g&&g[1].f===u||(g=((n,o)=>{const s={f:o};let c=!1;const l=(t,r)=>{if(!c){let o=s.a.get(n);o||(o=new Set,s.a.set(n,o)),r&&o.has(e)||o.add(t)}},a={get:(e,t)=>t===r?n:(l(t),i(e[t],s.a,s.c)),has:(e,r)=>r===t?(c=!0,s.a.delete(n),!0):(l(r),r in e),getOwnPropertyDescriptor:(e,t)=>(l(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:t=>(l(e),Reflect.ownKeys(t))};return o&&(a.set=a.deleteProperty=()=>!1),[a,s]})(y,u),g[1].p=n(u?(e=>{let t=a.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const r=Object.getOwnPropertyDescriptors(e);Object.values(r).forEach(e=>{e.configurable=!0}),t=Object.create(o(e),r)}a.set(e,t)}return t})(y):y,g[0]),p&&p.set(y,g)),g[1].a=l,g[1].c=p,g[1].p},p=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])},y=(t,r,n,o)=>{if(Object.is(t,r))return!1;if(!l(t)||!l(r))return!0;const s=n.get(f(t));if(!s)return!0;if(o){const e=o.get(t);if(e&&e.n===r)return e.g;o.set(t,{n:r,g:!1})}let c=null;for(const l of s){const s=l===e?p(t,r):y(t[l],r[l],n,o);if(!0!==s&&!1!==s||(c=s),c)break}return null===c&&(c=!0),o&&o.set(t,{n:r,g:c}),c},u=e=>!!c(e)&&t in e,g=e=>c(e)&&e[r]||null,b=(e,t=!0)=>{s.set(e,t)},O=(e,t)=>{const r=[],n=new WeakSet,o=(e,s)=>{if(n.has(e))return;l(e)&&n.add(e);const c=l(e)&&t.get(f(e));c?c.forEach(t=>{o(e[t],s?[...s,t]:[t])}):s&&r.push(s)};return o(e),r},w=e=>{n=e};export{O as affectedToPathList,i as createProxy,g as getUntracked,y as isChanged,b as markToTrack,w as replaceNewProxy,u as trackMemo};
//# sourceMappingURL=index.modern.mjs.map

1
node_modules/proxy-compare/dist/index.modern.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/proxy-compare/dist/index.umd.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).proxyCompare={})}(this,function(e){function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var r=Symbol(),n=Symbol(),o=Symbol(),i=function(e,t){return new Proxy(e,t)},a=Object.getPrototypeOf,u=new WeakMap,c=function(e){return e&&(u.has(e)?u.get(e):a(e)===Object.prototype||a(e)===Array.prototype)},f=function(e){return"object"==typeof e&&null!==e},l=new WeakMap,s=function(e){return e[o]||e},y=function(e,t,u){if(!c(e))return e;var f=s(e),p=function(e){return Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some(function(e){return!e.writable})}(f),b=u&&u.get(f);return b&&b[1].f===p||((b=function(e,t){var i,a=((i={}).f=t,i),u=!1,c=function(t,n){if(!u){var o=a.a.get(e);o||(o=new Set,a.a.set(e,o)),n&&o.has(r)||o.add(t)}},f={get:function(t,r){return r===o?e:(c(r),y(t[r],a.a,a.c))},has:function(t,r){return r===n?(u=!0,a.a.delete(e),!0):(c(r),r in t)},getOwnPropertyDescriptor:function(e,t){return c(t,!0),Object.getOwnPropertyDescriptor(e,t)},ownKeys:function(e){return c(r),Reflect.ownKeys(e)}};return t&&(f.set=f.deleteProperty=function(){return!1}),[f,a]}(f,p))[1].p=i(p?function(e){var t=l.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{var r=Object.getOwnPropertyDescriptors(e);Object.values(r).forEach(function(e){e.configurable=!0}),t=Object.create(a(e),r)}l.set(e,t)}return t}(f):f,b[0]),u&&u.set(f,b)),b[1].a=t,b[1].c=u,b[1].p},p=function(e,t){var r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some(function(e,t){return e!==n[t]})};e.affectedToPathList=function(e,t){var r=[],n=new WeakSet;return function e(o,i){if(!n.has(o)){f(o)&&n.add(o);var a=f(o)&&t.get(s(o));a?a.forEach(function(t){e(o[t],i?[].concat(i,[t]):[t])}):i&&r.push(i)}}(e),r},e.createProxy=y,e.getUntracked=function(e){return c(e)&&e[o]||null},e.isChanged=function e(n,o,i,a){if(Object.is(n,o))return!1;if(!f(n)||!f(o))return!0;var u=i.get(s(n));if(!u)return!0;if(a){var c,l=a.get(n);if(l&&l.n===o)return l.g;a.set(n,((c={}).n=o,c.g=!1,c))}for(var y,b,d=null,g=function(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(u);!(y=g()).done;){var v=y.value,m=v===r?p(n,o):e(n[v],o[v],i,a);if(!0!==m&&!1!==m||(d=m),d)break}return null===d&&(d=!0),a&&a.set(n,((b={}).n=o,b.g=d,b)),d},e.markToTrack=function(e,t){void 0===t&&(t=!0),u.set(e,t)},e.replaceNewProxy=function(e){i=e},e.trackMemo=function(e){return!!c(e)&&n in e}});
//# sourceMappingURL=index.umd.js.map

1
node_modules/proxy-compare/dist/index.umd.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

129
node_modules/proxy-compare/dist/src/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,129 @@
declare let newProxy: <T extends object>(target: T, handler: ProxyHandler<T>) => T;
/**
* Create a proxy.
*
* This function will create a proxy at top level and proxy nested objects as you access them,
* in order to keep track of which properties were accessed via get/has proxy handlers:
*
* NOTE: Printing of WeakMap is hard to inspect and not very readable
* for this purpose you can use the `affectedToPathList` helper.
*
* @param {object} obj - Object that will be wrapped on the proxy.
* @param {WeakMap<object, unknown>} affected -
* WeakMap that will hold the tracking of which properties in the proxied object were accessed.
* @param {WeakMap<object, unknown>} [proxyCache] -
* WeakMap that will help keep referential identity for proxies.
* @returns {Proxy<object>} - Object wrapped in a proxy.
*
* @example
* import { createProxy } from 'proxy-compare';
*
* const original = { a: "1", c: "2", d: { e: "3" } };
* const affected = new WeakMap();
* const proxy = createProxy(original, affected);
*
* proxy.a // Will mark as used and track its value.
* // This will update the affected WeakMap with original as key
* // and a Set with "a"
*
* proxy.d // Will mark "d" as accessed to track and proxy itself ({ e: "3" }).
* // This will update the affected WeakMap with original as key
* // and a Set with "d"
*/
export declare const createProxy: <T>(obj: T, affected: WeakMap<object, unknown>, proxyCache?: WeakMap<object, unknown>) => T;
/**
* Compare changes on objects.
*
* This will compare the affected properties on tracked objects inside the proxy
* to check if there were any changes made to it,
* by default if no property was accessed on the proxy it will attempt to do a
* reference equality check for the objects provided (Object.is(a, b)). If you access a property
* on the proxy, then isChanged will only compare the affected properties.
*
* @param {object} prevObj - The previous object to compare.
* @param {object} nextObj - Object to compare with the previous one.
* @param {WeakMap<object, unknown>} affected -
* WeakMap that holds the tracking of which properties in the proxied object were accessed.
* @param {WeakMap<object, unknown>} [cache] -
* WeakMap that holds a cache of the comparisons for better performance with repetitive comparisons,
* and to avoid infinite loop with circular structures.
* @returns {boolean} - Boolean indicating if the affected property on the object has changed.
*
* @example
* import { createProxy, isChanged } from 'proxy-compare';
*
* const obj = { a: "1", c: "2", d: { e: "3" } };
* const affected = new WeakMap();
*
* const proxy = createProxy(obj, affected);
*
* proxy.a
*
* isChanged(obj, { a: "1" }, affected) // false
*
* proxy.a = "2"
*
* isChanged(obj, { a: "1" }, affected) // true
*/
export declare const isChanged: (prevObj: unknown, nextObj: unknown, affected: WeakMap<object, unknown>, cache?: WeakMap<object, unknown>) => boolean;
export declare const trackMemo: (obj: unknown) => boolean;
/**
* Unwrap proxy to get the original object.
*
* Used to retrieve the original object used to create the proxy instance with `createProxy`.
*
* @param {Proxy<object>} obj - The proxy wrapper of the originial object.
* @returns {object | null} - Return either the unwrapped object if exists.
*
* @example
* import { createProxy, getUntracked } from 'proxy-compare';
*
* const original = { a: "1", c: "2", d: { e: "3" } };
* const affected = new WeakMap();
*
* const proxy = createProxy(original, affected);
* const originalFromProxy = getUntracked(proxy)
*
* Object.is(original, originalFromProxy) // true
* isChanged(original, originalFromProxy, affected) // false
*/
export declare const getUntracked: <T>(obj: T) => T | null;
/**
* Mark object to be tracked.
*
* This function marks an object that will be passed into `createProxy`
* as marked to track or not. By default only Array and Object are marked to track,
* so this is useful for example to mark a class instance to track or to mark a object
* to be untracked when creating your proxy.
*
* @param obj - Object to mark as tracked or not.
* @param mark - Boolean indicating whether you want to track this object or not.
* @returns No return.
*
* @example
* import { createProxy, markToTrack, isChanged } from 'proxy-compare';
*
* const nested = { e: "3" }
*
* markToTrack(nested, false)
*
* const original = { a: "1", c: "2", d: nested };
* const affected = new WeakMap();
*
* const proxy = createProxy(original, affected);
*
* proxy.d.e
*
* isChanged(original, { d: { e: "3" } }, affected) // true
*/
export declare const markToTrack: (obj: object, mark?: boolean) => void;
export declare const affectedToPathList: (obj: unknown, affected: WeakMap<object, unknown>) => (string | symbol)[][];
/**
* replace newProxy function.
*
* This can be used if you want to use proxy-polyfill.
* Note that proxy-polyfill can't polyfill everything.
* Use it at your own risk.
*/
export declare const replaceNewProxy: (fn: typeof newProxy) => void;
export {};