import { definePmNodeConverter } from "./../pm-converters/types.js";
import { Node_Type } from "./../ricos-schema/next-schema/index.js";
const codeBlockConverter = definePmNodeConverter({
  toPm: {
    types: [Node_Type.CODE_BLOCK],
    convert: (node, visit) => ({
      type: Node_Type.CODE_BLOCK,
      attrs: {
        ...node.codeBlockData,
        ...node.style ? { style: node.style } : {},
        id: node.id
      },
      content: visit?.(node)
    })
  },
  fromPm: {
    types: [Node_Type.CODE_BLOCK],
    convert: (node, visit) => {
      const { id, style, ...data } = node.attrs || {};
      return {
        type: Node_Type.CODE_BLOCK,
        id,
        nodes: visit?.(node),
        ...style ? { style } : {},
        codeBlockData: {
          ...data
        }
      };
    }
  }
});
export {
  codeBlockConverter
};
//# sourceMappingURL=code-block-converter.js.map
