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>
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
/**
|
|
* Parts of this source were derived and modified from react-native-web,
|
|
* released under the MIT license.
|
|
*
|
|
* Copyright (c) 2016-present, Nicolas Gallagher.
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
*/
|
|
const Platform = {
|
|
OS: 'web',
|
|
select: spec => 'web' in spec ? spec.web : spec.default,
|
|
isWeb: true
|
|
};
|
|
/**
|
|
* Component used to detect the current Platform being used.
|
|
* Use Platform.OS === 'web' to detect if running on web enviroment.
|
|
*
|
|
* This is the same concept as the React Native implementation.
|
|
*
|
|
* @see https://reactnative.dev/docs/platform-specific-code#platform-module
|
|
*
|
|
* Here is an example of how to use the select method:
|
|
* @example
|
|
* ```js
|
|
* import { Platform } from '@wordpress/element';
|
|
*
|
|
* const placeholderLabel = Platform.select( {
|
|
* native: __( 'Add media' ),
|
|
* web: __( 'Drag images, upload new ones or select files from your library.' ),
|
|
* } );
|
|
* ```
|
|
*/
|
|
var _default = exports.default = Platform;
|
|
//# sourceMappingURL=platform.js.map
|