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>
80 lines
1.6 KiB
JavaScript
80 lines
1.6 KiB
JavaScript
let Declaration = require('../declaration')
|
|
|
|
class TransformDecl extends Declaration {
|
|
/**
|
|
* Is transform contain 3D commands
|
|
*/
|
|
contain3d(decl) {
|
|
if (decl.prop === 'transform-origin') {
|
|
return false
|
|
}
|
|
|
|
for (let func of TransformDecl.functions3d) {
|
|
if (decl.value.includes(`${func}(`)) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
/**
|
|
* Don't add prefix for IE in keyframes
|
|
*/
|
|
insert(decl, prefix, prefixes) {
|
|
if (prefix === '-ms-') {
|
|
if (!this.contain3d(decl) && !this.keyframeParents(decl)) {
|
|
return super.insert(decl, prefix, prefixes)
|
|
}
|
|
} else if (prefix === '-o-') {
|
|
if (!this.contain3d(decl)) {
|
|
return super.insert(decl, prefix, prefixes)
|
|
}
|
|
} else {
|
|
return super.insert(decl, prefix, prefixes)
|
|
}
|
|
return undefined
|
|
}
|
|
|
|
/**
|
|
* Recursively check all parents for @keyframes
|
|
*/
|
|
keyframeParents(decl) {
|
|
let { parent } = decl
|
|
while (parent) {
|
|
if (parent.type === 'atrule' && parent.name === 'keyframes') {
|
|
return true
|
|
}
|
|
;({ parent } = parent)
|
|
}
|
|
return false
|
|
}
|
|
|
|
/**
|
|
* Replace rotateZ to rotate for IE 9
|
|
*/
|
|
set(decl, prefix) {
|
|
decl = super.set(decl, prefix)
|
|
if (prefix === '-ms-') {
|
|
decl.value = decl.value.replace(/rotatez/gi, 'rotate')
|
|
}
|
|
return decl
|
|
}
|
|
}
|
|
|
|
TransformDecl.names = ['transform', 'transform-origin']
|
|
|
|
TransformDecl.functions3d = [
|
|
'matrix3d',
|
|
'translate3d',
|
|
'translateZ',
|
|
'scale3d',
|
|
'scaleZ',
|
|
'rotate3d',
|
|
'rotateX',
|
|
'rotateY',
|
|
'perspective'
|
|
]
|
|
|
|
module.exports = TransformDecl
|