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

7
node_modules/@svgr/plugin-svgo/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,7 @@
Copyright 2017 Smooth Code
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

27
node_modules/@svgr/plugin-svgo/README.md generated vendored Normal file
View File

@@ -0,0 +1,27 @@
# @svgr/plugin-svgo
[![Build Status](https://img.shields.io/travis/smooth-code/svgr.svg)](https://travis-ci.org/smooth-code/svgr)
[![Version](https://img.shields.io/npm/v/@svgr/plugin-svgo.svg)](https://www.npmjs.com/package/@svgr/plugin-svgo)
[![MIT License](https://img.shields.io/npm/l/@svgr/plugin-svgo.svg)](https://github.com/smooth-code/svgr/blob/master/LICENSE)
Optimize SVG using SVGO.
## Install
```
npm install --save-dev @svgr/plugin-svgo
```
## Usage
**.svgrrc**
```json
{
"plugins": ["@svgr/plugin-svgo"]
}
```
## License
MIT

5
node_modules/@svgr/plugin-svgo/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import { Plugin } from '@svgr/core';
declare const svgoPlugin: Plugin;
export { svgoPlugin as default };

84
node_modules/@svgr/plugin-svgo/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,84 @@
'use strict';
var svgo = require('svgo');
var cosmiconfig = require('cosmiconfig');
const explorer = cosmiconfig.cosmiconfigSync("svgo", {
searchPlaces: [
"package.json",
".svgorc",
".svgorc.js",
".svgorc.json",
".svgorc.yaml",
".svgorc.yml",
"svgo.config.js",
"svgo.config.cjs",
".svgo.yml"
],
transform: (result) => result && result.config,
cache: true
});
const getSvgoConfigFromSvgrConfig = (config) => {
const params = { overrides: {} };
if (config.icon || config.dimensions === false) {
params.overrides.removeViewBox = false;
}
if (config.native) {
params.overrides.inlineStyles = {
onlyMatchedOnce: false
};
}
return {
plugins: [
{
name: "preset-default",
params
},
"prefixIds"
]
};
};
const getSvgoConfig = (config, state) => {
const cwd = state.filePath || process.cwd();
if (config.svgoConfig)
return config.svgoConfig;
if (config.runtimeConfig) {
const userConfig = explorer.search(cwd);
if (userConfig)
return userConfig;
}
return getSvgoConfigFromSvgrConfig(config);
};
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
const svgoPlugin = (code, config, state) => {
if (!config.svgo)
return code;
const svgoConfig = getSvgoConfig(config, state);
const result = svgo.optimize(code, __spreadProps(__spreadValues({}, svgoConfig), { path: state.filePath }));
if (result.modernError) {
throw result.modernError;
}
return result.data;
};
module.exports = svgoPlugin;
//# sourceMappingURL=index.js.map

1
node_modules/@svgr/plugin-svgo/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../src/config.ts","../src/index.ts"],"sourcesContent":["import { cosmiconfigSync } from 'cosmiconfig'\nimport type { Config, State } from '@svgr/core'\n\nconst explorer = cosmiconfigSync('svgo', {\n searchPlaces: [\n 'package.json',\n '.svgorc',\n '.svgorc.js',\n '.svgorc.json',\n '.svgorc.yaml',\n '.svgorc.yml',\n 'svgo.config.js',\n 'svgo.config.cjs',\n '.svgo.yml',\n ],\n transform: (result) => result && result.config,\n cache: true,\n})\n\nconst getSvgoConfigFromSvgrConfig = (config: Config): any => {\n const params = { overrides: {} as any }\n if (config.icon || config.dimensions === false) {\n params.overrides.removeViewBox = false\n }\n if (config.native) {\n params.overrides.inlineStyles = {\n onlyMatchedOnce: false,\n }\n }\n\n return {\n plugins: [\n {\n name: 'preset-default',\n params,\n },\n 'prefixIds',\n ],\n }\n}\n\nexport const getSvgoConfig = (config: Config, state: State): any => {\n const cwd = state.filePath || process.cwd()\n if (config.svgoConfig) return config.svgoConfig\n if (config.runtimeConfig) {\n const userConfig = explorer.search(cwd)\n if (userConfig) return userConfig\n }\n return getSvgoConfigFromSvgrConfig(config)\n}\n","import { optimize } from 'svgo'\nimport { getSvgoConfig } from './config'\nimport type { Plugin } from '@svgr/core'\n\nconst svgoPlugin: Plugin = (code, config, state) => {\n if (!config.svgo) return code\n const svgoConfig = getSvgoConfig(config, state)\n const result = optimize(code, { ...svgoConfig, path: state.filePath })\n\n // @ts-ignore\n if (result.modernError) {\n // @ts-ignore\n throw result.modernError\n }\n\n return result.data\n}\n\nexport default svgoPlugin\n"],"names":["cosmiconfigSync","optimize"],"mappings":";;;;;AAGA,MAAM,QAAA,GAAWA,4BAAgB,MAAQ,EAAA;AAAA,EACvC,YAAc,EAAA;AAAA,IACZ,cAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,IACA,gBAAA;AAAA,IACA,iBAAA;AAAA,IACA,WAAA;AAAA,GACF;AAAA,EACA,SAAW,EAAA,CAAC,MAAW,KAAA,MAAA,IAAU,MAAO,CAAA,MAAA;AAAA,EACxC,KAAO,EAAA,IAAA;AACT,CAAC,CAAA,CAAA;AAED,MAAM,2BAAA,GAA8B,CAAC,MAAwB,KAAA;AAC3D,EAAA,MAAM,MAAS,GAAA,EAAE,SAAW,EAAA,EAAU,EAAA,CAAA;AACtC,EAAA,IAAI,MAAO,CAAA,IAAA,IAAQ,MAAO,CAAA,UAAA,KAAe,KAAO,EAAA;AAC9C,IAAA,MAAA,CAAO,UAAU,aAAgB,GAAA,KAAA,CAAA;AAAA,GACnC;AACA,EAAA,IAAI,OAAO,MAAQ,EAAA;AACjB,IAAA,MAAA,CAAO,UAAU,YAAe,GAAA;AAAA,MAC9B,eAAiB,EAAA,KAAA;AAAA,KACnB,CAAA;AAAA,GACF;AAEA,EAAO,OAAA;AAAA,IACL,OAAS,EAAA;AAAA,MACP;AAAA,QACE,IAAM,EAAA,gBAAA;AAAA,QACN,MAAA;AAAA,OACF;AAAA,MACA,WAAA;AAAA,KACF;AAAA,GACF,CAAA;AACF,CAAA,CAAA;AAEa,MAAA,aAAA,GAAgB,CAAC,MAAA,EAAgB,KAAsB,KAAA;AAClE,EAAA,MAAM,GAAM,GAAA,KAAA,CAAM,QAAY,IAAA,OAAA,CAAQ,GAAI,EAAA,CAAA;AAC1C,EAAA,IAAI,MAAO,CAAA,UAAA;AAAY,IAAA,OAAO,MAAO,CAAA,UAAA,CAAA;AACrC,EAAA,IAAI,OAAO,aAAe,EAAA;AACxB,IAAM,MAAA,UAAA,GAAa,QAAS,CAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AACtC,IAAI,IAAA,UAAA;AAAY,MAAO,OAAA,UAAA,CAAA;AAAA,GACzB;AACA,EAAA,OAAO,4BAA4B,MAAM,CAAA,CAAA;AAC3C,CAAA;;;;;;;;;;;;;;;;;;;;;AC7CA,MAAM,UAAqB,GAAA,CAAC,IAAM,EAAA,MAAA,EAAQ,KAAU,KAAA;AAClD,EAAA,IAAI,CAAC,MAAO,CAAA,IAAA;AAAM,IAAO,OAAA,IAAA,CAAA;AACzB,EAAM,MAAA,UAAA,GAAa,aAAc,CAAA,MAAA,EAAQ,KAAK,CAAA,CAAA;AAC9C,EAAM,MAAA,MAAA,GAASC,cAAS,IAAM,EAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAAK,aAAL,EAAiB,IAAA,EAAM,KAAM,CAAA,QAAA,EAAU,CAAA,CAAA,CAAA;AAGrE,EAAA,IAAI,OAAO,WAAa,EAAA;AAEtB,IAAA,MAAM,MAAO,CAAA,WAAA,CAAA;AAAA,GACf;AAEA,EAAA,OAAO,MAAO,CAAA,IAAA,CAAA;AAChB;;;;"}

48
node_modules/@svgr/plugin-svgo/package.json generated vendored Normal file
View File

@@ -0,0 +1,48 @@
{
"name": "@svgr/plugin-svgo",
"description": "Optimize SVG",
"version": "8.1.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"repository": "https://github.com/gregberge/svgr/tree/main/packages/plugin-svgo",
"author": "Greg Bergé <berge.greg@gmail.com>",
"publishConfig": {
"access": "public"
},
"keywords": [
"svgr-plugin"
],
"engines": {
"node": ">=14"
},
"homepage": "https://react-svgr.com",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/gregberge"
},
"license": "MIT",
"scripts": {
"reset": "rm -rf dist",
"build": "rollup -c ../../build/rollup.config.mjs",
"prepublishOnly": "pnpm run reset && pnpm run build"
},
"peerDependencies": {
"@svgr/core": "*"
},
"dependencies": {
"cosmiconfig": "^8.1.3",
"deepmerge": "^4.3.1",
"svgo": "^3.0.2"
},
"devDependencies": {
"@svgr/core": "8.1.0"
},
"gitHead": "772592e042be5063e782bfb8711d024b2fefc6b8"
}