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>
89 lines
931 B
JavaScript
89 lines
931 B
JavaScript
'use strict';
|
|
|
|
const uniteSets = require('../utils/uniteSets.js');
|
|
|
|
const lengthUnits = new Set([
|
|
// Font-relative length units
|
|
'cap',
|
|
'ch',
|
|
'em',
|
|
'ex',
|
|
'ic',
|
|
'lh',
|
|
'rcap',
|
|
'rch',
|
|
'rem',
|
|
'rex',
|
|
'ric',
|
|
'rlh',
|
|
// Viewport-percentage lengths
|
|
'dvb',
|
|
'dvh',
|
|
'dvi',
|
|
'dvmax',
|
|
'dvmin',
|
|
'dvw',
|
|
'lvb',
|
|
'lvh',
|
|
'lvi',
|
|
'lvmax',
|
|
'lvmin',
|
|
'lvw',
|
|
'svb',
|
|
'svh',
|
|
'svi',
|
|
'svmax',
|
|
'svmin',
|
|
'svw',
|
|
'vb',
|
|
'vh',
|
|
'vi',
|
|
'vw',
|
|
'vmin',
|
|
'vmax',
|
|
'vm',
|
|
// Absolute length units
|
|
'px',
|
|
'mm',
|
|
'cm',
|
|
'in',
|
|
'pt',
|
|
'pc',
|
|
'q',
|
|
'mozmm',
|
|
// Flexible length units
|
|
'fr',
|
|
// Container query units
|
|
'cqw',
|
|
'cqh',
|
|
'cqi',
|
|
'cqb',
|
|
'cqmin',
|
|
'cqmax',
|
|
]);
|
|
|
|
const units = uniteSets(lengthUnits, [
|
|
// Relative length units
|
|
'%',
|
|
// Time length units
|
|
's',
|
|
'ms',
|
|
// Angle
|
|
'deg',
|
|
'grad',
|
|
'turn',
|
|
'rad',
|
|
// Frequency
|
|
'Hz',
|
|
'kHz',
|
|
// Resolution
|
|
'dpi',
|
|
'dpcm',
|
|
'dppx',
|
|
]);
|
|
|
|
module.exports = {
|
|
lengthUnits,
|
|
units,
|
|
};
|