import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import { skeleton, setters, plugins } from "@alilc/lowcode-engine";
import CommonSetters from '@ali/lowcode-engine-ext';
import RadioGroupCardSetter from "@ali/radio-group-card-setter";
import EditSetter from "@alife/rich-setter";
import TitleSetter from "@ali/setter-title";
import BehaviorSetter from './behavior-setter';
import ListSetter from './fake-list-setter';
import MagicEditorSetter from '@alilc/magic-editor-setter';
var _CommonSetters$setter = CommonSetters.setters,
    StringSetter = _CommonSetters$setter.StringSetter,
    RadioGroupSetter = _CommonSetters$setter.RadioGroupSetter;
setters.registerSetter('ChoiceSetter', RadioGroupSetter);
setters.registerSetter('TextSetter', StringSetter);
setters.registerSetter('EditSetter', EditSetter);
setters.registerSetter('ListSetter', ListSetter);
setters.registerSetter('RadioGroupCardSetter', RadioGroupCardSetter);
setters.registerSetter('BehaviorSetter', BehaviorSetter);
setters.registerSetter('TitleSetter', TitleSetter);
setters.registerSetter('MagicEditorSetter', MagicEditorSetter);

var extSettersRegistry = function extSettersRegistry(ctx) {
  var _window$AliLowCodeEng = window.AliLowCodeEngineExt,
      setterMap = _window$AliLowCodeEng.setterMap,
      pluginMap = _window$AliLowCodeEng.pluginMap;
  return {
    name: "ext-setters-registry",
    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:
                // 注册setterMap
                setters.registerSetter(setterMap); // 注册插件
                // 注册事件绑定面板

                skeleton.add({
                  area: "centerArea",
                  type: "Widget",
                  content: pluginMap.EventBindDialog,
                  name: "eventBindDialog",
                  props: {}
                }); // 注册变量绑定面板

                skeleton.add({
                  area: "centerArea",
                  type: "Widget",
                  content: pluginMap.VariableBindDialog,
                  name: "variableBindDialog",
                  props: {}
                });

              case 3:
              case "end":
                return _context.stop();
            }
          }
        }, _callee);
      }))();
    }
  };
};

extSettersRegistry.pluginName = 'extSettersRegistry';
plugins.register(extSettersRegistry);