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,13 @@
export default commentHandler;
export type CommentHandler = import('./index.js').CommentHandler;
/**
* @typedef {import('./index.js').CommentHandler} CommentHandler
*/
/**
* @param {{[name: string]: any}} settings
* @returns {CommentHandler}
*/
declare function commentHandler(settings: {
[name: string]: any;
}): CommentHandler;
//# sourceMappingURL=commentHandler.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"commentHandler.d.ts","sourceRoot":"","sources":["../src/commentHandler.js"],"names":[],"mappings":";6BAWa,OAAO,YAAY,EAAE,cAAc;AADhD;;GAEG;AAEH;;;GAGG;AACH;;IAFa,cAAc,CAwB1B"}

View File

@@ -0,0 +1,78 @@
export type JsdocTypeLine = {
delimiter: string;
postDelimiter: string;
rawType: string;
initial: string;
type: "JsdocTypeLine";
};
export type JsdocDescriptionLine = {
delimiter: string;
description: string;
postDelimiter: string;
initial: string;
type: "JsdocDescriptionLine";
};
export type JsdocInlineTagNoType = {
format: 'pipe' | 'plain' | 'prefix' | 'space';
namepathOrURL: string;
tag: string;
text: string;
};
export type JsdocInlineTag = JsdocInlineTagNoType & {
type: "JsdocInlineTag";
};
export type JsdocTag = {
delimiter: string;
description: string;
descriptionLines: JsdocDescriptionLine[];
initial: string;
inlineTags: JsdocInlineTag[];
name: string;
postDelimiter: string;
postName: string;
postTag: string;
postType: string;
rawType: string;
parsedType: import('jsdoc-type-pratt-parser').RootResult | null;
tag: string;
type: "JsdocTag";
typeLines: JsdocTypeLine[];
};
export type Integer = number;
export type JsdocBlock = {
delimiter: string;
description: string;
descriptionEndLine?: Integer;
descriptionLines: JsdocDescriptionLine[];
descriptionStartLine?: Integer;
hasPreterminalDescription: 0 | 1;
hasPreterminalTagDescription?: 1;
initial: string;
inlineTags: JsdocInlineTag[];
lastDescriptionLine?: Integer;
endLine: Integer;
lineEnd: string;
postDelimiter: string;
tags: JsdocTag[];
terminal: string;
type: "JsdocBlock";
};
/**
* Converts comment parser AST to ESTree format.
* @param {import('./index.js').JsdocBlockWithInline} jsdoc
* @param {import('jsdoc-type-pratt-parser').ParseMode} mode
* @param {object} opts
* @param {boolean} [opts.throwOnTypeParsingErrors]
* @returns {JsdocBlock}
*/
export function commentParserToESTree(jsdoc: import('./index.js').JsdocBlockWithInline, mode: import('jsdoc-type-pratt-parser').ParseMode, { throwOnTypeParsingErrors }?: {
throwOnTypeParsingErrors?: boolean | undefined;
}): JsdocBlock;
export namespace jsdocVisitorKeys {
let JsdocBlock: string[];
let JsdocDescriptionLine: never[];
let JsdocTypeLine: never[];
let JsdocTag: string[];
let JsdocInlineTag: never[];
}
//# sourceMappingURL=commentParserToESTree.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"commentParserToESTree.d.ts","sourceRoot":"","sources":["../src/commentParserToESTree.js"],"names":[],"mappings":"4BA+Ba;IACZ,SAAa,EAAE,MAAM,CAAC;IACtB,aAAiB,EAAE,MAAM,CAAC;IAC1B,OAAW,EAAE,MAAM,CAAC;IACpB,OAAW,EAAE,MAAM,CAAC;IACpB,IAAQ,EAAE,eAAe,CAAA;CACtB;mCAIS;IACZ,SAAa,EAAE,MAAM,CAAC;IACtB,WAAe,EAAE,MAAM,CAAC;IACxB,aAAiB,EAAE,MAAM,CAAC;IAC1B,OAAW,EAAE,MAAM,CAAC;IACpB,IAAQ,EAAE,sBAAsB,CAAA;CAC7B;mCAIS;IACZ,MAAU,EAAE,MAAM,GAAG,OAAO,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AAC;IACrB,QAAY,EAAE,MAAM,CAAC;IACrB,IAAQ,EAAE,YAAY,CAAC;CACpB;AAmBJ;;;;;;;GAOG;AACH,6CANW,OAAO,YAAY,EAAE,oBAAoB,QACzC,OAAO,yBAAyB,EAAE,SAAS;IAE5B,wBAAwB;IACrC,UAAU,CA0RtB"}

View File

@@ -0,0 +1,18 @@
export default estreeToString;
export type ESTreeToStringOptions = import('./index.js').ESTreeToStringOptions;
/**
* @todo convert for use by escodegen (until may be patched to support
* custom entries?).
* @param {import('./commentParserToESTree.js').JsdocBlock|
* import('./commentParserToESTree.js').JsdocDescriptionLine|
* import('./commentParserToESTree.js').JsdocTypeLine|
* import('./commentParserToESTree.js').JsdocTag|
* import('./commentParserToESTree.js').JsdocInlineTag|
* import('jsdoc-type-pratt-parser').RootResult
* } node
* @param {ESTreeToStringOptions} opts
* @throws {Error}
* @returns {string}
*/
declare function estreeToString(node: import('./commentParserToESTree.js').JsdocBlock | import('./commentParserToESTree.js').JsdocDescriptionLine | import('./commentParserToESTree.js').JsdocTypeLine | import('./commentParserToESTree.js').JsdocTag | import('./commentParserToESTree.js').JsdocInlineTag | import('jsdoc-type-pratt-parser').RootResult, opts?: ESTreeToStringOptions): string;
//# sourceMappingURL=estreeToString.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"estreeToString.d.ts","sourceRoot":"","sources":["../src/estreeToString.js"],"names":[],"mappings":";oCAQa,OAAO,YAAY,EAAE,qBAAqB;AAwGvD;;;;;;;;;;;;;GAaG;AACH,sCAXW,OAAO,4BAA4B,EAAE,UAAU,GACzD,OAAW,4BAA4B,EAAE,oBAAoB,GAC7D,OAAW,4BAA4B,EAAE,aAAa,GACtD,OAAW,4BAA4B,EAAE,QAAQ,GACjD,OAAW,4BAA4B,EAAE,cAAc,GACvD,OAAW,yBAAyB,EAAE,UAAU,SAEtC,qBAAqB,GAEnB,MAAM,CA4DlB"}

1161
node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

35
node_modules/@es-joy/jsdoccomment/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
export { visitorKeys as jsdocTypeVisitorKeys } from "jsdoc-type-pratt-parser";
export * from "jsdoc-type-pratt-parser";
export * from "./parseComment.js";
export * from "./commentParserToESTree.js";
export * from "./jsdoccomment.js";
export { default as commentHandler } from "./commentHandler.js";
export { default as toCamelCase } from "./toCamelCase.js";
export { default as estreeToString } from "./estreeToString.js";
export type InlineTag = import('./commentParserToESTree.js').JsdocInlineTagNoType & {
start: number;
end: number;
};
export type JsdocTagWithInline = import('comment-parser').Spec & {
line?: import('./commentParserToESTree.js').Integer;
inlineTags: (import('./commentParserToESTree.js').JsdocInlineTagNoType & {
line?: import('./commentParserToESTree.js').Integer;
})[];
};
/**
* Expands on comment-parser's `Block` interface.
*/
export type JsdocBlockWithInline = {
description: string;
source: import('comment-parser').Line[];
problems: import('comment-parser').Problem[];
tags: JsdocTagWithInline[];
inlineTags: (import('./commentParserToESTree.js').JsdocInlineTagNoType & {
line?: import('./commentParserToESTree.js').Integer;
})[];
};
export type ESTreeToStringOptions = {
preferRawType?: boolean;
};
export type CommentHandler = (commentSelector: string, jsdoc: import('./index.js').JsdocBlockWithInline) => boolean;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;wBACa,OAAO,4BAA4B,EAAE,oBAAoB,GAAG;IACxE,KAAS,EAAE,MAAM,CAAC;IAClB,GAAO,EAAE,MAAM,CAAC;CACb;iCAIS,OAAO,gBAAgB,EAAE,IAAI,GAAG;IAC5C,IAAQ,CAAC,EAAE,OAAO,4BAA4B,EAAE,OAAO,CAAC;IACxD,UAAc,EAAE,CAAC,OAAO,4BAA4B,EAAE,oBAAoB,GAAG;QAC7E,IAAU,CAAC,EAAE,OAAO,4BAA4B,EAAE,OAAO,CAAA;KACpD,CAAC,EAAE,CAAA;CACL;;;;mCAKS;IACZ,WAAe,EAAE,MAAM,CAAC;IACxB,MAAU,EAAE,OAAO,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC5C,QAAY,EAAE,OAAO,gBAAgB,EAAE,OAAO,EAAE,CAAC;IACjD,IAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,UAAc,EAAE,CAAC,OAAO,4BAA4B,EAAE,oBAAoB,GAAG;QAC7E,IAAU,CAAC,EAAE,OAAO,4BAA4B,EAAE,OAAO,CAAA;KACpD,CAAC,EAAE,CAAA;CACL;oCAIS;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAC;+CAK3B,MAAM,SACN,OAAO,YAAY,EAAE,oBAAoB,KACvC,OAAO"}

View File

@@ -0,0 +1,69 @@
export type Token = import('eslint').AST.Token | import('estree').Comment | {
type: import('eslint').AST.TokenType | "Line" | "Block" | "Shebang";
range: [number, number];
value: string;
};
export type ESLintOrTSNode = import('eslint').Rule.Node | import('@typescript-eslint/types').TSESTree.Node;
export type int = number;
/**
* Reduces the provided node to the appropriate node for evaluating
* JSDoc comment status.
*
* @param {import('eslint').Rule.Node} node An AST node.
* @param {import('eslint').SourceCode} sourceCode The ESLint SourceCode.
* @returns {import('eslint').Rule.Node} The AST node that
* can be evaluated for appropriate JSDoc comments.
*/
export function getReducedASTNode(node: import('eslint').Rule.Node, sourceCode: import('eslint').SourceCode): import('eslint').Rule.Node;
/**
* Retrieves the JSDoc comment for a given node.
*
* @param {import('eslint').SourceCode} sourceCode The ESLint SourceCode
* @param {import('eslint').Rule.Node} node The AST node to get
* the comment for.
* @param {{maxLines: int, minLines: int, [name: string]: any}} settings The
* settings in context
* @returns {Token|null} The Block comment
* token containing the JSDoc comment for the given node or
* null if not found.
* @public
*/
export function getJSDocComment(sourceCode: import('eslint').SourceCode, node: import('eslint').Rule.Node, settings: {
[name: string]: any;
maxLines: int;
minLines: int;
}): Token | null;
/**
* @param {(import('estree').Comment|import('eslint').Rule.Node) & {
* declaration?: any,
* decorators?: any[],
* parent?: import('eslint').Rule.Node & {
* decorators?: any[]
* }
* }} node
* @returns {import('@typescript-eslint/types').TSESTree.Decorator|undefined}
*/
export function getDecorator(node: (import('estree').Comment | import('eslint').Rule.Node) & {
declaration?: any;
decorators?: any[];
parent?: import('eslint').Rule.Node & {
decorators?: any[];
};
}): import('@typescript-eslint/types').TSESTree.Decorator | undefined;
/**
* Checks for the presence of a JSDoc comment for the given node and returns it.
*
* @param {import('eslint').Rule.Node} astNode The AST node to get
* the comment for.
* @param {import('eslint').SourceCode} sourceCode
* @param {{maxLines: int, minLines: int, [name: string]: any}} settings
* @returns {Token|null} The Block comment token containing the JSDoc comment
* for the given node or null if not found.
* @private
*/
export function findJSDocComment(astNode: import('eslint').Rule.Node, sourceCode: import('eslint').SourceCode, settings: {
[name: string]: any;
maxLines: int;
minLines: int;
}): Token | null;
//# sourceMappingURL=jsdoccomment.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"jsdoccomment.d.ts","sourceRoot":"","sources":["../src/jsdoccomment.js"],"names":[],"mappings":"oBAQa,OAAO,QAAQ,EAAE,GAAG,CAAC,KAAK,GAAG,OAAO,QAAQ,EAAE,OAAO,GAAG;IACpE,IAAQ,EAAE,OAAO,QAAQ,EAAE,GAAG,CAAC,SAAS,GAAC,MAAM,GAAC,OAAO,GAAC,SAAS,CAAC;IAClE,KAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,KAAS,EAAE,MAAM,CAAA;CACd;6BAIS,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,GACtC,OAAW,0BAA0B,EAAE,QAAQ,CAAC,IAAI;kBAIxC,MAAM;AAiKnB;;;;;;;;GAQG;AACH,wCALW,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,cAC1B,OAAO,QAAQ,EAAE,UAAU,GACzB,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,CAiFtC;AAyED;;;;;;;;;;;;GAYG;AACH,4CAVW,OAAO,QAAQ,EAAE,UAAU,QAC3B,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI;;cAEf,GAAG;cAAY,GAAG;IAE3B,KAAK,GAAC,IAAI,CAStB;AApUD;;;;;;;;;GASG;AACH,mCATW,CAAC,OAAO,QAAQ,EAAE,OAAO,GAAC,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG;IAClE,WAAe,CAAC,EAAE,GAAG,CAAC;IACtB,UAAc,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,MAAU,CAAC,EAAE,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG;QAC1C,UAAgB,CAAC,EAAE,GAAG,EAAE,CAAA;KACnB,CAAA;CACF,GACS,OAAO,0BAA0B,EAAE,QAAQ,CAAC,SAAS,GAAC,SAAS,CAK3E;AA+ND;;;;;;;;;;GAUG;AACH,0CARW,OAAO,QAAQ,EAAE,IAAI,CAAC,IAAI,cAE1B,OAAO,QAAQ,EAAE,UAAU;;cAChB,GAAG;cAAY,GAAG;IAC3B,KAAK,GAAC,IAAI,CA8DtB"}

View File

@@ -0,0 +1,34 @@
export function hasSeeWithLink(spec: import('comment-parser').Spec): boolean;
export const defaultNoTypes: string[];
export const defaultNoNames: string[];
/**
* Can't import `comment-parser/es6/parser/tokenizers/index.js`,
* so we redefine here.
*/
export type CommentParserTokenizer = (spec: import('comment-parser').Spec) => import('comment-parser').Spec;
/**
* Can't import `comment-parser/es6/parser/tokenizers/index.js`,
* so we redefine here.
* @typedef {(spec: import('comment-parser').Spec) =>
* import('comment-parser').Spec} CommentParserTokenizer
*/
/**
* @param {object} [cfg]
* @param {string[]} [cfg.noTypes]
* @param {string[]} [cfg.noNames]
* @returns {CommentParserTokenizer[]}
*/
export function getTokenizers({ noTypes, noNames }?: {
noTypes?: string[] | undefined;
noNames?: string[] | undefined;
} | undefined): CommentParserTokenizer[];
/**
* Accepts a comment token and converts it into `comment-parser` AST.
* @param {{value: string}} commentNode
* @param {string} [indent] Whitespace
* @returns {import('./index.js').JsdocBlockWithInline}
*/
export function parseComment(commentNode: {
value: string;
}, indent?: string | undefined): import('./index.js').JsdocBlockWithInline;
//# sourceMappingURL=parseComment.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"parseComment.d.ts","sourceRoot":"","sources":["../src/parseComment.js"],"names":[],"mappings":"AAmBO,qCAHI,OAAO,gBAAgB,EAAE,IAAI,GAC3B,OAAO,CAInB;AAED,sCAIE;AAEF,sCAWE;;;;;4CAUkB,OAAO,gBAAgB,EAAE,IAAI,KAChD,OAAW,gBAAgB,EAAE,IAAI;AAJlC;;;;;GAKG;AAEH;;;;;GAKG;AACH;;;gBAFa,sBAAsB,EAAE,CAkFpC;AAED;;;;;GAKG;AACH,0CAJW;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,gCAEb,OAAO,YAAY,EAAE,oBAAoB,CASrD"}

View File

@@ -0,0 +1,9 @@
/**
* Splits the `{@prefix}` from remaining `Spec.lines[].token.description`
* into the `inlineTags` tokens, and populates `spec.inlineTags`
* @param {import('comment-parser').Block} block
* @returns {import('./index.js').JsdocBlockWithInline}
*/
export default function parseInlineTags(block: import('comment-parser').Block): import('./index.js').JsdocBlockWithInline;
export type InlineTag = import('./index.js').InlineTag;
//# sourceMappingURL=parseInlineTags.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"parseInlineTags.d.ts","sourceRoot":"","sources":["../src/parseInlineTags.js"],"names":[],"mappings":"AAiFA;;;;;GAKG;AACH,+CAHW,OAAO,gBAAgB,EAAE,KAAK,GAC5B,OAAO,YAAY,EAAE,oBAAoB,CA0BrD;wBArFY,OAAO,YAAY,EAAE,SAAS"}

View File

@@ -0,0 +1,7 @@
export default toCamelCase;
/**
* @param {string} str
* @returns {string}
*/
declare function toCamelCase(str: string): string;
//# sourceMappingURL=toCamelCase.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"toCamelCase.d.ts","sourceRoot":"","sources":["../src/toCamelCase.js"],"names":[],"mappings":";AAAA;;;GAGG;AACH,kCAHW,MAAM,GACJ,MAAM,CAQlB"}