UNPKG

@wordpress/editor

Version:
61 lines (55 loc) 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerEntityAction = registerEntityAction; exports.unregisterEntityAction = unregisterEntityAction; var _data = require("@wordpress/data"); var _lockUnlock = require("../lock-unlock"); var _store = require("../store"); /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef {import('@wordpress/dataviews').Action} Action */ /** * Registers a new DataViews action. * * This is an experimental API and is subject to change. * it's only available in the Gutenberg plugin for now. * * @param {string} kind Entity kind. * @param {string} name Entity name. * @param {Action} config Action configuration. */ function registerEntityAction(kind, name, config) { const { registerEntityAction: _registerEntityAction } = (0, _lockUnlock.unlock)((0, _data.dispatch)(_store.store)); if (globalThis.IS_GUTENBERG_PLUGIN) { _registerEntityAction(kind, name, config); } } /** * Unregisters a DataViews action. * * This is an experimental API and is subject to change. * it's only available in the Gutenberg plugin for now. * * @param {string} kind Entity kind. * @param {string} name Entity name. * @param {string} actionId Action ID. */ function unregisterEntityAction(kind, name, actionId) { const { unregisterEntityAction: _unregisterEntityAction } = (0, _lockUnlock.unlock)((0, _data.dispatch)(_store.store)); if (globalThis.IS_GUTENBERG_PLUGIN) { _unregisterEntityAction(kind, name, actionId); } } //# sourceMappingURL=api.js.map