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

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/schemes/HttpUriPlugin").HttpUriPluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=n,module.exports.default=n;const t=new RegExp("^https?://","u");function e(n,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=n}={}){let i=null,p=0;if(0===p){if(!n||"object"!=typeof n||Array.isArray(n))return e.errors=[{params:{type:"object"}}],!1;{let o;if(void 0===n.allowedUris&&(o="allowedUris"))return e.errors=[{params:{missingProperty:o}}],!1;{const o=p;for(const r in n)if("allowedUris"!==r&&"cacheLocation"!==r&&"frozen"!==r&&"lockfileLocation"!==r&&"proxy"!==r&&"upgrade"!==r)return e.errors=[{params:{additionalProperty:r}}],!1;if(o===p){if(void 0!==n.allowedUris){let r=n.allowedUris;const o=p;if(p==p){if(!Array.isArray(r))return e.errors=[{params:{type:"array"}}],!1;{const n=r.length;for(let o=0;o<n;o++){let n=r[o];const s=p,a=p;let l=!1;const c=p;if(!(n instanceof RegExp)){const r={params:{}};null===i?i=[r]:i.push(r),p++}var f=c===p;if(l=l||f,!l){const r=p;if(p===r)if("string"==typeof n){if(!t.test(n)){const r={params:{pattern:"^https?://"}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}if(f=r===p,l=l||f,!l){const r=p;if(!(n instanceof Function)){const r={params:{}};null===i?i=[r]:i.push(r),p++}f=r===p,l=l||f}}if(!l){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}if(p=a,null!==i&&(a?i.length=a:i=null),s!==p)break}}}var c=o===p}else c=!0;if(c){if(void 0!==n.cacheLocation){let t=n.cacheLocation;const o=p,s=p;let a=!1;const l=p;if(!1!==t){const r={params:{}};null===i?i=[r]:i.push(r),p++}var u=l===p;if(a=a||u,!a){const e=p;if(p===e)if("string"==typeof t){if(t.includes("!")||!0!==r.test(t)){const r={params:{}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}u=e===p,a=a||u}if(!a){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),c=o===p}else c=!0;if(c){if(void 0!==n.frozen){const r=p;if("boolean"!=typeof n.frozen)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!0;if(c){if(void 0!==n.lockfileLocation){let t=n.lockfileLocation;const o=p;if(p===o){if("string"!=typeof t)return e.errors=[{params:{type:"string"}}],!1;if(t.includes("!")||!0!==r.test(t))return e.errors=[{params:{}}],!1}c=o===p}else c=!0;if(c){if(void 0!==n.proxy){const r=p;if("string"!=typeof n.proxy)return e.errors=[{params:{type:"string"}}],!1;c=r===p}else c=!0;if(c)if(void 0!==n.upgrade){const r=p;if("boolean"!=typeof n.upgrade)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!0}}}}}}}}return e.errors=i,0===p}function n(r,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=r}={}){let l=null,i=0;const p=i;let f=!1,c=null;const u=i;if(e(r,{instancePath:t,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?e.errors:l.concat(e.errors),i=l.length),u===i&&(f=!0,c=0),!f){const r={params:{passingSchemas:c}};return null===l?l=[r]:l.push(r),i++,n.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),n.errors=l,0===i}

View File

@@ -0,0 +1,74 @@
{
"definitions": {
"HttpUriOptions": {
"description": "Options for building http resources.",
"type": "object",
"additionalProperties": false,
"properties": {
"allowedUris": {
"$ref": "#/definitions/HttpUriOptionsAllowedUris"
},
"cacheLocation": {
"description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.",
"anyOf": [
{
"enum": [false]
},
{
"type": "string",
"absolutePath": true
}
]
},
"frozen": {
"description": "When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.",
"type": "boolean"
},
"lockfileLocation": {
"description": "Location of the lockfile.",
"type": "string",
"absolutePath": true
},
"proxy": {
"description": "Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.",
"type": "string"
},
"upgrade": {
"description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",
"type": "boolean"
}
},
"required": ["allowedUris"]
},
"HttpUriOptionsAllowedUris": {
"description": "List of allowed URIs (resp. the beginning of them).",
"type": "array",
"items": {
"description": "List of allowed URIs (resp. the beginning of them).",
"anyOf": [
{
"description": "Allowed URI pattern.",
"instanceof": "RegExp",
"tsType": "RegExp"
},
{
"description": "Allowed URI (resp. the beginning of it).",
"type": "string",
"pattern": "^https?://"
},
{
"description": "Allowed URI filter function.",
"instanceof": "Function",
"tsType": "import('../../../lib/schemes/HttpUriPlugin').AllowedUriFn"
}
]
}
}
},
"title": "HttpUriPluginOptions",
"oneOf": [
{
"$ref": "#/definitions/HttpUriOptions"
}
]
}

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/schemes/VirtualUrlPlugin").VirtualUrlPluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function t(r,{instancePath:e="",parentData:n,parentDataProperty:s,rootData:o=r}={}){let a=null,i=0;const l=i;let p=!1;const c=i;if("string"!=typeof r){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),i++}var u=c===i;if(p=p||u,!p){const t=i;if(!(r instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),i++}if(u=t===i,p=p||u,!p){const t=i;if(i==i)if(r&&"object"==typeof r&&!Array.isArray(r)){let t;if(void 0===r.source&&(t="source")){const r={params:{missingProperty:t}};null===a?a=[r]:a.push(r),i++}else{const t=i;for(const t in r)if("context"!==t&&"source"!==t&&"type"!==t&&"version"!==t){const r={params:{additionalProperty:t}};null===a?a=[r]:a.push(r),i++;break}if(t===i){if(void 0!==r.context){const t=i;if("string"!=typeof r.context){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),i++}var f=t===i}else f=!0;if(f){if(void 0!==r.source){const t=i;if(!(r.source instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),i++}f=t===i}else f=!0;if(f){if(void 0!==r.type){const t=i;if("string"!=typeof r.type){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),i++}f=t===i}else f=!0;if(f)if(void 0!==r.version){let t=r.version;const e=i,n=i;let s=!1;const o=i;if("boolean"!=typeof t){const t={params:{type:"boolean"}};null===a?a=[t]:a.push(t),i++}if(!0!==t){const t={params:{}};null===a?a=[t]:a.push(t),i++}var y=o===i;if(s=s||y,!s){const r=i;if("string"!=typeof t){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),i++}if(y=r===i,s=s||y,!s){const r=i;if(!(t instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),i++}y=r===i,s=s||y}}if(s)i=n,null!==a&&(n?a.length=n:a=null);else{const t={params:{}};null===a?a=[t]:a.push(t),i++}f=e===i}else f=!0}}}}}else{const t={params:{type:"object"}};null===a?a=[t]:a.push(t),i++}u=t===i,p=p||u}}if(!p){const r={params:{}};return null===a?a=[r]:a.push(r),i++,t.errors=a,!1}return i=l,null!==a&&(l?a.length=l:a=null),t.errors=a,0===i}function r(e,{instancePath:n="",parentData:s,parentDataProperty:o,rootData:a=e}={}){let i=null,l=0;if(0===l){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{let s;if(void 0===e.modules&&(s="modules"))return r.errors=[{params:{missingProperty:s}}],!1;{const s=l;for(const t in e)if("context"!==t&&"modules"!==t&&"scheme"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===l){if(void 0!==e.context){const t=l;if("string"!=typeof e.context)return r.errors=[{params:{type:"string"}}],!1;var p=t===l}else p=!0;if(p){if(void 0!==e.modules){let s=e.modules;const o=l;if(l===o){if(!s||"object"!=typeof s||Array.isArray(s))return r.errors=[{params:{type:"object"}}],!1;for(const r in s){const e=l;if(t(s[r],{instancePath:n+"/modules/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:s,parentDataProperty:r,rootData:a})||(i=null===i?t.errors:i.concat(t.errors),l=i.length),e!==l)break}}p=o===l}else p=!0;if(p)if(void 0!==e.scheme){const t=l;if("string"!=typeof e.scheme)return r.errors=[{params:{type:"string"}}],!1;p=t===l}else p=!0}}}}}return r.errors=i,0===l}function e(t,{instancePath:n="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;const p=l;let c=!1,u=null;const f=l;if(r(t,{instancePath:n,parentData:s,parentDataProperty:o,rootData:a})||(i=null===i?r.errors:i.concat(r.errors),l=i.length),f===l&&(c=!0,u=0),!c){const t={params:{passingSchemas:u}};return null===i?i=[t]:i.push(t),l++,e.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),e.errors=i,0===l}module.exports=e,module.exports.default=e;

View File

@@ -0,0 +1,85 @@
{
"definitions": {
"VirtualModule": {
"description": "A virtual module definition.",
"type": "object",
"additionalProperties": false,
"properties": {
"context": {
"description": "The context for the virtual module. A string path. Defaults to 'auto', which will try to resolve the context from the module id.",
"type": "string"
},
"source": {
"description": "The source function that provides the virtual content.",
"instanceof": "Function",
"tsType": "import('../../../lib/schemes/VirtualUrlPlugin').SourceFn"
},
"type": {
"description": "The module type.",
"type": "string"
},
"version": {
"description": "Optional version function or value for cache invalidation.",
"anyOf": [
{
"type": "boolean",
"enum": [true]
},
{
"type": "string"
},
{
"instanceof": "Function",
"tsType": "import('../../../lib/schemes/VirtualUrlPlugin').VersionFn"
}
]
}
},
"required": ["source"]
},
"VirtualModuleContent": {
"description": "A virtual module can be a string, a function, or a VirtualModule object.",
"anyOf": [
{
"type": "string"
},
{
"instanceof": "Function",
"tsType": "import('../../../lib/schemes/VirtualUrlPlugin').SourceFn"
},
{
"$ref": "#/definitions/VirtualModule"
}
]
},
"VirtualUrlOptions": {
"description": "Options for building virtual resources.",
"type": "object",
"additionalProperties": false,
"properties": {
"context": {
"description": "The default context for virtual modules. A string path. Defaults to 'auto', which will try to resolve the context from the module id.",
"type": "string"
},
"modules": {
"description": "The virtual modules configuration.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/VirtualModuleContent"
}
},
"scheme": {
"description": "The URL scheme to use for virtual resources.",
"type": "string"
}
},
"required": ["modules"]
}
},
"title": "VirtualUrlPluginOptions",
"oneOf": [
{
"$ref": "#/definitions/VirtualUrlOptions"
}
]
}