import { definePmNodeConverter } from "./../../pm-converters/types.js";
import { Node_Type } from "./../../ricos-schema/next-schema/index.js";
const cellConverter = definePmNodeConverter({
  toPm: {
    types: [Node_Type.LAYOUT_CELL],
    convert: (node, visit) => {
      return {
        type: Node_Type.LAYOUT_CELL,
        attrs: {
          id: node.id
        },
        content: visit?.(node)
      };
    }
  },
  fromPm: {
    types: [Node_Type.LAYOUT_CELL],
    convert: (node, visit) => {
      const { attrs = {} } = node;
      const { id, colSpan } = attrs;
      return {
        type: Node_Type.LAYOUT_CELL,
        id,
        nodes: visit?.(node) ?? [],
        layoutCellData: {
          colSpan
        }
      };
    }
  }
});
export {
  cellConverter
};
//# sourceMappingURL=cell-converter.js.map
