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>
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = parseMedia;
|
|
|
|
var _Container = require('./nodes/Container');
|
|
|
|
var _Container2 = _interopRequireDefault(_Container);
|
|
|
|
var _parsers = require('./parsers');
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/**
|
|
* Parses a media query list into an array of nodes. A typical node signature:
|
|
* {string} node.type -- one of: 'media-query', 'media-type', 'keyword',
|
|
* 'media-feature-expression', 'media-feature', 'colon', 'value'
|
|
* {string} node.value -- the contents of a particular element, trimmed
|
|
* e.g.: `screen`, `max-width`, `1024px`
|
|
* {string} node.after -- whitespaces that follow the element
|
|
* {string} node.before -- whitespaces that precede the element
|
|
* {string} node.sourceIndex -- the index of the element in a source media
|
|
* query list, 0-based
|
|
* {object} node.parent -- a link to the parent node (a container)
|
|
*
|
|
* Some nodes (media queries, media feature expressions) contain other nodes.
|
|
* They additionally have:
|
|
* {array} node.nodes -- an array of nodes of the type described here
|
|
* {funciton} node.each -- traverses direct children of the node, calling
|
|
* a callback for each one
|
|
* {funciton} node.walk -- traverses ALL descendants of the node, calling
|
|
* a callback for each one
|
|
*/
|
|
|
|
function parseMedia(value) {
|
|
return new _Container2.default({
|
|
nodes: (0, _parsers.parseMediaList)(value),
|
|
type: 'media-query-list',
|
|
value: value.trim()
|
|
});
|
|
} |