"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports["default"] = exports.componentsPaneRegistry = void 0;

var _lowcodeEngine = require("@alilc/lowcode-engine");

var _lowcodePluginComponentsPane = _interopRequireDefault(require("@alilc/lowcode-plugin-components-pane"));

var isNewEngineVersion = !!_lowcodeEngine.material;

var componentsPaneRegistry = function componentsPaneRegistry(ctx) {
  return {
    name: "components-pane-registry",
    init: function init() {
      var widget = ctx.skeleton.add({
        area: 'leftArea',
        name: 'componentsPane',
        type: 'PanelDock',
        props: {
          align: "top",
          icon: 'ic_component',
          description: '组件库'
        },
        panelProps: {
          width: 312
        },
        content: _lowcodePluginComponentsPane["default"]
      });
      widget && widget.disable();

      if (isNewEngineVersion) {
        _lowcodeEngine.project.onSimulatorRendererReady(function () {
          widget.enable();
        });
      } else {
        _lowcodeEngine.project.onRendererReady(function () {
          widget.enable();
        });
      }
    }
  };
};

exports.componentsPaneRegistry = componentsPaneRegistry;
componentsPaneRegistry.pluginName = 'componentsPaneRegistry';
var _default = componentsPaneRegistry;
exports["default"] = _default;