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>
26 lines
697 B
JavaScript
26 lines
697 B
JavaScript
'use strict';
|
|
const BasePlugin = require('../plugin');
|
|
const { IE_5_5, IE_6, IE_7 } = require('../dictionary/browsers');
|
|
const { DECL } = require('../dictionary/postcss');
|
|
|
|
module.exports = class Important extends BasePlugin {
|
|
/** @param {import('postcss').Result=} result */
|
|
constructor(result) {
|
|
super([IE_5_5, IE_6, IE_7], [DECL], result);
|
|
}
|
|
/**
|
|
* @param {import('postcss').Declaration} decl
|
|
* @return {void}
|
|
*/
|
|
detect(decl) {
|
|
const match = decl.value.match(/!\w/);
|
|
if (match && match.index) {
|
|
const hack = decl.value.substr(match.index, decl.value.length - 1);
|
|
this.push(decl, {
|
|
identifier: '!important',
|
|
hack,
|
|
});
|
|
}
|
|
}
|
|
};
|