UNPKG

@alilc/lowcode-plugin-command

Version:
39 lines 1.32 kB
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; import _regeneratorRuntime from "@babel/runtime/regenerator"; import { nodeCommand } from './node-command'; import { historyCommand } from './history-command'; export var CommandPlugin = function CommandPlugin(ctx) { var plugins = ctx.plugins; return { init: function init() { return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() { return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return plugins.register(nodeCommand, {}, { autoInit: true }); case 2: _context.next = 4; return plugins.register(historyCommand, {}, { autoInit: true }); case 4: case "end": return _context.stop(); } }, _callee); }))(); }, destroy: function destroy() { plugins["delete"](nodeCommand.pluginName); plugins["delete"](historyCommand.pluginName); } }; }; CommandPlugin.pluginName = '___default_command___'; CommandPlugin.meta = { commandScope: 'common' }; export default CommandPlugin;