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

52
node_modules/intl-messageformat-parser/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,52 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.8.1](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.8.0...intl-messageformat-parser@1.8.1) (2019-06-28)
**Note:** Version bump only for package intl-messageformat-parser
# [1.8.0](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.7.1...intl-messageformat-parser@1.8.0) (2019-06-27)
### Features
- **intl-messageformat:** allow passing in formatters ([#107](https://github.com/formatjs/formatjs/issues/107)) ([3605693](https://github.com/formatjs/formatjs/commit/3605693))
## [1.7.1](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.7.0...intl-messageformat-parser@1.7.1) (2019-06-26)
### Bug Fixes
- **intl-messageformat-parser:** Escape double-' to a single ' ([#103](https://github.com/formatjs/formatjs/issues/103)) ([4d0cd1f](https://github.com/formatjs/formatjs/commit/4d0cd1f))
# [1.7.0](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.8...intl-messageformat-parser@1.7.0) (2019-06-27)
### Features
- **intl-utils:** Add intl-utils ([#98](https://github.com/formatjs/formatjs/issues/98)) ([2329c57](https://github.com/formatjs/formatjs/commit/2329c57))
## [1.6.8](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.7...intl-messageformat-parser@1.6.8) (2019-06-18)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.7](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.6...intl-messageformat-parser@1.6.7) (2019-06-18)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.6](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.5...intl-messageformat-parser@1.6.6) (2019-06-12)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.5](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.3...intl-messageformat-parser@1.6.5) (2019-06-03)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.4](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.3...intl-messageformat-parser@1.6.4) (2019-06-03)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.3](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.2...intl-messageformat-parser@1.6.3) (2019-05-28)
**Note:** Version bump only for package intl-messageformat-parser
## [1.6.2](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.2...intl-messageformat-parser@1.6.2) (2019-05-28)

34
node_modules/intl-messageformat-parser/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,34 @@
Copyright 2014 Yahoo! Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Yahoo! Inc. nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
Inspired by and derived from:
messageformat.js https://github.com/SlexAxton/messageformat.js
Copyright 2014 Alex Sexton
Apache License, Version 2.0

152
node_modules/intl-messageformat-parser/README.md generated vendored Normal file
View File

@@ -0,0 +1,152 @@
# Intl MessageFormat Parser
Parses [ICU Message strings][icu] into an AST via JavaScript.
[![npm Version][npm-badge]][npm]
## Overview
This package implements a parser in JavaScript that parses the industry standard [ICU Message strings][icu] — used for internationalization — into an AST. The produced AST can then be used by a compiler, like [`intl-messageformat`][intl-mf], to produce localized formatted strings for display to users.
This parser is written in [PEG.js][], a parser generator for JavaScript. This parser's implementation was inspired by and derived from Alex Sexton's [messageformat.js][] project. The differences from Alex's implementation are:
- This project is standalone.
- It's authored as ES6 modules compiled to CommonJS and the Bundle format for the browser.
- The produced AST is more descriptive and uses recursive structures.
- The keywords used in the AST match the ICU Message "spec".
## Usage
### Loading in the Browser
The `dist/` folder contains the version of this package for use in the browser, and it can be loaded and used like this:
```html
<script src="intl-messageformat-parser/dist/parser.min.js"></script>
<script>
IntlMessageFormatParser.parse('...');
</script>
```
### Loading in Node.js
This package can also be `require()`-ed in Node.js:
```js
var parser = require('intl-messageformat-parser');
parser.parse('...');
```
### Example
Given an ICU Message string like this:
```
On {takenDate, date, short} {name} took {numPhotos, plural,
=0 {no photos.}
=1 {one photo.}
other {# photos.}
}
```
```js
// Assume `msg` is the string above.
parser.parse(msg);
```
This parser will produce this AST:
```json
{
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "On "
},
{
"type": "argumentElement",
"id": "takenDate",
"format": {
"type": "dateFormat",
"style": "short"
}
},
{
"type": "messageTextElement",
"value": " "
},
{
"type": "argumentElement",
"id": "name",
"format": null
},
{
"type": "messageTextElement",
"value": " took "
},
{
"type": "argumentElement",
"id": "numPhotos",
"format": {
"type": "pluralFormat",
"offset": 0,
"options": [
{
"type": "optionalFormatPattern",
"selector": "=0",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "no photos."
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "=1",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "one photo."
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "other",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "# photos."
}
]
}
}
]
}
}
]
}
```
## License
This software is free to use under the Yahoo! Inc. BSD license.
See the [LICENSE file][] for license text and copyright information.
[npm]: https://www.npmjs.org/package/intl-messageformat-parser
[npm-badge]: https://img.shields.io/npm/v/intl-messageformat-parser.svg?style=flat-square
[icu]: http://userguide.icu-project.org/formatparse/messages
[intl-mf]: https://github.com/formatjs/formatjs
[peg.js]: https://pegjs.org/
[messageformat.js]: https://github.com/SlexAxton/messageformat.js
[license file]: https://github.com/formatjs/formatjs/blob/master/LICENSE

14
node_modules/intl-messageformat-parser/build.js generated vendored Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env node
const peg = require('pegjs')
const fs = require('fs')
const {outputFileSync} = require('fs-extra')
const grammar = fs.readFileSync('./src/parser.pegjs', 'utf-8')
// ES6
outputFileSync('src/parser.js', `export default ${peg.generate(grammar, {output: 'source'})}`)
// Globals
outputFileSync('dist/parser.js', peg.generate(grammar, {output: 'source', format: 'globals', exportVar: 'IntlMessageFormatParser'}))
// CJS
outputFileSync('lib/parser.js', peg.generate(grammar, {output: 'source', format: 'commonjs'}))

1552
node_modules/intl-messageformat-parser/dist/parser.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

63
node_modules/intl-messageformat-parser/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
export type Selector = string
export interface LocationDetails {
offset: number
line: number
column: number
}
export interface Location {
start: LocationDetails,
end: LocationDetails
}
export interface SimpleFormat {
type: 'numberFormat' | 'dateFormat' | 'timeFormat'
style: string
location: Location
}
export interface PluralFormat extends PluralStyle {
ordinal: false
}
export interface SelectFormat {
type: 'selectFormat'
options: OptionalFormatPattern[],
location: Location
}
export interface SelectOrdinalFormat extends PluralStyle {
ordinal: true,
}
export type ElementFormat = SimpleFormat | PluralFormat | SelectOrdinalFormat | SelectFormat
export interface OptionalFormatPattern {
type: 'optionalFormatPattern',
selector: Selector
value: MessageFormatPattern
location: Location
}
export interface PluralStyle {
type: 'pluralFormat',
offset: number
options: OptionalFormatPattern[],
location: Location
}
export interface MessageTextElement {
type: 'messageTextElement'
value: string
location: Location
}
export interface ArgumentElement {
type: 'argumentElement'
id: string
format: ElementFormat
location: Location
}
export type Element = MessageTextElement | ArgumentElement
export interface MessageFormatPattern {
type: 'messageFormatPattern',
elements: Array<Element>,
location: Location
}
interface Parser {
parse (msg: string): MessageFormatPattern
SyntaxError: Error
}
declare const parser: Parser
export default parser

6
node_modules/intl-messageformat-parser/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
'use strict';
var parser = require('./lib/parser')
module.exports = parser
module.exports['default'] = parser

1551
node_modules/intl-messageformat-parser/lib/parser.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

44
node_modules/intl-messageformat-parser/package.json generated vendored Normal file
View File

@@ -0,0 +1,44 @@
{
"name": "intl-messageformat-parser",
"version": "1.8.1",
"description": "Parses ICU Message strings into an AST via JavaScript.",
"main": "index.js",
"module": "src/parser.js",
"scripts": {
"clean": "rimraf dist lib",
"build": "./build.js",
"benchmark": "./test/benchmark.js",
"prepublish": "npm run build",
"test": "mocha --opts ../../mocha.opts tests/index.ts"
},
"contributors": [
"Eric Ferraiuolo <eferraiuolo@gmail.com>",
"Long Ho <holevietlong@gmail.com>",
"Ryuichi Okumura <okuryu@okuryu.com>",
"Seth Bertalotto <seth@bertalotto.net>",
"Song Seunggeun <giff.song@gmail.com>",
"Tobias Bieniek <tobias.bieniek@gmail.com>"
],
"repository": {
"type": "git",
"url": "git://github.com/formatjs/formatjs.git"
},
"keywords": [
"i18n",
"intl",
"internationalization",
"localization",
"globalization",
"messageformat",
"parser",
"plural",
"icu"
],
"author": "Eric Ferraiuolo <eferraiuolo@gmail.com>",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/formatjs/formatjs/issues"
},
"homepage": "https://github.com/formatjs/formatjs",
"gitHead": "60ddf374ed659ffe2f3807c3c7df411c80492761"
}

1552
node_modules/intl-messageformat-parser/src/parser.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

167
node_modules/intl-messageformat-parser/src/parser.pegjs generated vendored Normal file
View File

@@ -0,0 +1,167 @@
/*
Copyright 2014, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
/*
Inspired by and derivied from:
messageformat.js https://github.com/SlexAxton/messageformat.js
Copyright 2014 Alex Sexton
Apache License, Version 2.0
*/
start
= messageFormatPattern
messageFormatPattern
= elements:messageFormatElement* {
return {
type : 'messageFormatPattern',
elements: elements,
location: location()
};
}
messageFormatElement
= messageTextElement
/ argumentElement
messageText
= chunks:(_ chars _)+ {
return chunks.reduce(function (all, chunk) {
return all.concat(chunk)
}, []).join('')
}
/ $(ws)
messageTextElement
= messageText:messageText {
return {
type : 'messageTextElement',
value: messageText,
location: location()
};
}
argument
= number
/ chars:quoteEscapedChar* { return chars.join(''); }
argumentElement
= '{' _ id:argument _ format:(',' _ elementFormat)? _ '}' {
return {
type : 'argumentElement',
id : id,
format: format && format[2],
location: location()
};
}
elementFormat
= simpleFormat
/ pluralFormat
/ selectOrdinalFormat
/ selectFormat
simpleFormat
= type:('number' / 'date' / 'time') _ style:(',' _ chars)? {
return {
type : type + 'Format',
style: style && style[2],
location: location()
};
}
pluralFormat
= 'plural' _ ',' _ pluralStyle:pluralStyle {
return {
type : pluralStyle.type,
ordinal: false,
offset : pluralStyle.offset || 0,
options: pluralStyle.options,
location: location()
};
}
selectOrdinalFormat
= 'selectordinal' _ ',' _ pluralStyle:pluralStyle {
return {
type : pluralStyle.type,
ordinal: true,
offset : pluralStyle.offset || 0,
options: pluralStyle.options,
location: location()
}
}
selectFormat
= 'select' _ ',' _ options:optionalFormatPattern+ {
return {
type : 'selectFormat',
options: options,
location: location()
};
}
selector
= $('=' number)
/ chars
optionalFormatPattern
= _ selector:selector _ '{' pattern:messageFormatPattern '}' {
return {
type : 'optionalFormatPattern',
selector: selector,
value : pattern,
location: location()
};
}
offset
= 'offset:' _ number:number {
return number;
}
pluralStyle
= offset:offset? _ options:optionalFormatPattern+ {
return {
type : 'pluralFormat',
offset : offset,
options: options,
location: location()
};
}
// -- Helpers ------------------------------------------------------------------
ws 'whitespace' = [ \t\n\r]+
_ 'optionalWhitespace' = $(ws*)
digit = [0-9]
hexDigit = [0-9a-f]i
number = digits:('0' / $([1-9] digit*)) {
return parseInt(digits, 10);
}
quoteEscapedChar =
!("'" / [ \t\n\r,.+={}#]) char:. { return char; }
/ "'" sequence:escape { return sequence; }
apostrophe = "'"
escape = [ \t\n\r,.+={}#] / apostrophe
char
=
"'" sequence:apostrophe { return sequence; }
/ [^{}\\\0-\x1F\x7f \t\n\r]
/ '\\\\' { return '\\'; }
/ '\\#' { return '\\#'; }
/ '\\{' { return '\u007B'; }
/ '\\}' { return '\u007D'; }
/ '\\u' digits:$(hexDigit hexDigit hexDigit hexDigit) {
return String.fromCharCode(parseInt(digits, 16));
}
chars = chars:char+ { return chars.join(''); }