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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
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 { baseKeymap } from 'prosemirror-commands';
import { dropCursor } from 'prosemirror-dropcursor';
import { gapCursor } from 'prosemirror-gapcursor';
import { history } from 'prosemirror-history';
import { keymap } from 'prosemirror-keymap';
import { Schema } from 'prosemirror-model';
import { Plugin, PluginKey } from 'prosemirror-state';
import ContentPlaceholderPlugin from './ContentPlaceholderPlugin.js';
import CursorPlaceholderPlugin from './CursorPlaceholderPlugin.js';
import EditorPageLayoutPlugin from './EditorPageLayoutPlugin.js';
import LinkTooltipPlugin from './LinkTooltipPlugin.js';
import SelectionPlaceholderPlugin from './SelectionPlaceholderPlugin.js';
import TablePlugins from './TablePlugins.js';
import buildInputRules from './buildInputRules.js';
import createEditorKeyMap from './createEditorKeyMap.js';
// Creates the default plugin for the editor.
var DefaultEditorPlugins = /*#__PURE__*/function () {
  function DefaultEditorPlugins(schema) {
    _classCallCheck(this, DefaultEditorPlugins);
    _defineProperty(this, "plugins", void 0);
    this.plugins = [new ContentPlaceholderPlugin(), new CursorPlaceholderPlugin(), new EditorPageLayoutPlugin(), new LinkTooltipPlugin(), new SelectionPlaceholderPlugin(), this.setPluginKey(buildInputRules(schema), 'InputRules'), this.setPluginKey(dropCursor(), 'DropCursor'), this.setPluginKey(gapCursor(), 'GapCursor'), history(), this.setPluginKey(keymap(createEditorKeyMap()), 'EditorKeyMap'), this.setPluginKey(keymap(baseKeymap), 'BaseKeymap')].concat(TablePlugins);
  }
  // [FS] IRAD-1005 2020-07-07
  // Upgrade outdated packages.
  // set plugin keys so that to avoid duplicate key error when keys are assigned automatically.
  return _createClass(DefaultEditorPlugins, [{
    key: "setPluginKey",
    value: function setPluginKey(plugin, key) {
      plugin.spec.key = new PluginKey(key + 'Plugin');
      plugin.key = plugin.spec.key.key;
      return plugin;
    }
  }, {
    key: "get",
    value: function get() {
      return this.plugins;
    }
  }]);
}();
export { DefaultEditorPlugins as default };