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

37
node_modules/@tannin/compile/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,37 @@
## 1.1.0 (2020-03-07)
New Features
- Add TypeScript definitions
## 1.0.4 (2019-11-27)
Internal
- Update project inter-dependencies
## 1.0.3 (2019-03-07)
Internal
- Add `repository.directory` to `package.json`
## 1.0.2 (2019-01-19)
Documentation
- Correct documentation unpkg links
Internal
- Use Lerna for managing mono-repo
## 1.0.1 (2018-11-04)
Bug Fixes
- Fix dependencies pointers from local filesystem to npm copies.
## 1.0.0 (2018-11-04)
- Initial release

7
node_modules/@tannin/compile/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,7 @@
[The MIT License (MIT)](https://opensource.org/licenses/MIT)
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.

33
node_modules/@tannin/compile/README.md generated vendored Normal file
View File

@@ -0,0 +1,33 @@
`@tannin/compile`
=================
Compiles an evaluating function for a C expression.
## Installation
Using [npm](https://www.npmjs.com/) as a package manager:
```
npm install @tannin/compile
```
Otherwise, download a pre-built copy from unpkg:
[https://unpkg.com/@tannin/compile/dist/compile.min.js](https://unpkg.com/@tannin/compile/dist/compile.min.js)
## Usage
```js
import compile from '@tannin/compile';
const evaluate = compile( 'n > 1' );
evaluate( { n: 2 } );
// ⇒ true
```
## License
Copyright 2019-2020 Andrew Duthie
Released under the [MIT License](https://opensource.org/licenses/MIT).

35
node_modules/@tannin/compile/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var postfix = _interopDefault(require('@tannin/postfix'));
var evaluate = _interopDefault(require('@tannin/evaluate'));
/**
* Given a C expression, returns a function which can be called to evaluate its
* result.
*
* @example
*
* ```js
* import compile from '@tannin/compile';
*
* const evaluate = compile( 'n > 1' );
*
* evaluate( { n: 2 } );
* // ⇒ true
* ```
*
* @param {string} expression C expression.
*
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
*/
function compile( expression ) {
var terms = postfix( expression );
return function( variables ) {
return evaluate( terms, variables );
};
}
module.exports = compile;

269
node_modules/@tannin/compile/dist/compile.js generated vendored Normal file
View File

@@ -0,0 +1,269 @@
var compile = (function () {
'use strict';
var PRECEDENCE, OPENERS, TERMINATORS, PATTERN;
/**
* Operator precedence mapping.
*
* @type {Object}
*/
PRECEDENCE = {
'(': 9,
'!': 8,
'*': 7,
'/': 7,
'%': 7,
'+': 6,
'-': 6,
'<': 5,
'<=': 5,
'>': 5,
'>=': 5,
'==': 4,
'!=': 4,
'&&': 3,
'||': 2,
'?': 1,
'?:': 1,
};
/**
* Characters which signal pair opening, to be terminated by terminators.
*
* @type {string[]}
*/
OPENERS = [ '(', '?' ];
/**
* Characters which signal pair termination, the value an array with the
* opener as its first member. The second member is an optional operator
* replacement to push to the stack.
*
* @type {string[]}
*/
TERMINATORS = {
')': [ '(' ],
':': [ '?', '?:' ],
};
/**
* Pattern matching operators and openers.
*
* @type {RegExp}
*/
PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
/**
* Given a C expression, returns the equivalent postfix (Reverse Polish)
* notation terms as an array.
*
* If a postfix string is desired, simply `.join( ' ' )` the result.
*
* @example
*
* ```js
* import postfix from '@tannin/postfix';
*
* postfix( 'n > 1' );
* // ⇒ [ 'n', '1', '>' ]
* ```
*
* @param {string} expression C expression.
*
* @return {string[]} Postfix terms.
*/
function postfix( expression ) {
var terms = [],
stack = [],
match, operator, term, element;
while ( ( match = expression.match( PATTERN ) ) ) {
operator = match[ 0 ];
// Term is the string preceding the operator match. It may contain
// whitespace, and may be empty (if operator is at beginning).
term = expression.substr( 0, match.index ).trim();
if ( term ) {
terms.push( term );
}
while ( ( element = stack.pop() ) ) {
if ( TERMINATORS[ operator ] ) {
if ( TERMINATORS[ operator ][ 0 ] === element ) {
// Substitution works here under assumption that because
// the assigned operator will no longer be a terminator, it
// will be pushed to the stack during the condition below.
operator = TERMINATORS[ operator ][ 1 ] || operator;
break;
}
} else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) {
// Push to stack if either an opener or when pop reveals an
// element of lower precedence.
stack.push( element );
break;
}
// For each popped from stack, push to terms.
terms.push( element );
}
if ( ! TERMINATORS[ operator ] ) {
stack.push( operator );
}
// Slice matched fragment from expression to continue match.
expression = expression.substr( match.index + operator.length );
}
// Push remainder of operand, if exists, to terms.
expression = expression.trim();
if ( expression ) {
terms.push( expression );
}
// Pop remaining items from stack into terms.
return terms.concat( stack.reverse() );
}
/**
* Operator callback functions.
*
* @type {Object}
*/
var OPERATORS = {
'!': function( a ) {
return ! a;
},
'*': function( a, b ) {
return a * b;
},
'/': function( a, b ) {
return a / b;
},
'%': function( a, b ) {
return a % b;
},
'+': function( a, b ) {
return a + b;
},
'-': function( a, b ) {
return a - b;
},
'<': function( a, b ) {
return a < b;
},
'<=': function( a, b ) {
return a <= b;
},
'>': function( a, b ) {
return a > b;
},
'>=': function( a, b ) {
return a >= b;
},
'==': function( a, b ) {
return a === b;
},
'!=': function( a, b ) {
return a !== b;
},
'&&': function( a, b ) {
return a && b;
},
'||': function( a, b ) {
return a || b;
},
'?:': function( a, b, c ) {
if ( a ) {
throw b;
}
return c;
},
};
/**
* Given an array of postfix terms and operand variables, returns the result of
* the postfix evaluation.
*
* @example
*
* ```js
* import evaluate from '@tannin/evaluate';
*
* // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'
* const terms = [ '3', '4', '5', '*', '6', '/', '+' ];
*
* evaluate( terms, {} );
* // ⇒ 6.333333333333334
* ```
*
* @param {string[]} postfix Postfix terms.
* @param {Object} variables Operand variables.
*
* @return {*} Result of evaluation.
*/
function evaluate( postfix, variables ) {
var stack = [],
i, j, args, getOperatorResult, term, value;
for ( i = 0; i < postfix.length; i++ ) {
term = postfix[ i ];
getOperatorResult = OPERATORS[ term ];
if ( getOperatorResult ) {
// Pop from stack by number of function arguments.
j = getOperatorResult.length;
args = Array( j );
while ( j-- ) {
args[ j ] = stack.pop();
}
try {
value = getOperatorResult.apply( null, args );
} catch ( earlyReturn ) {
return earlyReturn;
}
} else if ( variables.hasOwnProperty( term ) ) {
value = variables[ term ];
} else {
value = +term;
}
stack.push( value );
}
return stack[ 0 ];
}
/**
* Given a C expression, returns a function which can be called to evaluate its
* result.
*
* @example
*
* ```js
* import compile from '@tannin/compile';
*
* const evaluate = compile( 'n > 1' );
*
* evaluate( { n: 2 } );
* // ⇒ true
* ```
*
* @param {string} expression C expression.
*
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
*/
function compile( expression ) {
var terms = postfix( expression );
return function( variables ) {
return evaluate( terms, variables );
};
}
return compile;
}());

1
node_modules/@tannin/compile/dist/compile.min.js generated vendored Normal file
View File

@@ -0,0 +1 @@
var compile=function(){"use strict";var o,c,s,a;o={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},c=["(","?"],s={")":["("],":":["?","?:"]},a=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(n){return!n},"*":function(n,r){return n*r},"/":function(n,r){return n/r},"%":function(n,r){return n%r},"+":function(n,r){return n+r},"-":function(n,r){return n-r},"<":function(n,r){return n<r},"<=":function(n,r){return n<=r},">":function(n,r){return r<n},">=":function(n,r){return r<=n},"==":function(n,r){return n===r},"!=":function(n,r){return n!==r},"&&":function(n,r){return n&&r},"||":function(n,r){return n||r},"?:":function(n,r,t){if(n)throw r;return t}};return function(n){var r=function(n){for(var r,t,u,e,i=[],f=[];r=n.match(a);){for(t=r[0],(u=n.substr(0,r.index).trim())&&i.push(u);e=f.pop();){if(s[t]){if(s[t][0]===e){t=s[t][1]||t;break}}else if(0<=c.indexOf(e)||o[e]<o[t]){f.push(e);break}i.push(e)}s[t]||f.push(t),n=n.substr(r.index+t.length)}return(n=n.trim())&&i.push(n),i.concat(f.reverse())}(n);return function(n){return function(n,r){var t,u,e,i,f,o,c=[];for(t=0;t<n.length;t++){if(f=n[t],i=p[f]){for(u=i.length,e=Array(u);u--;)e[u]=c.pop();try{o=i.apply(null,e)}catch(n){return n}}else o=r.hasOwnProperty(f)?r[f]:+f;c.push(o)}return c[0]}(r,n)}}}();

22
node_modules/@tannin/compile/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
* Given a C expression, returns a function which can be called to evaluate its
* result.
*
* @example
*
* ```js
* import compile from '@tannin/compile';
*
* const evaluate = compile( 'n > 1' );
*
* evaluate( { n: 2 } );
* // ⇒ true
* ```
*
* @param {string} expression C expression.
*
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
*/
export default function compile(expression: string): (variables?: {
[variable: string]: any;
}) => any;

29
node_modules/@tannin/compile/index.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import postfix from '@tannin/postfix';
import evaluate from '@tannin/evaluate';
/**
* Given a C expression, returns a function which can be called to evaluate its
* result.
*
* @example
*
* ```js
* import compile from '@tannin/compile';
*
* const evaluate = compile( 'n > 1' );
*
* evaluate( { n: 2 } );
* // ⇒ true
* ```
*
* @param {string} expression C expression.
*
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
*/
export default function compile( expression ) {
var terms = postfix( expression );
return function( variables ) {
return evaluate( terms, variables );
};
}

38
node_modules/@tannin/compile/package.json generated vendored Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "@tannin/compile",
"version": "1.1.0",
"description": "Compiles an evaluating function for a C expression",
"main": "build/index.js",
"module": "index.js",
"types": "index.d.ts",
"keywords": [],
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "https://andrewduthie.com"
},
"homepage": "https://github.com/aduth/tannin",
"repository": {
"type": "git",
"url": "https://github.com/aduth/tannin.git",
"directory": "packages/compile"
},
"bugs": {
"url": "https://github.com/aduth/tannin/issues"
},
"license": "MIT",
"files": [
"index.js",
"index.d.ts",
"build",
"dist"
],
"dependencies": {
"@tannin/evaluate": "^1.2.0",
"@tannin/postfix": "^1.1.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "cd1c7447843df7751c4abd1b92aee03fe56bfba4"
}