import { Decoration_Type } from "./../../ricos-schema/next-schema/index.js";
const superscriptConverter = {
  fromPm: {
    type: Decoration_Type.SUPERSCRIPT,
    convert: (mark) => {
      const { type: _, attrs } = mark;
      if (typeof attrs?.superscriptData === "undefined" || attrs.superscriptData) {
        return [{ type: Decoration_Type.SUPERSCRIPT }];
      }
      return [{ type: Decoration_Type.SUPERSCRIPT, ...attrs }];
    }
  },
  toPm: {
    type: Decoration_Type.SUPERSCRIPT,
    convert: (decoration) => {
      const { type: _, ...data } = decoration;
      if (typeof data.superscriptData === "undefined") {
        return {
          type: Decoration_Type.SUPERSCRIPT,
          attrs: { superscriptData: true }
        };
      }
      return {
        type: Decoration_Type.SUPERSCRIPT,
        attrs: { ...data }
      };
    }
  }
};
export {
  superscriptConverter
};
//# sourceMappingURL=superscript-converter.js.map
