import {
  getElementId,
  randomCode,
  deepCopy,
  objAssign,
} from "../../../card/plugins/utils";

const MODEL = {
  type: "RICH_TEXT",
  x: 0,
  y: 0,
  w: 200,
  h: 50,
  contType: "content",
  styles: {},
  content: {
    sections: [{ blocks: [] }],
  },
};

const getModel = (presetData) => {
  const model = objAssign(deepCopy(MODEL), presetData);
  model.id = getElementId();
  model.key = randomCode();
  return model;
};

export { MODEL, getModel };
