// packages/block-editor/src/layouts/flow.js
import { __ } from "@wordpress/i18n";
import { getBlockGapCSS, getAlignmentsInfo } from "./utils";
import { getGapCSSValue } from "../hooks/gap";
import { shouldSkipSerialization } from "../hooks/utils";
import { LAYOUT_DEFINITIONS } from "./definitions";
var flow_default = {
  name: "default",
  label: __("Flow"),
  inspectorControls: function DefaultLayoutInspectorControls() {
    return null;
  },
  toolBarControls: function DefaultLayoutToolbarControls() {
    return null;
  },
  getLayoutStyle: function getLayoutStyle({
    selector,
    style,
    blockName,
    hasBlockGapSupport,
    layoutDefinitions = LAYOUT_DEFINITIONS
  }) {
    const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap);
    let blockGapValue = "";
    if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) {
      if (blockGapStyleValue?.top) {
        blockGapValue = getGapCSSValue(blockGapStyleValue?.top);
      } else if (typeof blockGapStyleValue === "string") {
        blockGapValue = getGapCSSValue(blockGapStyleValue);
      }
    }
    let output = "";
    if (hasBlockGapSupport && blockGapValue) {
      output += getBlockGapCSS(
        selector,
        layoutDefinitions,
        "default",
        blockGapValue
      );
    }
    return output;
  },
  getOrientation() {
    return "vertical";
  },
  getAlignments(layout, isBlockBasedTheme) {
    const alignmentInfo = getAlignmentsInfo(layout);
    if (layout.alignments !== void 0) {
      if (!layout.alignments.includes("none")) {
        layout.alignments.unshift("none");
      }
      return layout.alignments.map((alignment) => ({
        name: alignment,
        info: alignmentInfo[alignment]
      }));
    }
    const alignments = [
      { name: "left" },
      { name: "center" },
      { name: "right" }
    ];
    if (!isBlockBasedTheme) {
      const { contentSize, wideSize } = layout;
      if (contentSize) {
        alignments.unshift({ name: "full" });
      }
      if (wideSize) {
        alignments.unshift({
          name: "wide",
          info: alignmentInfo.wide
        });
      }
    }
    alignments.unshift({ name: "none", info: alignmentInfo.none });
    return alignments;
  }
};
export {
  flow_default as default
};
//# sourceMappingURL=flow.js.map
