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

const MODEL = {
  type: "FILL_FIELD",
  x: 0,
  y: 0,
  w: 200,
  h: 100,
  sign: "",
  fieldCountPerLine: 1,
  lineSpacing: 30,
  nameIsJustify: false,
  fields: [],
  fieldInfos: {},
};

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

  return model;
};

export { MODEL, getModel };
