"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Store = void 0;

var _mobx = require("mobx");

var debug = require('debug')('worker:mobx');

var Store =
/** @class */
function () {
  function Store() {
    this.hoveredMeta = ''; // hover的元组件

    this.clickedMeta = ''; // 点击的元组件

    this.clickedGroup = ''; // 点击的元组件组

    this.clickedFloor = ''; // 点击的楼层

    this.textSelection = null; // 文本元组件选中区域

    this.clickedGroupTitle = ''; // 点击的group组标题

    (0, _mobx.makeObservable)(this, {
      hoveredMeta: _mobx.observable,
      clickedMeta: _mobx.observable,
      clickedGroup: _mobx.observable,
      clickedFloor: _mobx.observable,
      // clickedGroupTitle: observable,
      setState: _mobx.action.bound
    });
  }
  /** 修改状态 */


  Store.prototype.setState = function (data) {
    var _this = this;

    debug('magicDesign state', data);
    var propertyList = Object.getOwnPropertyNames(data);
    propertyList.forEach(function (field) {
      _this[field] = data[field];
    });
  };

  return Store;
}();

exports.Store = Store;