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>
92 lines
2.4 KiB
JavaScript
92 lines
2.4 KiB
JavaScript
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.applyFilters = exports.addFilter = exports.addAction = exports.actions = void 0;
|
|
Object.defineProperty(exports, "createHooks", {
|
|
enumerable: true,
|
|
get: function () {
|
|
return _createHooks.default;
|
|
}
|
|
});
|
|
exports.removeFilter = exports.removeAllFilters = exports.removeAllActions = exports.removeAction = exports.hasFilter = exports.hasAction = exports.filters = exports.doingFilter = exports.doingAction = exports.doAction = exports.didFilter = exports.didAction = exports.defaultHooks = exports.currentFilter = exports.currentAction = void 0;
|
|
var _createHooks = _interopRequireDefault(require("./createHooks"));
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
/** @typedef {(...args: any[])=>any} Callback */
|
|
|
|
/**
|
|
* @typedef Handler
|
|
* @property {Callback} callback The callback
|
|
* @property {string} namespace The namespace
|
|
* @property {number} priority The namespace
|
|
*/
|
|
|
|
/**
|
|
* @typedef Hook
|
|
* @property {Handler[]} handlers Array of handlers
|
|
* @property {number} runs Run counter
|
|
*/
|
|
|
|
/**
|
|
* @typedef Current
|
|
* @property {string} name Hook name
|
|
* @property {number} currentIndex The index
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Record<string, Hook> & {__current: Current[]}} Store
|
|
*/
|
|
|
|
/**
|
|
* @typedef {'actions' | 'filters'} StoreKey
|
|
*/
|
|
|
|
/**
|
|
* @typedef {import('./createHooks').Hooks} Hooks
|
|
*/
|
|
|
|
const defaultHooks = exports.defaultHooks = (0, _createHooks.default)();
|
|
const {
|
|
addAction,
|
|
addFilter,
|
|
removeAction,
|
|
removeFilter,
|
|
hasAction,
|
|
hasFilter,
|
|
removeAllActions,
|
|
removeAllFilters,
|
|
doAction,
|
|
applyFilters,
|
|
currentAction,
|
|
currentFilter,
|
|
doingAction,
|
|
doingFilter,
|
|
didAction,
|
|
didFilter,
|
|
actions,
|
|
filters
|
|
} = defaultHooks;
|
|
exports.filters = filters;
|
|
exports.actions = actions;
|
|
exports.didFilter = didFilter;
|
|
exports.didAction = didAction;
|
|
exports.doingFilter = doingFilter;
|
|
exports.doingAction = doingAction;
|
|
exports.currentFilter = currentFilter;
|
|
exports.currentAction = currentAction;
|
|
exports.applyFilters = applyFilters;
|
|
exports.doAction = doAction;
|
|
exports.removeAllFilters = removeAllFilters;
|
|
exports.removeAllActions = removeAllActions;
|
|
exports.hasFilter = hasFilter;
|
|
exports.hasAction = hasAction;
|
|
exports.removeFilter = removeFilter;
|
|
exports.removeAction = removeAction;
|
|
exports.addFilter = addFilter;
|
|
exports.addAction = addAction;
|
|
//# sourceMappingURL=index.js.map
|