"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.defaultPanelRegistry = exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _lowcodeEditorSkeleton = require("@gant-lowcode/lowcode-editor-skeleton");
var _lowcodePluginDesigner = _interopRequireDefault(require("@gant-lowcode/lowcode-plugin-designer"));
// 注册默认的面板
var defaultPanelRegistry = exports.defaultPanelRegistry = function defaultPanelRegistry(editor) {
  var fun = function fun(ctx) {
    return {
      init: function init() {
        var skeleton = ctx.skeleton,
          config = ctx.config;
        skeleton.add({
          area: 'mainArea',
          name: 'designer',
          type: 'Widget',
          content: /*#__PURE__*/React.createElement(_lowcodePluginDesigner["default"], {
            engineConfig: config,
            engineEditor: editor
          })
        });
        if (!config.get('disableDefaultSettingPanel')) {
          skeleton.add({
            area: 'rightArea',
            name: 'settingsPane',
            type: 'Panel',
            content: /*#__PURE__*/React.createElement(_lowcodeEditorSkeleton.SettingsPrimaryPane, {
              engineEditor: editor
            }),
            props: {
              ignoreRoot: true
            },
            panelProps: (0, _extends2["default"])({}, config.get('defaultSettingPanelProps') || {})
          });
        }
      }
    };
  };
  fun.pluginName = '___default_panel___';
  return fun;
};
var _default = exports["default"] = defaultPanelRegistry;