function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import { EditorState } from 'prosemirror-state';
import { Transform } from 'prosemirror-transform';
import { Schema } from 'prosemirror-model';
import { EditorView } from 'prosemirror-view';
import ReactDOM from 'react-dom';
var bpfrpt_proptype_SetStateCall = PropTypes.func;
var SimpleConnector = /*#__PURE__*/_createClass(function SimpleConnector(_editorState, setState) {
  var _this = this;
  _classCallCheck(this, SimpleConnector);
  _defineProperty(this, "_setState", void 0);
  _defineProperty(this, "_editorState", void 0);
  // This flag is used to deteremine if data passed in or not
  // If not passed in, use the data from collab server when in collab mode.
  // else use empty content.
  _defineProperty(this, "_dataDefined", void 0);
  _defineProperty(this, "onEdit", function (transaction, view) {
    ReactDOM.unstable_batchedUpdates(function () {
      var editorState = _this._editorState.apply(transaction);
      // [FS] IRAD-1236 2020-03-05
      // The state property should not be directly mutated. Use the updateState method.
      if (view) {
        view.updateState(editorState);
      }
      var state = {
        editorState: editorState,
        data: transaction.doc.toJSON()
      };
      _this._setState(state, function () {
        _this._editorState = editorState;
      });
    });
  });
  // FS IRAD-989 2020-18-06
  // updating properties should automatically render the changes
  _defineProperty(this, "getState", function () {
    return _this._editorState;
  });
  // FS IRAD-1040 2020-09-02
  // Send the modified schema to server
  _defineProperty(this, "updateSchema", function (schema, data) {});
  _defineProperty(this, "updateContent", function (data) {});
  _defineProperty(this, "cleanUp", function () {});
  this._editorState = _editorState;
  this._setState = setState;
});
export default SimpleConnector;
import PropTypes from "prop-types";
export { bpfrpt_proptype_SetStateCall };