import { Node } from 'prosemirror-model';
import { toClosestFontPtSize } from './toClosestFontPtSize.js';
var FontSizeMarkSpec = {
  attrs: {
    pt: {
      "default": null
    }
  },
  inline: true,
  group: 'inline',
  parseDOM: [{
    style: 'font-size',
    getAttrs: getAttrs
  }],
  toDOM: function toDOM(node) {
    var pt = node.attrs.pt;
    var domAttrs = pt ? {
      style: "font-size: ".concat(pt, "pt;"),
      "class": 'czi-font-size-mark'
    } : null;
    return ['span', domAttrs, 0];
  }
};
function getAttrs(fontSize) {
  var attrs = {};
  if (!fontSize) {
    return attrs;
  }
  var ptValue = toClosestFontPtSize(fontSize);
  if (!ptValue) {
    return attrs;
  }
  return {
    pt: ptValue
  };
}
export default FontSizeMarkSpec;
import { bpfrpt_proptype_MarkSpec } from "./Types.js";