import _extends from "@babel/runtime/helpers/extends";
import { SettingsPrimaryPane } from '@gant-lowcode/lowcode-editor-skeleton';
import DesignerPlugin from '@gant-lowcode/lowcode-plugin-designer';

// 注册默认的面板
export var 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(DesignerPlugin, {
            engineConfig: config,
            engineEditor: editor
          })
        });
        if (!config.get('disableDefaultSettingPanel')) {
          skeleton.add({
            area: 'rightArea',
            name: 'settingsPane',
            type: 'Panel',
            content: /*#__PURE__*/React.createElement(SettingsPrimaryPane, {
              engineEditor: editor
            }),
            props: {
              ignoreRoot: true
            },
            panelProps: _extends({}, config.get('defaultSettingPanelProps') || {})
          });
        }
      }
    };
  };
  fun.pluginName = '___default_panel___';
  return fun;
};
export default defaultPanelRegistry;