"use strict";

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

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

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

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

var _lowcodeEngineExt = _interopRequireDefault(require("@ali/lowcode-engine-ext"));

var _radioGroupCardSetter = _interopRequireDefault(require("@ali/radio-group-card-setter"));

var _richSetter = _interopRequireDefault(require("@alife/rich-setter"));

var _setterTitle = _interopRequireDefault(require("@ali/setter-title"));

var _behaviorSetter = _interopRequireDefault(require("./behavior-setter"));

var _fakeListSetter = _interopRequireDefault(require("./fake-list-setter"));

var _magicEditorSetter = _interopRequireDefault(require("@alilc/magic-editor-setter"));

var _CommonSetters$setter = _lowcodeEngineExt["default"].setters,
    StringSetter = _CommonSetters$setter.StringSetter,
    RadioGroupSetter = _CommonSetters$setter.RadioGroupSetter;

_lowcodeEngine.setters.registerSetter('ChoiceSetter', RadioGroupSetter);

_lowcodeEngine.setters.registerSetter('TextSetter', StringSetter);

_lowcodeEngine.setters.registerSetter('EditSetter', _richSetter["default"]);

_lowcodeEngine.setters.registerSetter('ListSetter', _fakeListSetter["default"]);

_lowcodeEngine.setters.registerSetter('RadioGroupCardSetter', _radioGroupCardSetter["default"]);

_lowcodeEngine.setters.registerSetter('BehaviorSetter', _behaviorSetter["default"]);

_lowcodeEngine.setters.registerSetter('TitleSetter', _setterTitle["default"]);

_lowcodeEngine.setters.registerSetter('MagicEditorSetter', _magicEditorSetter["default"]);

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 (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
        return _regenerator["default"].wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                // 注册setterMap
                _lowcodeEngine.setters.registerSetter(setterMap); // 注册插件
                // 注册事件绑定面板


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


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

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

extSettersRegistry.pluginName = 'extSettersRegistry';

_lowcodeEngine.plugins.register(extSettersRegistry);