"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.transformToDivider = exports.insertDivider = void 0;
var _slate = require("slate");
var _core = require("../../core");
var _elementTypes = require("../../constants/element-types");
const transformToDivider = editor => {
  if (!editor.selection) return;
  _slate.Transforms.setNodes(editor, {
    type: _elementTypes.DIVIDER
  });
  (0, _core.focusEditor)(editor);
};
exports.transformToDivider = transformToDivider;
const insertDivider = editor => {
  if (!editor.selection) return;
  const dividerNode = (0, _core.generateElement)(_elementTypes.DIVIDER);
  _slate.Transforms.insertNodes(editor, dividerNode);
  (0, _core.focusEditor)(editor);
};
exports.insertDivider = insertDivider;