@alilc/lowcode-plugin-components-pane
Version:
41 lines • 1.9 kB
JavaScript
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import ComponentsPane from './pane';
var ComponentPanelPlugin = function ComponentPanelPlugin(ctx) {
return {
init: function init() {
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var _componentsPane$disab;
var skeleton, project, componentsPane;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
skeleton = ctx.skeleton, project = ctx.project; // 注册组件面板
componentsPane = skeleton.add({
area: 'leftArea',
type: 'PanelDock',
name: 'componentsPane',
content: ComponentsPane,
contentProps: {},
props: {
align: 'top',
icon: 'zujianku',
description: '组件库'
}
});
componentsPane === null || componentsPane === void 0 ? void 0 : (_componentsPane$disab = componentsPane.disable) === null || _componentsPane$disab === void 0 ? void 0 : _componentsPane$disab.call(componentsPane);
project.onSimulatorRendererReady(function () {
var _componentsPane$enabl;
componentsPane === null || componentsPane === void 0 ? void 0 : (_componentsPane$enabl = componentsPane.enable) === null || _componentsPane$enabl === void 0 ? void 0 : _componentsPane$enabl.call(componentsPane);
});
case 4:
case "end":
return _context.stop();
}
}, _callee);
}))();
}
};
};
ComponentPanelPlugin.pluginName = 'ComponentPanelPlugin';
export default ComponentPanelPlugin;