import { Slice } from '@atlaskit/editor-prosemirror/model';
export const transformSingleColumnLayout = (slice, schema) => {
  if (slice.content.childCount === 1 && slice.openStart === 0 && slice.openEnd === 0) {
    var _slice$content$firstC, _slice$content$firstC2, _slice$content$firstC3;
    if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === schema.nodes.layoutColumn) {
      const newSlice = new Slice(slice.content.firstChild.content, 0, 0);
      return newSlice;
    } else if (((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === schema.nodes.layoutSection && slice.content.firstChild.childCount === 1 && ((_slice$content$firstC3 = slice.content.firstChild.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type) === schema.nodes.layoutColumn) {
      const newSlice = new Slice(slice.content.firstChild.firstChild.content, 0, 0);
      return newSlice;
    }
  }
  return slice;
};