{"size": 1380, "ext": "js", "max_stars_repo_path": "src/Components/Row/index.js", "max_stars_repo_name": "stevepond/elevate-editor", "max_stars_repo_stars_event_min_datetime": "2018-10-19T21:41:59.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-23T23:33:15.000Z", "max_issues_repo_path": "src/Components/Row/index.js", "max_issues_repo_name": "stevepond/elevate-editor", "max_issues_repo_issues_event_min_datetime": "2018-10-22T02:03:13.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-17T18:09:22.000Z", "max_forks_repo_path": "src/Components/Row/index.js", "max_forks_repo_name": "stevepond/elevate-editor", "max_forks_repo_forks_event_min_datetime": "2019-04-24T21:50:48.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-04T07:50:45.000Z"}
{"max_stars_count": 9, "max_issues_count": 30, "max_forks_count": 4, "avg_line_length": 25.0909090909, "max_line_length": 179, "alphanum_fraction": 0.5884057971}
// @flow
import generateUUID from "../../utils/generate-uuid";
import Render from "./Render";
import Form from "./Form";
import { Tools } from "../../";

const defaultAttrs = (attrs: Object = {}) => {
  return Tools.applyDefaults(
    {
      width: "100%",
      height: "",
      borderSize: 0,
      borderColor: "#000000",
      backgroundColor: "transparent",
      backgroundImage: "",
      backgroundSize: "",
      upload: "",
      direction: "vertical",
      alignment: "",
      paddingTop: 8,
      paddingRight: 8,
      paddingBottom: 8,
      paddingLeft: 8,
      allowChildren: false,
    },
    attrs
  );
};

export default {
  Render,
  Form,
  type: "Row",
  label: "Row", // cannot be called single column row because all multi-column rows become a Row after component selection
  description:
    "The row component allows you to group multiple components together. It can be used for vertically stacking components or positioning multiple components next to each other.",

  defaultAttrs,
  generateContent: () => [
    {
      id: generateUUID(),
      type: "Row",
      content: [
        {
          id: generateUUID(),
          type: "Row",
          content: [],
          attrs: defaultAttrs({ width: "100%", allowChildren: true }),
        },
      ],
      attrs: defaultAttrs({ direction: "horizontal", allowChildren: false }),
    },
  ],
};
